DBA > Interview Resource

Oracle DBA Interview questions and Answers

Part:   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16 

(Continued from previous part...)

What are cursor attributes?

Cursor attributes are used to get the information about the current status of your cursor. Both explicit and implicit cursors have four attributes, as shown:
Name Description
%FOUND Returns TRUE if record was fetched successfully, FALSE otherwise.
%NOTFOUND Returns TRUE if record was not fetched successfully, FALSE otherwise.
%ROWCOUNT Returns number of records fetched from cursor at that point in time.
%ISOPEN Returns TRUE if cursor is open, FALSE otherwise.


Difference between an implicit and an explicit cursor.

The implicit cursor is used by Oracle server to test and parse the SQL statements and the explicit cursors are declared by the programmers.


What is a cursor?

A cursor is a mechanism by which you can assign a name to a “select statement” and manipulate the information within that SQL statement.


What is the purpose of a cluster?

A cluster provides an optional method of storing table data. A cluster is comprised of a group of tables that share the same data blocks, which are grouped together because they share common columns and are often used together. For example, the EMP and DEPT table share the DEPTNO column. When you cluster the EMP and DEPT, Oracle physically stores all rows for each department from both the EMP and DEPT tables in the same data blocks. You should not use clusters for tables that are frequently accessed individually.


How do you find the number of rows in a Table ?

select count(*) from table, or from NUM_ROWS column of user_tables if the table statistics has been collected.


Display the number value in Words?


What is a pseudo column. Give some examples?

Information such as row numbers and row descriptions are automatically stored by Oracle and is directly accessible, ie. not through tables. This information is contained within pseudo columns. These pseudo columns can be retrieved in queries. These pseudo columns can be included in queries which select data from tables.

Available Pseudo Columns
· ROWNUM - row number. Order number in which a row value is retrieved.
· ROWID - physical row (memory or disk address) location, ie. unique row identification.
· SYSDATE - system or today’s date.
· UID - user identification number indicating the current user.
· USER - name of currently logged in user.

(Continued on next part...)

Part:   1  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16