General Interview Questions in Oracle Database

What are the various types of Exceptions?
User defined and Predefined Exceptions.

Can we define exceptions twice in same block?
No.

What is the difference between a procedure and a function?
Functions return a single variable by value whereas procedures do not return any variable by value. Rather they return multiple variables by passing variables by reference through their OUT parameter.

Can you have two functions with the same name in a PL/SQL block?
Yes.

Can you have two stored functions with the same name?
Yes.

Can you call a stored function in the constraint of a table?
No.

What are the various types of parameter modes in a procedure?
IN, OUT AND INOUT.

What is Over Loading and what are its restrictions?
OverLoading means an object performing different functions depending upon the no. of parameters or the data type of the parameters passed to it.

Can functions be overloaded?
Yes.

Can 2 functions have same name & input parameters but differ only by return datatype?
No.

What are the constructs of a procedure, function or a package?
The constructs of a procedure, function or a package are :

  • variables and constants
  • cursors
  • exceptions
Why Create or Replace and not Drop and recreate procedures?
So that Grants are not dropped.

Can you pass parameters in packages? How?
Yes. You can pass parameters to procedures or functions in a package.

What are the parts of a database trigger?
The parts of a trigger are:

  • A triggering event or statement
  • A trigger restriction
  • A trigger action
What are the various types of database triggers?
There are 12 types of triggers, they are combination of :
Insert, Delete and Update Triggers.
Before and After Triggers.
Row and Statement Triggers.
(3*2*2=12)

What is the advantage of a stored procedure over a database trigger?
We have control over the firing of a stored procedure but we have no control over the firing of a trigger.

What is the maximum no. of statements that can be specified in a trigger statement?
One.

Can views be specified in a trigger statement?
No

What are the values of :new and :old in Insert/Delete/Update Triggers?
INSERT : new = new value, old = NULL
DELETE : new = NULL, old = old value
UPDATE : new = new value, old = old value

What are cascading triggers? What is the maximum no of cascading triggers at a time?
When a statement in a trigger body causes another trigger to be fired, the triggers are said to be cascading. Max = 32.

What are mutating triggers?
A trigger giving a SELECT on the table on which the trigger is written.

What are constraining triggers?
A trigger giving an Insert/Update on a table having referential integrity constraint on the triggering table.
Describe Oracle database's physical and logical structure ?
Physical : Data files, Redo Log files, Control file.
Logical : Tables, Views, Tablespaces, etc.

Can you increase the size of a tablespace? How?
Yes, by adding datafiles to it.

What is the use of Control files?
Contains pointers to locations of various data files, redo log files, etc.

What is the use of Data Dictionary?
Used by Oracle to store information about various physical and logical Oracle structures e.g. Tables, Tablespaces, datafiles, etc

What are the advantages of clusters?
Access time reduced for joins.

What are the disadvantages of clusters?
The time for Insert increases.

Can Long/Long RAW be clustered?
No.

Can null keys be entered in cluster index, normal index?
Yes.

Can Check constraint be used for self referential integrity? How?
Yes. In the CHECK condition for a column of a table, we can reference some other column of the same table and thus enforce self referential integrity.

What are the min. extents allocated to a rollback extent?
Two

What are the states of a rollback segment? What is the difference between partly available and needs recovery?
The various states of a rollback segment are :
ONLINE, OFFLINE, PARTLY AVAILABLE, NEEDS RECOVERY and INVALID.

What is the difference between unique key and primary key?
Unique key can be null; Primary key cannot be null.

An insert statement followed by a create table statement followed by rollback? Will the rows be inserted?
No.

Can you define multiple savepoints?
Yes.

Can you Rollback to any savepoint?
Yes.

What is the maximum no. of columns a table can have?
254.

See Also

Have a Oracle Question
Do you have an Oracle Question?

Oracle Books
Oracle Certification, Database Administration, SQL, Application, Programming Reference Books

Oracle Application
Oracle Application Hints and Tips

Oracle Home
Oracle Database, SQL, Application, Programming Tips

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.
The site www.erpgreat.com is not affiliated with or endorsed by any company listed at this site.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.