How to Extract Good Plan Hash Value for SQL Statement from AWR Warehouse and Load to SPM Baseline

(Doc ID 2382833.1)

Last updated on APRIL 14, 2018

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.4 and later
Information in this document applies to any platform.

Goal

Goal of this document is to extract the good plan hash value for SQL statements from AWR warehouse and then to load the good plans for SPM baselines for plan stability. Effective from the 12.1.0.4 release, Oracle Enterprise Manager (EM) Cloud Control now provides the ability to transfer the performance data stored in the Automatic Workload Repository (AWR) across all Oracle databases into a central performance warehouse called AWR Warehouse.

 

<Document 1907335.1> : Master Note on AWR Warehouse in Enterprise Manager

Users can store the old out of retention historical data to AWR warehouse so that it can be used whenever required.
However, it is a limitation with SQLT which does not look for plans from AWR warehouse when good plans are available in AWR warehouse.
AWR warehouse apparently setup in separate database which has the repository data for all source databases it is registered.
When SQLT is executed from one of the sources , it cannot look from AWR warehouse which is outside of source environment.
DB links have to be created to connect to AWR warehouse DB to extract the plan details for SQLs that are older than the local AWR info.

This document provides the manual scripts to extract the good plans for the SQL statements which can be loaded to SPM baselines of source database.

 

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms