[20201231]RAC buffer states: XCUR, SCUR, PI,CR.txt
--//別人問及rac buffer狀態PI,按照檔案介紹就是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涉及快取融合以及資源掌控方面的問題,搞的比單實體的資料庫要復雜N多,
--//不過我找到一篇blog,http://www.dbi-services.com/index.php/blog/entry/rac-buffer-states-xcur-scur-pi-ci
--//注:后面的ci我估計作者筆誤,應該不是CI而是CR,我在自己的環境下重復測驗,說明問題,
1.環境:
[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
;
--//增加LE_ADDR,inst_id欄位,我發現在單實體上LE_ADDR輸出是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
--//沒有輸出正常,因為并沒有訪問對應的資料塊,
2.測驗:
--//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
--//僅僅出現在1個資料庫實體上,
--//注意state=scur,而不是像單實體出現的是state=xcur.也許這個是RAC的特性.
--//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 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
--//沒有修改塊,兩邊都是共享的,state=scur.
3.繼續測驗:
--//session 1,做一個修改,注我的測驗與原鏈接不同,我沒有重繪資料快取:
[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
--//看看在兩個實體上執行bh.sql腳本的輸出,
--//實體2的STATE從scur->CR,而CR_SCN_BAS從0變成了3703090072,
--//實體1的STATE從scur->CR,而CR_SCN_BAS從0變成了3703090073,也就是先要修改實體2的狀態在修改實體1的狀態們(從scn資訊可以看出來),
--//實體1上生成新塊state=xcur.
--//在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
--//增加1行,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
--//你可以發現現在實體1上構造出CR_SCN_BAS=3703090708,然后在傳輸到實體2上,
--//session 2,注意修改發生在實體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標識清除,發生在實體1.
4.測驗STATE=PI的狀態如何出現:
--//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
--//變成了臟塊.
--//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.
--//注意看dirty標識,兩個依舊標識為Y,實體1原來的state 從xcur->pi,也就是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查看:
[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
--//實體1的原來state=xcur 變成了 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標識清除,變成了cr,而且lock_element_addr=00.并且標識dirty變成Y->N(2個實體)
--//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
--//特別注意下劃線的CR_SCN_BAS=3703092337.原來是0. 很奇怪的是TCH從2變成了1,LE_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
--//注意看下劃線以及CR_SCN_BAS列的變化,你可以猜測大概操作流程,先從實體1傳輸或者拷貝過來,然后在修改,
--//從實體1 CR_SCN_BAS=0 變成 3703092337,就可以看出來,
5.繼續測驗:
--//從實體2讀取特定scn的情況,
--//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
--//沒有變化,甚至tch值,視乎這樣的查詢僅僅通過實體1傳輸過來,
--//session 1,重復上面的查詢:
[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
--//可以發現TCH從2 -> 3.
--//session 2,改變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
--//如果你仔細觀察就能發現CR_SCN_BAS=3703090708的TCH從2->3.也就是構造從當前實體CR_SCN_BAS=3703090708 反向操作會 scn= 7,3703090074.
--//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.總結:
--//至于為什么出現PI,按照檔案介紹節省recovery的恢復時間,一些細節操作我的分析能力,
--//測驗還是有點亂....
--//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
--//實際上rac并非是什么好東西,處理不好比單實體要慢,特別是原來單實體就存在性能問題的情況下,rac環境可能放大這樣的效果.
--//而且從上面測驗也可以看出幾點:
--//1.事務應該還是盡可能的快速提交.
--//2.行內的網路傳輸能力要盡量的塊.盡可能進行業務分割.相同的業務在1個實體處理.我還見過行內網路使用hub的情況.
--// 這種網路設備一般就是100M,全雙工也就是200M,最大傳輸能力就是20M/秒.這樣如果行內流量很大,出現問題的可能性很大.
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/245143.html
標籤:Oracle
