The purpose of this bulletin is to instruct both customers and support analyst on how easy it can be to submit a testcase that demonstrates a problem with an AWR report.
The awrextr.sql script extracts the AWR data for a range of snapshots from the database into a Data Pump export file. Once created, this dump file can be transported to another system where the extracted data can be loaded. To run the awrextr.sql script, you need to be connected to the database as the SYS user.
To extract AWR data:
1. At the SQL prompt, enter:
2. A list of the databases in the AWR schema is displayed.
Specify the database from which the AWR data will be extracted:
3. In this example, the database with the database identifier of 1377863381 is selected.
Specify the number of days for which you want to list snapshot Ids.
4. A list of existing snapshots for the specified time range is displayed. In this example, snapshots captured in the last 2 days are displayed.
Define the range of snapshots for which AWR data will be extracted by specifying a beginning and ending snapshot Id:
5. In this example, the snapshot with a snapshot Id of 30 is selected as the beginning snapshot, and the snapshot with a snapshot Id of 40 is selected as the ending snapshot.
A list of directory objects is displayed.
Specify the directory object pointing to the directory where the export dump file will be stored:
6. In this example, the directory object DATA_PUMP_DIR is selected.
Specify the prefix for name of the export dump file (the .dmp suffix will be automatically appended):
In this example, an export dump file named awrdata_30_40 will be created in the directory corresponding to the directory object you specified:
Depending on the amount of AWR data that needs to be extracted, the AWR extract operation may take a while to complete. Once the dump file is created, you can use Data Pump to transport the file to another system.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
On the source database when you want to demonstrate the problem:
Once the export dump file is transported to the target system, you can load the extracted AWR data using the awrload.sql script. The awrload.sql script will first create a staging schema where the snapshot data is transferred from the Data Pump file into the database. The data is then transferred from the staging schema into the appropriate AWR tables. To run the awrload.sql script, you need to be connected to the database as the SYS user.
To load AWR data:
1. At the SQL prompt, enter:
2. A list of directory objects is displayed.
Specify the directory object pointing to the directory where the export dump file is located:
3. In this example, the directory object DATA_PUMP_DIR is selected.
Specify the prefix for name of the export dump file (the .dmp suffix will be automatically appended):
4. In this example, the export dump file named awrdata_30_40 is selected.
Specify the name of the staging schema where the AWR data will be loaded:
Schema should not be an existing schema. The default staging schema name is AWR_STAGE.
To use this name, press
an alternative.
5. In this example, a staging schema named AWR_STAGE will be created where the AWR data will be loaded.
Specify the default tablespace for the staging schema:
6. In this example, the SYSAUX tablespace is selected.
Specify the temporary tablespace for the staging schema:
7. In this example, the TEMP tablespace is selected.
A staging schema named AWR_STAGE will be created where the AWR data will be loaded. After the AWR data is loaded into the AWR_STAGE schema, the data will be transferred into the AWR tables in the SYS schema:
Depending on the amount of AWR data that needs to be loaded, the AWR load operation may take a while to complete. After the AWR data is loaded, the staging schema will be dropped automatically.
Obviously this method presumes that you have the database configured to use DataPump.