A financial services application is experiencing severe performance degradation during its nightly batch processing. An AWR report for the period shows the top wait event is 'latch: cache buffers chains', with a high number of consistent gets. The primary table involved in the batch job is frequently accessed via a non-selective index. Which action is the most direct and effective way to mitigate this specific latch contention?
Answer and explanation
Correct answer: C
'latch: cache buffers chains' contention often occurs when multiple sessions are trying to access blocks protected by the same latch, a situation commonly caused by 'hot blocks'. This is frequently a result of inefficient SQL, such as repeatedly scanning a large number of blocks through a non-selective index. The most effective solution is to fix the root cause: the SQL statement. Tuning the SQL to use a more selective index or a full table scan (if appropriate) will reduce the logical I/O and the contention on the same set of blocks. Increasing the buffer cache might slightly alleviate the symptoms but doesn't solve the underlying SQL inefficiency. Reducing block size is a major architectural change and not a direct solution. Increasing _DB_BLOCK_LRU_LATCHES is a deprecated action and not recommended.
Question 2
A database is configured with Automatic Memory Management (AMM) by setting MEMORY_TARGET. After a system reboot, the database fails to start, and the alert log shows an ORA-00845 error. What is the most likely cause of this error?
Answer and explanation
Correct answer: B
The ORA-00845 error (MEMORY_TARGET not supported on this system) indicates that the operating system environment cannot support the Automatic Memory Management configuration. On Linux systems, AMM requires the /dev/shm shared memory filesystem to be large enough to hold the entire MEMORY_TARGET allocation. If /dev/shm is smaller than MEMORY_TARGET, the database instance cannot allocate the required shared memory and will fail to start. The correct resolution is to increase the size of /dev/shm (typically by editing /etc/fstab) to be at least the size of MEMORY_TARGET and reboot the server or remount the filesystem.
Question 3
Multiple answers
You are tasked with analyzing the performance impact of a major application upgrade before deploying it to production. The goal is to test the exact production workload against the upgraded database environment to identify any SQL regressions. Which two Oracle features should be used in combination to achieve this? (Select TWO)
Answer and explanation
Correct answers: A, C
Question 4
A query against a large, partitioned table is performing poorly. The execution plan reveals that the optimizer is performing a full scan on all partitions, even though the WHERE clause contains a filter on the partitioning key column. You have confirmed that optimizer statistics are up-to-date. What is the most probable reason for the lack of partition pruning?
Answer and explanation
Correct answer: B
Partition pruning can only occur if the optimizer can determine at parse time which partitions need to be accessed. If a function (e.g., TO_CHAR, SUBSTR) or an implicit data type conversion is applied to the partitioning key column in the WHERE clause, the optimizer cannot make this determination. For example, if a DATE column is the partitioning key and the WHERE clause compares it to a character string (WHERE partition_date_col = '01-JAN-2023'), the implicit TO_DATE conversion on the literal value is fine. However, if the query is written as WHERE TO_CHAR(partition_date_col, 'YYYY-MM-DD') = '2023-01-01', the function on the column prevents pruning. This is a common cause of performance issues with partitioned tables.
Question 5
True or False: When using the In-Memory Column Store, the INMEMORY clause can be applied at the tablespace level, causing all new tables and partitions created in that tablespace to be automatically enabled for In-Memory population.
Answer and explanation
Correct answer: A
This statement is true. Oracle Database allows you to set a default In-Memory attribute for a tablespace. When you create a new table or partition within that tablespace without specifying an INMEMORY or NO INMEMORY clause, it inherits the default setting from the tablespace. This simplifies the management of In-Memory objects for large applications.
Question 6
You are managing a database for an e-commerce platform that experiences very high transaction rates. Users report intermittent slowdowns. Your analysis of ASH data reveals frequent waits for 'log file sync' and 'log file parallel write'. Which of the following is the most appropriate first step to diagnose the I/O subsystem's contribution to this problem?
Answer and explanation
Correct answer: B
The 'log file sync' wait event indicates that user sessions are waiting for LGWR to write redo from the log buffer to the online redo logs. The 'log file parallel write' event is the time LGWR itself spends writing to the logs. To determine if the I/O subsystem is the bottleneck, you must measure the actual write performance. The AWR report's I/O stats section, specifically the 'redo write time' and average write time (avg wrt(ms) for the redo log files), provides a direct measurement of the I/O performance for redo writes. High values here (e.g., >10ms) confirm an I/O bottleneck. Increasing the log buffer is unlikely to help if the I/O subsystem cannot keep up. Increasing log file size might reduce log switches but won't improve write speed. Adding more redo log groups is a good practice for availability but also doesn't directly speed up individual writes.
Question 7
A DBA is trying to improve the performance of a specific SQL statement. They run the SQL Tuning Advisor, which recommends creating a SQL Profile. What is the primary function of a SQL Profile?
Answer and explanation
Correct answer: B
A SQL Profile does not freeze an execution plan like a SQL Plan Baseline does. Instead, it contains supplemental statistics and correction factors (e.g., adjustments to cardinality or cost estimates) derived from the SQL Tuning Advisor's analysis. When the SQL statement is parsed, the optimizer uses this additional information from the profile, along with the regular object statistics, to make better decisions and generate a more optimal plan. This allows the plan to adapt to future changes in data or statistics while still being guided by the profile's corrections.
Question 8
An administrator is investigating high PGA usage. The V$PGASTAT view shows a large value for total PGA allocated and a significant number of workarea executions - multipass. What is the most direct way to get a recommendation for sizing the PGA to reduce multipass executions?
-- Query executed by DBA:
SELECT * FROM V$PGA_TARGET_ADVICE;
Answer and explanation
Correct answer: A
The V$PGA_TARGET_ADVICE view is specifically designed to help DBAs size the PGA_AGGREGATE_TARGET. It predicts how changes to this parameter will affect the cache hit percentage and the number of multipass executions. By examining the ESTD_OVERALLOC_COUNT or ESTD_MULTIPASS_EXECUTIONS (in older versions) columns, the DBA can see at which PGA_AGGREGATE_TARGET value the number of multipass executions would drop to zero or an acceptable level. This provides a direct, data-driven recommendation for tuning the PGA.
Question 9
Multiple answers
A system is experiencing high buffer busy waits. An analysis of V$WAITSTAT and segment statistics from an AWR report indicates the contention is on data blocks belonging to a single, heavily inserted table. The application uses a sequence to populate the primary key. Which two actions could help alleviate this specific type of contention? (Select TWO)
Answer and explanation
Correct answers: A, C
Question 10
Case Study: A retail company runs its primary OLTP database on a 2-node Oracle RAC 19c environment. During peak holiday sales, the system experiences significant performance issues. The business requires that the database remains highly available and that the performance issues are resolved without application code changes.
An AWR report from the peak period shows the top timed foreground events are 'gc cr block 2-way', 'gc current block 2-way', and 'DB CPU'. The 'Interconnect Ping Latency Stats' section of the report indicates low latency, suggesting the private network is healthy. Further analysis of the 'SQL ordered by Cluster Wait Time' section reveals that a small number of UPDATE statements against the INVENTORY table are responsible for the majority of the 'gc current block' waits.
The INVENTORY table is frequently updated by transactions originating from both nodes as sales are processed. The application logic reads the current stock level, updates it, and commits. The table is not partitioned and has a standard B-tree index on the PRODUCT_ID primary key.
Given this information, what is the most appropriate solution to mitigate the 'gc current block 2-way' contention and improve performance?
Answer and explanation
Correct answer: C
The high 'gc current block 2-way' waits on the INVENTORY table indicate severe block contention between the RAC nodes. This happens when both nodes are frequently requesting the most current version of the same data blocks for modification. The root cause is that updates for different products are likely physically co-located in the same data blocks, causing inter-node conflicts. Implementing hash partitioning on PRODUCT_ID will physically separate the data for different products into different partitions, and therefore different sets of data blocks. This dramatically reduces the probability that Node 1 and Node 2 will need to modify the same block at the same time, thus mitigating the global cache contention. Directing traffic to one node would serialize the workload, defeating the purpose of RAC for scalability. Increasing DBWRs doesn't solve the inter-node block transfer issue. Rebuilding indexes might temporarily help but won't solve the fundamental data placement problem.