2013년 8월 12일 월요일

ORACLE SGA Buffer Summary

SET ECHO off
REM NAME:  TFSSGABF.SQL
REM USAGE:"@path/tfssgabf"
REM ------------------------------------------------------------------------
REM REQUIREMENTS:
REM    Needs to be run as SYS
REM ------------------------------------------------------------------------
REM AUTHOR: 
REM    Virag Saksena, Oracle Corporation     
REM    (c)1996 Oracle Corporation
REM ------------------------------------------------------------------------
REM PURPOSE:
REM    Reports statistics about the buffers in the SGA. It will print
REM    the information about the types of buffers in the SGA, how many of
REM    them are on the dirty queue and how many are not.
REM ------------------------------------------------------------------------
REM DISCLAIMER:
REM    This script is provided for educational purposes only. It is NOT 
REM    supported by Oracle World Wide Technical Support.
REM    The script has been tested and appears to work as intended.
REM    You should always run new scripts on a test instance initially.
REM ------------------------------------------------------------------------
REM Main text of script follows:
 
col class form A10
select decode(greatest(class,10),10,decode(class,1,'Data',2
            ,'Sort',4,'Header',to_char(class)),'Rollback') "Class",
      sum(decode(bitand(flag,1),1,0,1)) "Not Dirty",
 sum(decode(bitand(flag,1),1,1,0)) "Dirty",
      sum(dirty_queue) "On Dirty",count(*) "Total"
from x$bh
group by decode(greatest(class,10),10,decode(class,1,'Data',2
        ,'Sort',4,'Header',to_char(class)),'Rollback')
/



Sample Output
=============

    Class      Not Dirty      Dirty  On Dirty      Total
    ---------- ---------- ---------- ---------- ----------
    7                  1        00          1
    Data            2194        598          0      2792
    Header            35          0          0        35
    Rollback          370          2          0        372 

댓글 없음:

댓글 쓰기