Oracle性能分析入門學習中,遇到Oracle數據庫的性能問題,壹般首要的步驟就是導出AWR的分析報告,AWR是10g中新引入的壹個工具,在這之前壹般是利用statspack。要導出AWR報告,只要利用Oracle的壹個腳本即可以完成,下面是我利用script錄制的壹段導出AWR report的過程。
首先進入$ORACLE_HOME/rdbms/admin目錄,在sqlplus下運行@awrrpt腳本,按照提示壹步壹步就可以達成,導出的格式有兩種,txt格式和html格式。
在OTN上,有壹個DBA新feature系列,第六周就是專門講的這個feature,大家可以去那裏了解壹下(中文的)
Script started on Sun 27 Jan 2008 08:47:15 PM PST
[ractest@sun880-1 /u01/app/oracle/orahome/rdbms/admin]$ cd $ORACLE_HOME/rdbms/admin
[ractest@sun880-1 /u01/app/oracle/orahome/rdbms/admin]$ sqlplus / as sysdba
SQL*Plus: Release 10.2.0.4.0 – Production on Sun Jan 27 20:47:38 2008
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 – 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
SQL> @awrrpt
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
———– ———— ——– ————
2080780909 ORCLDB 1 orcldb1
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’
Enter value for report_type: text
Type Specified: text
Instances in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DB Id Inst Num DB Name Instance Host
———— ——– ———— ———— ————
* 2080780909 1 ORCLDB orcldb1 sun880-1
2080780909 4 ORCLDB orcldb4 sun880-4
2080780909 2 ORCLDB orcldb2 sun880-2
2080780909 3 ORCLDB orcldb3 sun880-3
Using 2080780909 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.
Enter value for num_days: 1
Listing the last day’s Completed Snapshots
Snap
Instance DB Name Snap Id Snap Started Level
———— ———— ——— —————— —–