Thursday, February 4, 2010

Script to check global cache activity for the table segments of a schema

SELECT
 table_name AS "Table Name",
 gc_buffer_busy AS "Buffer Busy",
 gc_cr_blocks_received AS "CR Blocks Received",
 gc_current_blocks_received AS "Current Blocks Received"
 FROM
 (
 SELECT table_name FROM dba_tables
 WHERE owner = '&schema_name'
 ) t,
 (
 SELECT object_name,value AS gc_buffer_busy
 FROM v$segment_statistics
 WHERE owner = '&schema_name'
 AND object_type = 'TABLE'
 AND statistic_name = 'gc buffer busy'
 ) ss1,
 (
 SELECT object_name,value AS gc_cr_blocks_received
 FROM v$segment_statistics
 WHERE owner = '&schema_name'
 AND object_type = 'TABLE'
 AND statistic_name = 'gc cr blocks received'
 ) ss2,
 (
 SELECT object_name,value AS gc_current_blocks_received
 FROM v$segment_statistics
 WHERE owner = '&schema_name'
 AND object_type = 'TABLE'
 AND statistic_name = 'gc current blocks received'
 ) ss3
 WHERE t.table_name = ss1.object_name
 AND t.table_name = ss2.object_name
 AND t.table_name = ss3.object_name;


Note: this script is copied from Julian Dyke's book "Pro Oracle Database 10g RAC on Linux", p691

Labels: , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home