About DIRTY BUFFER

xiaoxiao2021-03-06  124

In fact, everyone may always pay enough attention to the view of V $ BH.

Let's take a look at the main field of this view:

Status varchar2 (1) status of the buffer:

Free - Not Currently in Use Xcur - Exclusive scur - Shared Current CR - Consistent Read READ - BEING READ RECOVE IREC - IN Instance Recovery Mode?

Dirty varchar2 (1) Y - block modified temp varchar2 (1) y - temporary block ping varcha2 (1) y - block pinged stale varcha2 (1) y - block is stale direct varcha2 (1) y - Direct Block

?

We noticed that V $ dirty is a block moduified.

?

If we trace it further:

SQL> SELECT View_DEFINITION from V $ fixed_view_definition where view_name = 'gv $ bh';

View_definition ------------------------------------- ------------------------------ SELECT BH.INST_ID, FILE #, DBABLK, CLASS, DECODE (State, 0, ' Free ', 1,' Xcur ', 2,' scur ', 3,' Cr ', 4,' Read ', 5,' MREC ', 6,' IREC ', 7,' WRITE ', 8,' PI ' ), x_to_null, forced_reads, forced_writes, bh.le_addr, name, le_class, decode (Bitand (Flag, 1), 0, 'N', 'Y'), Decode (Bitand (Flag, 16), 0, 'N' , 'Y'), Decode (Bitand (Flag, 1536), 0, 'N', 'Y'), DECODE (Bitand (Flag, 16384), 0, 'N', 'Y'), Decode (Bitand Flag, 65536), 0, 'n', 'y'), 'n', obj, ts # from x $ BH BH, X $ le's big be bh.le_addr = le.le_addr ( )

We can see the bottom of V $ BH represents x $ bh

Where the Dirty / Temp / Ping / Store / Direct in V $ BH is derived from the Flag field in X $ BH.

Format the output:

SELECT BH.INST_ID, FILE #, DBABLK, CLASS, ?????? decode (state, ?????????????????????????? ?????? 1, 'xcur', ???????????????? 2, 'scur', ??????????????? 3, 'Cr ', ?????????????? 4,' read ', ?????????????? 5,' mrec ', ???????? ?????? 6, 'IREC', ?????????????????????????????????? 8, 'Pi '??????????????), ?????? x_to_null, forced_reads, forced_writes, bh.le_addr, name, le_class, ?????? decode (Bitand (Flag, 1) , 0, 'n', 'y'), ?????? decode (Bitand (Flag, 16), 0, 'N', 'Y'), ?????? decode (Bitand (Flag, 1536), 0, 'n', 'Y'), ?????? decode (Bitand (Flag, 16384), 0, 'N', 'Y'), ?????? decode (Bitand Flag, 65536), 0, 'n', 'y'), 'n', obj, ts #? from x $ BH BH, X $ le? where big.le_addr = le.le_addr ( ) So we Separate the deep meaning of X $ BH.FLAG.

转载请注明原文地址:https://www.9cbs.com/read-126570.html

New Post(0)