今天有学会使用一个脚本,可以把AWR全部导出。目的很简单,就是在客户那里不用分析一个取一个、分析一个取一个。先在可以一起都取回来慢慢去研究,真的不错。下面来演示整个过程:
------------------------------导出-------------------------------------
SQL>@?/rdbms/admin/awrextr
~~~~~~~~~~~~~
AWR
EXTRACT
………………………………………………………………
* 1275817864 ORCL WIN-4CO7R8IQ
2DV
The default database id is the local one: '1275817864'. To use
this
database id, press
输入 dbid 的值:1275817864
Using 1275817864 for Database ID
………………………………………………
输入 num_days 的值:1
Listing the last day's Completed Snapshots
DB Name Snap Id Snap Started
------------ ---------
------------------
ORCL 397 03 8月 2011 15:32
398 03 8月 2011 17:00
Specify the Begin and End Snapshot
Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
输入 begin_snap 的值:397
Begin
Snapshot Id specified: 397
输入 end_snap 的值:398
End Snapshot Id specified: 398
…………………………
输入 directory_name 的值:DATA_PUMP_DIR
Using the dump directory: DATA_PUMP_DIR
………………………………………………
输入 file_name 的值:ggx
Using the dump file prefix: ggx
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| The AWR extract dump file
will be located
………………………………………………………………
| d:\app\Administrator\admin\orcl\dpdump\
|
ggx.log
|
End of AWR Extract
-----------------------------------导入-------------------------------
SQL>@?/rdbms/admin/awrload
~~~~~~~~~~
AWR
LOAD
……………………………………………………
Choose a Directory Name from the list above (case-sensitive).
输入 directory_name 的值:DATA_PUMP_DIR
Using the dump directory: DATA_PUMP_DIR
Specify the Name of the Dump File to
Load
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Please specify the prefix
of the dump file (.dmp) to load:
输入 file_name 的值:GGX
…………………………………………
The default staging schema name is AWR_STAGE.
To use
this name, press
an
alternative.
输入 schema_name 的值:AWR_STAGE_1
Using the staging schema name: AWR_STAGE_1
…………………………………………
GGX1 PERMANENT
SYSAUX PERMANENT *
TEBS PERMANENT
USERS
PERMANENT
Pressing
tablespace
(identified by *) being used.
输入 default_tablespace 的值:GGX
Using tablespace GGX as the default tablespace for the AWR_STAGE_1
……………………
------------------------------ ---------
-----------------------
TEMP TEMPORARY *
Pressing
tablespace (identified by *) being used.
输入 temporary_tablespace 的值:TEMP
Using tablespace TEMP as the temporary tablespace for AWR_STAGE_1
... Creating AWR_STAGE_1 user
|
………………………………………………………………………………
| GGX.log
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/25517773/viewspace-730294/ ,如需转载,请注明出处,否则将追究法律责任。