Oracle Database Interview Questions & Answers Set-11

«« Previous
Next »»

1. What are the differences between LOV and List Item?
Ans: LOV is property whereas list items are considered as single item. List of items is set to be a collection of list of items. A list item can have only one column, LOV can have one or more columns.

2. What are privileges and Grants?
Ans: Privileges are the rights to execute SQL statements – means Right to connect and connect. Grants are given to the object so that objects can be accessed accordingly. Grants can be provided by the owner or creator of an object.

3. What is the difference between $ORACLE_BASE and $ORACLE_HOME?
Ans: Oracle base is the main or root directory of an oracle whereas ORACLE_HOME is located beneath base folder in which all oracle products reside.

4. What is the fastest query method to fetch data from the table?
Ans: Row can be fetched from table by using ROWID. Using ROW ID is the fastest query method to fetch data from the table.

5. What is the maximum number of triggers that can be applied to a single table?
Ans: 12 is the maximum number of triggers that can be applied to a single table.

6. How to display row numbers with the records?
Ans: Display row numbers with the records numbers –

Select rownum, <fieldnames> from table;

This query will display row numbers and the field values from the given table.

7. How can we view last record added to a table?
Ans: Last record can be added to a table and this can be done by –

Select * from (select * from employees order by rownum desc) where rownum<2;

8. What is the data type of DUAL table?
Ans: The DUAL table is a one-column table present in oracle database.  The table has a single VARCHAR2(1) column called DUMMY which has a value of ‘X’.

9. What is difference between Cartesian Join and Cross Join?
Ans: There are no differences between the join. Cartesian and Cross joins are same. Cross join gives cartesian product of two tables – Rows from first table is multiplied with another table which is called cartesian product.

Cross join without where clause gives Cartesian product.

10. How to display employee records who gets more salary than the average salary in the department?
Ans: This can be done by this query –

Select * from employee where salary>(select avg(salary) from dept, employee where dept.deptno = employee.deptno;

11. What information is stored in Control File?
Ans: Every Oracle Database has a control file, which is a small binary file that records the physical structure of the database. The control file includes: The database name. Names and locations of associated datafiles and redo log files.

12. What is an Oracle Instance?
Ans: When a database is started on a database server (regardless of the type of computer), Oracle allocates a memory area called the System Global Area (SGA) and starts one or more Oracle processes. This combination of the SGA and the Oracle processes is called an Oracle instance.

13. What is Instance Recovery?
Ans: When instance fails before committed data are written into data files, Oracle uses the data recorded in the online redo log files to recover the lost data when the associated database is re-started. This process is called Roll forward or cache recovery.

14. What is the Job of  SMON, PMON processes?
Ans: PMON and SMON are two required background processes. PMON is the Process Monitor which is responsible for recovering processes when the user process fails. PMON does the process cleanup. SMON is the System Monitor which is responsible for recovering the system after a failure.

SMON - Performs critical tasks such as instance recovery and dead transaction recovery, and maintenance tasks such as temporary space reclamation, data dictionary cleanup, and undo tablespace management. PMON - Monitors the other background processes and performs process recovery when a server or dispatcher process terminates abnormally.

15. When you start an Oracle DB which file is accessed first?
1. parameter file (nomount)
2. control file (mount)
3. datafiles and redo logs (ope

«« Previous
Next »»