TOP PL/SQL Interview Questions and Answers
Name two files used for network connection to a database.
TNSNAMES.ORA and SQLNET.ORA
What is the difference between the SQL*Loader and IMPORT utilities?
These two Oracle utilities are used for loading data into the database. The difference is that the import utility relies on the data being produced by another Oracle utility EXPORT while the SQL*Loader utility allows data to be loaded that has been produced by other utilities from different data sources just so long as it conforms to ASCII formatted or delimited files.
How can you enable a trace for a session?
Use the DBMS_SESSION.SET_SQL_TRACE or
Use ALTER SESSION SET SQL_TRACE = TRUE;
How can you gather statistics on a table?
The ANALYZE command.
You have just compiled a PL/SQL package but got errors, how would you view the errors?
Explain what partitioning is and what its benefit is.
Partitioning is a method of taking large tables and indexes and splitting them into smaller, more manageable pieces.
How can you rebuild an index?
ALTER INDEX REBUILD;
How would you determine who has added a row to a table?
Turn on fine grain auditing for the table.
What view would you use to determine free space in a tablespace?
What view would you use to look at the size of a data file?
How do you resize a data file?
ALTER DATABASE DATAFILE RESIZE;
How do you add a data file to a tablespace?
ALTER TABLESPACE ADD DATAFILE SIZE
When creating a user, what permissions must you grants to allow them to connect to the database?
Grant the CONNECT to the user.
Name a tablespace automatically created when you create a database.
The SYSTEM tablespace.
What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace?
A temporary tablespace is used for temporary objects such as sort structures while permanent tablespaces are used to store those objects meant to be used as the true objects of the database.
What does coalescing a table space do?
Coalescing is only valid for dictionary-managed table spaces and de-fragments space by combining neighboring free extents into large single extents.