下面这个脚本在8i里可用,但9i中x$bh里边没有了BUF#这个列,不知道对应那个列,麻烦告诉我!非常感谢!
select 'DEFAULT' "BUFFER_POOL",
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)) notdirty,
sum(decode(bitand(Flag, 1), 1, 1, 0)) Dirty,
SUM(Dirty_Queue) OnDirtyQ,
count(*) Total
from x$bh
where class in (1, 2, 4, 10) and
buf# >= (select lo_bnum
from v$buffer_pool
where name = 'DEFAULT' and buffers > 0) and
buf#0)
group by 'DEFAULT',
DECODE(GREATEST(Class, 10),
10,
DECODE(Class,
1,
'Data',
2,
'Sort',
4,
'Header',
To_char(class)),
'Rollback'); |