在11g中AWR自動的每隔一小時進行一次數據採集並生成快照,所以我們只管用就行!下面是生成AWR報告的步驟:
1:At the SQL prompt, enter:
@$ORACLE_HOME/rdbms/admin/awrrpt.sql
2:Specify whether you want an HTML or a text report:指定生成報表的格式:建議html,方便查看
Enter value for report_type: html3:Specify the number of days for which you want to list snapshot IDs.
指定顯示幾天的快照id(11g中AWR快照默認保留時間爲8天)
Enter value for num_days: 2回車後,就會出現2天以來的所有快照ID
4:Specify a beginning and ending snapshot ID for the workload repository report:
給負載庫報表指定開始快照ID和結束快照ID(可以跨越多個ID)
Enter value for begin_snap: 150 Enter value for end_snap: 1605:Enter a report name, or accept the default report name:
輸入報表名,或者不輸入(oracle會生成一個默認名)
Enter value for report_name: Using the report name /u01/awrrpt_1_150_160.html這樣就生成了一個名爲:awrrpt_1_150_160.html的AWR報表文件了,該文件位於/u01下!!