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
-- ----------
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
-- ----------
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
-- ----------
Y 117
N 1472751
小小菜鸟一枚