This repository has been archived by the owner on Nov 25, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+ added sga target advice for end_snapshot to AWR stats
git-svn-id: svn+ssh://svn.izzysoft.de/public/osprep/trunk@468 b04bc735-7639-0410-8817-d65b05825077
- Loading branch information
Showing
6 changed files
with
129 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,6 +114,7 @@ | |
|
||
PROCEDURE pgat IS | ||
/** PGA Target Advice -- AWR only*/ | ||
BEGIN | ||
NULL; | ||
EXCEPTION | ||
WHEN OTHERS THEN | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
-- Undo Segment Stats | ||
sga_sum; | ||
sga_advice; | ||
IF MK_SGABREAK = 1 THEN | ||
sga_break; | ||
END IF; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
|
||
PROCEDURE sga_sum IS | ||
/** SGA Memory Summary */ | ||
SIZ VARCHAR2(10); | ||
CURSOR C_SGASum IS | ||
SELECT name, | ||
value val | ||
FROM stats$sga | ||
WHERE snap_id = EID | ||
AND dbid = DB_ID | ||
AND instance_number = INST_NUM | ||
ORDER BY name; | ||
BEGIN | ||
L_LINE := TABLE_OPEN||'<TR><TH COLSPAN="2"><A NAME="sga">SGA Memory Summary</A></TH></TR>'|| | ||
' <TR><TD COLSPAN="2" ALIGN="center">Values at the time of the End SnapShot</TD></TR>'; | ||
print(L_LINE); | ||
L_LINE := ' <TR><TH CLASS="th_sub">SGA Region</TH><TH CLASS="th_sub">Size</TH>'; | ||
print(L_LINE); | ||
I1 := 0; | ||
FOR R_SGASum in C_SGASum LOOP | ||
SIZ := format_fsize(R_SGASum.val); | ||
I1 := I1 + R_SGASum.val; | ||
L_LINE := ' <TR><TD CLASS="td_name">'||R_SGASum.name||'</TD><TD ALIGN="right">'|| | ||
SIZ||'</TD></TR>'; | ||
print(L_LINE); | ||
END LOOP; | ||
SIZ := format_fsize(I1); | ||
L_LINE := ' <TR><TD>Sum</TD><TD ALIGN="right">'||SIZ|| | ||
'</TD></TR>'||TABLE_CLOSE; | ||
print(L_LINE); | ||
EXCEPTION | ||
WHEN OTHERS THEN print(TABLE_CLOSE); | ||
END; | ||
|
||
PROCEDURE sga_advice IS | ||
/** SGA Target Advice -- AWR only */ | ||
FSI NUMBER; SIZ VARCHAR2(20); FAC VARCHAR2(10); TIM VARCHAR2(15); EPR VARCHAR2(15); | ||
CURSOR C_Ad IS | ||
SELECT sga_size, | ||
sga_size_factor factor, | ||
estd_db_time dbtime, | ||
estd_physical_reads phyreads | ||
FROM dba_hist_sga_target_advice | ||
WHERE snap_id = EID | ||
AND dbid = DB_ID | ||
AND instance_number = INST_NUM | ||
ORDER BY factor; | ||
BEGIN | ||
L_LINE := TABLE_OPEN||'<TR><TH COLSPAN="4"><A NAME="sga">SGA Target Advice</A></TH></TR>'|| | ||
' <TR><TD COLSPAN="4" ALIGN="center">Values at the time of the End SnapShot ('||EID||')</TD></TR>'; | ||
print(L_LINE); | ||
L_LINE := ' <TR><TH CLASS="th_sub" TITLE="Value used for this estimation">SGA Size</TH>'|| | ||
'<TH CLASS="th_sub" TITLE="Size factor based on current setting">Factor</TH>'; | ||
print(L_LINE); | ||
L_LINE := '<TH CLASS="th_sub" TITLE="Estimated DB Time">DBTime</TH>'|| | ||
'<TH CLASS="th_sub" TITLE="Estimated Physical Reads">PhyReads</TH></TR>'; | ||
print(L_LINE); | ||
FOR rec IN C_Ad LOOP | ||
FSI := rec.sga_size*1.024*1024*1024; -- values are in "false MB" | ||
SIZ := format_fsize(FSI); | ||
FAC := TO_CHAR(rec.factor,'99.999'); | ||
TIM := numformat(rec.dbtime); | ||
EPR := numformat(rec.phyreads); | ||
L_LINE := ' <TR><TD ALIGN="right">'||SIZ||'</TD><TD ALIGN="right">'||FAC||'</TD><TD ALIGN="right">'||TIM||'</TD><TD ALIGN="right">'||EPR||'</TD></TR>'; | ||
print(L_LINE); | ||
END LOOP; | ||
print(TABLE_CLOSE); | ||
EXCEPTION | ||
WHEN OTHERS THEN NULL; | ||
END; | ||
|
||
PROCEDURE sga_break IS | ||
/** SGA BreakDown Difference */ | ||
CURSOR C_SGABreak IS | ||
SELECT nvl(replace(b.pool,'pool',''),' ') pool, | ||
b.name name, | ||
to_char(b.bytes,'999,999,999,999') snap1, | ||
to_char(e.bytes,'999,999,999,999') snap2, | ||
to_char(100* (e.bytes - b.bytes)/b.bytes,'9,990.00') diff | ||
FROM stats$sgastat b, stats$sgastat e | ||
WHERE b.snap_id = BID | ||
AND e.snap_id = EID | ||
AND b.dbid = DB_ID | ||
AND e.dbid = DB_ID | ||
AND b.dbid = e.dbid | ||
AND b.instance_number = INST_NUM | ||
AND e.instance_number = INST_NUM | ||
AND b.instance_number = e.instance_number | ||
AND b.name = e.name | ||
AND nvl(b.pool,'a') = nvl(e.pool,'a') | ||
ORDER BY b.pool, b.name; | ||
BEGIN | ||
L_LINE := TABLE_OPEN||'<TR><TH COLSPAN="5">SGA BreakDown Difference</TH></TR>'|| | ||
' <TR><TH CLASS="th_sub">Pool</TH><TH CLASS="th_sub">Name</TH>'|| | ||
'<TH CLASS="th_sub">Begin Value</TH>'; | ||
print(L_LINE); | ||
L_LINE := '<TH CLASS="th_sub">End Value</TH><TH CLASS="th_sub">% Diff</TH></TR>'; | ||
print(L_LINE); | ||
FOR R_SGASum in C_SGABreak LOOP | ||
L_LINE := ' <TR><TD CLASS="td_name">'||R_SGASum.pool||'</TD><TD CLASS="td_name">'|| | ||
R_SGASum.name||'</TD><TD ALIGN="right">'||R_SGASum.snap1|| | ||
'</TD><TD ALIGN="right">'||R_SGASum.snap2||'</TD><TD ALIGN="right">'|| | ||
R_SGASum.diff||'</TD></TR>'; | ||
print(L_LINE); | ||
END LOOP; | ||
L_LINE := TABLE_CLOSE; | ||
print(L_LINE); | ||
EXCEPTION | ||
WHEN OTHERS THEN NULL; | ||
END; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters