AWR的SNAP生成后,不一定要在原数据库上生成报告,可以利用AWR提供的导出、导入功能,将AWR数据迁移到测试数据库上进一步分析。
将上一篇文章导出的dmp文件拷贝到目标数据库的指定DIRECTORY目录下,就可以调用$ORACLE_HOME/rdbms/admin/awrload.sql脚本执行导入了:
SQL> @?/rdbms/admin/awrload.sql
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Disclaimer: This SQL/Plus script. should only be called under
the guidance of Oracle Support.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~
AWR LOAD
~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ This script. will load the AWR data from a dump file. The ~
~ script. will prompt users for the following information: ~
~ (1) name of directory object ~
~ (2) name of dump file ~
~ (3) staging schema name to load AWR data into ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Specify the Directory Name
~~~~~~~~~~~~~~~~~~~~~~~~~~
Directory Name Directory Path
------------------------------ -------------------------------------------------
ADMIN_DIR /opt/ora10g/product/10.2.0/db_1/md/admin
DATA_PUMP_DIR /opt/ora10g/product/10.2.0/db_1/rdbms/log/
DMP_DIR /data/backup
DUMP_DIR /home/oracle/shiyq/
DUMP_FILE_DIR /data/backup/dmp
D_OUTPUT /home/oracle
D_TRANS /data/oradata/test08
EXTDIR /home/oracle/script/
TRAN /data/backup
WORK_DIR /opt/ora10g/product/10.2.0/db_1/work
Choose a Directory Name from the list above (case-sensitive).
Enter value for directory_name: D_OUTPUT
Using the dump directory: D_OUTPUT
Specify the Name of the Dump File to Load
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please specify the prefix of the dump file (.dmp) to load:
Enter value for file_name: awr_testrac_2782_2806
Loading from the file name: awr_testrac_2782_2806.dmp
Staging Schema to Load AWR Snapshot Data
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The next step is to create the staging schema
where the AWR snapshot data will be loaded.
After loading the data into the staging schema,
the data will be transferred into the AWR tables
in the SYS schema.