AWR中繼資料的遷移或匯入到其他資料庫,awr中繼資料遷移匯入

來源:互聯網
上載者:User

AWR中繼資料的遷移或匯入到其他資料庫,awr中繼資料遷移匯入

我們可以將AWR中繼資料遷移(匯入)到其他資料庫,低版本的匯入到高版本,再用高版本的資料庫產生AWR報告,也能使用一些新特性,如

SQL ordered by Physical Reads (UnOptimized)
SQL ordered by User I/O Wait Time

 

匯出

testnode:/home/oracle$export ORACLE_SID=wy1
testnode:/home/oracle$sqlplus / as sysdba
SQL> @?/rdbms/admin/awrextr.sql
~~~~~~~~~~~~~
AWR EXTRACT
~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~  This script will extract the AWR data for a range 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 Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id     DB Name      Host
------------ ------------ ------------
* 3988169241 WY           testnode1
* 3988169241 WY           testnode2

The default database id is the local one: '3988169241'.  To use this
database id, press <return> to continue, otherwise enter an alternative.

Enter value for dbid:

Using 3988169241 for Database ID


Specify the number of days of snapshots to choose from
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Entering the number of days (n) will result in the most recent
(n) days of snapshots being listed.  Pressing <return> without
specifying a number lists all completed snapshots.


Enter value for num_days:

Listing all Completed Snapshots

...
DB Name        Snap Id    Snap Started
------------ --------- ------------------
WY                4706 18 Mar 2015 18:00
                  4707 18 Mar 2015 19:00   <<<
                  4708 18 Mar 2015 20:00   <<<


Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 4707    <<<<起始SNAP
Begin Snapshot Id specified: 4707   <<<<結束SNAP

Enter value for end_snap: 4708
End   Snapshot Id specified: 4708


Specify the Directory Name
~~~~~~~~~~~~~~~~~~~~~~~~~~

Directory Name                 Directory Path
------------------------------ -------------------------------------------------
DATA_PUMP_DIR                  /u01/app/oracle/product/11.2.0/db_1/rdbms/log/
EXPDP                          /tmp/expdp       <<<<<<<<<<<<<<<<
ORACLE_OCM_CONFIG_DIR          /u01/app/oracle/product/11.2.0/db_1/ccr/state
ORACLE_OCM_CONFIG_DIR2         /u01/app/oracle/product/11.2.0/db_1/ccr/state
XMLDIR                         /u01/app/oracle/product/11.2.0/db_1/rdbms/xml

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

Enter value for directory_name: EXPDP   <<<<<<<<<輸入DIRECTORY,右邊是目錄所對應的實體路徑.注: 如果SNAP跨度大,需要較大的空間來存放檔案

Using the dump directory: EXPDP

Specify the Name of the Extract Dump File
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The prefix for the default dump file name is awrdat_4707_4708.
To use this name, press <return> to continue, otherwise enter
an alternative.

Enter value for file_name:

Using the dump file prefix: awrdat_4707_4708
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  The AWR extract dump file will be located
|  in the following directory/file:
|   /tmp/expdp                <<<<目錄   
|   awrdat_4707_4708.dmp      <<<<檔案名稱
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|  *** AWR Extract Started ...
|
|  This operation will take a few moments. The
|  progress of the AWR extract operation can be
|  monitored in the following directory/file:
|   /tmp/expdp                       
|   awrdat_4707_4708.log             
|

匯入:
匯入處理程序也類似

SQL> @?/rdbms/admin/awrload
~~~~~~~~~~
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
------------------------------ -------------------------------------------------
AGREE_AWRREPORT_DIR        /tmp/xunjian
DATA_PUMP_DIR         /u01/app/oracle/admin/orcl/dpdump/
EXPDP          /arch/expdp       <<<<<<<<<<<<<<<<<<<<<<
ORA10G_PUMP         /u01/app/oracle/datapump/ora10g
ORACLE_OCM_CONFIG_DIR        /u01/app/oracle/product/11.2.0/db_1/ccr/state
XMLDIR          /u01/app/oracle/product/11.2.0/db_1/rdbms/xml

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

Enter value for directory_name: EXPDP  <<<<<<<<<<<<<<<<輸入DIRECTORY名稱
Using the dump directory: EXPDP

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: awrdat_4707_4708        <<<<<<<<<<<<<<<輸入檔案名稱(不包含尾碼.dmp)

Loading from the file name: awrdat_4707_4708.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.


The default staging schema name is AWR_STAGE.
To use this name, press <return> to continue, otherwise enter
an alternative.

Enter value for schema_name:          <<<<<<<<<<<<<<斷行符號,取預設值

Using the staging schema name: AWR_STAGE

Choose the Default tablespace for the AWR_STAGE user
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Choose the AWR_STAGE users's default tablespace.  This is the
tablespace in which the AWR data will be staged.

TABLESPACE_NAME
--------------------------------------------------------------------------------
CONTENTS      DEFAULT TABLESPACE
--------------------------- ------------------
SYSAUX
PERMANENT      *

USERS
PERMANENT


Pressing <return> will result in the recommended default
tablespace (identified by *) being used.

Enter value for default_tablespace:          <<<<<<<<<<<<<斷行符號,取預設值

Using tablespace SYSAUX as the default tablespace for the AWR_STAGE


Choose the Temporary tablespace for the AWR_STAGE user
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Choose the AWR_STAGE user's temporary tablespace.

TABLESPACE_NAME
--------------------------------------------------------------------------------
CONTENTS      DEFAULT TEMP TABLESPACE
--------------------------- -----------------------
TEMP
TEMPORARY      *


Pressing <return> will result in the database's default temporary
tablespace (identified by *) being used.

Enter value for temporary_tablespace:          <<<<<<<<<<<<<斷行符號,取預設值

Using tablespace TEMP as the temporary tablespace for AWR_STAGE


... Creating AWR_STAGE user

|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  Loading the AWR data from the following
|  directory/file:
|   /arch/expdp
|   awrdat_4707_4708.dmp
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|  *** AWR Load Started ...
|
|  This operation will take a few moments. The
|  progress of the AWR load operation can be
|  monitored in the following directory/file:
|   /arch/expdp
|   awrdat_4707_4708.log
|
...

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

道行尚淺,歡迎拍磚。

轉載請註明出處.

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.