[20201231]RAC buffer states: XCUR, SCUR, PI,CR.txt

Time:2021-4-7

[20201231]RAC buffer states: XCUR, SCUR, PI,CR.txt

–//When someone asks about the status Pi of Rac buffer, according to the document, it is past image

■ Note If you have SYS privileges you can run the following query to see how many blocks you have in what
state: select state, count(*) from x$bh group by state; The commonest states are:  0—free, 1—XCUR
(exclusive current), 2—SCUR (shared current), 3—CR (available only for consistent read), 8—PI (past image). This
isn’t a nice thing to do to your buffer cache, so resist the temptation to do it on a busy production system with a
large cache.

–//RAC involves cache convergence and resource control, which is more complex than single instance database.
–//But I found a blog. http://www.dbi-services.com/index.php/blog/entry/rac-buffer-states-xcur-scur-pi-ci
–//Note: in the following Ci, I estimate that the author’s clerical error should not be CI but CR. I repeated the test in my own environment to explain the problem.

1. Environment:
[email protected]:1521/fyhis/fyhis1> @ ver1

PORT_STRING                    VERSION        BANNER
—————————— ————– ——————————————————————————–
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production

$ cat bhy.sql
SELECT inst_id
        ,class#
        ,status
        ,lock_element_addr
        ,dirty
        ,temp
        ,ping
        ,stale
        ,direct
        ,new
    FROM gv$bh
   WHERE     objd = (SELECT data_object_id
                       FROM dba_objects
                      WHERE owner = ‘SCOTT’ AND object_name = ‘DEPT’)
         AND status != ‘free’
ORDER BY inst_id;

$ cat bh.sql
set echo off
——————————————————————————–
— @name: bh
— @author: dion cho
— @note: show block header
— @usage: @bh f# b# state
——————————————————————————–
col object_name format a20
col state format a10

select
b.inst_id,
b.hladdr,
  b.dbarfil,
  b.dbablk,
  b.class,
  decode(b.class,1,’data block’,2,’sort block’,3,’save undo block’, 4,
  ‘segment header’,5,’save undo header’,6,’free list’,7,’extent map’,
  8,’1st level bmb’,9,’2nd level bmb’,10,’3rd level bmb’, 11,’bitmap block’,
  12,’bitmap index block’,13,’file header block’,14,’unused’,
  15,’system undo header’,16,’system undo block’, 17,’undo header’,
  18,’undo block’) class_type,
  decode(state,0,’free’,1,’xcur’,2,’scur’,3,’cr’, 4,’read’,5,’mrec’,6,’irec’,7,’write’,8,’pi’, 9,’memory’,10,’mwrite’,11,’donated’) as state,
  b.tch,
  cr_scn_bas,
  cr_scn_wrp,
  cr_uba_fil,
  cr_uba_blk,
  cr_uba_seq,
  ba,
  b.LE_ADDR,
  (select object_name from dba_objects where data_object_id = b.obj) as object_name
from x$bh b
where
  dbarfil = &1 and
  dbablk = &2
;
–//Add le_ ADDR,inst_ The ID field, I found, is on a single instance_ Addr output is 00

[email protected]:1521/fyhis/fyhis1> select rowid from scott.dept where deptno=10;
ROWID
——————
AAAVRCAAEAAAACHAAA

[email protected]:1521/fyhis/fyhis1> @ rowid AAAVRCAAEAAAACHAAA
    OBJECT       FILE      BLOCK        ROW ROWID_DBA            DBA                  TEXT
———- ———- ———- ———- ——————– ——————– —————————————-
     87106          4        135          0  0x1000087           4,135                alter system dump datafile 4 block 135 ;

[email protected]:1521/fyhis/fyhis1> @ bh 4 135
no rows selected
–//No output is normal because the corresponding data block is not accessed.

2. Test:
–//session 1:
[email protected]:1521/fyhis/fyhis1> select * from scott.dept where rowid=’AAAVRCAAEAAAACHAAA’;
    DEPTNO DNAME          LOC
———- ————– ————-
        10 ACCOUNTING     NEW YORK

[email protected]:1521/fyhis/fyhis1> @ bh 4 135

   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         1 00000004E22F9FD8          4        135          1 data block         scur                1          0          0          0          0          0 0000000461890000 0000000117F2B4D8 DEPT

[email protected]:1521/fyhis/fyhis1> @ bhy 4 135
   INST_ID     CLASS# STATUS     LOCK_ELEMENT_ADD D T P S D N
———- ———- ———- —————- – – – – – –
         1          1 scur       0000000117F2B4D8 N N N N N N
–//It only appears on one database instance.
–//Note that state = SCUR, rather than state = xcur as single instance. Maybe this is a feature of Rac

–//Session 2, how about execution?
[email protected]:1521/fyhis/fyhis2> select * from scott.dept where rowid=’AAAVRCAAEAAAACHAAA’;

    DEPTNO DNAME          LOC
———- ————– ————-
        10 ACCOUNTING     NEW YORK

[email protected]:1521/fyhis/fyhis2> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         2 00000004E239D750          4        135          1 data block         scur                2          0          0          0          0          0 000000037465A000 0000000223FB8D68 DEPT

[email protected]:1521/fyhis/fyhis2> @ bhy 4 135
   INST_ID     CLASS# STATUS     LOCK_ELEMENT_ADD D T P S D N
———- ———- ———- —————- – – – – – –
         1          1 scur       0000000117F2B4D8 N N N N N N
         2          1 scur       0000000223FB8D68 N N N N N N
–//There is no modification block, both sides are shared. state=scur.

3. Continue testing:
–//Session 1, make a modification, note that my test is different from the original link, I did not refresh the data cache:
[email protected]:1521/fyhis/fyhis1> select * from scott.dept where rowid=’AAAVRCAAEAAAACHAAA’ for update;
    DEPTNO DNAME          LOC
———- ————– ————-
        10 ACCOUNTING     NEW YORK

[email protected]:1521/fyhis/fyhis1> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         1 00000004E22F9FD8          4        135          1 data block         xcur                2          0          0          0          0          0 00000000A076A000 0000000117F2B4D8 DEPT
         1 00000004E22F9FD8          4        135          1 data block         cr                  2 3703090073          7          0          0          0 0000000461890000 00               DEPT

[email protected]:1521/fyhis/fyhis1> @ bhy
   INST_ID     CLASS# STATUS     LOCK_ELEMENT_ADD D T P S D N
———- ———- ———- —————- – – – – – –
         1          1 xcur       0000000117F2B4D8 Y N N N N N
         1          1 cr         00               N N N N N N
         2          1 cr         00               N N N N N N

–//session 2:
[email protected]:1521/fyhis/fyhis2> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         2 00000004E239D750          4        135          1 data block         cr                  1 3703090072          7          0          0          0 000000037465A000 00               DEPT

–//Look at executing on two instances bh.sql The output of the script.
–//The state of instance 2 is from SCUR > Cr, while Cr is from SCUR > CR_ SCN_ Bas changed from 0 to 3703090072.
–//The state of instance 1 is from SCUR > Cr, while Cr is not_ SCN_ Bas changed from 0 to 3703090073. That is to say, first modify the state of instance 2, then modify the state of instance 1 (as can be seen from the SCN information).
–//A new block state = xcur is generated on instance 1
–//Continue in session 2:

[email protected]:1521/fyhis/fyhis2> select * from scott.dept where rowid=’AAAVRCAAEAAAACHAAA’;
    DEPTNO DNAME          LOC
———- ————– ————-
        10 ACCOUNTING     NEW YORK

[email protected]:1521/fyhis/fyhis2> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         2 00000004E239D750          4        135          1 data block         cr                  1 3703090708          7          0          0          0 0000000384620000 00               DEPT
         2 00000004E239D750          4        135          1 data block         cr                  1 3703090072          7          0          0          0 000000037465A000 00               DEPT
–//Add 1 line, state = CR

[email protected]:1521/fyhis/fyhis2> @ bhy
   INST_ID     CLASS# STATUS     LOCK_ELEMENT_ADD D T P S D N
———- ———- ———- —————- – – – – – –
         1          1 xcur       0000000117F2B4D8 Y N N N N N
         1          1 cr         00               N N N N N N
         1          1 cr         00               N N N N N N
         2          1 cr         00               N N N N N N
         2          1 cr         00               N N N N N N

–//session 1:
[email protected]:1521/fyhis/fyhis1> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         1 00000004E22F9FD8          4        135          1 data block         cr                  0 3703090708          7          3       4278      36326 0000000190F96000 00               DEPT
         1 00000004E22F9FD8          4        135          1 data block         xcur                2          0          0          0          0          0 00000000A076A000 0000000117F2B4D8 DEPT
         1 00000004E22F9FD8          4        135          1 data block         cr                  2 3703090073          7          0          0          0 0000000461890000 00               DEPT
–//You can see that CR is constructed on instance 1_ SCN_ Bas = 3703090708, and then transfer to instance 2.

–//In session 2, note that the modification occurred in instance 1:
[email protected]:1521/fyhis/fyhis2> alter system checkpoint;
System altered.

[email protected]:1521/fyhis/fyhis2> @ bhy
   INST_ID     CLASS# STATUS     LOCK_ELEMENT_ADD D T P S D N
———- ———- ———- —————- – – – – – –
         1          1 xcur       0000000117F2B4D8 N N N N N N
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        
         1          1 cr         00               N N N N N N
         1          1 cr         00               N N N N N N
         2          1 cr         00               N N N N N N
         2          1 cr         00               N N N N N N
–//Dirty ID is cleared. Occurs in instance 1

4. Test how the state = Pi state appears
–//session 1:
[email protected]:1521/fyhis/fyhis1> commit ;
Commit complete.

[email protected]:1521/fyhis/fyhis1> alter system checkpoint;
System altered.

[email protected]:1521/fyhis/fyhis1> @ bhy
   INST_ID     CLASS# STATUS     LOCK_ELEMENT_ADD D T P S D N
———- ———- ———- —————- – – – – – –
         1          1 xcur       0000000117F2B4D8 Y N N N N N
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        
         1          1 cr         00               N N N N N N
         1          1 cr         00               N N N N N N
         2          1 cr         00               N N N N N N
         2          1 cr         00               N N N N N N
–//It turned into a dirty lump
–//session 2:
[email protected]:1521/fyhis/fyhis2> select * from scott.dept where rowid=’AAAVRCAAEAAAACHAAA’ for update;
    DEPTNO DNAME          LOC
———- ————– ————-
        10 ACCOUNTING     NEW YORK

[email protected]:1521/fyhis/fyhis2> @ bhy
   INST_ID     CLASS# STATUS     LOCK_ELEMENT_ADD D T P S D N
———- ———- ———- —————- – – – – – –
         1          1 cr         00               N N N N N N
         1          1 cr         00               N N N N N N
         1          1 pi         0000000117F2B4D8 Y N N N N N
         2          1 cr         00               N N N N N N
         2          1 cr         00               N N N N N N
         2          1 cr         00               N N N N N N
         2          1 xcur       0000000223FB8D68 Y N N N N N
7 rows selected.
–//Notice the dirty logo. The two are still marked as y. The original state of instance 1 is xcur > pi, that is, post image

[email protected]:1521/fyhis/fyhis2> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         2 00000004E239D750          4        135          1 data block         xcur                1          0          0          0          0          0 00000003C8108000 0000000223FB8D68 DEPT
         2 00000004E239D750          4        135          1 data block         cr                  1 3703092337          7          0          0          0 00000003B5A72000 00               DEPT
         2 00000004E239D750          4        135          1 data block         cr                  1 3703090708          7          0          0          0 0000000384620000 00               DEPT
         2 00000004E239D750          4        135          1 data block         cr                  1 3703090072          7          0          0          0 000000037465A000 00               DEPT

–//Session 1 View:
[email protected]:1521/fyhis/fyhis1> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         1 00000004E22F9FD8          4        135          1 data block         cr                  0 3703090708          7          3       4278      36326 0000000190F96000 00               DEPT
         1 00000004E22F9FD8          4        135          1 data block         pi                  2          0          0          0          0          0 00000000A076A000 0000000117F2B4D8 DEPT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        
         1 00000004E22F9FD8          4        135          1 data block         cr                  2 3703090073          7          0          0          0 0000000461890000 00               DEPT
–//The original state = xcur of instance 1 becomes state = Pi

–//session 2:
[email protected]:1521/fyhis/fyhis2> alter system checkpoint;
System altered.

[email protected]:1521/fyhis/fyhis2> @ bhy
   INST_ID     CLASS# STATUS     LOCK_ELEMENT_ADD D T P S D N
———- ———- ———- —————- – – – – – –
         1          1 cr         00               N N N N N N
         1          1 cr         00               N N N N N N
         1          1 cr         00               N N N N N N
         2          1 cr         00               N N N N N N
         2          1 cr         00               N N N N N N
         2          1 cr         00               N N N N N N
         2          1 xcur       0000000223FB8D68 N N N N N N
7 rows selected.
–//State = Pi, the ID is cleared, it becomes Cr, and lock_ element_ Addr = 00. And the identity dirty becomes Y – > n (2 instances)

–//session 1:
[email protected]:1521/fyhis/fyhis1> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         1 00000004E22F9FD8          4        135          1 data block         cr                  0 3703090708          7          3       4278      36326 0000000190F96000 00               DEPT
         1 00000004E22F9FD8          4        135          1 data block         cr                  1 3703092337          7          0          0          0 00000000A076A000 00               DEPT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         1 00000004E22F9FD8          4        135          1 data block         cr                  2 3703090073          7          0          0          0 0000000461890000 00               DEPT
–//Pay special attention to the underlined CR_ SCN_ It’s strange that it’s changed from base = 30921. 33927_ ADDR=00.

–//session 2:
[email protected]:1521/fyhis/fyhis2> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         2 00000004E239D750          4        135          1 data block         xcur                1          0          0          0          0          0 00000003C8108000 0000000223FB8D68 DEPT
         2 00000004E239D750          4        135          1 data block         cr                  1 3703092337          7          0          0          0 00000003B5A72000 00               DEPT
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~        
         2 00000004E239D750          4        135          1 data block         cr                  1 3703090708          7          0          0          0 0000000384620000 00               DEPT
         2 00000004E239D750          4        135          1 data block         cr                  1 3703090072          7          0          0          0 000000037465A000 00               DEPT
–//Pay attention to the underline and Cr_ SCN_ Change of BAS column. You can guess the general operation process, first transfer or copy from instance 1, and then modify it.
–//From instance 1 Cr_ SCN_ If bas = 0 becomes 3703092337, you can see it.

5. Continue testing:
–//Read specific SCN from instance 2.
–//7,3703090073 = scn(10): 33767861145 = scn(16): 0x7dcb8ab99
–//session 2:
[email protected]:1521/fyhis/fyhis2> commit ;
Commit complete.

[email protected]:1521/fyhis/fyhis2> select * from scott.dept as of scn 33767861145 where rowid=’AAAVRCAAEAAAACHAAA’ ;
    DEPTNO DNAME          LOC
———- ————– ————-
        10 ACCOUNTING     NEW YORK

[email protected]:1521/fyhis/fyhis2> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         2 00000004E239D750          4        135          1 data block         xcur                1          0          0          0          0          0 00000003C8108000 0000000223FB8D68 DEPT
         2 00000004E239D750          4        135          1 data block         cr                  1 3703092337          7          0          0          0 00000003B5A72000 00               DEPT
         2 00000004E239D750          4        135          1 data block         cr                  2 3703090708          7          0          0          0 0000000384620000 00               DEPT
         2 00000004E239D750          4        135          1 data block         cr                  1 3703090072          7          0          0          0 000000037465A000 00               DEPT

–//session 1:
[email protected]:1521/fyhis/fyhis1> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         1 00000004E22F9FD8          4        135          1 data block         cr                  0 3703090708          7          3       4278      36326 0000000190F96000 00               DEPT
         1 00000004E22F9FD8          4        135          1 data block         cr                  1 3703092337          7          0          0          0 00000000A076A000 00               DEPT
         1 00000004E22F9FD8          4        135          1 data block         cr                  2 3703090073          7          0          0          0 0000000461890000 00               DEPT
–//There is no change, not even the threshold. Depending on the fact that such a query is only transmitted through instance 1.
–//Session 1, repeat the above query:
[email protected]:1521/fyhis/fyhis1> select * from scott.dept as of scn 33767861145 where rowid=’AAAVRCAAEAAAACHAAA’ ;
    DEPTNO DNAME          LOC
———- ————– ————-
        10 ACCOUNTING     NEW YORK

[email protected]:1521/fyhis/fyhis1> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         1 00000004E22F9FD8          4        135          1 data block         cr                  0 3703090708          7          3       4278      36326 0000000190F96000 00               DEPT
         1 00000004E22F9FD8          4        135          1 data block         cr                  1 3703092337          7          0          0          0 00000000A076A000 00               DEPT
         1 00000004E22F9FD8          4        135          1 data block         cr                  3 3703090073          7          0          0          0 0000000461890000 00               DEPT
–//It can be found that TCH changes from 2 to 3

–//Session 2, how about changing SCN?
[email protected]:1521/fyhis/fyhis2> select * from scott.dept as of scn 33767861146 where rowid=’AAAVRCAAEAAAACHAAA’ ;
    DEPTNO DNAME          LOC
———- ————– ————-
        10 ACCOUNTING     NEW YORK
–//33767861146    = scn_wrap,scn_base(10): 7,3703090074 = scn_wrap,scn_base(16): 0x7,0xdcb8ab9a

[email protected]:1521/fyhis/fyhis2> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         2 00000004E239D750          4        135          1 data block         xcur                1          0          0          0          0          0 00000003C8108000 0000000223FB8D68 DEPT
         2 00000004E239D750          4        135          1 data block         cr                  1 3703092337          7          0          0          0 00000003B5A72000 00               DEPT
         2 00000004E239D750          4        135          1 data block         cr                  3 3703090708          7          0          0          0 0000000384620000 00               DEPT
         2 00000004E239D750          4        135          1 data block         cr                  1 3703090072          7          0          0          0 000000037465A000 00               DEPT
–//If you look closely, you can see CR_ SCN_ The TCH of BAS = 3703090708 starts from 2 – > 3. That is, the construction starts from the current instance CR_ SCN_ Bas = 3703090708, SCN = 73703090074
–//session 1:

[email protected]:1521/fyhis/fyhis1> @ bh 4 135
   INST_ID HLADDR              DBARFIL     DBABLK      CLASS CLASS_TYPE         STATE             TCH CR_SCN_BAS CR_SCN_WRP CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ BA               LE_ADDR          OBJECT_NAME
———- —————- ———- ———- ———- —————— ———- ———- ———- ———- ———- ———- ———- —————- —————- ——————–
         1 00000004E22F9FD8          4        135          1 data block         cr                  0 3703090708          7          3       4278      36326 0000000190F96000 00               DEPT
         1 00000004E22F9FD8          4        135          1 data block         cr                  1 3703092337          7          0          0          0 00000000A076A000 00               DEPT
         1 00000004E22F9FD8          4        135          1 data block         cr                  3 3703090073          7          0          0          0 0000000461890000 00               DEPT

6. Summary:
–//As for why PI appears, save the recovery time according to the document, and operate my analysis ability in some details.
–//The test is still a bit messy
–//http://www.dbi-services.com/index.php/blog/entry/rac-buffer-states-xcur-scur-pi-ci
Here are the states we have seen here:

XCUR: current version of the block – holding an exclusive lock for it
SCUR: current version of the block that can be share because no modification were done
CR: only valid for consistent read, after applying the necessary undo to get it back to requried SCN
PI: past image of a modified current block, kept until the latest version is checkpointed

and the other possible states:

FREE: The buffer is not currently in use.
READ: when the block is being read from disk
MREC: when the block is being recovered for media recovery
IREC: when the block is being recovered for crash recovery

–//In fact, RAC is not a good thing. It’s not as slow as single instance. Especially when the original single instance has performance problems, the RAC environment may amplify this effect
–//And from the above test, we can see several points:
–//1. Transactions should be committed as quickly as possible
–//2. The transmission capacity of the in-line network should be as large as possible. The service should be divided as much as possible. The same service should be processed in one instance. I have also seen the use of hub in the in-line network
–//This kind of network equipment is generally 100m, full duplex is 200m, and the maximum transmission capacity is 20m / S. in this way, if the inline traffic is large, there is a great possibility of problems

Recommended Today

Review of SQL Sever basic command

catalogue preface Installation of virtual machine Commands and operations Basic command syntax Case sensitive SQL keyword and function name Column and Index Names alias Too long to see? Space Database connection Connection of SSMS Connection of command line Database operation establish delete constraint integrity constraint Common constraints NOT NULL UNIQUE PRIMARY KEY FOREIGN KEY DEFAULT […]