You manage a 19c database with default optimizer settings. This statement is used extensively as subquery in the application queries: SELECT city_id FROM sh2.sales WHERE city_id=:Bl You notice the performance of these queries is often poor and, therefore, execute: SELECT city_id,COUNT(*) FROM sh2.sales GROUP BY city_id; Examine the results: There is no index on the CITY_ID column. Which two options improve the performance?
Correct Answer: A,B
In this scenario, creating an index and generating frequency histograms are two methods that can potentially improve performance: * A (Correct): Generating frequency histograms on the CITY_ID column can help the optimizer make better decisions regarding the execution plan, especially if the data distribution is skewed. Histograms provide the optimizer with more detailed information about the data distribution in a column, which is particularly useful for columns with non-uniform distributions. * B (Correct): Creating an index on the CITY_ID column would speed up queries that filter on this column, especially if it's used frequently in the WHERE clause as a filter. An index would allow for an index range scan instead of a full table scan, reducing the I/O and time needed to execute such queries. * C (Incorrect): While SQL profiles can be used to improve the performance of specific SQL statements, they are usually not the first choice for such a problem, and creating a profile does not replace the need for proper indexing or statistics. * D (Incorrect): Forcing the subquery to use dynamic sampling might not provide a consistent performance benefit, especially if the table statistics are not representative or are outdated. However, dynamic sampling is not as effective as having accurate statistics and a well-chosen index. * E (Incorrect): Adaptive plans can adjust the execution strategy based on the conditions at runtime. While they can be useful in certain scenarios, in this case, creating an index and ensuring accurate statistics would likely provide a more significant performance improvement. References: * Oracle Database SQL Tuning Guide: Managing Optimizer Statistics * Oracle Database SQL Tuning Guide: Using Indexes and Clusters
1Z0-084 Exam Question 7
Which two statements are true about cursor sharing?
Correct Answer: A,D
A: When Cursor_sharing is set to FORCE, Oracle tries to avoid hard parses by replacing literals in SQL statements with bind variables, even if the original statement didn't include bind variables. This can lead to the use of a single execution plan for multiple executions of a statement with different literal values, which might not be optimal for all executions. D: Setting cursor_sharing to EXACT ensures that SQL statements must match exactly for them to share a cursor. This setting prevents the use of Adaptive Cursor Sharing (ACS) since ACS relies on the ability to share cursors among similar statements that differ only in their literal values. With EXACT, there's no cursor sharing for statements with different literals, hence no opportunity for ACS to operate. References: * Oracle Database SQL Tuning Guide, 19c * Oracle Database Reference, 19c
1Z0-084 Exam Question 8
Which three statements are true about server-generated alerts?
Correct Answer: A,C,F
Server-generated alerts in Oracle Database are designed to notify DBAs and other administrators about issues within the database environment. These alerts can be triggered by a variety of conditions, including threshold-based metrics and specific events such as ORA- error messages. Here's how these options align with the statements provided: * A (True):Server-generated alerts are indeed notifications from the Oracle Database Server that highlight existing or impending issues. These alerts are part of Oracle's proactive management capabilities, designed to inform administrators about potential problems before they escalate. * C (True):These alerts are logged in the alert log of the Oracle Database. The alert log is a crucial diagnostic tool that records major events and changes in the database, including server-generated alerts. This log is often the first place DBAs look when troubleshooting database issues. * F (True):Server-generated alerts may include suggestions for correcting identified problems. Oracle Database often provides actionable advice within these alerts to assist in resolving issues more efficiently. These suggestions can range from adjusting configuration parameters to performing specific maintenance tasks. Options B, D, and E do not accurately describe server-generated alerts: * B (False):While the statement might have been true in some contexts, Oracle's server-generated alerts often include corrective suggestions, making this statement incorrect. * D (False):Server-generated alerts can be viewed from various interfaces, not just the Cloud Control Database home page. They are accessible through Enterprise Manager, SQL Developer, and directly within the database alert log, among other tools. * E (False):While it's true that threshold settings for some alerts can be modified, the method specified, usingDBMS_SERVER_ALERT, is not correct. Threshold settings are typically adjusted through Enterprise Manager or by modifying specific initialization parameters directly. References: * Oracle Database Documentation:Oracle Database 19c: Performance Management and Tuning * Oracle Base: Alert Log and Trace Files * Oracle Support:Understanding and Managing Server-Generated Alerts
1Z0-084 Exam Question 9
Which two statements are true about session wait information contained in v$session or v$session_wait?
Correct Answer: B,C
In theV$SESSIONview, Oracle provides information about the session waits: B: When theWAIT_TIMEcolumn has a value of 0, it signifies that the session is currently waiting for a resource. This column represents the duration of the current or last wait. C: If the session is not actively waiting, theWAIT_TIMEcolumn shows the time the session spent waiting for the last wait event. If theSTATEcolumn is showing "WAITED KNOWN TIME", it means the session is not currently waiting, but it indicates the time for which it had waited. References: * Oracle Database Reference, 19c * Oracle Database Performance Tuning Guide, 19c
1Z0-084 Exam Question 10
Multiple sessions are inserting data concurrently into a table that has an LOB column. At some point in time, one of the sessions cannot find available space in the LOB segment and needs to allocate a new extent. Which wait event will be raised in the other sessions that need space in the LOB column?
Correct Answer: C
When sessions concurrently insert data into a table with an LOB column and one session needs to allocate a new extent because it cannot find available space, the wait event associated with this contention is "enq: HW - contention". The HW stands for High Water Mark which is related to space allocation in the database segment. When a session needs to allocate a new extent, it may raise this wait event in other sessions that are also attempting to allocate space in the same LOB segment. References * Oracle Database 19c Reference Guide - enq: HW - contention