nerdexam
Oracle

1Z0-117 · Question #89

While tuning a SQL statement, the SQL Tuning Advisor finds an existing SQL profile for a statement that has stale statistics. Automatic optimizer statistics is enabled for the database. What does…

The correct answer is B. Makes the statistics information available to GATHER_DATABASE_STATS_JOB_PROC. Automatic optimizer statistics collection calls the DBMS_STATS.GATHER_DATABASE_STATS_JOB_PROC procedure. This internal procedure operates similarly to the DBMS_STATS.GATHER_DATABASE_STATS procedure using the GATHER AUTO option. The main difference is that…

Implementing SQL Performance Advisors

Question

While tuning a SQL statement, the SQL Tuning Advisor finds an existing SQL profile for a statement that has stale statistics. Automatic optimizer statistics is enabled for the database. What does the optimizer do in this situation?

Options

  • AUpdates the existing SQL profiles for which the statistics are stale.
  • BMakes the statistics information available to GATHER_DATABASE_STATS_JOB_PROC
  • CStarts the statistics collection process by running GATHER_STATS_JOB
  • DWrites a warning message in the alert log file

How the community answered

(36 responses)
  • A
    17% (6)
  • B
    72% (26)
  • C
    3% (1)
  • D
    8% (3)

Explanation

Automatic optimizer statistics collection calls the DBMS_STATS.GATHER_DATABASE_STATS_JOB_PROC procedure. This internal procedure operates similarly to the DBMS_STATS.GATHER_DATABASE_STATS procedure using the GATHER AUTO option. The main difference is that GATHER_DATABASE_STATS_JOB_PROCprioritizes database objects that require statistics, so that objects that most need updated statistics are processed first, before the maintenance window closes. * The optimizer relies on object statistics to generate execution plans. If these statistics are stale or missing, then the optimizer does not have the necessary information it needs and can generate poor execution plans. The Automatic Tuning Optimizer checks each query object for missing or stale statistics, and produces two types of output: / Recommendations to gather relevant statistics for objects with stale or no statistics Because optimizer statistics are automatically collected and refreshed, this problem occurs only when automatic optimizer statistics collection is disabled. See "Managing Automatic Optimizer Statistics Collection". / Auxiliary statistics for objects with no statistics, and statistic adjustment factor for objects with stale statistics The database stores this auxiliary information in an object called a SQL profile. * Oracle recommends that you enable automatic optimizer statistics collection. In this case, the database automatically collects optimizer statistics for tables with absent or stale statistics. If fresh statistics are required for a table, then the database collects them both for the table and associated indexes. Automatic collection eliminates many manual tasks associated with managing the optimizer. It also significantly reduces the risks of generating poor execution plans because of missing or stale Automatic optimizer statistics collection calls the DBMS_STATS.GATHER_DATABASE_STATS_JOB_PROC procedure. This internal procedure operates similarly to the DBMS_STATS.GATHER_DATABASE_STATS procedure using the GATHER AUTO option. The main difference is that GATHER_DATABASE_STATS_JOB_PROC prioritizes database objects that require statistics, so that objects that most need updated statistics are processed first, before the maintenance window closes. Statistics Collection

Topics

#SQL Tuning Advisor#SQL profile#stale statistics#automatic statistics

Community Discussion

No community discussion yet for this question.

Full 1Z0-117 Practice