Oracle 在
要查看當前的設置
select snap_intervalretention from dba_hist_wr_control; SNAP_INTERVAL RETENTION
+: : + : :
這些 SQL 語句顯示快照每小時采集一次
begin dbms_workload_repositorymodify_snapshot_settings ( interval => retention => * * ); end;
AWR 使用幾個表來存儲采集的統計數據
在這些表上構建了幾種帶前綴 DBA_HIST_ 的視圖
手工創建快照可以使用
exec dbms_workload_repositorycreate_snapshot;
通過awrrpt腳本可以生成報告
@?/rdbms/admin/awrrpt
生成報告
Version
AWR Objects Source {ORACLE_HOME}/rdbms/admin/dbmsawr
AWRRPT_HTML_TYPE
AWRRPT_TEXT_TYPE_TABLE
AWRRPT_HTML_TYPE_TABLE
SYS AWRRPT_ROW_TYPE Dependencies dba_hist_baseline dba_hist_snapshot
AWR_REPORT_HTML Display the AWR report in HTML dbms_workload_repository
l_dbid IN NUMBER
l_inst_num IN NUMBER
l_bid IN NUMBER
l_eid IN NUMBER
l_options IN NUMBER DEFAULT
RETURN awrrpt_text_type_table PIPELINED;
awrrpt_text_type_table is VARCHAR
AWR_REPORT_TEXT Display the AWR report in ASCII text dbms_workload_repository
l_dbid IN NUMBER
l_inst_num IN NUMBER
l_bid IN NUMBER
l_eid IN NUMBER
l_options IN NUMBER DEFAULT
RETURN awrrpt_text_type_table PIPELINED;
awrrpt_text_type_table is VARCHA
From:http://tw.wingwit.com/Article/program/Oracle/201311/18184.html