11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 4 ■ PERFORMANCE MANAGEMENT 2<strong>11</strong>You must grant a user the administer_sql_management object privilege so they can executethe evolve_sql_plan baseline procedure.Evolving Plans with the SQL Tuning AdvisorWhen you run the SQL Tuning Advisor, it may sometimes recommend the acceptance of a SQLprofile when the advisor runs across a plan whose performance is better than any plan in theSQL plan baseline. If you implement the recommendation by accepting the SQL profile, theSQL Tuning Advisor automatically adds that plan to the SQL plan baseline. In <strong>Oracle</strong> <strong>Database</strong><strong>11</strong>g, as we explained in the SQL Tuning Advisor discussion, the Automatic SQL Tuning Advisortask that runs nightly during the maintenance window automatically implements the SQLprofile recommendations made by the SQL Tuning Advisor. Thus, any tuned high-load SQLstatements automatically become part of the SQL plan baselines for those statements.■Note If you want to set the number of possible plans to a single plan, you can do so by using fixed SQLplan baselines. You can also use fixed-plan baselines when migrating a stored outline by making the storedoutline a fixed SQL plan baseline. The optimizer will then pick the fixed plan even if it finds other plans withlower costs. The optimizer won’t automatically add new plans to a fixed plan baseline. You can evolve a fixedSQL plan baseline manually, however, by manually loading new plans from an STS or a cursor cache.Displaying SQL Plan BaselinesYou can examine the SQL plan baselines for any SQL statement using the DISPLAY_SQL_PLAN_BASELINE function of the DBMS_XPLAN package, as shown here:SQL> select * from table(2 dbms_xplan.display_sql_plan_baseline(3 sql_handle=>’SYS_SQL_2d02582d7a04c30b’,4 format =>’basic’;));PLAN_TABLE_OUTPUT----------------------------------------------------------------------SQL handle: SYS_SQL_2d02582d7a04c30bSQL text: select * from hr.employees order by last_name--------------------------------------------------------------------------------------------------------------------------------------------Plan name: SYS_SQL_PLAN_7a04c30b6d8b6a03Enabled: YES Fixed: NO Accepted: YES Origin: MANUAL-LOAD----------------------------------------------------------------------PLAN_TABLE_OUTPUT----------------------------------------------------------------------Plan hash value: 3447538987

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!