oracle 10g awr效能收集工具的用法

paulyibinyi發表於2009-02-05

     oracle 10g addm工具根據awr收集的資訊能給出個解決方案,以下是awr指令碼的用法

和statspack工具差不多。

C:\Documents and Settings\Administrator>sqlplus / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on 星期四 2月 5 11:52:18 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> @?/rdbms/admin/awrrpt.sql

Current Instance
~~~~~~~~~~~~~~~~

   DB Id    DB Name      Inst Num Instance
----------- ------------ -------- ------------
 1199626219 ORCL                1 orcl


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 的值:  text

Type Specified:  text


Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   DB Id     Inst Num DB Name      Instance     Host
------------ -------- ------------ ------------ ------------
* 1199626219        1 ORCL         orcl         PRIMARY
* 1199626219        1 ORCL         orcl         RAC1
* 1199626219        1 ORCL         orcl         STANDBY

Using 1199626219 for database Id
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 without
specifying a number lists all completed snapshots.


輸入 num_days 的值:  4

Listing the last 4 days of Completed Snapshots

                                                        Snap
Instance     DB Name        Snap Id    Snap Started    Level
------------ ------------ --------- ------------------ -----
orcl         ORCL                25 03 2月  2009 13:53     1

                                 26 03 2月  2009 15:00     1
                                 27 03 2月  2009 16:00     1
                                 28 03 2月  2009 16:05     1
                                 29 03 2月  2009 16:06     1
                                 30 03 2月  2009 16:07     1
                                 31 03 2月  2009 16:09     1
                                 32 03 2月  2009 17:00     1

                                 33 05 2月  2009 09:42     1

 

Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
輸入 begin_snap 的值:  28
Begin Snapshot Id specified: 28

輸入 end_snap 的值:  29
End   Snapshot Id specified: 29

 

Specify the Report Name
~~~~~~~~~~~~~~~~~~~~~~~
The default report file name is awrrpt_1_28_29.txt.  To use this name,
press to continue, otherwise enter an alternative.

輸入 report_name 的值:d:\awrrpt_1_28_29.txt  即可

 透過以下檢視可以查出,做快照的間隔時間和保留多長時間

select snap_interval, retention
from dba_hist_wr_control;

SNAP_INTERVAL       RETENTION
------------------- -------------------
+00000 01:00:00.0   +00007 00:00:00.0

這些 SQL 語句顯示快照每小時採集一次,採集的資料保留 7 天。要修改設定 例如,快照時間間隔為 30 分鐘,保留時間為三天 您可以發出以下命令。引數以分鐘為單位。

begin
   dbms_workload_repository.modify_snapshot_settings (
      interval => 30,
      retention => 3*24*60
   );
end;
具體awr報告比statspack報告多了很多東西出來,還有待具體研究

                                                    

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-545351/,如需轉載,請註明出處,否則將追究法律責任。

相關文章