Oracle Database 12c: Performance Management and Tuning — Question 9
You are administering a database that supports an OLTP workload. Users complain about the degraded response time of a query. You want to gather new statistics for objects accessed by the query and test query performance with the new statistics without affecting other sessions connected to the instance.
The STALE_PERCENT statistic preference is set to a default value and the STATISTICS_LEVEL parameter is set to TYPICAL.
Which two actions would you take to accomplish the task? (Choose two.)
Answer options
- A. Set the STALE_PERCENT statistic preference to a higher value than the default, and then gather statistics.
- B. Set the STATISTICS_LEVEL parameter to ALL for the instance.
- C. Set the INCREMENTAL preference to TRUE, and then gather statistics.
- D. Set the OPTIMIZER_USE_PENDING_STATISTICS parameter to TRUE for the session in which you want to test the query.
- E. Set the PUBLISH statistic preference to FALSE, and then gather statistics.
- F. Set the NO_INVALIDATE statistic preference to TRUE, and then gather statistics.
Correct answer: B, E
Explanation
Option B is correct because setting the STATISTICS_LEVEL parameter to ALL allows for more comprehensive statistics to be gathered, which can improve query performance. Option E is also correct as setting the PUBLISH statistic preference to FALSE ensures that the gathered statistics do not affect other sessions until confirmed. The other options either do not address the need to test without impacting other sessions or do not directly contribute to improving query performance.