DUMP的AWR报告如何导入到Oracle详解(一)

2014-11-24 17:28:21 · 作者: · 浏览: 0

1.在导出数据之前,一般需要创建以下路径:


DATA_PUMP_DIR


EXP


IMP


DATA_FILE_DIR




23:54:29 sys@felix SQL>create directoryexp as '/u01/exp';



Directory created.



23:55:33 sys@felix SQL>create directorydate_dir as'/u01/dir';



Directory created.



2.导出AWR数据



可以使用awrextr.sql脚本导出AWR数据到dmp文件,实现AWR数据的迁移。步骤大致如下:



00:03:54 sys@felix SQL>@ /rdbms/admin/awrextr


~~~~~~~~~~~~~


AWR EXTRACT


~~~~~~~~~~~~~


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


~This script will extract the AWR data for arange of snapshots~


~into a dump file.The script will prompt users for the~


~following information:~


~(1) database id~


~(2) snapshot range to extract~


~(3) name of directory object~


~(4) name of dump file~


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




Databases in this WorkloadRepository schema


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



DB IdDB NameHost


------------ ------------------------


* 3569708122 FELIXfelix



The default database id isthe local one: '3569708122'.To use this


database id, press to continue, otherwise enter an alternative.



---这里输出的是本oracledbid



Enter value for dbid: 3569708122



Using 3569708122 for DatabaseID




Specify the number of days ofsnapshots to choose from


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Entering the number of days(n) will result in the most recent


(n) days of snapshots beinglisted.Pressing without


specifying a number lists allcompleted snapshots.




Enter value for num_days: 3



Listing the last 3 days ofCompleted Snapshots



DB NameSnap IdSnap Started


------------ ---------------------------


FELIX15 08 Nov 2013 00:00


16 08 Nov 2013 01:01


17 08 Nov 2013 02:00


18 08 Nov 2013 03:00


19 08 Nov 2013 04:00


20 08 Nov 2013 05:00


21 08 Nov 2013 06:11


22 08 Nov 2013 07:00


23 08 Nov 2013 08:00


24 08 Nov 2013 09:00


25 08 Nov 2013 10:00


26 08 Nov 2013 11:00


27 08 Nov 2013 12:00


28 08 Nov 2013 13:00


29 08 Nov 2013 14:00


30 09 Nov 2013 21:12


31 09 Nov 2013 22:00


32 09 Nov 2013 23:00


33 10 Nov 2013 00:00




Specify the Begin and EndSnapshot Ids


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Enter value for begin_snap: 26


Begin Snapshot Id specified: 26



Enter value for end_snap: 29


EndSnapshot Id specified: 29




Specify the Directory Name


~~~~~~~~~~~~~~~~~~~~~~~~~~



Directory NameDirectory Path


-------------------------------------------------------------------------------


DATA_FILE_DIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/s


ales_history/



DATA_PUMP_DIR/u01/app/oracle/admin/felix/dpdump/


DATE_DIR/u01/dir


EXP/u01/exp


LOG_FILE_DIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/l


og/



MEDIA_DIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/p


roduct_media/



ORACLE_OCM_CONFIG_DIR/u01/app/oracle/product/11.2.0/db_1/ccr/state


SS_OE_XMLDIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/o


rder_entry/



SUBDIR/u01/app/oracle/product/11.2.0/db_1/demo/schema/o


rder_entry//2002/Sep



XMLDIR/u01/app/oracle/product/11.2.0/db_1/rdbms/xml



Choose a Directory Name fromthe above list (case-sensitive).



Enter value for directory_name: DATE_DIR---记得要大写



Using the dump directory:DATE_DIR



Specify the Name of theExtract Dump File


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


The prefix for the defaultdump file name is awrdat_26_29.


To use this name, press to continue, otherwise enter


an alternative.



Enter value for file_name: AWREXPIMP



Using the dump file prefix:AWREXPIMP


|


|~~~~~~~~~~~~~~~~~~~~