Top 50 Oracle Dba Troubleshooting Interview Questions You Must Prepare 19.Mar.2024

  • Several tools, such as Oracle Enterprise Manager, and utilities from third party are available for monitoring database performance.
  • However, all these tools or utilities depend on statistics gathered by Oracle, which are available through dynamic performance views.

  • The db_file_sequential_read event generally indicates index usage and shows an access by rowid while the db_file_scattered_read event indicates full table scan.
  • A single block is read at one time in the db_file_sequential_read event while multiple blocks are read parallel in the db_file_scattered_read event.

The db file sequential read wait event performs single block read operations against indexes, tables, control files, rollback segments and data file headers.

It has three parameters:

file#, firstblock# and block count.

An event is an Oracle is an occurrence that substantially alters the way your database executes or performs.

There are two types of events in Oracle:

  • wait events 
  • OEM defined events.

  • STARTUP NOMOUNT – Instance startup
  • STARTUP MOUNT – The database is mounted
  • STARTUP OPEN – The database is opened

You get this error when you get a snapshot too old within rollback. It can usually be solved by increasing the undo retention or increasing the size of rollbacks. You should also look at the logic involved in the application getting the error message.

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.

ARCHIVELOG mode is a mode that you can put the database in for creating a backup of all tractions that have occurred in the database so that you can recover to any point in time. NOARCHIVELOG mode is basically the absence of ARCHIVELOG mode and has the disadvantage of not being able to recover to any point in time.
NOARCHIVELOG mode does have the advantage of not having to write tractions to an archive log and thus increases the performance of the database slightly.

A hot backup is basically taking a backup of the database while it is still up and running and it must be in archive log mode. A cold backup is taking a backup of the database while it is shut down and does not require being in archive log mode. The benefit of taking a hot backup is that the database is still available for use while the backup is occurring and you can recover the database to any point in time. The benefit of taking a cold backup is that it is typically easier to administer the backup and recovery process. In addition, since you are taking cold backups the database does not require being in archive log mode and thus there will be a slight performance gain as the database is not cutting archive logs to disk.

Block corruption or physical corruption occurs when a block on a physical disk becomes unreadable or inconsistent to the state that the data is unusable. Block corruption can be caused by many different sources; and therefore, it is difficult to find the exact reason of block corruption.

However, it is mostly due to human error with the use of software (patches) firmware, or hardware bugs.

You can avoid this by testing all the hardware and software patches thoroughly in the test environment. In addition, you can use mirrored disk to protect your data.

You can handle ORA- 01403: no data found error by terminating the processing for the select statement.

  • A latch is a semaphore or an on/off switch in Oracle database that a process must access in order to conduct certain type of activities. Latches govern the usage of Oracle's internal resources by its processes.
  • They enforce serial access to the resources and limit the amount of time for which a single process can use a resource.
  • There are over 80 latches available in Oracle.

Oracle records the information about different kind of errors and the processes in the files, such as ALERT log, user process trace files and background process trace files.

Faster access to data blocks in a table.

A data block is the smallest unit of logical storage for a database object. As objects grow they take chunks of additional storage that are composed of contiguous data blocks. These groupings of contiguous data blocks are called extents. All the extents that an object takes when grouped together are considered the segment of the database object.

Coalescing is only valid for dictionary-managed tablespaces and de-fragments space by combining neighboring free extents into large single extents.

ALTER SYSTEM SWITCH LOGFILE;

  • Wait event occurs when a user process is kept waiting because of some problem, such as an I/O bottleneck or a busy CPU.
  • The information about wait event is available in the V$SYSTEM_WAIT and V$SESSION_WAIT dynamic performance views.

ALTER TABLESPACE ADD DATAFILE SIZE

Use the buffer cache advisory over a given workload and then query the v$db_cache_advice table. If a change was necessary then I would use the alter system set db_cache_size command.

Use the describe command or use the dbms_metadata.get_ddl package.

  • The Oracle Wait Interface is the set of data dictionary tables that store information about wait events.
  • Oracle offers multiple views to give information about wait events, such as v$system_event and v$session_event.
  • You can get the information about the wait events for the database or a specific session from these views and find out the event, which seems too high.

In unix $ORACLE_HOME/rdbms/audit, in Windows the event viewer

Alter database backup control file to trace.

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.

  • An Oracle process must acquire relevant latch in order to get resource allocated.
  • A latch is required for a very short amount of time to ensure that the resource is allocated.

Whenever there is a contention for latch, it indicates that there is a performance issue, which may be due to either of the two following reasons:

    • Lack of availability of resource.
    • Poor application programming resulting in high number of requests for resource.

The UNION operation removes redundancy while UNION ALL does not; therefore, the UNION operation needs to perform sort. As a result, UNION ALL performs better as it does not need to perform any sort.

Materialized views are objects that are reduced sets of information that have been summarized, grouped, or aggregated from base tables. They are typically used in data warehouse or decision support systems.

The ALERT log is a log file that records database wide events. The information in the ALERT log file is generally used for trouble shooting.

Following events are recorded in the ALERT log file:

  • Database shutdown and startup information
  • All non default parameters
  • Oracle internal (ORA – 600) errors
  • Information about a modified control file
  • At log switch
  • The location of ALERT log file is specified in the BACKGROUND_DUMP_DEST parameter.

Disable the foreign key constraint to the parent, drop the table, re-create the table, enable the foreign key constraint.

User process trace file is used for performance tuning because it contains information about execution plan and resource consumption. This information can be used for performance tuning.

These files are located in the directory specified in the BACKGROUND_DUMP_DIRECTORY parameter.

Fact tables and dimension tables. A fact table contains measurements while dimension tables will contain data that will help describe the fact tables.

The behavior of merge join is influenced by the initialization parameters:

  • sort_area_size and
  • db_file_multiblock_read_count

Issue the create spfile from pfile command.

Lock is a mechanism provided by Oracle to reserve a database object so that different sessions do not interfere in each other's work.

Locking helps in ensuring data consistency and maintaining database objects in usable state in a multi user environment. However, it can cause one session to block another.

A function and procedure are the same in that they are intended to be a collection of PL/SQL code that carries a single task. While a procedure does not have to return any values to the calling application, a function will return a single value. A package on the other hand is a collection of functions and procedures that are grouped together based on their commonality to a business function or application.

Partitioning is a method of taking large tables and indexes and splitting them into smaller, more manageable pieces.

  • Enqueue is used to queue request for lock on any db object that can't be served immediately and session is ready to wait.
  • Latches are internal locking mechanism of Oracle to provide short term exclusive access to Oracle's internal objects like library cache etc.
  • Another difference is that enqueues follow first in first out (FIFO) algorithm while latches do not follow any such algorithm.