Professional Documents
Culture Documents
DBA Interview 3
DBA Interview 3
Q #8) What is a password file in a database and why is it required when a user can be
authenticated using data dictionary tables?
Answer: Database users can be authenticated using data dictionary tables as they store the username
& password. If the password provided by a user matches with the one stored in the database, then the
user would be able to log in. However, this can happen only if the database is open.
If the database is in shutdown mode, then these tables cannot be accessed and hence password file
will be used by the database administrators to log in and open the database.
Q #9) What are the different types of backups that are available in Oracle?
Answer: On a higher level, there are 2 types of backup that are available in Oracle which are
physical & logical.
During physical backup, copies of physical database files (like data files, control files, redo logs &
other executables) are created and saved for the future. This can be achieved using either operating
system utilities or RMAN.
In contrast, logical backup allows taking a backup of the database objects like tables, views, indexes,
stored procedures, etc. individually through Export/Import utility provided by Oracle.
Q #10) What do we mean by hot backup & cold backup and how are they different?
Answer: Hot backup is the process of taking database backup while the database is in running mode.
Hence, it is also known as Online Backup. While cold backup can be taken only when the database is
in shut down mode and hence it is known as Offline Backup as well.
There are few websites like banking & trading ones, which are 24 hours operational and hence,
cannot support bringing the database down. Hence, DBAs need to take the backup in online mode
only.
Q #11) What is the difference between restoring a database and recovering a database?
Answer: During the restoration process, backup files are copied from the hard disk, media or tapes to
the restoration location and later make the database operational. Recovery has an additional step of
updating these data files by applying redo logs so as to recover the changes which are not backed up.
Let us understand this with the help of a scenario.
Database full backup is taken on Friday 11 PM
Database crash happened on Saturday 7 AM
We can restore the lost files using the 11 PM full backup which is Restoration. However, the data
will be restored up till Friday at 11 PM and not till Saturday at 7 AM. In order to do the same, redo
logs can be applied which will bring the database to the point of failure.
Q #12) What do you understand by Redo Log file mirroring?
Answer: Redo log is the most crucial component of database architecture that records all
transactions within the database even before it goes to the data file.
Hence, the mirroring of these files is done to protect them. Redo Log file mirroring allows redo logs
to be copied to different disks simultaneously. And this can be achieved using Data Guard and other
utilities.
If you take a full back up on Friday at 10 AM and then differential backup on Saturday at 10 AM, it
will take the backup of the files changed since Friday, 10 AM. Further, if the differential backup is
taken on Sunday at 10 AM, it will take the backup of the files changed since Friday, 10 AM.
RMAN does incremental backup rather than taking full file backups which are done by user-
managed backups, which again saves time.
RMAN creates backup and recovery scripts that can be re-used and scheduled and does not need
manual intervention.
RMAN can detect corrupted data blocks automatically during the backup process and recover them,
whereas it doesn’t happen in user-managed backups.
restorecontrolfile;
Q #18) What is the difference between media recovery & crash recovery?
Answer: Media recovery is the process of recovering the database from the backup whenever a disk
failure is there. Physical files like data files, control files or server parameter files get recovered
during media recovery. However, crash recovery will be performed whenever a database instance
failure occurs.
Media recovery needs to be performed by DBA while crash recovery is an automated process that is
taken care of SMON background process.
Q #19) What is RAC and what are the various benefits of using RAC architecture?
Answer: RAC or Real Application Cluster allows the database to be installed across multiple servers
forming a cluster and sharing the storage structure at the same time. This prevents the database from
a single point of failure as one or the other instance will always stay up even if the other fails.
Using RAC helps in
Maintaining high availability of the system.
Managing workload with the least expenses.
Scalability & agility.
Q #20) How would you differentiate between cluster and grid?
Answer: Clustering is an integral part of grid infrastructure and focuses on a specific objective.
While grid, which may or may not consist of multiple clusters, possesses a wider framework that
enables sharing of storage systems, data resources and remaining others across different geographical
locations.
A cluster will have single ownership but the grid can have multiple ownership based on the number
of the cluster it holds.
Memory Instance will have dedicated Every instance will have separate SGA
SGA
Access to Only one instance will access Data files and Control Files are shared across
physical files data files all instances.
and control files.
Q #31) How can we tune a SQL query to optimize the performance of a database?
Answer: Enlisted are a few of the best practices for writing SQL queries.
Column names should be provided instead of * in SELECT statements.
Joins should be used in the place of sub-queries.
EXISTS should be used instead of IN to verify the existence of data.
UNION ALL should be used in the place of UNION.
HAVING should be used only for filtering the resulted rows from the SQL query.
Q #32) How would you identify the SHARED_POOL_SIZE parameter that needs to be
adjusted?
Answer: Below is the indications for the same:
Getting an ORA-04031 error.
Degrading the performance even when all the other parameters are already optimized.
Poor library cache/data dictionary hits.
Q #33) What do you understand by Row Chaining?
Answer: When a row is too large that it cannot fit in a block, then it will end up using consequent
blocks which lead to the concept of Row Chaining. It can be avoided by updating the storage
parameters to an appropriate value.
Q #34) What is table partitioning and why is it required?
Answer: It is a process of dividing a table into smaller chunks so as to make the data retrieval easy
and quick. Each piece will be known as a partition and can be accessed separately. Apart from tables,
indexes can also be partitioned.
Q #35) How can we identify the resources for which the sessions are waiting?
Answer: We can find it out using v$session_waits and v$ system _waits.