Saturday 28 May 2016

Oracle Interview Questions

Oracle Interview Questions
Oracle is a secured database that is widely used in multinational companies. The frequently asked questions from oracle database are given below.

1) What are the components of physical database structure of Oracle database?
Components of physical database structure are given below.
  • One or more data files.
  • Two or more redo log files.
  • One or more control files.

2) What are the components of logical database structure in Oracle database?
Components of logical database structure.
  • Tablespaces
  • Database's schema objects

3) What is a tablespace?
A database contains Logical Storage Unit called tablespaces. A tablespace is a set of related logical structures. Actually a tablespace groups related logical structures together.

4) What is a SYSTEM tablespace and when it is created?
When the database is created in Oracle database system, it automatically generate a SYSTEM named SYSTEM tablespace. The SYSTEM tablespace contains data dictionary tables for the entire database.

5) What is an Oracle table?
A table is basic unit of data storage in Oracle database. A table contains all the accessible information of a user in rows and columns.

6) In the Oracle version 9.3.0.5.0, what does each number shows?
Oracle version number refers:
  • 9 - Major database release number
  • 3 - Database maintenance release number
  • 0 - Application server release number
  • 5 - Component Specific release number
  • 0 - Platform Specific release number

7) What is bulk copy or BCP in Oracle?
Bulk copy or BCP in Oracle, is used to import or export data from tables and views but it does not copy structure of same data.
The main advantage of BCP is fast mechanism for coping data and you can also take the backup of data easily.

8) What is the relationship among database, tablespace and data file?
An Oracle database contains one or more logical storage units called tablespaces. These tablespaces collectively store whole data of databases and each tablespace in Oracle database consists of one or more files called datafiles. These datafiles are physical structure that confirm with the operating system in which Oracle is running.

9) What is a snapshot in Oracle database?
A snapshot is a replica of a target master table from a single point-in-time. In simple words you can say, snapshot is a copy of a table on a remote database.

10) What is the difference between hot backup and cold backup in Oracle? Tell about their benefits also.
Hot backup (Online Backup): A hot backup is also known as online backup because it is done while the database is active. Some sites can not shut down their database while making a backup copy, they are used for 24 hour a day, 7 days a week.
Cold backup (Offline Backup): A cold backup is also known as offline backup because it is done while the database has been shutdown using the SHUTDOWN normal command. If the database is suddenly shutdown with a uncertain condition it should be restarted with RESTRICT mode and then shutdown with NORMAL option.
For a complete cold backup the following files must be backed up.
All datafiles, All control files, All online redo log files(optional) and the init.ora file (you can recreate it manually).

11) How many memory layers are in the Oracle shared pool?
Oracle shared pools contains two layers:
1.     library cache
2.     data dictionary cache

12) What is save point in Oracle database?
Save points are used to divide a transaction into smaller parts. It allows rolling back of a transaction. Maximum five save points are allowed. It is used to save our data, whenever you encounter an error you can roll back from the point where you save your SAVEPOINT.

13) What is hash cluster in Oracle?
Hash cluster is a technique to store a data in hash table and improve the performance of data retrieval. Hash function is applied on table row's cluster key value and store in hash cluster.

14) What are the various Oracle database objects?
Tables: This is a set of elements organized in vertical and horizontal fashion.
Tablespaces: This is a logical storage unit in Oracle.
Views: It is virtual table derived from one or more tables.
Indexes: This is a performance tuning method to process the records.
Synonyms: This is a name for tables.

15) What is the difference between pre-select and pre-query?
A pre-query trigger fire before the query executes and fire once while you try to query. With the help of this trigger you can modify the where clause part dynamically.
Pre-select query fires during the execute query and count query processing after Oracle forms construct the select statement to be issued, but before the statement is actually issued.
Pre-query trigger fires before Pre-select trigger.

16) How to convert a date to char in Oracle? Give one example.
The to_char() function is used to convert date to character. You can also specify the format in which you want output.
1.     SELECT to_char ( to_date ('12-12-2012''DD-MM-YYYY') , 'YYYY-MM-DD'FROM dual;  
Or,
1.     SELECT to_char ( to_date ('12-12-2012''DD-MM-YYYY') , 'DD-MM-YYYY'FROM dual;  

17) What are the extensions used by Oracle reports?
Oracle reports are use to make business enable with the facility to provide information of all level within or outside in a secure way. Oracle report uses REP files and RDF file extensions.

18) How to convert a string to a date in Oracle database?
Syntax: to_date (string , format)
Let us take an example :
1.     to_date ('2012-12-12''YYYY/MM/DD')  
It will return December 12, 2012.

19) How do you find current date and time in Oracle?
The SYSDATE() function is used in Oracle to find the current date and time of operating system on which the database is running.
1.     SELECT TO_CHAR (SYSDATE, 'MM-DD-YYYY HH24:MI:SS'"Current_Date" FROM DUAL;  

20) What will be the syntax to find current date and time in format "YYYY-MM-DD"?
1.     SELECT TO_CHAR (SYSDATE, 'YYYY-MM-DD HH24:MI:SS'"Current_Date" FROM DUAL;  



PL/SQL Interview Questions

PL/SQL Interview Questions
PL/SQL is an advance version of SQL. There are given top list of PL/SQL interview questions with answer.

1) What is PL/SQL?
PL/SQL stands for procedural language extension to SQL. It supports procedural features of programming language and SQL both. It was developed by Oracle Corporation in early of 90's to enhance the capabilities of SQL.

2) What is PL/SQL table? Why it is used?
Objects of type tables are called PL/SQL tables that are modeled as database table. We can also say that PL/SQL tables are a way to providing arrays. Arrays are like temporary tables in memory that are processed very quickly. PL/SQL tables are used to move bulk data. They simplifies moving collections of data.

3) What are the datatypes available in PL/SQL?
There are two types of datatypes in PL/SQL:
1.     Scalar datatypes Example are NUMBER, VARCHAR2, DATE, CHAR, LONG, BOOLEAN etc.
2.     Composite datatypes Example are RECORD, TABLE etc.

4) What is the basic structure of PL/SQL?
PL/SQL uses BLOCK structure as its basic structure. Each PL/SQL program consists of SQL and PL/SQL statement which form a PL/SQL block.
PL/SQL block contains 3 sections.
1.     The Declaration Section (optional)
2.     The Execution Section (mandatory)
3.     The Exception handling Section (optional)

5) What is the difference between FUNCTION, PROCEDURE AND PACKAGE in PL/SQL?
Function: The main purpose of a PL/SQL function is generally to compute and return a single value. A function has a return type in its specification and must return a value specified in that type.
Procedure: A procedure does not have a return type and should not return any value but it can have a return statement that simply stops its execution and returns to the caller. A procedure is used to return multiple values otherwise it is generally similar to a function.
Package: A package is schema object which groups logically related PL/SQL types , items and subprograms. You can also say that it is a group of functions, procedure, variables and record type statement. It provides modularity, due to this facility it aids application development. It is used to hide information from unauthorized users.

6) What is exception? What are the types of exceptions?
Exception is an error handling part of PL/SQL. There are two type of exceptions: pre_defined exception and user_defined exception.

7) How exception is different from error?
Whenever an Error occurs Exception arises. Error is a bug whereas exception is a warning or error condition.

8) What is the main reason behind using an index?
Faster access of data blocks in the table.

9) What are PL/SQL exceptions? Tell me any three.
1.     Too_many_rows
2.     No_Data_Found
3.     Value_error
4.     Zero_error etc.

10) What is the maximum number of triggers, you can apply on a single table?
12 triggers.

11) How many types of triggers exist in PL/SQL?
There are 12 types of triggers in PL/SQL that contains the combination of BEFORE, AFTER, ROW, TABLE, INSERT, UPDATE, DELETE and ALL keywords.
  • BEFORE ALL ROW INSERT
  • AFTER ALL ROW INSERT
  • BEFORE INSERT
  • AFTER INSERT etc.

12) What is stored Procedure?
A stored procedure is a sequence of statement or a named PL/SQL block which performs one or more specific functions. It is similar to a procedure in other programming languages. It is stored in the database and can be repeatedly executed. It is stored as schema object. It can be nested, invoked and parameterized.

13) How to execute a stored procedure?
There are two way to execute a stored procedure.
From the SQL prompt, write EXECUTE or EXEC followed by procedure_name.
1.     EXECUTE or [EXEC] procedure_name;  
Simply use the procedure name
1.     procedure_name;  

14) What are the advantages of stored procedure?
Modularity, extensibility, reusability, Maintainability and one time compilation.

15) What are the cursor attributes used in PL/SQL?
%ISOPEN: it checks whether the cursor is open or not.
%ROWCOUNT: returns the number of rows affected by DML operations: INSERT,DELETE,UPDATE,SELECT.
%FOUND: it checks whether cursor has fetched any row. If yes - TRUE.
%NOTFOUND: it checks whether cursor has fetched any row. If no - TRUE.

16) What is consistency?
Consistency simply means that each user sees the consistent view of the data.
Consider an example: there are two users A and B. A transfers money to B's account. Here the changes are updated in A's account (debit) but until it will be updated to B's account (credit), till then other users can't see the debit of A's account. After the debit of A and credit of B, one can see the updates. That?s consistency.

17) What is cursor and why it is required?
A cursor is a temporary work area created in a system memory when an SQL statement is executed.
A cursor contains information on a select statement and the row of data accessed by it. This temporary work area stores the data retrieved from the database and manipulate this data. A cursor can hold more than one row, but can process only one row at a time. Cursor are required to process rows individually for queries.

18) How many types of cursors are available in PL/SQL?
There are two types of cursors in PL/SQL.
1.     Implicit cursor, and
2.     explicit cursor



Cloud Computing Interview Questions

Cloud Computing Interview Questions
There is given Cloud Computing interview questions and answers that has been asked in many companies. Let's see the list of top Cloud Computing interview questions.

1) What is cloud computing?
Cloud computing is an internet based new age computer technology. It is the next stage technology that uses the clouds to provide the services whenever and wherever the user need it.It provides a method to access several servers world wide.

2) What are the benefits of cloud computing?
The main benefits of cloud computing are:
  • Data backup and storage of data.
  • Powerful server capabilities.
  • Incremented productivity.
  • Very cost effective and time saving.
  • Software as Service known as SaaS.

3) What is a cloud?
A cloud is a combination of networks ,hardware, services, storage, and interfaces that helps in delivering computing as a service. It has three users :
  1. End users
  2. Business management users
  3. cloud service provider

4) What are the different data types used in cloud computing?
There are different data types in cloud computing like emails, contracts, images , blogs etc. As we know that data is increasing day by day so it is needed to new data types to store these new data. For an example, if you want to store video then you need a new data type.

5) What are the different layers in cloud computing? Explain working of them.
There are 3 layers in the hierarchy of cloud computing.
Infrastructure as a service (IaaS):It provides cloud infrastructure in terms of hardware as like memory, processor, speed etc.
Platform as a service (PaaS):It provides cloud application platform for the developer.
Software as a service (SaaS)::It provides the cloud applications to users directly without installing anything on the system. These applications remains on cloud.
6) What do you mean by software as a service?
Software As a Service (SaaS) is an important layer of cloud computing. It provides cloud applications like Google is doing. It facilitate users to save their document on the cloud and create as well.

7) What is the platform as a service?
It is also a layer in cloud architecture. This model is built on the infrastructure model and provide resources like computers, storage and network. It is responsible to provide complete virtualization of the infrastructure layer, make it look like a single server and invisible for outside world.

8) What is on-demand functionality? How is it provided in cloud computing?
Cloud computing provides a on-demand access to the virtualized IT resources. It can be used by the subscriber. It uses shared pool to provide configurable resources. Shared pool contains networks, servers, storage, applications and services.

9) What are the platforms used for large scale cloud computing?
Apache Hadoop and MapReduce are the platforms use for large scale cloud computing.

10) What are the different models for deployment in cloud computing?
These are the different deployment model in cloud computing:
Private cloud
Public cloud
Hybrid cloud
Community cloud

11) What is the difference between cloud computing and mobile computing?
Mobile computing and cloud computing are slightly same in concept. Mobile computing uses the concept of cloud computing . Cloud computing provides users the data which they required while in mobile computing, applications run on the remote server and gives user the access for storage and manage.

12) What are the security benefits of cloud computing?
Cloud computing authorizes the application service, so it is used in identity management.
It provides permissions to the users so that they can control the access of another user who is entering into the cloud environment.

13) What is "EUCALYPTUS" in cloud computing? Why is it used?
. It is an acronym stands for Elastic Utility Computing Architecture For Linking Your Program To Useful Systems. It is an open source software infrastructure in cloud computing and used to implement clusters in cloud computing platform. It creates public, private and hybrid cloud. It facilitate a user to create his own data center into a private cloud and use its functionalities to many other organizations.

14) Explain System integrators in cloud computing.
System integrator provides a strategy of a complicated process used to design a cloud platform. It creates more accurate hybrid and private cloud network because integrator have all the knowledge about the data center creation.

15) What are the open source cloud computing platform databases?
MongoDB, CouchDB, LucidDB are the example of open source cloud computing platform database.

16) Give some example of large cloud provider and databases?
Google bigtable
Amazon simpleDB
Cloud based SQL

17) What is the difference between cloud and traditional datacenters?
The cost of the traditional datacenter is higher than cloud because in traditional databases, there is overheating problems and some software and hardware issue.

18) What are the different in Software as a Service (SaaS)?
Simple Multi-tenancy:In this mode, Every user has independent resources and are uniquely different from other users. This is an efficient mode.
Fine grain multi-tenancy:: In this mode, the resources can be shared by many users but the functionality remains the same.

19) Why API's is used in cloud services?
API's (Application Programming Interfaces) is used in cloud platform because:
It provide an alternative way that you don't need to write the fully fledged program.
It makes communication between one or more applications.
It creates applications and link the cloud services with other systems.

20) What are the different datacenters in cloud computing?
1. Containerized datacenter
2. Low density datacenter

21) What do you mean by CaaS?
CaaS is a terminology used in telecom industry as Communication As a Service. CaaS offers the enterprise user features such as desktop call control, unified messaging and desktop faxing.

22) What do you mean by VPN? What does it contain?
VPN stands for Virtual Private Network. VPN is a private cloud that manage the security of the data during the communication in the cloud environment. With VPN, you can make a public network as private network.

23) What are the basic clouds in cloud computing?
There are three basic clouds in cloud computing:
1. Professional cloud
2. Personal cloud
3. Performance cloud