Oracle查找脏数据块的个数

V$BH视图提供了一个列DIRTY,用于指出BUFFER CACHE中某个数据块是否是DIRTY的,取值为Y或者N。
如下:
 
SQL> select dirty,count(1) from v$bh group by dirty;
DI   COUNT(1)
-- ----------
Y         158
N     1472703
 
SQL> update test set object_id=object_id;    
   
391898 rows updated.
 
SQL> commit;
 
Commit complete.
 
SQL>  select dirty,count(1) from v$bh group by dirty;
 
DI   COUNT(1)
-- ----------
Y       13572
N     1459296
 
SQL>  alter system checkpoint;
 
System altered.
 
SQL>  select dirty,count(1) from v$bh group by dirty;
 
DI   COUNT(1)
-- ----------
Y         117
N     1472751
 
posted @ 2014-07-16 01:59  princessd8251  阅读(534)  评论(0编辑  收藏  举报