手動產生AWR報告
有時候資料庫中為安裝EM,無法圖形化產生AWR報告,此時需要手工產生AWR報告,Oracle提供了以個sql,可以手工產生AWR報告,首先建立產生報告的目錄,這裡為/home/oracle/AWR
$ mkdir AWR
$ cd AWR
$ pwd
/home/oracle/AWR
進入sqlplus
[oracle@ocp ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Wed Dec 30 02:41:04 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
執行指令碼,?代表$ORACLE_HOME,@表示執行sql,預設提供兩種報表格式,html和txt,預設為html格式
@?/rdbms/admin/awrrpt.sql
Current Instance
~~~~~~~~~~~~~~~~
DB Id DB Name Inst Num Instance
----------- ------------ -------- ------------
1425858850 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'
Enter value for report_type: html
選擇從系統中抽取的報告的時間段,一般設7天就可以了,ORACLE會把七天內的報告都顯示在螢幕上
Enter value for num_days: 7
Listing the last 7 days of Completed Snapshots
輸入開始的snap id和結束的snap id,表示截取報告的時間段
Instance DB Name Snap Id Snap Started Level
------------ ------------ --------- ------------------ -----
orcl ORCL 81 29 Dec 2015 13:33 1
82 29 Dec 2015 15:00 1
83 29 Dec 2015 16:00 1
84 29 Dec 2015 17:00 1
85 29 Dec 2015 18:00 1
86 29 Dec 2015 19:00 1
87 29 Dec 2015 20:00 1
88 29 Dec 2015 21:00 1
89 29 Dec 2015 22:00 1
90 29 Dec 2015 23:00 1
91 30 Dec 2015 00:00 1
92 30 Dec 2015 01:00 1
93 30 Dec 2015 02:00 1
Specify the Begin and End Snapshot Ids
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter value for begin_snap: 83
Begin Snapshot Id specified: 83
Enter value for end_snap: 93
End Snapshot Id specified: 93
指定報告名稱,如果不指定,直接斷行符號,系統會按照工具提示名稱產生報告名
Report written to awrrpt_1_83_93.html
下載到本地後查看就可以了