ash報表

sqlplus ljb/ljb
--有的環境需要操作如下後纔可以正常完成報表輸出
alter session set nls_date_language='american' ;
@?/rdbms/admin/ashrpt.sql


Current Instance
~~~~~~~~~~~~~~~~


   DB Id    DB Name      Inst Num Instance
----------- ------------ -------- ------------
  977587123 TEST11G             1 test11g




Specify the Report Type
~~~~~~~~~~~~~~~~~~~~~~~
Enter 'html' for an HTML report, or 'text' for plain text
Defaults to 'html'
輸入 report_type 的值:


Type Specified:  html








ASH Samples in this Workload Repository schema
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


Oldest ASH sample available:  10-2月 -14 13:58:14  [  11301 mins in the past]
Latest ASH sample available:  18-2月 -14 10:10:50  [      8 mins in the past]




Specify the timeframe to generate the ASH report
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Enter begin time for report:


--    Valid input formats:
--      To specify absolute begin time:
--        [MM/DD[/YY]] HH24:MI[:SS]
--        Examples: 02/23/03 14:30:15
--                  02/23 14:30:15
--                  14:30:15
--                  14:30
--      To specify relative begin time: (start with '-' sign)
--        -[HH24:]MI
--        Examples: -1:15  (SYSDATE - 1 Hr 15 Mins)
--                  -25    (SYSDATE - 25 Mins)


Defaults to -15 mins
輸入 begin_time 的值:
/*
注:


1. 你是一路回車,就是獲取最近5分鐘的ASH報表。
2. 你根據oldest ash sample available 時間,然後回車,選擇的是目前可以收集到的最長ASH運行情況
3. 你可以選擇Oldest ASH sample available和Latest ASH sample available之間時間,然後輸入時長,比如30表示30分鐘,取你要取的任何時段的ASH報表
4. ASH報表的獲取不同於AWR的地方在於,快照之間有無重啓動作不影響報表的獲取。
5. 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)


*/


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章