Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
1Activity
0 of .
Results for:
No results containing your search query
P. 1
SQL for awr summary

SQL for awr summary

Ratings: (0)|Views: 195|Likes:
Published by Liqin Zhang

More info:

Categories:Types, Research
Published by: Liqin Zhang on Jan 15, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOC, PDF, TXT or read online from Scribd
See more
See less

01/15/2011

pdf

text

original

 
 PROCEDURE REPORT_SUMMARY(L_DBID IN NUMBER,L_INST_NUM IN NUMBER,L_BID IN NUMBER,L_EID IN NUMBER,L_OPTIONS IN NUMBER,TO_HTML IN BINARY_INTEGER,INIT_RPT IN BINARY_INTEGER DEFAULT TRUE_I)ISOUTPUT OUTPUT_TYPE; EVENT_FMT OUTPUT_TYPE;WAITS_FMT OUTPUT_TYPE;TIME_FMT OUTPUT_TYPE;PCTW_FMT OUTPUT_TYPE;CLASS_FMT OUTPUT_TYPE;AVGWT_FMT OUTPUT_TYPE;COLOFFSET NUMBER;SUMM_STATS_1 STAT_MAPPING;SUMM_STATS_2 STAT_MAPPING;SUMM_STATS_3 STAT_MAPPING;L_DBTIME_MINS NUMBER;BSUS NUMBER;ESUS NUMBER;BSUSM NUMBER;ESUSM NUMBER;NUM_INST1 NUMBER;NUM_INST2 NUMBER;----- SELECT VALUE FROM DBA_HIST_SYS_TIME_MODEL-----WHERE DBID=L_DBID AND SNAP_ID=I_SNAP_ID ANDINSTANCE_NUMBER=L_INST_NUM AND STAT_NAME=I_NAME;--------------RPT_STATS(STAT_DBTIME) = 'DB time'--------------RPT_STATS(STAT_CPU_TIME) = 'DB CPU'
 
CURSOR WAIT_EVENT_CUR(TOP_N_EVENTS NUMBER) ISSELECT EVENT, WAITS, TIME,DECODE(WAITS, NULL, TO_NUMBER(NULL),0, TO_NUMBER(NULL),TIME/WAITS*1000) AVGWT,PCTWTT, WAIT_CLASSFROM (SELECT EVENT, WAITS, TIME, PCTWTT, WAIT_CLASSFROM (SELECT E.EVENT_NAME EVENT,E.TOTAL_WAITS - NVL(B.TOTAL_WAITS,0) WAITS,(E.TIME_WAITED_MICRO -NVL(B.TIME_WAITED_MICRO,0)) / 1000000 TIME,100 * (E.TIME_WAITED_MICRO -NVL(B.TIME_WAITED_MICRO,0)) /RPT_STATS(STAT_DBTIME) PCTWTT,E.WAIT_CLASS WAIT_CLASSFROM DBA_HIST_SYSTEM_EVENT B,DBA_HIST_SYSTEM_EVENT EWHERE B.SNAP_ID(+) = L_BIDAND E.SNAP_ID = L_EIDAND B.DBID(+) = L_DBIDAND E.DBID = L_DBIDAND B.INSTANCE_NUMBER(+) = L_INST_NUMAND E.INSTANCE_NUMBER = L_INST_NUMAND B.EVENT_ID(+) = E.EVENT_IDAND E.TOTAL_WAITS > NVL(B.TOTAL_WAITS,0)AND E.WAIT_CLASS != 'Idle'UNION ALLSELECT 'CPU time' EVENT,TO_NUMBER(NULL) WAITS,RPT_STATS(STAT_CPU_TIME)/1000000 TIME,100 * RPT_STATS(STAT_CPU_TIME) /RPT_STATS(STAT_DBTIME) PCTWTT,NULL WAIT_CLASSFROM DUALWHERE RPT_STATS(STAT_CPU_TIME) > 0)ORDER BY TIME DESC, WAITS DESC)WHERE ROWNUM <= TOP_N_EVENTS;WAIT_EVENT_OUT WAIT_EVENT_CUR%ROWTYPE;ROW_NUM NUMBER := 0;BEGIN IF (INIT_RPT = TRUE_I) THEN ----
这个判断是判断选择生成的类型是文本还是
html
 
REPORT_INIT(L_DBID, L_INST_NUM, L_BID, L_EID, RPT_STATS, RPT_PARAMS,RPT_TIME_VALS);END IF;----- SELECT VALUE FROM DBA_HIST_SYS_TIME_MODEL-----WHERE DBID=L_DBID AND SNAP_ID=I_SNAP_ID ANDINSTANCE_NUMBER=L_INST_NUM AND STAT_NAME=I_NAME;--------------RPT_STATS(STAT_TIMEDSTAT_B) = 'timed_statistics'--------------RPT_STATS(STAT_STATLEVEL_B) = 'statistics_level'--------------RPT_STATS(STAT_TIMEDSTAT_E) = 'timed_statistics'--------------RPT_STATS(STAT_STATLEVEL_E) = 'statistics_level' IF ((RPT_PARAMS(STAT_TIMEDSTAT_B) = 'FALSE') OR(RPT_PARAMS(STAT_TIMEDSTAT_E) = 'FALSE')) THEN ------
此判断是检测开始时间与结束时间是否检测不到
APPEND_ROW('WARNING: timed_statistics setting was set to ''FALSE'' ' ||'in the snapshot ');APPEND_ROW('period: TIMINGS ARE INVALID');APPEND_ROW(BLANK_LINE);IF (TO_HTML = TRUE_I) THENAPPEND_ROW(LINE_BREAK);END IF;END IF; IF ((RPT_PARAMS(STAT_STATLEVEL_B) = 'BASIC') OR(RPT_PARAMS(STAT_STATLEVEL_E) = 'BASIC')) THEN --------
此判断是检测时间与结束时间
APPEND_ROW('WARNING: statistics_level setting was set to ''BASIC'' ' ||'in the snapshot ');APPEND_ROW('period: TIME MODEL DATA IS INVALID');APPEND_ROW(BLANK_LINE);IF (TO_HTML = TRUE_I) THENAPPEND_ROW(LINE_BREAK);END IF;END IF; 

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->