//表使用频率最高的100个表
SQL> execute statspack.snap (i_snap_level=>7, i_modify_parameter=>'true');
select table_owner "table owner",
table_name "table name",
command "command issued",
executions "executions",
disk_reads "disk reads",
gets "buffer gets",
rows_processed "rows processed"
from (select distinct executions,
command,
table_owner,
table_name,
gets,
rows_processed,
disk_reads
from (select decode(a.command_type,
2,
'insert ',
3,
'select ',
6,
'update ',
7,
'delete ',
26,
'table lock ') command,
c.owner table_owner,
c.name table_name,
sum(a.disk_reads) disk_reads,
sum(0 - a.executions) executions,
sum(a.buffer_gets) gets,
sum(a.rows_processed) rows_processed
from sys.v_$sql a,
sys.v_$object_dependency b,
sys.v_$db_object_cache c
where a.command_type in (2, 3, 6, 7, 26)
and b.from_address = a.address
and b.to_owner = c.owner
and b.to_name = c.name
and c.type = 'table'
and c.owner not in ('SYS', 'SYSTEM')
group by a.command_type, c.owner, c.name))
where rownum <= 100;
阅读(1252) | 评论(0) | 转发(0) |