@?/rdbms/admin/ashrpt.sql 1. 你是一路回車,就是獲取最近15分鐘的ASH報表。 2. 你根據oldest ash sample available 時間,然後回車,選擇的是目前可以收集到的最長ASH運行情況 3. 你可以選擇Oldest ASH sample available和Latest ASH sample available之間時間,然後輸入時長,比如30表示30分鐘,取你要取的任何時段的ASH報表ASH報表也可以直接手工獲取,比如select output from table(dbms_workload_repository.ash_report_html( dbid,inst_num,l_btime,l_etime);
示例: set pagesize 0 set linesize 121 spool d:\ash_rpt.html select output from table(dbms_workload_repository.ash_report_html( 977587123,1,SYSDATE-30/1440,SYSDATE-1/1440)); spool off --包詳細參數: dbms_workload_repository.ash_report_html( l_dbid IN NUMBER, l_inst_num IN NUMBER, l_btime IN DATE, l_etime IN DATE, l_options IN NUMBER DEFAULT 0, l_slot_width IN NUMBER DEFAULT 0, l_sid IN NUMBER DEFAULT NULL, l_sql_id IN VARCHAR2 DEFAULT NULL, l_wait_class IN VARCHAR2 DEFAULT NULL, l_service_hash IN NUMBER DEFAULT NULL, l_module IN VARCHAR2 DEFAULT NULL, l_action IN VARCHAR2 DEFAULT NULL, l_client_id IN VARCHAR2 DEFAULT NULL, l_plsql_entry IN VARCHAR2 DEFAULT NULL)