天天看点

Oracle 10g AWR的生成,导入,导出

1.AWR的生成

AWR由ORACLE自动产生,默认30分钟采集一次,保留5天的记录。但是也可以通过DBMS_WORKLOAD_REPOSITORY包来手工创建、删除和修改。使用脚本awrrpt.sql或awrrpti.sql来查看AWR报告,这两个脚本都在目录$ORACLE_HOME/rdbms/admin中,报告可以保存为文本文件或HTML文件。

生成AWR报告的步骤如下:

sqlplussys/[email protected]/scmis as sysdba

SQL>@c:/oracle/product/10.2.4/db_1/RDBMS/ADMIN/awrrpt.sql

输入report_type的值:html (注:确定报告的格式)

输入num_days的值:1 (注:选择快照的天数)

输入begin_snap的值:425   (注:起始快照)

输入end_snap的值:427     (注:结束快照)

输入report_name的值:d:\scmis-awr-2011-10-29.html (注:报告生成的名称和位置)

2.AWR的导出

ORACLE10G  AWR是数据库DBA对数据库进行性能分析的核心,DBA经常运行的awrrpt等脚本,都是从AWR的相关表执行查询  得到分析的结果,实际上,oracle提供了脚本,把AWR相关表的数据导出,这个在其它数据库上面来分析AWR的结果。大致过程如下:   oracle的sys用户运行脚本awrextr.sql [email protected]> @/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/awrextr.sql     

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

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

Disclaimer: This SQL/Plus script should only be called under

the guidance of Oracle Support.

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

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

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

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

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

* 225523772  PROD         secdb1

The default database id is the local one: ' 225523772'.  To use this

database id, press <return> to continue, otherwise enter an alternative.

Enter value for dbid:                                              ----输入 dbid 的值:输入回车使用默认DBID

Using  225523772 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: 7                             -----输入想导出的天数

Listing the last 7 days of Completed Snapshots

DB Name        Snap Id    Snap Started

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

PROD                 1 25 Apr 2013 17:00

                     2 25 Apr 2013 18:00

                     3 25 Apr 2013 19:00

                     4 25 Apr 2013 20:00

                     5 25 Apr 2013 21:00

                     6 25 Apr 2013 22:00

                     7 25 Apr 2013 23:24

                     8 26 Apr 2013 20:01

Specify the Begin and End Snapshot Ids

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

Enter value for begin_snap: 1                        ------输入开始快照ID

Begin Snapshot Id specified: 1

Enter value for end_snap: 8                           -------输入结束快照ID

End   Snapshot Id specified: 8

Specify the Directory Name

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

Directory Name                 Directory Path

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

AWRDMP                         /home/oracle/awrdmp

DATA_PUMP_DIR                  /u01/app/oracle/product/10.2.0/db_1/rdbms/log/

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

Enter value for directory_name: AWRDMP           ----输入数据存放导出DMP文件的目录

说明:该目录必须是通过create directory创建的oracle能识别的目录

Using the dump directory: AWRDMP

Specify the Name of the Extract Dump File

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

The prefix for the default dump file name is awrdat_1_8.

To use this name, press <return> to continue, otherwise enter

an alternative.

Enter value for file_name: awr_04_26.dmp               ------输入DMP文件名称

根据输入的结果系统开始导出数据:

Using the dump file prefix: awr_04_26.dmp

|

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

|  The AWR extract dump file will be located

|  in the following directory/file:

|   /home/oracle/awrdmp

|   awr_04_26.dmp.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/awrdmp

|   awr_04_26.dmp.log

这个时候实际上oracle调用的DATA PUMP导出输入:导出的日志如下:

Starting "SYS"."SYS_EXPORT_TABLE_02":

Estimate in progress using BLOCKS method...

Processing object type TABLE_EXPORT/TABLE/TABLE_DATA

Total estimation using BLOCKS method: 4.5 MB

Processing object type TABLE_EXPORT/TABLE/TABLE

Processing object type TABLE_EXPORT/TABLE/INDEX/INDEX

Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/CONSTRAINT

Processing object type TABLE_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT

. . exported "SYS"."WRH$_SQL_PLAN"                       230.3 KB     902 rows

. . exported "SYS"."WRH$_LATCH":"WRH$_LATCH_225523772_0"  157.7 KB    3056 rows

. . exported "SYS"."WRH$_SQLTEXT"                        71.16 KB     177 rows

. . exported "SYS"."WRH$_EVENT_NAME"                     67.89 KB     874 rows

. . exported "SYS"."WRH$_PARAMETER":"WRH$_PARAME_225523772_0"  90.00 KB    2112 rows

. . exported "SYS"."WRH$_PARAMETER_NAME"                 60.15 KB    1385 rows

. . exported "SYS"."WRH$_SEG_STAT":"WRH$_SEG_ST_225523772_0"  92.28 KB     733 rows

. . exported "SYS"."WRH$_SEG_STAT_OBJ"                   49.82 KB     454 rows

. . exported "SYS"."WRH$_SQLSTAT":"WRH$_SQLSTA_225523772_0"  122.5 KB     499 rows

. . exported "SYS"."WRH$_SYSMETRIC_SUMMARY"              79.70 KB    1072 rows

. . exported "SYS"."WRH$_SYSSTAT":"WRH$_SYSSTA_225523772_0"  82.95 KB    2904 rows

. . exported "SYS"."WRH$_ACTIVE_SESSION_HISTORY":"WRH$_ACTIVE_225523772_0"  20.99 KB      45 rows

. . exported "SYS"."WRH$_BG_EVENT_SUMMARY"               12.34 KB     160 rows

. . exported "SYS"."WRH$_BUFFER_POOL_STATISTICS"         12.51 KB       8 rows

. . exported "SYS"."WRH$_DATAFILE"                       7.382 KB       4 rows

. . exported "SYS"."WRH$_DB_CACHE_ADVICE":"WRH$_DB_CAC_225523772_0"  18.42 KB     168 rows

. . exported "SYS"."WRH$_ENQUEUE_STAT"                   30.01 KB     454 rows

. . exported "SYS"."WRH$_FILESTATXS":"WRH$_FILEST_225523772_0"  10.96 KB      32 rows

. . exported "SYS"."WRH$_INSTANCE_RECOVERY"              11.78 KB       8 rows

. . exported "SYS"."WRH$_JAVA_POOL_ADVICE"               8.976 KB      16 rows

. . exported "SYS"."WRH$_LATCH_MISSES_SUMMARY":"WRH$_LATCH__225523772_0"  15.48 KB     138 rows

. . exported "SYS"."WRH$_LATCH_NAME"                     22.24 KB     382 rows

. . exported "SYS"."WRH$_LIBRARYCACHE"                   13.84 KB      88 rows

. . exported "SYS"."WRH$_LOG"                            9.648 KB      24 rows

. . exported "SYS"."WRH$_METRIC_NAME"                    24.77 KB     211 rows

. . exported "SYS"."WRH$_OPTIMIZER_ENV"                  7.179 KB       9 rows

. . exported "SYS"."WRH$_OSSTAT":"WRH$_OSSTAT_225523772_0"  7.859 KB      72 rows

. . exported "SYS"."WRH$_OSSTAT_NAME"                    5.757 KB       9 rows

. . exported "SYS"."WRH$_PGASTAT"                        11.38 KB     120 rows

. . exported "SYS"."WRH$_PGA_TARGET_ADVICE"              12.23 KB     104 rows

. . exported "SYS"."WRH$_PROCESS_MEMORY_SUMMARY"         10.19 KB      32 rows

. . exported "SYS"."WRH$_RESOURCE_LIMIT"                 8.914 KB      32 rows

. . exported "SYS"."WRH$_ROWCACHE_SUMMARY":"WRH$_ROWCAC_225523772_0"     28 KB     304 rows

. . exported "SYS"."WRH$_SERVICE_NAME"                   5.929 KB       3 rows

. . exported "SYS"."WRH$_SERVICE_STAT":"WRH$_SERVIC_225523772_0"  28.81 KB     672 rows

. . exported "SYS"."WRH$_SERVICE_WAIT_CLASS":"WRH$_SERVIC_225523772_0"  12.72 KB     121 rows

. . exported "SYS"."WRH$_SGA"                            7.273 KB      32 rows

. . exported "SYS"."WRH$_SGASTAT":"WRH$_SGASTA_225523772_0"  16.80 KB     224 rows

. . exported "SYS"."WRH$_SGA_TARGET_ADVICE"              8.523 KB      56 rows

. . exported "SYS"."WRH$_SHARED_POOL_ADVICE"             13.72 KB     104 rows

. . exported "SYS"."WRH$_SQL_BIND_METADATA"              41.47 KB     621 rows

. . exported "SYS"."WRH$_SQL_SUMMARY"                    7.046 KB       8 rows

. . exported "SYS"."WRH$_SQL_WORKAREA_HISTOGRAM"         9.515 KB      56 rows

. . exported "SYS"."WRH$_STAT_NAME"                      22.17 KB     380 rows

. . exported "SYS"."WRH$_SYSTEM_EVENT":"WRH$_SYSTEM_225523772_0"  20.52 KB     401 rows

. . exported "SYS"."WRH$_SYS_TIME_MODEL":"WRH$_SYS_TI_225523772_0"  10.46 KB     152 rows

. . exported "SYS"."WRH$_TABLESPACE_STAT":"WRH$_TABLES_225523772_0"  9.570 KB      32 rows

. . exported "SYS"."WRH$_TEMPFILE"                       7.117 KB       1 rows

. . exported "SYS"."WRH$_TEMPSTATXS"                     9.593 KB       8 rows

. . exported "SYS"."WRH$_THREAD"                         7.679 KB       8 rows

. . exported "SYS"."WRH$_UNDOSTAT"                       16.29 KB      46 rows

. . exported "SYS"."WRH$_WAITSTAT":"WRH$_WAITST_225523772_0"  11.34 KB     144 rows

. . exported "SYS"."WRM$_DATABASE_INSTANCE"              7.445 KB       1 rows

. . exported "SYS"."WRM$_SNAPSHOT"                       8.953 KB       8 rows

. . exported "SYS"."WRM$_WR_CONTROL"                     10.13 KB       1 rows

. . exported "SYS"."WRH$_ACTIVE_SESSION_HISTORY":"WRH$_ACTIVE_SES_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_ACTIVE_SESSION_HISTORY_BL"          0 KB       0 rows

. . exported "SYS"."WRH$_BUFFERED_QUEUES"                    0 KB       0 rows

. . exported "SYS"."WRH$_BUFFERED_SUBSCRIBERS"               0 KB       0 rows

. . exported "SYS"."WRH$_COMP_IOSTAT"                        0 KB       0 rows

. . exported "SYS"."WRH$_CR_BLOCK_SERVER"                    0 KB       0 rows

. . exported "SYS"."WRH$_CURRENT_BLOCK_SERVER"               0 KB       0 rows

. . exported "SYS"."WRH$_DB_CACHE_ADVICE":"WRH$_DB_CACHE_AD_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_DB_CACHE_ADVICE_BL"                 0 KB       0 rows

. . exported "SYS"."WRH$_DLM_MISC":"WRH$_DLM_MISC_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_DLM_MISC":"WRH$_DLM_MI_225523772_0"      0 KB       0 rows

. . exported "SYS"."WRH$_DLM_MISC_BL"                        0 KB       0 rows

. . exported "SYS"."WRH$_FILEMETRIC_HISTORY"                 0 KB       0 rows

. . exported "SYS"."WRH$_FILESTATXS":"WRH$_FILESTATXS_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_FILESTATXS_BL"                      0 KB       0 rows

. . exported "SYS"."WRH$_INST_CACHE_TRANSFER":"WRH$_INST_CACHE_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_INST_CACHE_TRANSFER":"WRH$_INST_C_225523772_0"      0 KB       0 rows

. . exported "SYS"."WRH$_INST_CACHE_TRANSFER_BL"             0 KB       0 rows

. . exported "SYS"."WRH$_LATCH":"WRH$_LATCH_MXDB_MXSN"       0 KB       0 rows

. . exported "SYS"."WRH$_LATCH_BL"                           0 KB       0 rows

. . exported "SYS"."WRH$_LATCH_CHILDREN":"WRH$_LATCH_CHILD_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_LATCH_CHILDREN":"WRH$_LATCH__225523772_0"      0 KB       0 rows

. . exported "SYS"."WRH$_LATCH_CHILDREN_BL"                  0 KB       0 rows

. . exported "SYS"."WRH$_LATCH_MISSES_SUMMARY":"WRH$_LATCH_MISSE_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_LATCH_MISSES_SUMMARY_BL"            0 KB       0 rows

. . exported "SYS"."WRH$_LATCH_PARENT":"WRH$_LATCH_PAREN_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_LATCH_PARENT":"WRH$_LATCH__225523772_0"      0 KB       0 rows

. . exported "SYS"."WRH$_LATCH_PARENT_BL"                    0 KB       0 rows

. . exported "SYS"."WRH$_MTTR_TARGET_ADVICE"                 0 KB       0 rows

. . exported "SYS"."WRH$_OSSTAT":"WRH$_OSSTAT_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_OSSTAT_BL"                          0 KB       0 rows

. . exported "SYS"."WRH$_PARAMETER":"WRH$_PARAMETER_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_PARAMETER_BL"                       0 KB       0 rows

. . exported "SYS"."WRH$_ROWCACHE_SUMMARY":"WRH$_ROWCACHE_SU_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_ROWCACHE_SUMMARY_BL"                0 KB       0 rows

. . exported "SYS"."WRH$_RULE_SET"                           0 KB       0 rows

. . exported "SYS"."WRH$_SEG_STAT":"WRH$_SEG_STAT_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_SEG_STAT_BL"                        0 KB       0 rows

. . exported "SYS"."WRH$_SERVICE_STAT":"WRH$_SERVICE_STAT_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_SERVICE_STAT_BL"                    0 KB       0 rows

. . exported "SYS"."WRH$_SERVICE_WAIT_CLASS":"WRH$_SERVICE_WAIT_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_SERVICE_WAIT_CLASS_BL"              0 KB       0 rows

. . exported "SYS"."WRH$_SESSMETRIC_HISTORY"                 0 KB       0 rows

. . exported "SYS"."WRH$_SESS_TIME_STATS"                    0 KB       0 rows

. . exported "SYS"."WRH$_SGASTAT":"WRH$_SGASTAT_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_SGASTAT_BL"                         0 KB       0 rows

. . exported "SYS"."WRH$_SQLSTAT":"WRH$_SQLSTAT_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_SQLSTAT_BL"                         0 KB       0 rows

. . exported "SYS"."WRH$_STREAMS_APPLY_SUM"                  0 KB       0 rows

. . exported "SYS"."WRH$_STREAMS_CAPTURE"                    0 KB       0 rows

. . exported "SYS"."WRH$_STREAMS_POOL_ADVICE"                0 KB       0 rows

. . exported "SYS"."WRH$_SYSMETRIC_HISTORY"                  0 KB       0 rows

. . exported "SYS"."WRH$_SYSSTAT":"WRH$_SYSSTAT_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_SYSSTAT_BL"                         0 KB       0 rows

. . exported "SYS"."WRH$_SYSTEM_EVENT":"WRH$_SYSTEM_EVEN_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_SYSTEM_EVENT_BL"                    0 KB       0 rows

. . exported "SYS"."WRH$_SYS_TIME_MODEL":"WRH$_SYS_TIME_MO_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_SYS_TIME_MODEL_BL"                  0 KB       0 rows

. . exported "SYS"."WRH$_TABLESPACE_SPACE_USAGE"             0 KB       0 rows

. . exported "SYS"."WRH$_TABLESPACE_STAT":"WRH$_TABLESPACE_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_TABLESPACE_STAT_BL"                 0 KB       0 rows

. . exported "SYS"."WRH$_WAITCLASSMETRIC_HISTORY"            0 KB       0 rows

. . exported "SYS"."WRH$_WAITSTAT":"WRH$_WAITSTAT_MXDB_MXSN"      0 KB       0 rows

. . exported "SYS"."WRH$_WAITSTAT_BL"                        0 KB       0 rows

. . exported "SYS"."WRM$_SNAP_ERROR"                         0 KB       0 rows

Master table "SYS"."SYS_EXPORT_TABLE_02" successfully loaded/unloaded

******************************************************************************

Dump file set for SYS.SYS_EXPORT_TABLE_02 is:

/home/oracle/awrdmp/awr_04_26.dmp.dmp

Job "SYS"."SYS_EXPORT_TABLE_02" successfully completed at 20:28:23

[email protected]> 

查看目录awr已经成功导出

[[email protected] ~]$ cd /home/oracle/awrdmp/

[[email protected] awrdmp]$ ll

total 116612

-rw-r----- 1 oracle oinstall   3538944 Apr 26 20:28 awr_04_26.dmp.dmp

-rw-r--r-- 1 oracle oinstall     10624 Apr 26 20:28 awr_04_26.dmp.log

3.AWR的导入

[email protected]> @?/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

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

AWRDMP                         /home/oracle/awrdmp

DATA_PUMP_DIR                  /u01/app/oracle/product/10.2.0/db_1/rdbms/log/

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

ORACLE提示输入需要加载的数据在那个路径下,需要注意的是AWRDMP一定要大写。

Enter value for directory_name: AWRDMP

Using the dump directory: AWRDMP

ORACLE问你需要加载的文件名字是什么?需注意的是这个文件名字不能加后缀。(特别引起注意

需要输入文件后缀名一定要是.dmp,但是不能加

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_18740_18897    

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

需要输入(临时创建用户)

也可以默认AWR_STAGE.

春哥的话:(ORACLE说了,这些数据要加载到在SYS SCHEMA里的AWR表里,但是默认干这个活的是AWR_STAGE这个小子,然后ORACLE问了,你打算让谁干这个活啊?既然AWR_STAGE小子轻车熟路,当然是让他干啦。)

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: HXY_AWR

Using the staging schema name: HXY_AWR

Choose the Default tablespace for the HXY_AWR user

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

Choose the HXY_AWR users's default tablespace.  This is the

tablespace in which the AWR data will be staged.

ORACLE列出了数据库里的所有表空间,问你既然你让AWR_STAGE这小子来干这个活,那你给得给他安排个办公场所啊,你选择那个表空间给他用啊?这里我选择了TBS_1表空间。

TABLESPACE_NAME                CONTENTS  DEFAULT TABLESPACE

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

SYSAUX                         PERMANENT *

TBS_1                          PERMANENT

Pressing <return> will result in the recommended default

tablespace (identified by *) being used.

Enter value for default_tablespace: TBS_1

Using tablespace TBS_1 as the default tablespace for the HXY_AWR

选择哪个临时表空间给AWR_STAGE用啊

Choose the Temporary tablespace for the HXY_AWR user

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

Choose the HXY_AWR user's temporary tablespace.

TABLESPACE_NAME                CONTENTS  DEFAULT TEMP TABLESPACE

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

TEMPTS1                        TEMPORARY *

Pressing <return> will result in the database's default temporary

tablespace (identified by *) being used.

Enter value for temporary_tablespace: TEMPTS1

Using tablespace TEMPTS1 as the temporary tablespace for HXY_AWR

... Creating HXY_AWR user

|

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

|  Loading the AWR data from the following

|  directory/file:

|   /home/oracle/awrdmp

|   awrdat_18740_18897.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:

|   /home/oracle/awrdmp

|   awrdat_18740_18897.log

|

可以通过查看/home/oracle/awrdmp/awrdat_18740_18897.log

监控导出awr数据进度

出现下面字样说明加载完成

Finished MOVE_TO_AWR procedure

... Dropping HXY_AWR user

End of AWR Load

4.查看AWR报告

SQL> @?/RDBMS/admin/awrrpti.sql

Specify the Report Type

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

Would you

like

an HTML report,

or

a plain text report?

Enter

'html'

for

an HTML report,

or

'text'

for

plain text

Defaults

to

'html'

输入 report_type 的值:  html   <

--需要输入

Type Specified:  html

Instances

in

this Workload Repository

schema

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

DB Id     Inst Num DB

Name

Instance     Host

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

3753332923        2 FDJDB        fdjdb2       ora2

3753332923        1 FDJDB        fdjdb1       ora1

* 1393262699        1 XIFENFEI     xff          XIFENFEI-PC

输入 dbid 的值:   3753332923  <

--需要输入

Using  3753332923

for

database

Id

输入 inst_num 的值:  1        <

--需要输入

Using 1

for

instance number

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.

输入 num_days 的值:  1  <

--需要输入

Listing the

last

day

's Completed Snapshots

Snap

Instance     DB

Name

Snap Id    Snap Started   

Level

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

fdjdb1       FDJDB              906 23 4月  2012 00:00     1

907 23 4月  2012 01:00     1

908 23 4月  2012 02:00     1

909 23 4月  2012 03:00     1

910 23 4月  2012 04:00     1

911 23 4月  2012 05:00     1

912 23 4月  2012 06:00     1

913 23 4月  2012 07:00     1

914 23 4月  2012 08:00     1

915 23 4月  2012 09:00     1

916 23 4月  2012 10:00     1

917 23 4月  2012 11:00     1

918 23 4月  2012 12:00     1

919 23 4月  2012 13:00     1

Specify the

Begin

and

End

Snapshot Ids

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

输入 begin_snap 的值:  917  <

--需要输入

Begin

Snapshot Id specified: 917

输入 end_snap 的值:  918    <

--需要输入

End

Snapshot Id specified: 918

Specify the Report

Name

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

The

default

report file

name

is

awrrpt_1_917_918.html. 

To

use this

name

,

press <

return

>

to

continue

, otherwise enter an alternative.

输入 report_name 的值:hxy_awr.html  <

--需要输入