053第246题

246.The OPTIMIZER_USE_PLAN_BASELINES parameter is set to TRUE. The optimizer generates a

plan for a SQL statement but does not find a matching plan in the SQL plan baseline.

Which two operations are performed by the optimizer in this scenario?

(Choose two.)

A. The optimizer adds the new plan to the plan history.

B. The optimizer selects the new plan for the execution of the SQL statement.

C. The optimizer adds the new plan to the SQL plan baseline as an accepted plan.

D. The optimizer adds the new plan to the SQL plan baseline but not in the ENABLED state.

E. The optimizer costs each of the accepted plans in the SQL plan baseline and picks the one with the

lowest cost.

Answer: AE

The plan history is the set of plans, both accepted and not accepted, that the optimizer generates for a SQL statement over time. Because only accepted plans are in the SQL plan baseline, the plans in the baseline
form a susbset of the plan history. For example, after the optimizer generates the first acceptable plan for a SQL plan baseline, subsequent plans are part of the plan history but not part of the plan baseline.

The process of adding plans to a SQL plan baseline is plan evolution. To be eligible to be evolved, a plan must be enabled for use by the optimizer.

During the SQL plan baseline selection phase, Oracle Database detects plan changes
based on the stored plan history, and selects plans to avoid potential performance regressions for a set of SQL statements.

Each time the database compiles a SQL statement, the optimizer does the following:

  1. Uses a cost-based search method to build a best-cost plan
  2. Tries to find a matching plan in the SQL plan baseline
  3. Does either of the following depending on whether a match is found:
    • If found, then the optimizer proceeds using the matched plan
    • If not found, then the optimizer evaluates the cost of each accepted plan in the SQL plan baseline and selects the plan with the lowest cost

The best-cost plan found by the optimizer that does not match any plans in the plan history for the SQL statement represents a new plan. The database adds this plan as a nonaccepted plan to the plan history. The database does not use the new
plan until it is verified to not cause a performance regression. However, if a change in the system (such as a dropped index) causes all accepted plans to become non-reproducible, then the optimizer selects the best-cost plan. Thus, the presence of a SQL plan
baseline causes the optimizer to use conservative plan selection strategy for the SQL statement.

To enable the use of SQL plan baselines, set the OPTIMIZER_USE_SQL_PLAN_BASELINES initialization
parameter to TRUE (default).

时间: 2024-08-08 21:04:50

053第246题的相关文章

053第383题

383.At the request of a user, you issue the following command to restore a dropped table: flashback table "BIN$F2JFfMq8Q5unbC0ceE9eJg==$0" to before drop; Later, the user notifies you that the data in the table seems to be very old and out of da

053第256题

256.Sales details are being stored on a daily basis in the SALES_2007 table. A large amount of data is added to the table daily. To save disk space, you issued the following command: ALTER TABLE sales_2007 COMPRESS FOR ALL OPERATIONS; What would be t

053第170题

170.ASM supports all but which of the following file types? (Choose all that apply.) A. Database files B. Spfiles C. Redo-log files D. Archived log files E. RMAN backup sets F. Password files G. init.ora files Answer: FG Files that are stored in Orac

053第455题

455.When a job exceeds the date specified in its END_DATE attribute, which of the following will happen? (Choose all that apply.) A. The job will be dropped automatically if the value of the AUTO_DROP attribute is TRUE. B. The job will only be disabl

053第502题

502.A database is running In ARCHIVBXXMS mode. It has two online redo log groups and each group has one member. A LGWR Input/output (I/O) fells due to permanent media failure that has resulted In the loss of redo log file and the LWGR terminates caus

053第423题

423.Which of the following describes how a distributed resumable transaction behaves? A. The resumable setting on the initiating session determines the resumable conditions for the entire distributed transaction. B. The resumable setting for the init

053第85题

85.You executed the following command to drop a user: DROP USER scott CASCADE; Which two statements regarding the above command are correct? (Choose two.) A. All the objects of scott are moved to the Recycle Bin. B. Any objects in the Recycle Bin bel

053 第561题

561.If you issue the command shutdown abort prior to trying to put the database in ARCHIVELOG mode, what will be the result when you issue the command alter database archivelog? A. The alter database archivelog command will fail. B. The alter databas

053第42题

42.You plan to use SQL Performance Analyzer to analyze the SQL workload. You created a SQL Tuning Set as a part of the workload capturing. What information is captured as part of this process? (Choose all that apply.) A. the SQL text B. the execution