Courseiva

CCNA Performance Tuning And Diagnostics Questions

69 questions · Performance Tuning And Diagnostics · All types, answers revealed

1
MCQmedium

When reviewing an AWR report, you notice a high value for 'db time'. What does this indicate?

A.The time spent on disk I/O only
B.The time spent on instance background processes
C.The time the database was open
D.The total time spent by sessions in the database
AnswerD

DB time aggregates the elapsed time all foreground sessions spend actively working inside the database, including CPU and non-idle wait time. A high value therefore signals that sessions are collectively spending excessive time in the database, indicating heavy workload or contention rather than merely long connection durations.

Why this answer

'DB time' in an AWR report represents the cumulative time spent by all foreground sessions in database calls — essentially the total amount of work the database performed, including CPU and wait time. A high DB time relative to elapsed time indicates sessions are spending significant time waiting or consuming CPU, signaling potential performance pressure.

Exam trap

The trap is confusing DB time with elapsed time or with I/O wait time — DB time is a cumulative measure of session activity, not wall-clock duration or a single wait category.

How to eliminate wrong answers

Option A is wrong because DB time is not limited to disk I/O; it includes CPU time and all wait events, not just I/O-related waits. Option B is wrong because background process time is tracked separately (as 'background time' or 'background CPU'), not included in DB time. Option C is wrong because the time the database was open is the 'elapsed time' of the snapshot interval, which is a different metric used as the denominator when computing average active sessions.

2
Multi-Selecthard

Which THREE factors influence the optimizer's choice of an execution plan?

Select 3 answers
A.Optimizer statistics
B.Indexes on the queried columns
C.The current time of day
D.Initialization parameters
E.User password strength
AnswersA, B, D

Optimiser statistics describe table, column and index data distribution, feeding cardinality estimates that drive cost calculations. They satisfy the stem because inaccurate or stale statistics cause the optimiser to select a plan based on wrong row-count assumptions.

Why this answer

The optimizer considers statistics, system parameters, and schema objects.

3
Multi-Selecthard

You are a DBA for an Oracle Database 23ai instance. A developer reports that a specific SQL statement is performing poorly. You want to gather detailed execution statistics for this single statement to diagnose the issue. Which two methods can provide the actual execution plan and runtime statistics for this statement? (Choose two.)

Select 2 answers
A.Enable SQL tracing for the session using ALTER SESSION SET SQL_TRACE = TRUE and then run the statement.
B.Query V$SQL_PLAN for the SQL_ID of the statement.
C.Query DBA_HIST_SQLSTAT for the SQL_ID.
D.Use the EXPLAIN PLAN FOR command and then query PLAN_TABLE.
E.Use the DBMS_XPLAN.DISPLAY_CURSOR function with the SQL_ID after execution.
AnswersA, E

Enabling SQL trace for the session captures detailed execution statistics for all SQL statements executed in that session, including the problematic one. The trace file contains the execution plan, wait events, and row source statistics. This is a classic method for in-depth diagnosis of a single statement. It can be enabled at the session or instance level, but session-level is preferred for targeted analysis.

Why this answer

To diagnose a poorly performing SQL statement, you need the actual execution plan and runtime statistics. DBMS_XPLAN.DISPLAY_CURSOR with 'ALLSTATS LAST' provides the actual plan and row source statistics for a statement in the shared pool. Enabling SQL_TRACE for the session captures a trace file with detailed execution statistics, including the plan and wait events.

Both methods give the necessary information. Querying V$SQL_PLAN only shows the plan without runtime stats. EXPLAIN PLAN gives only estimates.

DBA_HIST_SQLSTAT provides historical aggregates, not detailed plan or per-execution statistics.

Exam trap

The trap here is confusing estimated plans (EXPLAIN PLAN) or plan-only views (V$SQL_PLAN) with methods that provide actual runtime statistics, such as DBMS_XPLAN.DISPLAY_CURSOR with ALLSTATS or SQL_TRACE.

4
Multi-Selectmedium

Which TWO views can be used to monitor current session performance?

Select 2 answers
A.V$CONTROLFILE
B.V$SESSION_WAIT
C.DBA_TABLES
D.DBA_USERS
E.V$SESSION
AnswersB, E

V$SESSION_WAIT exposes the current wait event, wait time and wait parameters for each active session, letting you pinpoint which sessions are stalled and on what resource right now. This directly satisfies the requirement to monitor current session performance rather than historical trends.

Why this answer

V$SESSION and V$SESSION_WAIT are standard tools for real-time monitoring.

5
MCQmedium

When running the SQL Tuning Advisor, what does the 'Accept' action do?

A.It permanently changes the SQL code
B.It implements the recommended SQL Profile
C.It deletes the SQL from the cache
D.It updates the global statistics
AnswerB

Accepting a SQL Tuning Advisor recommendation applies the suggested SQL Profile, storing it in the SQL profile repository so the optimizer uses the adjusted estimates for that statement. It does not rewrite the SQL text or create indexes; it implements the profile itself.

Why this answer

Accepting a recommendation (like a profile) implements it in the database for future executions.

6
MCQeasy

Which background process is responsible for capturing AWR snapshots?

A.PMON
B.MMNL
C.DBWn
D.LGWR
AnswerB

MMNL performs background tasks, including AWR snapshotting.

Why this answer

The MMNL (Manageability Monitor) process is responsible for AWR snapshots.

7
MCQeasy

You are an Oracle Database 23ai administrator. A developer complains that a query against a table with a recently added column is returning stale results. You suspect that the optimizer's statistics are outdated. Which task should you perform to refresh the statistics for this table?

A.Enable automatic statistics collection by setting STATISTICS_LEVEL to TYPICAL.
B.Run ANALYZE TABLE ... COMPUTE STATISTICS.
C.Set the OPTIMIZER_MODE initialization parameter to FIRST_ROWS.
D.Execute DBMS_STATS.GATHER_TABLE_STATS for the table.
AnswerD

DBMS_STATS.GATHER_TABLE_STATS is the standard procedure to collect fresh statistics for a table. It gathers table, column, and index statistics, which the optimizer uses to generate execution plans. In this scenario, the stale results are likely due to outdated statistics after adding a column, so refreshing them with this procedure is the correct action. It ensures the optimizer has current data distribution information.

Why this answer

The most direct and recommended way to refresh statistics for a specific table is to use the DBMS_STATS.GATHER_TABLE_STATS procedure. It collects current statistics that the optimizer needs to make accurate cardinality estimates. The other options either use deprecated methods, change unrelated parameters, or rely on automatic processes that do not provide immediate results.

Exam trap

The trap here is thinking that enabling automatic statistics collection or using the legacy ANALYZE command is sufficient, when in fact manual gathering with DBMS_STATS is the correct immediate action.

8
MCQmedium

You are the DBA for an Oracle Database 23ai instance. Users report that a particular application module is slow. You query V$ACTIVE_SESSION_HISTORY and see a high number of samples for the wait event 'log file sync'. You want to determine which sessions and SQL statements are contributing most to this wait. Which of the following would you use to find the top sessions and SQL_IDs associated with 'log file sync'?

A.Query V$SQL and order by ELAPSED_TIME descending.
B.Query V$SESSION_EVENT and order by TIME_WAITED descending.
C.Query V$ACTIVE_SESSION_HISTORY filtering on the event and group by session_id and sql_id.
D.Query V$SYSSTAT and look at the 'user commits' statistic.
AnswerC

V$ACTIVE_SESSION_HISTORY contains sampled session activity, including the wait event, session ID, and SQL ID. By filtering for 'log file sync' and grouping by session_id and sql_id, you can identify which sessions and SQL statements are experiencing the most waits. This is the correct approach for top-down analysis.

Why this answer

V$ACTIVE_SESSION_HISTORY samples active sessions and records the wait event, session ID, and SQL ID for each sample. By filtering on the 'log file sync' event and aggregating by session_id and sql_id, you can identify the top contributors to this wait. This is the standard method for drilling down from a system-wide wait event to the specific sessions and SQL statements causing it.

Exam trap

The trap here is using cumulative views like V$SESSION_EVENT or V$SYSSTAT, which lack the SQL_ID correlation and time-sliced sampling needed to identify top contributors to a specific wait event.

9
MCQhard

You are an Oracle Database 23ai administrator. A batch job that performs many small random reads on a large table is experiencing high 'db file sequential read' wait times. The table is stored in a tablespace with a block size of 8 KB. You suspect that the storage subsystem is the bottleneck. Which action would best confirm whether the wait time is due to slow disk I/O?

A.Check the value of the DB_CACHE_SIZE parameter to see if the buffer cache is too small.
B.Run an EXPLAIN PLAN on the batch job's SQL statements to see if full table scans are used.
C.Use the SQL Tuning Advisor to analyze the batch SQL and recommend indexes.
D.Query V$FILESTAT and compare the average read time per file.
AnswerD

V$FILESTAT accumulates physical read counts and read time (in centiseconds) per data file. Dividing the read time by the number of reads gives the average read latency per file. If this value is high (e.g., >20 ms), it indicates slow I/O. This directly confirms whether the storage is the bottleneck for the observed single-block reads.

Why this answer

The 'db file sequential read' wait event indicates single-block reads, often from indexes. To confirm if the storage subsystem is slow, you need to measure average I/O latency. V$FILESTAT provides cumulative read time and read count per file, allowing you to calculate average read time.

High average read time points to slow disk I/O as the root cause.

Exam trap

The trap here is focusing on buffer cache size or execution plans when the wait event specifically suggests an I/O latency issue that requires storage-level metrics.

10
MCQeasy

Which of these is the most effective way to address performance issues caused by suboptimal plans?

A.Dropping and recreating the database
B.Increasing the number of CPUs
C.SQL Plan Management
D.Disabling indexes
AnswerC

SQL Plan Management captures and stores known-good execution plans, then ensures the optimiser uses them instead of regressing to suboptimal plans. This directly addresses plan instability, the stated cause, by preventing performance fluctuations rather than merely reacting to symptoms after they appear.

Why this answer

SQL Plan Management is specifically designed to manage and enforce optimal plans.

11
MCQeasy

Which parameter controls the frequency of AWR snapshot collection?

A.PROCESSES
B.DB_CACHE_SIZE
C.STATISTICS_LEVEL
D.OPTIMIZER_MODE
AnswerC

Setting this to TYPICAL or ALL enables AWR snapshots.

Why this answer

STATISTICS_LEVEL controls the automatic collection of AWR snapshots.

12
Multi-Selecthard

When using the SQL Tuning Advisor to analyze a SQL statement, which THREE types of recommendations can it provide to improve performance?

Select 3 answers
A.Creating a SQL profile
B.Restructuring the SQL query syntax
C.Renaming database tables
D.Creating a new index
E.Updating optimizer statistics
AnswersA, D, E

A SQL profile supplies auxiliary statistics and hints that steer the optimizer toward a better plan without changing the SQL text or schema objects. SQL Tuning Advisor recommends this when plan regressions or misestimates persist, directly improving performance.

Why this answer

The SQL Tuning Advisor can suggest creating new indexes, refreshing optimizer statistics, and creating SQL profiles to alter the execution plan.

13
Multi-Selectmedium

Which TWO components are essential for the operation of the Automatic Database Diagnostic Monitor (ADDM)?

Select 2 answers
A.SQL Plan Baselines
B.Data Pump files
C.AWR snapshots
D.ADDM Analysis Task
E.Listener control
AnswersC, D

ADDM relies on AWR snapshots as its data source: each analysis run compares two snapshots to quantify instance-wide activity and identify bottlenecks. Without a snapshot pair, ADDM has no baseline or interval to diagnose, so AWR snapshot generation is essential to its operation.

Why this answer

ADDM relies on AWR snapshots (option C) because it analyzes the performance data captured in the Automatic Workload Repository between two snapshots to identify root causes and quantify their impact. It also requires an ADDM Analysis Task (option D), which is the actual diagnostic run that processes those snapshots and produces findings and recommendations. Without AWR snapshots there is no historical performance data to diagnose, and without an ADDM Analysis Task the diagnostic engine has no execution context.

SQL Plan Baselines (A) are a SQL plan management feature for plan stability, not a prerequisite for ADDM. Data Pump files (B) are used for export/import operations and are unrelated to ADDM diagnostics. Listener control (E) manages network listener services and has no role in ADDM's internal analysis.

14
Multi-Selecthard

Which THREE items are required for the Automatic SQL Plan Management to effectively stabilize plans?

Select 3 answers
A.SQL Plan Baselines
B.An external monitoring server
C.SQL Plan History
D.A manual index rebuild
E.Automatic Evolve Task
AnswersA, C, E

SQL Plan Baselines store accepted, known-good execution plans that the optimiser is forced to reproduce. They satisfy the stabilisation requirement by preventing plan regression, since only verified plans are permitted for the captured SQL statement.

Why this answer

SPM requires SQL baselines, a plan history, and an evolution process.

15
MCQmedium

You are the lead DBA for a busy online transaction processing (OLTP) database. Users report that a critical order-entry application has become slow. You run a query against V$SYSTEM_EVENT and notice that the 'log file sync' wait event has the highest total time waited. Which action should you take to address this issue?

A.Increase the size of the redo log buffer.
B.Reduce the number of commits performed by the application.
C.Tune the redo log file I/O by moving them to faster storage.
D.Increase the number of database writer (DBWn) processes.
AnswerC

The 'log file sync' wait event occurs when a user session must wait for the log writer (LGWR) to write redo information to disk upon a COMMIT. The primary cause of high 'log file sync' waits is slow I/O on the redo log files. Moving the redo logs to faster storage, such as solid-state drives (SSDs), or ensuring they are on dedicated, low-latency disks directly reduces the time LGWR takes to complete the write, thereby reducing the wait time for user sessions.

Why this answer

The 'log file sync' wait event indicates that user sessions are waiting for the log writer (LGWR) to write redo entries to disk during commit operations. This wait is predominantly caused by slow I/O on the redo log files. To resolve this, the DBA should focus on improving the performance of the storage where the redo logs reside, such as by moving them to faster disks or SSDs.

Increasing the redo log buffer size or adjusting DBWn processes does not directly address the I/O bottleneck that LGWR faces.

Exam trap

The trap here is assuming that increasing the redo log buffer size will reduce 'log file sync' waits, when in fact the bottleneck is usually the I/O speed of the redo log files themselves.

16
MCQeasy

You are an Oracle Database 23ai administrator. A user reports that a specific SQL query is running slowly. You want to see the execution plan that the optimizer actually used for the most recent execution of that query. Which dynamic performance view should you query?

A.V$SESSION_LONGOPS
B.V$SQL_PLAN
C.V$SQLAREA
D.DBA_HIST_SQL_PLAN
AnswerB

V$SQL_PLAN displays the execution plans for cursors currently in the library cache. It shows the plan that was actually used for each child cursor, including operations, costs, and cardinalities. By joining to V$SQL on SQL_ID and CHILD_NUMBER, you can retrieve the exact plan for the most recent execution, making it the correct choice.

Why this answer

To see the actual execution plan used for a recently executed SQL statement, you query V$SQL_PLAN. It stores the plan for each child cursor in the library cache, including the operations and their order. By joining with V$SQL, you can identify the specific SQL_ID and CHILD_NUMBER, and then retrieve the plan steps.

Exam trap

The trap here is choosing a historical plan view like DBA_HIST_SQL_PLAN or an aggregate view like V$SQLAREA, which do not show the current actual plan for a specific execution.

17
MCQhard

You have a high volume of parse time in your database. What could be the cause?

A.High memory usage
B.Using literals instead of bind variables
C.Too many indexes
D.Missing statistics
AnswerB

Literals force Oracle to hard-parse every distinct statement, so each execution incurs full parse and optimisation cost, inflating parse time. Bind variables let one parsed cursor be reused across executions, eliminating repeated hard parsing. This directly addresses the high parse time described in the stem.

Why this answer

Hard parsing occurs when SQL is not shared, often due to literals instead of bind variables.

18
MCQeasy

What is the purpose of the 'ASH' report?

A.To backup the database
B.To analyze short-term performance
C.To analyze long-term trends
D.To manage user accounts
AnswerB

ASH samples active session activity every second into a circular buffer, so it exposes transient spikes and brief contention that AWR's ten-minute snapshots smooth over. This short-term sampling interval is precisely what makes it suited to analysing short-term performance.

Why this answer

ASH reports analyze transient problems by looking at recent active session history.

19
MCQhard

You have a query that is being incorrectly optimized because the statistics are not representative of the actual data distribution. What is the best method to handle this without changing the global statistics?

A.Run the SQL Tuning Advisor
B.Modify the init.ora parameter
C.Use DBMS_STATS.SET_TABLE_PREFS
D.Create a SQL Plan Baseline
AnswerC

Preferences allow granular control over how stats are gathered for a specific object.

Why this answer

Table-specific statistics collection with specific parameters or using preference settings can help.

20
MCQhard

Which feature allows you to capture SQL statements from the cursor cache and load them into a SQL Tuning Set?

A.DBMS_SPM.LOAD_PLANS_FROM_CURSOR_CACHE
B.DBMS_STATS.GATHER_SYSTEM_STATS
C.DBMS_WORKLOAD_REPOSITORY.EXTRACT_SQL
D.DBMS_SQLTUNE.CAPTURE_CURSOR_CACHE_SQLSET
AnswerD

DBMS_SQLTUNE.CAPTURE_CURSOR_CACHE_SQLSET polls the shared pool's cursor cache over a specified interval, extracting SQL statements and their execution statistics directly into a SQL Tuning Set. This satisfies the stem's requirement to capture statements from the cursor cache, unlike alternatives that load sets from AWR snapshots or manual SQL text.

Why this answer

DBMS_SQLTUNE.CAPTURE_CURSOR_CACHE_SQLSET is the procedure used to pull queries from memory.

21
MCQeasy

You are analyzing an AWR report for an Oracle Database 23ai instance. You notice that the 'DB Time' is significantly higher than the 'Elapsed Time' for the snapshot interval. What does this indicate?

A.The database is experiencing a high number of user calls.
B.The database instance is running on a single CPU.
C.There is significant concurrency; multiple sessions are active simultaneously.
D.The AWR snapshot interval was too short.
AnswerC

DB Time is the sum of the time spent by all foreground sessions in database calls (CPU time plus wait time). Elapsed Time is the actual wall-clock time of the AWR snapshot interval. If DB Time exceeds Elapsed Time, it means that on average, more than one session was active at the same time. For example, if DB Time is 10 minutes and Elapsed Time is 5 minutes, the average concurrency was 2. This indicates that the database was handling multiple concurrent requests, which is normal in a busy system but can highlight contention if waits are high.

Why this answer

In an AWR report, Elapsed Time is the duration of the snapshot interval in wall-clock time. DB Time is the total time spent by all foreground sessions in database calls, which includes CPU time and wait time. If DB Time is greater than Elapsed Time, it means that on average, more than one session was active at the same time.

This is a measure of average concurrency. For instance, if DB Time is 120 minutes and Elapsed Time is 60 minutes, the average concurrency is 2. This is normal for a multi-user system and does not necessarily indicate a problem, but it helps in understanding the workload.

Exam trap

The trap here is thinking that DB Time > Elapsed Time indicates a problem, when it actually just reflects concurrent session activity.

22
MCQmedium

What does the 'Elapsed Time' in a SQL statement represent?

A.The time spent on CPU only
B.The total duration of the SQL execution
C.The time since the SQL was parsed
D.The time spent waiting for I/O
AnswerB

Elapsed Time measures the total wall-clock duration of the SQL execution, from parse through fetch completion, including all waits and CPU time. It reflects the full end-to-end latency the user experiences, not just CPU consumption or database time.

Why this answer

It is the total wall-clock time spent executing the statement from start to finish.

23
MCQmedium

A production database experiences a sudden performance degradation. You want to analyze the last 10 minutes of activity to pinpoint blocked sessions. Which approach is best?

A.Generate an AWR report for the last hour
B.Query V$ACTIVE_SESSION_HISTORY
C.Check the Alert Log for ORA errors
D.Run the SQL Access Advisor
AnswerB

V$ACTIVE_SESSION_HISTORY samples active sessions every second, retaining recent history in memory, so it exposes which sessions blocked others during the last 10 minutes. This directly satisfies the stem's requirement to pinpoint blocked sessions within that short window.

Why this answer

ASH data is stored in memory and is the primary source for recent, short-term performance diagnostics.

24
Multi-Selectmedium

Which THREE of the following are components of the Oracle performance tuning lifecycle?

Select 3 answers
A.Implementing a solution
B.Deleting all users
C.Identifying the bottleneck
D.Reinstalling the database
E.Analyzing the cause
AnswersA, C, E

Implementing a solution closes the tuning lifecycle by applying the chosen change to the production system. This satisfies the stem's requirement for a lifecycle component, since tuning progresses from observation through diagnosis to corrective action, and implementation is the stage where the remedy is actually deployed and its effect realised.

Why this answer

Tuning is an iterative process involving identification, analysis, and implementation.

25
MCQhard

You need to capture a specific set of SQL statements that are causing high CPU usage for later tuning. Which tool allows you to group these statements and transport them across different database environments?

A.SQL Tuning Sets
B.SQL Plan Baselines
C.ADDM Findings
D.AWR Snapshots
AnswerA

SQL Tuning Sets capture a defined group of SQL statements with their execution context, and can be exported and imported into another database. This satisfies the stem's requirement to group high-CPU statements and transport them across environments.

Why this answer

SQL Tuning Sets (STS) are designed to capture a specific set of SQL statements along with their execution context, and they can be exported and transported to other databases for tuning or plan comparison. This makes them the correct tool for grouping high-CPU SQL and moving it across environments.

Exam trap

The trap is that candidates pick SQL Plan Baselines because they also deal with SQL and plans, but only SQL Tuning Sets are designed to group and transport multiple SQL statements across databases.

How to eliminate wrong answers

Option B is wrong because SQL Plan Baselines store and enforce execution plans for individual SQL statements; they do not group multiple statements for transport. Option C is wrong because ADDM Findings are diagnostic outputs from the Automatic Database Diagnostic Monitor, not a transportable container for SQL statements. Option D is wrong because AWR Snapshots capture performance statistics over time intervals, not a curated set of SQL statements for tuning across environments.

26
Multi-Selectmedium

A DBA is analyzing an AWR report for an Oracle Database 23ai instance and notices a high number of 'enq: TX - row lock contention' waits. Which two actions should the DBA take to diagnose and resolve this issue? (Choose two.)

Select 2 answers
A.Increase the number of undo tablespaces to reduce contention.
B.Enable automatic undo management and increase the undo retention period.
C.Query V$LOCK and V$SESSION to identify the blocking session and the locked object.
D.Examine the SQL text of the blocking and waiting sessions to identify the problematic transaction.
E.Set the parameter DML_LOCKS to a higher value.
AnswersC, D

V$LOCK shows locks held and requested, including TX locks. By joining V$LOCK with V$SESSION, you can identify the blocking session and the object causing the contention. This is the primary diagnostic step to find the root cause of row lock contention. It helps determine which session is holding the lock and what SQL it is executing.

Why this answer

Row lock contention occurs when one transaction holds a lock on a row that another transaction needs. The first step is to identify the blocking session and the locked object using V$LOCK and V$SESSION. Then, examining the SQL of both sessions helps understand why the lock is held.

This allows the DBA to tune the transaction or application to reduce lock duration. Increasing undo tablespaces or DML_LOCKS does not address the root cause.

Exam trap

The trap here is assuming that row lock contention is related to undo or DML lock limits, when it is actually caused by transaction conflicts on specific rows.

27
MCQmedium

You are an Oracle Database 23ai administrator. Users report that a critical order-entry form intermittently stalls for several seconds when submitting a row. You run an AWR report for the busy period and notice a high average 'row lock wait time' and a significant number of 'enq: TX - row lock contention' waits. Which action should you take first to diagnose the issue?

A.Query V$LOCK to identify the blocking session and the locked object.
B.Increase the value of the DB_BLOCK_CHECKING parameter to detect corruption.
C.Reduce the value of the PGA_AGGREGATE_TARGET to free memory for locks.
D.Run ADDM to automatically resolve the row lock contention.
AnswerA

V$LOCK shows current lock holders and requesters, including the blocking session ID and the object ID for TX enqueue waits. Joining V$LOCK with DBA_OBJECTS and V$SESSION identifies the exact row-level conflict. This is the correct first step to pinpoint which session holds the lock and what object is involved, enabling targeted resolution.

Why this answer

Row lock contention occurs when one session holds a lock on a row that another session needs to modify. The first diagnostic step is to identify the blocking session and the object involved. V$LOCK provides this information by showing lock holders and requesters.

Once identified, you can decide whether to wait, commit, or terminate the blocker.

Exam trap

The trap here is assuming that an advisory tool like ADDM can directly resolve lock contention, when it only reports and recommends.

28
MCQmedium

You are an Oracle Database 23ai administrator. A developer complains that a query joining two large tables is spilling to disk, and the session shows high 'direct path write temp' waits. The database uses Automatic Shared Memory Management (ASMM) and Automatic PGA Memory Management. Which action should you take to allow the query to complete without disk spills?

A.Set the WORKAREA_SIZE_POLICY parameter to MANUAL and configure SORT_AREA_SIZE.
B.Increase the SGA_TARGET parameter.
C.Increase the DB_CACHE_SIZE parameter to cache more blocks and reduce temp usage.
D.Increase the PGA_AGGREGATE_TARGET parameter.
AnswerD

Automatic PGA Memory Management uses PGA_AGGREGATE_TARGET to dynamically allocate work areas. When a query spills to disk, it indicates insufficient PGA memory for the operation. Increasing this parameter gives the database more memory to allocate to work areas, reducing or eliminating temp space usage. This is the correct action to address the spills.

Why this answer

Automatic PGA Memory Management dynamically allocates memory to work areas based on PGA_AGGREGATE_TARGET. When a query spills to disk, it means the allocated work area was insufficient. Increasing PGA_AGGREGATE_TARGET provides more memory for sorts and hash joins, reducing temp space usage and improving performance.

This is the direct solution for the described symptom.

Exam trap

The trap here is confusing SGA and PGA memory, or reverting to manual work area management, when the issue is specifically insufficient PGA memory for a large join.

29
MCQeasy

What does the 'SQL ID' in an Oracle database represent?

A.A table name
B.A user ID
C.An execution plan version
D.A unique identifier for a SQL statement
AnswerD

The SQL ID is the hash-derived identifier Oracle assigns to a SQL statement's text in the shared pool, letting you trace that statement across V$SQL, AWR and ASH. It identifies the statement itself, not a session or execution plan.

Why this answer

The SQL ID is a unique hash of the SQL text, used to identify statements in the library cache.

30
MCQhard

You notice that a specific query is performing very slowly due to excessive 'direct path read' waits. What is the most likely cause?

A.The query is performing a full table scan
B.The library cache is too small
C.The PGA is too large
D.The redo logs are too small
AnswerA

Direct path reads occur when Oracle bypasses the buffer cache and reads blocks straight into PGA memory, typical of parallel or serial full table scans on large segments. Excessive waits therefore point to a full table scan rather than index or rowid access.

Why this answer

Direct path reads often occur during full table scans when the data is not in the buffer cache.

31
MCQmedium

Which procedure in the DBMS_SPM package is used to evolve a SQL plan baseline?

A.DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE
B.DBMS_SPM.DROP_SQL_PLAN_BASELINE
C.DBMS_SPM.ALTER_SQL_PLAN_BASELINE
D.DBMS_SPM.LOAD_PLANS_FROM_SQLSET
AnswerA

DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE verifies unaccepted plans against the SQL performance history and promotes those that perform better to accepted status, optionally running in verify or commit mode. It is the sole DBMS_SPM procedure providing this evolution capability.

Why this answer

DBMS_SPM.EVOLVE_SQL_PLAN_BASELINE is the standard procedure to evolve baselines.

32
MCQmedium

You are performing a SQL tuning exercise. How do you create a SQL Tuning Set (STS) to be used as input for the SQL Tuning Advisor?

A.DBMS_SQLTUNE.CREATE_SQLSET
B.DBMS_WORKLOAD_REPOSITORY.CREATE_SNAPSHOT
C.DBMS_SPM.CREATE_BASELINE
D.DBMS_STATS.CREATE_STAT_TABLE
AnswerA

DBMS_SQLTUNE.CREATE_SQLSET creates the empty SQL tuning set object, which is then populated from sources such as the cursor cache, AWR or SQL trace before being passed to the SQL Tuning Advisor as its input workload.

Why this answer

DBMS_SQLTUNE.CREATE_SQLSET is the required procedure to initialize an STS container.

33
MCQmedium

You are tuning a data warehouse query that performs a large hash join. The query is spilling to disk, and you want to determine if increasing the PGA_AGGREGATE_TARGET would help. Which of the following dynamic performance views would you query to see the current PGA memory usage and the number of multi-pass executions?

A.V$PROCESS
B.V$PGASTAT
C.V$SQL_WORKAREA
D.V$SESSTAT
AnswerB

V$PGASTAT provides instance-level statistics on PGA memory usage, including total PGA allocated, cache hit percentage, and the number of multi-pass and one-pass executions for work areas. This view directly shows if operations are spilling to disk and the overall efficiency of PGA memory, making it the correct choice.

Why this answer

V$PGASTAT is the primary view for monitoring PGA memory allocation and work area execution efficiency. It includes statistics such as 'aggregate PGA target parameter', 'total PGA allocated', 'cache hit percentage', and counts of optimal, one-pass, and multi-pass executions. By checking the number of multi-pass executions, you can determine if increasing PGA_AGGREGATE_TARGET would reduce disk spills and improve performance.

Exam trap

The trap here is focusing on per-session or per-SQL views when the question asks for overall PGA memory usage and multi-pass executions, which are summarized in V$PGASTAT.

34
Multi-Selectmedium

You are diagnosing a performance issue where a specific SQL statement is consuming excessive CPU. You have identified the SQL_ID and want to gather detailed execution statistics for this statement to understand its behavior. Which two methods can you use to obtain execution statistics for this SQL statement? (Choose two.)

Select 2 answers
A.Use DBMS_XPLAN.DISPLAY_CURSOR with the 'ALLSTATS LAST' format.
B.Query V$SQL_PLAN_STATISTICS_ALL for the SQL_ID.
C.Use DBMS_SQL_MONITOR.REPORT_SQL_MONITOR for the SQL_ID.
D.Query DBA_HIST_SQLSTAT for the SQL_ID.
E.Query V$SQLSTATS for the SQL_ID.
AnswersA, C

DBMS_XPLAN.DISPLAY_CURSOR with the 'ALLSTATS LAST' format displays the execution plan along with runtime statistics for the last execution of the cursor. It shows actual rows, consistent gets, and other metrics per operation. This is a standard method to obtain detailed execution statistics for a SQL statement, provided the cursor is still in the library cache and statistics were collected (e.g., via GATHER_PLAN_STATISTICS hint or STATISTICS_LEVEL=ALL).

Why this answer

DBMS_SQL_MONITOR.REPORT_SQL_MONITOR and DBMS_XPLAN.DISPLAY_CURSOR with 'ALLSTATS LAST' are both valid methods to obtain detailed execution statistics for a specific SQL statement. SQL Monitor provides a comprehensive report including wait events and row source statistics, while DISPLAY_CURSOR with ALLSTATS LAST shows the execution plan with actual runtime statistics per operation.

Exam trap

The trap here is assuming that any view containing SQL statistics provides the same level of detail, when in fact only specific tools like SQL Monitor and DISPLAY_CURSOR with ALLSTATS LAST offer per-execution, row source level statistics.

35
MCQmedium

You are the lead DBA for an Oracle Database 23ai production system. Users report that a critical order-entry application becomes unresponsive for several seconds every few minutes. While monitoring, you notice a significant number of 'log file sync' wait events in V$SYSTEM_EVENT. Which action is most likely to reduce this contention?

A.Increase the number of redo log groups.
B.Configure the redo log files on faster storage with lower latency.
C.Increase the size of the redo log buffer.
D.Enable asynchronous I/O for the redo log files.
AnswerB

The 'log file sync' wait event occurs when a user session commits a transaction and must wait for the log writer (LGWR) to write the redo entries to the online redo log files. If the storage subsystem hosting the redo logs has high latency, commits will be slow. Placing redo logs on faster, lower-latency storage directly reduces the time spent waiting for the write to complete, thus reducing 'log file sync' waits.

Why this answer

The 'log file sync' wait event is directly related to the time a user session waits for the log writer to write redo to disk during a commit. The primary factor affecting this wait is the performance of the storage where the online redo logs reside. Moving the redo logs to faster storage with lower latency reduces the write time, thereby reducing the wait.

Other options, such as increasing buffer size or adding log groups, do not address the commit path latency.

Exam trap

The trap here is assuming that increasing the redo log buffer size will reduce commit waits, when in fact the buffer is not the bottleneck for log file sync events.

36
MCQhard

You are analyzing a performance degradation in a data warehouse. The AWR report shows a high number of 'cell single block physical read' waits on Exadata. You suspect that the storage index is not being used effectively for a particular query. Which action should you take to improve the effectiveness of the storage index for this query?

A.Ensure that the query predicates are not using functions on the columns.
B.Enable the 'cell_offload_processing' parameter.
C.Recreate the table with a larger block size.
D.Increase the size of the Exadata Smart Flash Cache.
AnswerA

Storage indexes on Exadata work by storing min/max values for columns in storage cells. If a predicate applies a function to a column, the storage index cannot be used because the function's result is not stored. By ensuring predicates are on bare columns, the storage index can filter out irrelevant storage regions, reducing physical I/O. This is a key best practice for maximizing storage index effectiveness.

Why this answer

The storage index relies on predicates that reference columns directly, without functions or expressions, to filter out storage regions. If a predicate uses a function on a column, the storage index cannot be applied, leading to unnecessary physical reads. Ensuring predicates are on bare columns allows the storage index to function optimally and reduce I/O.

Exam trap

The trap here is attributing storage index inefficiency to caching or block size, when the real issue is often the use of functions on columns in predicates.

37
MCQhard

You are analyzing a performance issue in your Oracle 23ai database. You suspect that a specific SQL statement is performing poorly due to a suboptimal execution plan. You want to capture the actual execution plan and runtime statistics for this statement while it is executing. Which tool should you use to achieve this with minimal overhead?

A.Enable SQL trace for the session and use TKPROF.
B.EXPLAIN PLAN FOR statement;
C.Use the DBMS_XPLAN.DISPLAY_CURSOR function with the 'ALLSTATS LAST' format.
D.Query the V$SQL_PLAN_STATISTICS_ALL view for the SQL ID.
AnswerC

The DBMS_XPLAN.DISPLAY_CURSOR function can display the actual execution plan of a SQL statement that is currently in the library cache, along with runtime statistics. By specifying the 'ALLSTATS LAST' format, you can see the actual rows processed, consistent gets, physical reads, and other execution statistics for the last execution of the cursor. This method has minimal overhead because it retrieves information from the cursor's runtime statistics that are already collected by the database, without needing to re-execute the statement or enable additional tracing.

Why this answer

To capture the actual execution plan and runtime statistics for a specific SQL statement with minimal overhead, the DBMS_XPLAN.DISPLAY_CURSOR function with the 'ALLSTATS LAST' format is the most efficient method. It retrieves the plan and statistics from the library cache for the last execution of the cursor, leveraging data that the database already collects. This avoids the overhead of enabling SQL trace or re-executing the statement with EXPLAIN PLAN, and it provides the actual rows and other runtime metrics needed for tuning.

Exam trap

The trap here is confusing the generation of a predicted plan with the retrieval of an actual execution plan and its runtime statistics; EXPLAIN PLAN only shows the optimizer's intended plan without executing the statement.

38
MCQeasy

You need to identify the top SQL statements consuming the most CPU resources in an Oracle 23ai database over the last hour. Which tool provides the most direct analysis of this performance issue?

A.SQL Tuning Advisor
B.Automatic Workload Repository (AWR) report
C.Active Session History (ASH) report
D.SQL Plan Management
AnswerB

The AWR report captures snapshots of database activity, including SQL statistics ranked by CPU consumption, over a specified interval such as the last hour. This directly identifies the top CPU-consuming SQL statements, unlike real-time tools that lack historical aggregation.

Why this answer

The AWR report is the most direct tool for identifying top SQL by CPU consumption over a specific time period such as the last hour. AWR automatically captures snapshots of performance statistics, including SQL ordered by CPU time, and the report presents this data in a ready-to-read format. ASH provides session-level sampling for shorter, more granular analysis, but AWR is the standard tool for hourly or longer-range top-SQL identification.

Exam trap

The trap is confusing AWR with ASH — candidates often pick ASH because it sounds more granular, but AWR is the correct tool for hourly top-SQL-by-CPU analysis.

How to eliminate wrong answers

Option A is wrong because SQL Tuning Advisor analyzes individual SQL statements for tuning recommendations; it does not rank top SQL by CPU over a time window. Option C is wrong because ASH is a sampling-based tool best suited for short-term, fine-grained diagnosis (e.g., last few minutes) and does not directly produce a top-SQL-by-CPU ranking over an hour. Option D is wrong because SQL Plan Management is used to stabilize execution plans, not to identify resource-consuming SQL.

39
MCQhard

You are investigating a performance issue where a batch job that inserts millions of rows into a table with a unique index is running slowly. You notice a high number of 'enq: TX - index contention' waits. Which action is most likely to reduce this contention without compromising data integrity?

A.Increase the PCTFREE value for the index.
B.Use a reverse key index.
C.Rebuild the index with a larger block size.
D.Decrease the INITRANS value for the index.
AnswerB

A reverse key index reverses the bytes of each indexed column value, which spreads inserts across many leaf blocks instead of concentrating them on the rightmost leaf block. This reduces contention on the index during high-concurrency inserts. For a batch job inserting many rows, a reverse key index can significantly decrease 'enq: TX - index contention' waits while still enforcing uniqueness. However, it may affect range scans, so it is best for unique or primary key indexes on monotonically increasing values.

Why this answer

A reverse key index is the correct solution because it distributes index entries across many blocks, eliminating the hot spot on the rightmost leaf block that occurs with sequentially increasing keys. This reduces contention during high-volume inserts while preserving uniqueness. Other options either do not address the root cause or could worsen the situation.

Exam trap

The trap here is focusing on physical storage parameters like block size or PCTFREE, which do not resolve the concurrency issue of multiple sessions inserting into the same index leaf block.

40
MCQhard

You are seeing 'enq: TX - row lock contention' in your performance reports. What does this mean?

A.The library cache is full
B.Sessions are competing for the same row locks
C.The tablespace is full
D.The database is waiting for I/O
AnswerB

The TX enqueue wait signifies transactional locking, where one session holds a row lock and others queue for that same row until the holder commits or rolls back. The wait therefore directly indicates concurrent sessions competing for identical rows, matching the reported contention.

Why this answer

TX lock contention indicates that multiple sessions are trying to update the same rows.

41
MCQmedium

You are analyzing an AWR report and notice a high value for 'db file scattered read'. What is the most likely cause of this wait event?

A.Insufficient PGA memory for sorting operations.
B.Excessive log file sync waits.
C.Heavy use of nested loop joins.
D.Full table scans or index fast full scans.
AnswerD

The 'db file scattered read' wait arises from multiblock reads, which Oracle issues during full table scans and index fast full scans. Single-block index range scans produce 'db file sequential read' instead, making this the precise cause matching the stem's high value.

Why this answer

'db file scattered read' is typically associated with full table scans or index fast full scans where multiple blocks are read into non-contiguous memory locations.

42
Multi-Selectmedium

Which TWO of these are common sources of performance degradation?

Select 2 answers
A.Renaming a table
B.High resource contention
C.Changing the database name
D.Inefficient SQL statements
E.Adding a new user
AnswersB, D

High resource contention directly degrades performance because CPU, memory, disk, and network capacity are finite; when multiple processes compete for the same constrained resource, queuing delays increase and throughput falls. This satisfies the stem's requirement for a common degradation source, as contention predictably slows response times across workloads.

Why this answer

Suboptimal SQL and system-wide resource contention are the most common issues.

43
MCQhard

Which of the following is true regarding SQL Plan Baselines?

A.They automatically gather statistics
B.They store the actual table data
C.They require the Oracle Enterprise Manager
D.They provide stability for SQL execution plans
AnswerD

SQL Plan Baselines lock in a known-good execution plan for a SQL statement, preventing the optimiser from regressing to a worse plan after statistics or parameter changes. This directly delivers plan stability, the property the option asserts.

Why this answer

They allow the database to maintain a stable execution plan even if the environment (stats, indexes) changes.

44
MCQeasy

In which view can you find information about the current SQL Plan Baselines?

A.DBA_SQL_PLAN_BASELINES
B.V$SESSION
C.V$SQL
D.DBA_INDEXES
AnswerA

DBA_SQL_PLAN_BASELINES lists every SQL plan baseline in the database, showing the SQL handle, plan name, enabled and accepted status, and origin. Querying it reveals which plans are currently captured and active, which is exactly the baseline information required.

Why this answer

DBA_SQL_PLAN_BASELINES is the primary view for information about SQL plan baselines.

45
MCQmedium

You observe a significant performance regression after a database upgrade. You suspect that the optimizer has chosen a suboptimal execution plan. Which component of SQL Plan Management should you use to ensure the database only uses known, verified execution plans?

A.SQL Plan Baselines
B.Optimizer Statistics Advisor
C.SQL Tuning Sets
D.Automatic SQL Tuning Advisor
AnswerA

SQL Plan Baselines capture accepted, verified plans and make the optimizer use only those, preventing it from adopting a newly generated suboptimal plan after the upgrade. This directly enforces the requirement that only known, verified execution plans are used.

Why this answer

SQL Plan Baselines are used to capture and freeze known good execution plans for SQL statements. When the optimizer considers a new plan, it compares it to the baseline; if the new plan is not verified as better, the baseline plan is used. This ensures that only verified plans are used, preventing performance regressions after an upgrade.

Exam trap

OCP often tests the distinction between SQL Plan Baselines and SQL Tuning Sets; candidates may think Tuning Sets enforce plans, but they are just containers for SQL statements used for tuning, not for plan control.

How to eliminate wrong answers

Option B is wrong because the Optimizer Statistics Advisor analyzes statistics gathering and recommends improvements, but it does not control execution plans. Option C is wrong because SQL Tuning Sets are collections of SQL statements with their execution statistics and context, used for tuning, but they do not enforce plan usage. Option D is wrong because the Automatic SQL Tuning Advisor analyzes SQL and may recommend SQL profiles or plan baselines, but it does not itself ensure only verified plans are used; that is the role of SQL Plan Management and baselines.

46
MCQhard

You are managing an Oracle Database 23ai instance. A critical application query is performing poorly. You have identified the SQL ID and want to capture a detailed execution plan with runtime statistics for a specific execution. The query is currently running and has been for several minutes. Which action should you take to get the most detailed diagnostic information?

A.Use DBMS_XPLAN.DISPLAY_AWR with the SQL ID to get the plan from AWR.
B.Generate an active SQL Monitor report using DBMS_SQL_MONITOR.REPORT_SQL_MONITOR for the SQL ID.
C.Query V$SQL_PLAN for the SQL ID to retrieve the execution plan.
D.Enable SQL tracing for the session using DBMS_SESSION.SET_SQL_TRACE and then examine the trace file.
AnswerB

SQL Monitor provides real-time monitoring of long-running SQL statements, including detailed execution statistics such as actual rows, memory, time, and wait events per operation. It is designed for exactly this scenario: a currently running query that needs in-depth diagnosis. You can generate a report using DBMS_SQL_MONITOR.REPORT_SQL_MONITOR, which gives the most comprehensive information for an active execution.

Why this answer

SQL Monitor is specifically designed to monitor long-running or parallel SQL statements in real time. It captures detailed execution statistics, including actual rows, memory usage, time, and wait events for each operation. The report generated by DBMS_SQL_MONITOR.REPORT_SQL_MONITOR provides a comprehensive view of the query's performance while it is running, making it the ideal tool for this scenario.

Exam trap

The trap here is assuming that any dynamic performance view or AWR report will provide runtime statistics for a currently running query, when in fact only SQL Monitor captures such detailed real-time data.

47
Multi-Selecthard

You are diagnosing a performance issue in an Oracle Database 23ai instance. You suspect that the issue is related to the optimizer's cardinality estimates. You want to gather additional information to confirm your suspicion. Which two of the following would provide you with the optimizer's estimated cardinality and the actual cardinality for each step of an execution plan? (Choose two.)

Select 2 answers
A.Querying V$SQLAREA and looking at the OPTIMIZER_COST column.
B.Querying V$SQL_PLAN for the SQL_ID and examining the CARDINALITY column.
C.Using the /*+ GATHER_PLAN_STATISTICS */ hint and then querying V$SQL_PLAN_STATISTICS_ALL.
D.Using DBMS_XPLAN.DISPLAY_CURSOR with the 'ALLSTATS LAST' format.
E.Using the EXPLAIN PLAN FOR command and then querying PLAN_TABLE for the CARDINALITY column.
AnswersC, D

The GATHER_PLAN_STATISTICS hint instructs the optimizer to collect execution statistics for all operations in the plan. These statistics, including estimated and actual rows, are then available in V$SQL_PLAN_STATISTICS_ALL. This is a standard method to compare estimates with actuals for a specific execution.

Why this answer

To compare estimated and actual cardinality, you need a method that captures runtime execution statistics. The GATHER_PLAN_STATISTICS hint causes the optimizer to collect actual row counts during execution, which are then visible in V$SQL_PLAN_STATISTICS_ALL. Similarly, DBMS_XPLAN.DISPLAY_CURSOR with 'ALLSTATS LAST' shows the plan with both estimated (E-Rows) and actual (A-Rows) cardinalities for the last execution.

Both approaches are valid and commonly used for this purpose.

Exam trap

The trap here is thinking that static plan views like V$SQL_PLAN or PLAN_TABLE contain actual runtime cardinality, when they only store estimates.

48
MCQhard

You have a query that is performing poorly due to a stale execution plan. You want to lock the current optimal plan to prevent the optimizer from changing it during subsequent runs. What should you do?

A.Run DBMS_STATS.LOCK_TABLE_STATS
B.Use DBMS_SPM.LOAD_PLANS_FROM_CURSOR_CACHE
C.Set OPTIMIZER_FEATURES_ENABLE to a previous version
D.Use SQL Tuning Advisor to accept a new profile
AnswerB

DBMS_SPM.LOAD_PLANS_FROM_CURSOR_CACHE captures the existing optimal plan from the shared pool and loads it into a SQL plan baseline, which pins that plan so the optimizer cannot substitute a different one on later executions. This directly satisfies the requirement to lock the current plan against change.

Why this answer

DBMS_SPM.LOAD_PLANS_FROM_CURSOR_CACHE loads existing plans from the cursor cache into SQL Plan Baselines, allowing you to lock the current optimal plan. This prevents the optimizer from changing it because the baseline will be used.

Exam trap

OCP often tests the difference between locking statistics and locking plans; candidates must know that DBMS_STATS.LOCK_TABLE_STATS does not lock execution plans, and that SPM is the correct tool for plan stability.

How to eliminate wrong answers

Option A is wrong because DBMS_STATS.LOCK_TABLE_STATS locks statistics, not execution plans; it prevents statistics changes but not plan changes. Option C is wrong because setting OPTIMIZER_FEATURES_ENABLE to a previous version affects optimizer behavior globally, not locking a specific plan. Option D is wrong because SQL Tuning Advisor may recommend a new profile, which could change the plan, not lock the current one.

49
Multi-Selecteasy

Which TWO types of reports are most useful for diagnosing long-term database performance trends?

Select 2 answers
A.V$SESSION_WAIT view
B.AWR Report
C.ASH Report
D.SQL Trace (tkprof)
E.ADDM Report
AnswersB, E

AWR reports capture persistent, historical snapshots of database workload statistics, enabling comparison across days or weeks. This directly satisfies the long-term trend requirement, since the stem asks for diagnosing performance over time rather than instantaneous activity. Unlike real-time views, AWR retains data in the workload repository for retrospective analysis.

Why this answer

The AWR Report (B) is correct because Automatic Workload Repository snapshots persist performance data over long retention periods, enabling comparison of load, wait events, and top SQL across days or weeks to reveal long-term trends. The ADDM Report (E) is correct because Automatic Database Diagnostic Monitor analyzes AWR snapshots and produces findings and recommendations that track recurring performance issues over time, making it well suited for trend diagnosis. V$SESSION_WAIT (A) is a dynamic view showing only current or very recent wait activity, so it lacks historical depth.

ASH Report (C) samples active sessions at fine granularity but typically covers short windows, not long-term trends. SQL Trace with tkprof (D) captures a single session's statement-level execution details for point-in-time tuning, not multi-period trend analysis.

50
MCQeasy

Which report provides a summary of SQL statements that have the highest 'Elapsed Time'?

A.Alert Log
B.AWR Report
C.Listener Log
D.ADDM Report
AnswerB

The AWR report satisfies the requirement for identifying SQL statements ranked by elapsed time, since its SQL ordered by Elapsed Time section aggregates statements across the snapshot interval. Unlike STATSPACK, which offers similar data but with less detail, AWR captures this automatically from the Automatic Workload Repository, directly answering the stem's summary request.

Why this answer

The AWR (Automatic Workload Repository) Report includes a section titled 'SQL ordered by Elapsed Time' that lists SQL statements ranked by total elapsed time, making it the correct choice. This report aggregates performance statistics over a snapshot interval, capturing the cumulative impact of each SQL statement. The Alert Log and Listener Log do not provide SQL-level performance summaries, and ADDM focuses on diagnostic findings rather than raw SQL timing.

Exam trap

OCP often tests the distinction between AWR and ADDM reports, where candidates mistakenly choose ADDM because it sounds more 'diagnostic', but ADDM does not provide a direct SQL elapsed time ranking.

How to eliminate wrong answers

Option A is wrong because the Alert Log records critical errors, startup/shutdown events, and other administrative messages, not SQL performance metrics. Option C is wrong because the Listener Log tracks connection requests and listener service activity, not SQL execution times. Option D is wrong because the ADDM Report analyzes AWR data to identify performance issues and recommends actions, but it does not directly list SQL statements ordered by elapsed time.

51
MCQeasy

An administrator has been tasked with reducing the overhead of AWR snapshot collection. What is the most effective way to modify the snapshot interval?

A.Edit the SPFILE to change the statistics_level to 'BASIC'.
B.Use the DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS procedure.
C.Update the SGA_TARGET parameter.
D.Manually delete old records from the DBA_HIST_SNAPSHOT view.
AnswerB

DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS directly alters the interval parameter controlling Automatic Workload Repository snapshot frequency, satisfying the requirement to reduce collection overhead. Unlike manual snapshots or statistics-gathering changes, it adjusts the scheduled interval itself, so fewer snapshots are captured without disabling AWR entirely.

Why this answer

The DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS procedure is the official method to adjust snapshot frequency and retention policies.

52
MCQmedium

How can you view the recommendations made by the Automatic Database Diagnostic Monitor (ADDM)?

A.Checking the alert log
B.Querying V$SGA
C.Querying DBA_ADVISOR_FINDINGS
D.Running the catproc script
AnswerC

Querying DBA_ADVISOR_FINDINGS returns ADDM's stored findings directly, since ADDM writes its results into the advisor framework tables rather than exposing a dedicated view. This satisfies the requirement to view recommendations without generating a new report, though the view holds raw finding rows rather than formatted advice.

Why this answer

ADDM recommendations can be viewed in AWR or via the DBA_ADVISOR_FINDINGS view.

53
MCQeasy

An administrator needs to identify the top wait events causing performance degradation in the database over the last hour. Which tool provides the most granular, session-level view of these wait events?

A.Active Session History (ASH)
B.SQL Tuning Advisor
C.Automatic Database Diagnostic Monitor (ADDM)
D.Automatic Workload Repository (AWR)
AnswerA

Active Session History samples active sessions every second into a circular buffer, recording session identifier, wait event, and blocking details. This one-second granularity over the past hour gives the session-level wait breakdown that aggregated views such as AWR cannot provide.

Why this answer

ASH provides real-time, session-level performance data, making it the ideal tool for analyzing short-term, granular performance spikes.

54
Multi-Selecthard

Which THREE actions can you take to improve execution plan stability?

Select 3 answers
A.Frequently drop and recreate indexes
B.Increase the SGA size every day
C.Use SQL Profiles
D.Freeze execution plans
E.Create SQL Plan Baselines
AnswersC, D, E

SQL Profiles supply auxiliary statistics and hints that let the optimiser choose a more consistent plan for a specific statement without altering the SQL text, improving execution plan stability by countering poor cardinality estimates that cause plan changes.

Why this answer

SQL Profiles (C) improve plan stability by supplying optimizer hints and statistics adjustments that steer the optimizer toward a proven plan without changing application SQL. Freezing execution plans (D) locks a specific plan for a SQL statement so the optimizer cannot switch to a different, potentially worse plan. SQL Plan Baselines (E) capture and enforce known-good plans, allowing the optimizer to use only plans in the baseline and preventing regressions.

Dropping and recreating indexes (A) is disruptive and can cause plan changes and instability, not stability. Increasing the SGA size daily (B) is arbitrary and does not directly stabilize execution plans.

55
MCQmedium

When using SQL Tuning Advisor, what is a 'SQL Tuning Set' (STS)?

A.A backup set of the database
B.A list of database users
C.A container for SQL statements and their metadata
D.A set of database indexes
AnswerC

A SQL Tuning Set is a database object holding SQL statements plus their execution context, such as bind values, execution plans and statistics. SQL Tuning Advisor consumes this container to analyse and tune the captured workload.

Why this answer

An STS is a collection of SQL statements with their associated execution context.

56
MCQeasy

Which view displays the current settings for the AWR retention period?

A.DBA_SNAPSHOTS
B.V$DATABASE
C.DBA_HIST_WR_CONTROL
D.V$INSTANCE
AnswerC

DBA_HIST_WR_CONTROL stores the active Automatic Workload Repository configuration, exposing columns such as RETENTION and SNAP_INTERVAL. Querying it returns the current retention period directly, satisfying the stem's requirement for present settings rather than historical snapshots or parameter defaults.

Why this answer

DBA_HIST_WR_CONTROL contains the snapshot settings including retention and interval.

57
MCQmedium

You are tuning a complex SQL statement. You want to see the execution plan that the optimizer is currently choosing. Which dynamic performance view is most useful?

A.V$SQL_PLAN
B.V$SESSION
C.V$SQLAREA
D.V$SYSSTAT
AnswerA

V$SQL_PLAN exposes the execution plan rows the optimizer actually chose for a cached SQL statement, keyed by SQL_ID and child number. It satisfies the requirement to see the plan currently in use, unlike EXPLAIN PLAN, which shows a predicted plan.

Why this answer

V$SQL_PLAN shows the execution plan for statements currently in the library cache.

58
MCQhard

To improve performance, you suspect an index is missing. Which advisor should you invoke to get recommendations for new indexes?

A.SQL Tuning Advisor
B.Memory Advisor
C.ADDM
D.SQL Access Advisor
AnswerD

SQL Access Advisor analyses workload from the SQL cache and recommends indexes, materialised views and partitioning for the supplied workload, which directly satisfies the stem's need for new index recommendations. Unlike the SQL Tuning Advisor, which tunes individual statements, it evaluates an entire workload to propose missing indexes.

Why this answer

The SQL Access Advisor provides recommendations on schema design, including indexes and materialized views.

59
MCQhard

The Automatic SQL Plan Management (ASPM) feature is enabled. A new execution plan is identified for a high-load query that performs better during testing. How does the database verify this plan before evolving the baseline?

A.It flags the plan for manual DBA approval via the DBMS_SPM package.
B.It automatically promotes the plan based on the optimizer cost estimation.
C.It executes the SQL statement using the new plan and compares its performance metrics against the current baseline.
D.It relies on the Advisor to run a full analysis of the explain plan tree.
AnswerC

ASPM validates a candidate plan by executing the SQL statement with the new plan and comparing its performance metrics against the existing baseline. Only if the measured performance improves does the database accept and evolve the baseline, ensuring the change is verified rather than assumed.

Why this answer

The database performs a verification task where it executes the new plan and compares it against the baseline performance to decide if it should be accepted.

60
Multi-Selectmedium

Which TWO methods can be used to tune SQL statements?

Select 2 answers
A.Increasing the number of backups
B.Dropping the database
C.Manual addition of optimizer hints
D.Changing user roles
E.SQL Tuning Advisor
AnswersC, E

Optimizer hints embedded in the SQL text directly override the optimizer's cost-based decisions, forcing a specific join method, index or access path. This manual method gives the DBA explicit control when statistics or transformations produce a poor plan.

Why this answer

Option C (Manual addition of optimizer hints) is correct because optimizer hints are directives embedded in SQL statements (e.g., /*+ INDEX(...) */ or /*+ FULL(...) */) that influence the query optimizer's execution plan, directly tuning statement performance. Option E (SQL Tuning Advisor) is correct because it is an Oracle tool that analyzes a SQL statement, its execution plan, and statistics, then produces tuning recommendations such as SQL profiles, indexes, or restructured SQL. The other options do not tune SQL statements: increasing backups (A) is a backup/recovery activity, dropping the database (B) is a destructive DDL operation, and changing user roles (D) is a security/privilege change, none of which affect query execution plans or SQL performance.

61
MCQhard

You are tuning a query that is performing poorly due to high 'buffer busy waits'. What is the likely cause?

A.PGA memory exhausted
B.Library cache contention
C.Excessive disk I/O
D.Multiple sessions accessing the same blocks
AnswerD

Buffer busy waits arise when sessions contend for the same data blocks concurrently in the buffer cache. Multiple sessions accessing identical blocks serialise on buffer pins and latches, so the wait event points directly to block-level contention rather than I/O latency or parsing overhead.

Why this answer

Buffer busy waits occur when multiple sessions try to modify the same block at the same time.

62
MCQmedium

What is the primary benefit of using a SQL Profile?

A.They improve the accuracy of the optimizer
B.They fix the execution plan forever
C.They speed up physical I/O
D.They automatically gather new statistics
AnswerA

A SQL Profile supplies auxiliary statistics and corrections to the optimizer for a specific statement, letting it derive a better plan without changing the SQL text. That improved cardinality and cost estimation is what raises optimizer accuracy.

Why this answer

SQL Profiles improve the optimizer's choices by providing better selectivity and cardinality estimates.

63
Multi-Selecthard

Which THREE types of information are captured in an AWR snapshot?

Select 3 answers
A.Tablespace creation scripts
B.Library cache statistics
C.Database user passwords
D.System-wide wait events
E.SQL execution statistics
AnswersB, D, E

Important for parsing/memory health.

Why this answer

AWR captures workload, system statistics, and session activity.

64
MCQeasy

What is the primary function of ADDM in Oracle Database 23ai?

A.To capture SQL execution plans
B.To migrate data between instances
C.To identify performance bottlenecks and provide recommendations
D.To automatically tune individual SQL statements
AnswerC

ADDM (Automatic Database Diagnostic Monitor) analyses Automatic Workload Repository data to detect performance bottlenecks and generate actionable recommendations. This directly satisfies the stem's requirement, distinguishing it from AWR, which merely collects statistics, and SQL Tuning Advisor, which targets individual statements.

Why this answer

ADDM analyzes AWR snapshots to identify performance bottlenecks and provide recommendations.

65
MCQeasy

What is the result of setting STATISTICS_LEVEL to 'BASIC'?

A.It increases CPU overhead
B.It enables SQL Tuning Advisor
C.It disables AWR and ADDM
D.It enables all features
AnswerC

Setting STATISTICS_LEVEL to BASIC disables Automatic Workload Repository snapshots and Automatic Database Diagnostic Monitor analysis, since both depend on TYPICAL-level statistics collection. This satisfies the scenario's requirement to stop AWR and ADDM entirely, unlike TYPICAL or ALL, which retain them.

Why this answer

Setting it to BASIC disables many diagnostic features, including AWR and ADDM.

66
MCQmedium

You are managing an Oracle Database 23ai instance where a specific SQL statement is consuming excessive CPU. You want to identify the top SQL statements by CPU usage in real time. Which dynamic performance view should you query?

A.V$SQLSTATS
B.V$SQLAREA
C.V$SYSSTAT
D.V$SESSION
AnswerA

V$SQLSTATS provides statistics on SQL statements currently in the shared pool, aggregated by SQL_ID and plan hash value. It includes CPU_TIME, which is the cumulative CPU time consumed by the statement. This view is designed for efficient access to SQL statistics and is ideal for identifying high-CPU SQL in real time. It is updated frequently and is less resource-intensive than querying V$SQL directly for aggregation.

Why this answer

To identify top SQL statements by CPU usage in real time, you should query a view that aggregates CPU time per SQL statement and is optimized for quick access. V$SQLSTATS is designed for this purpose, providing cumulative CPU_TIME and other statistics for SQL statements in the shared pool. It is more efficient than V$SQLAREA and more granular than V$SYSSTAT.

V$SESSION does not aggregate CPU per SQL. Therefore, V$SQLSTATS is the correct choice.

Exam trap

The trap here is choosing V$SQLAREA because it is familiar, but V$SQLSTATS is the modern, more efficient view for real-time SQL statistics.

67
MCQmedium

You are analyzing a query with the SQL Tuning Advisor. The advisor recommends an 'SQL Profile'. What does the profile actually do?

A.It updates the table statistics
B.It creates a new index
C.It adds optimizer hints and cardinality adjustments
D.It rewrites the SQL query
AnswerC

An SQL Profile stores auxiliary information, including optimizer hints and adjusted cardinality estimates, that the optimiser applies when parsing the statement, steering it toward the advisor's recommended plan without editing the SQL text or changing statistics.

Why this answer

A SQL Profile provides additional optimizer hints and statistics corrections.

68
MCQhard

A DBA is troubleshooting a performance issue in Oracle Database 23ai. A query that previously used an index full scan now performs a full table scan. The DBA suspects that the optimizer's statistics are stale. Which action should the DBA take to confirm this suspicion?

A.Query DBA_TAB_STATISTICS and DBA_IND_STATISTICS to compare LAST_ANALYZED dates with the table modification timestamps.
B.Use DBMS_STATS.GATHER_TABLE_STATS with the default parameters and see if the plan changes.
C.Examine the execution plan and compare the estimated cardinality with the actual rows processed using DBMS_XPLAN.DISPLAY_CURSOR with the ALLSTATS LAST option.
D.Check the OPTIMIZER_MODE parameter to ensure it is set to ALL_ROWS.
AnswerC

By comparing estimated cardinality (from the optimizer) with actual rows (from runtime statistics) using DBMS_XPLAN.DISPLAY_CURSOR with ALLSTATS LAST, you can see if the optimizer's estimates are significantly off. If the estimates are inaccurate, it suggests stale or missing statistics. This directly confirms whether statistics are the cause of the suboptimal plan.

Why this answer

To confirm that stale statistics caused the optimizer to choose a full table scan, the DBA should compare the optimizer's estimated cardinality with the actual rows processed. If the estimates are far off, it indicates that the statistics do not reflect the current data. DBMS_XPLAN.DISPLAY_CURSOR with ALLSTATS LAST provides this comparison.

Merely checking LAST_ANALYZED dates or gathering statistics does not confirm the cause.

Exam trap

The trap here is assuming that gathering statistics or checking LAST_ANALYZED dates directly confirms stale statistics as the cause, when the definitive method is comparing estimated versus actual cardinality.

69
MCQmedium

You are investigating high CPU utilization in the database. Which view provides the top SQL statements currently in memory based on CPU usage?

A.V$SQLAREA
B.V$SESSION
C.V$SYSSTAT
D.V$LIBRARYCACHE
AnswerA

V$SQLAREA aggregates statistics per SQL statement across all cursors sharing the same text, including CPU usage, so it ranks the top statements resident in memory by CPU consumption. That matches the requirement to identify the highest-CPU SQL currently in memory.

Why this answer

V$SQLAREA contains aggregated statistics for SQL statements in the library cache, including CPU_TIME.

Ready to test yourself?

Try a timed practice session using only Performance Tuning And Diagnostics questions.