Basic Oracle Interview Questions Answers
1. What are schema objects?
A. Schema objects are tables, indexes, databases, views, sequences,
synonyms, triggers, functions, procedures, and packages.
2. What are the components of physical database structure in
the Oracle database?
A. The components of the physical database structure are:
Greater than equal to two redo log files.
Greater than equal to one control file.
Greater than equal to one data file.
3. What are the components of logical database structure in
Oracle database?
The two main components of logical database structure in the Oracle
database are:
Tablespaces
Database's schema objects
A tablespace is the logical storage unit of an Oracle database. It is
a set of related logical structures. The default tablespaces are:
SYSTEM and SYSAUX tablespaces
USERS tablespace
UNDOTBS1 tablespace
TEMP tablespace
4. Differentiate between Varchar and varchar2.
A. Varchar and Varchar2 are data types in Oracle to store character
strings of varying lengths. While Varchar can store characters up to
2000 bytes, Varchar2 can store up to 4000 bytes. Varchar will hold
space for all characters defined during declaration. Varchar2 will free
up the space for characters that were unused.
5. What is an Oracle table?
A. A table is the basic unit of data storage in the Oracle database. Data
is stored in rows and columns.
“CREATE TABLE” statement is used to create a new table.
6. What is a nested table?
A. Nested table is a data type in Oracle used to hold columns for
storing multi-valued attributes. A nested table can hold an entire sub
table.
7. How are comments represented in Oracle?
A. We can represent comments in Oracle in the following two ways:
Two dashes (–) before the line starts – Single statement
For block of statement, we can use /*—— */ to represent it as
comments
8. What is the relationship between database, tablespace and
data file?
A. An Oracle database can contain one or more tablespaces or logical
storage units. These tablespaces collectively store all the data in a
database. Each tablespace consists of one or more files called data
files. The data files are physical structures conforming to the
operating system in which Oracle is running.
9. What are database objects in Oracle?
A. Various Oracle database objects are:
Tables – set of elements arranged in vertical and horizontal
manner
Tablespaces – logical storage unit
Views – Virtual table derived from one or more tables.
Indexes – performance tuning method for record processing.
Synonyms – name for tables
10. Explain the ANALYZE command in Oracle.
A. The “ANALYZE” command allows the user to perform various
functions on index, table or cluster. It helps:
To identify migrated and chained rows of the table or cluster.
To validate structure of an object
To collect statistics about objects used by user, which are then
stored onto the data dictionary
To delete statistics used by an object from the data dictionary