How to Export and Import the AWR Repository From One Database to Another (文档 ID 785730.1)
2017-03-20 16:06
1221 查看
APPLIES TO:
Oracle Database - Enterprise Edition - Version 11.1.0.6 and laterInformation in this document applies to any platform.
PURPOSE
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.
TROUBLESHOOTING STEPS
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 canbe 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:
start $ORACLE_HOME/rdbms/admin/awrextr.sql
2. A list of the databases in the AWR schema is displayed.
Specify the database from which the AWR data will be extracted:
Enter value for db_id: 1377863381
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.
Enter value for num_days: 2
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:
Enter value for begin_snap: 30
Enter value for end_snap: 40
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:
Enter value for directory_name: DATA_PUMP_DIR
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):
Enter value for file_name: awrdata_30_40
In this example, an export dump file named awrdata_30_40 will be created in the directory corresponding to the directory object you specified:
Dump file set for SYS.SYS_EXPORT_TABLE_01 is:
C:\ORACLE\PRODUCT\11.1.0.5\DB_1\RDBMS\LOG\AWRDATA_30_40.DMP
Job "SYS"."SYS_EXPORT_TABLE_01" successfully completed at 08:58:20
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:
start $ORACLE_HOME/rdbms/admin/awrload.sql
2. A list of directory objects is displayed.
Specify the directory object pointing to the directory where the export dump file is located:
Enter value for directory_name: DATA_PUMP_DIR
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):
Enter value for file_name: awrdata_30_40
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:
Enter value for schema_name: AWR_STAGE
Schema should not be an existing schema. The default staging schema name is AWR_STAGE.
To use this name, press <return> to continue, otherwise enter
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:
Enter value for default_tablespace: SYSAUX
6. In this example, the SYSAUX tablespace is selected.
Specify the temporary tablespace for the staging schema:
Enter value for temporary_tablespace: TEMP
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:
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Completed 113 CONSTRAINT objects in 11 seconds
Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Completed 1 REF_CONSTRAINT objects in 1 seconds
Job "SYS"."SYS_IMPORT_FULL_03" successfully completed at 09:29:30
... Dropping AWR_STAGE user
End of AWR Load
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.
相关文章推荐
- How to Calculate the Number of IOPS and Throughput of a Database (文档 ID 2206831.1)
- How to Edit a Stored Outline to Use the Plan from Another Stored Outline (文档 ID 730062.1)
- How to move RAC Database ORACLE_HOME from one location to another one (Doc ID 1438719.1)
- How to export/import data with LOB type from one user/schema to another
- Export/Import DataPump Parameter ACCESS_METHOD - How to Enforce a Method of Loading and Unloading Data ? [ID 552424.1]
- Export/Import DataPump Parameter ACCESS_METHOD - How to Enforce a Method of Loading and Unloading Data ? [ID 552424.1]
- How To Reclaim Wasted Space on The Segment (Table, Index and LOB) and Tablespace Levels (文档 ID 16827
- How to (how to refresh/redirect the contents of one frame from another frame )
- Export/Import DataPump Parameter ACCESS_METHOD - How to Enforce a Method of Loading and Unloading Data ? [ID 552424.1]
- How to Read PGA Memory Advisory Section in AWR and Statspack Reports (文档 ID 786554.1)
- How to move ASM database files from one diskgroup to another
- Export/Import DataPump Parameter ACCESS_METHOD - How to Enforce a Method of Loading and Unloading Data ? [ID 552424.1]
- How to Find the Offending SQL from a ORA-600 or ORA-7445 Trace File (文档 ID 154170.1) 转到底部 In this
- How to move ASM database files from one diskgroup to another
- How To Query And Change The Oracle Hidden Parameters In Oracle 10g and 11g (文档 ID 315631.1)
- How To Export/import OAM 11g Policies? (文档 ID 1487455.1)
- How to Interpret the OS stats section of an AWR report (文档 ID 762526.1)
- How to Interpret the "SQL ordered by Physical Reads (UnOptimized)" Section in AWR (文档 ID 1466035.1)
- Export/Import DataPump Parameter ACCESS_METHOD - How to Enforce a Method of Loading and Unloading Data ? [ID 552424.1]
- How to Generate an AWR Report and Create Baselines (文档 ID 748642.1)