AWR--导出AWR数据

SQL> create or replace directory expdp_dir as '/home/oracle/dump';

Directory created.

SQL> @$ORACLE_HOME/rdbms/admin/awrextr
~~~~~~~~~~~~~
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
------------ ------------ ------------
* 1725496767 DBT          testdb

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

Enter value for dbid: 1725496767

Using 1725496767 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: 1

Listing the last day's Completed Snapshots

DB Name        Snap Id    Snap Started
------------ --------- ------------------
DBT                350 05 Aug 2015 00:00
                   351 05 Aug 2015 01:00
                   352 05 Aug 2015 02:00
                   353 05 Aug 2015 03:00
                   354 05 Aug 2015 04:00
                   355 05 Aug 2015 05:00
                   356 05 Aug 2015 06:00
                   357 05 Aug 2015 07:00
                   358 05 Aug 2015 08:00
                   359 05 Aug 2015 09:00
                   360 05 Aug 2015 10:00

DB Name        Snap Id    Snap Started
------------ --------- ------------------
DBT                361 05 Aug 2015 11:00
                   362 05 Aug 2015 12:52
                   363 05 Aug 2015 12:52


Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 350
Begin Snapshot Id specified: 350

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


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

Directory Name                 Directory Path
------------------------------ -------------------------------------------------
DATA_PUMP_DIR                  /u01/app/oracle/admin/dbt/dpdump/
EXPDP_DIR                      /home/oracle/dump
ORACLE_OCM_CONFIG_DIR          /u01/app/oracle/product/11.2.0/dbhome_1/ccr/hosts
                               /testdb/state

ORACLE_OCM_CONFIG_DIR2         /u01/app/oracle/product/11.2.0/dbhome_1/ccr/state
XMLDIR                         /u01/app/oracle/product/11.2.0/dbhome_1/rdbms/xml

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

Enter value for directory_name: EXPDP_DIR

Using the dump directory: EXPDP_DIR

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

Enter value for directory_name: EXPDP_DIR

Using the dump directory: EXPDP_DIR

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

Enter value for file_name: AWR_350_360

Using the dump file prefix: AWR_350_360
|
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|  The AWR extract dump file will be located
|  in the following directory/file:
|   /home/oracle/dump
|   AWR_350_360.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:
|   /home/oracle/dump
|   AWR_350_360.log
|

End of AWR Extract
SQL> 
原文地址:https://www.cnblogs.com/abclife/p/4704479.html