oracle x$bh及v$bh與table cache表快取系列(三)

wisdomone1發表於2013-01-29
---可以快取,難道僅插入一條記錄即可快取嗎
SQL> select * from x$bh where bj=67419;
 
ADDR                   INDX    INST_ID HLADDR                BLSIZ NXT_HASH         PRV_HASH         NXT_REPL         PRV_REPL               FLAG      FLAG2      LOBID      RFLAG      SFLAG   LRU_FLAG        TS#      FILE#    DBARFIL     DBABLK      CLASS      STATE  MODE_HELD    CHANGES     CSTATE LE_ADDR          DIRTY_QUEUE SET_DS                  OBJ BA               CR_SCN_BAS CR_SCN_WRP CR_XID_USN CR_XID_SLT CR_XID_SQN CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ CR_UBA_REC     CR_SFL CR_CLS_BAS CR_CLS_WRP   LRBA_SEQ   LRBA_BNO   HSCN_BAS   HSCN_WRP   HSUB_SCN US_NXT           US_PRV           WA_NXT           WA_PRV           OQ_NXT           OQ_PRV           AQ_NXT           AQ_PRV             OBJ_FLAG        TCH        TIM   CR_RFCNT  SHR_RFCNT
---------------- ---------- ---------- ---------------- ---------- ---------------- ---------------- ---------------- ---------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- ----------- ---------------- ---------- ---------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------- ---------- ---------- ---------- ----------
 
SQL> /
 
ADDR                   INDX    INST_ID HLADDR                BLSIZ NXT_HASH         PRV_HASH         NXT_REPL         PRV_REPL               FLAG      FLAG2      LOBID      RFLAG      SFLAG   LRU_FLAG        TS#      FILE#    DBARFIL     DBABLK      CLASS      STATE  MODE_HELD    CHANGES     CSTATE LE_ADDR          DIRTY_QUEUE SET_DS                  OBJ BA               CR_SCN_BAS CR_SCN_WRP CR_XID_USN CR_XID_SLT CR_XID_SQN CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ CR_UBA_REC     CR_SFL CR_CLS_BAS CR_CLS_WRP   LRBA_SEQ   LRBA_BNO   HSCN_BAS   HSCN_WRP   HSUB_SCN US_NXT           US_PRV           WA_NXT           WA_PRV           OQ_NXT           OQ_PRV           AQ_NXT           AQ_PRV             OBJ_FLAG        TCH        TIM   CR_RFCNT  SHR_RFCNT
---------------- ---------- ---------- ---------------- ---------- ---------------- ---------------- ---------------- ---------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- ----------- ---------------- ---------- ---------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------- ---------- ---------- ---------- ----------
000000001EEA6D00        316          1 000007FFFB255BD8       8192 000007FFFB25D148 000007FFFB25D148 000007FFE7FCADA0 000007FFE7FCAB40   33554433          0          0          0          0          0          8         10         10     220408          8          1          0          1          0 00                         0 000007FFFBDA5978      67419 000007FFE7A9C000          0          0          0          0          0          0          0          0          0          0          0          0        116      39584    2552797          0          1 000007FFE7FCABA8 000007FFE7FCABA8 000007FFE7FCABB8 000007FFE7FCABB8 000007FFF69EAE78 000007FFE7FCAB68 000007FFF69EAE58 000007FFE7FCAB78        242          1 1359375379          0          0
000000001EEA6D00        925          1 000007FFFB355DC0       8192 000007FFFB35D8C8 000007FFFB35D8C8 000007FFE7F80690 000007FFE7F80430   33554433          0          0          0          0          0          8         10         10     220413          1          1          0          1          0 00                         0 000007FFFBDA4BD8      67419 000007FFE72C6000          0          0          0          0          0          0          0          0          0          0          0          0        116      39594    2552797          0          1 000007FFE7F80498 000007FFE7F80498 000007FFE7F804A8 000007FFE7F804A8 000007FFE7F80918 000007FFF69EEAE0 000007FFE7F80928 000007FFF69EEAC0        242          1 1359375380          0          0
000000001EEA6D00       1952          1 000007FFFB4FA9B8       8192 000007FFFB4FF248 000007FFFB4FF248 000007FFE7F80A20 000007FFE7F807C0   33554433          0          0          0          0          0          8         10         10     220410          4          1          0          1          0 00                         0 000007FFFBDA4BD8      67419 000007FFE72CC000          0          0          0          0          0          0          0          0          0          0          0          0        116      39584    2552797          0          1 000007FFE7F80828 000007FFE7F80828 000007FFE7F80838 000007FFE7F80838 000007FFF69EEAE0 000007FFE7F80588 000007FFF69EEAC0 000007FFE7F80598        242          1 1359375379          0          0
000000001EEA6D00       2567          1 000007FFFB5FABA0       8192 000007FFFB5FF9C8 000007FFFB5FF9C8 000007FFE7FCAB40 000007FFE7FCA8E0   33554433          0          0          0          0          0          8         10         10     220415          1          1          0          1          0 00                         0 000007FFFBDA5978      67419 000007FFE7A98000          0          0          0          0          0          0          0          0          0          0          0          0        116      39594    2552798          0          1 000007FFE7FCA948 000007FFE7FCA948 000007FFE7FCA958 000007FFE7FCA958 000007FFE7FCAB68 000007FFF69EAE78 000007FFE7FCAB78 000007FFF69EAE58        242          1 1359375380          0          0
000000001EEA6D00       3568          1 000007FFFB7976D0       8192 000007FFFB79E148 000007FFFB79E148 000007FFE7FEF4B0 000007FFE7FEF250   33554433          0          0          0          0          0          8         10         10     220412          1          1          0          1          0 00                         0 000007FFFBDA6048      67419 000007FFE7E72000          0          0          0          0          0          0          0          0          0          0          0          0        116      39594    2552797          0          1 000007FFE7FEF2B8 000007FFE7FEF2B8 000007FFE7FEF2C8 000007FFE7FEF2C8 000007FFF69E9CF8 000007FFF69E9CF8 000007FFF69E9CD8 000007FFF69E9CD8        242          1 1359375380          0          0
000000001EEA6D00       4555          1 000007FFFB93C2C8       8192 000007FFFB93FAC8 000007FFFB93FAC8 000007FFE7FA60A0 000007FFE7FA5E40   33554433          0          0          0          0          0          8         10         10     220409          9          1          0          1          0 00                         0 000007FFFBDA52A8      67419 000007FFE76BC000          0          0          0          0          0          0          0          0          0          0          0          0        116      39584    2552787          0          1 000007FFE7FA5EA8 000007FFE7FA5EA8 000007FFE7FA5EB8 000007FFE7FA5EB8 000007FFF69E3BE8 000007FFE7FA5C08 000007FFF69E3BC8 000007FFE7FA5C18        242          1 1359375379          0          0
000000001EEA6D00       5164          1 000007FFFBA3C4B0       8192 000007FFFBA40248 000007FFFBA40248 000007FFE7FA5D10 000007FFE7FA5AB0   33554433          0          0          0          0          0          8         10         10     220414          1          1          0          1          0 00                         0 000007FFFBDA52A8      67419 000007FFE76B6000          0          0          0          0          0          0          0          0          0          0          0          0        116      39594    2552797          0          1 000007FFE7FA5B18 000007FFE7FA5B18 000007FFE7FA5B28 000007FFE7FA5B28 000007FFE7FA5F98 000007FFF69E3BE8 000007FFE7FA5FA8 000007FFF69E3BC8        242          1 1359375380          0          0
000000001EEA6D00       6154          1 000007FFFBBD90A8       8192 000007FFFBBDE9C8 000007FFFBBDE9C8 000007FFE7FCAC70 000007FFE7FCAA10   33554433          0          0          0          0          0          8         10         10     220411          1          1          0          1          0 00                         0 000007FFFBDA5978      67419 000007FFE7A9A000          0          0          0          0          0          0          0          0          0          0          0          0        116      39594    2552797          0          1 000007FFE7FCAA78 000007FFE7FCAA78 000007FFE7FCAA88 000007FFE7FCAA88 000007FFE7FCAC98 000007FFE7FCAA38 000007FFE7FCACA8 000007FFE7FCAA48        242          1 1359375380          0          0
 
8 rows selected

-----繼續向此表插入30條記錄
20:16:21 SQL> insert into t_other select 1 from dual connect by level<=3e1;
 
30 rows inserted
 
Executed in 0 seconds
 
20:17:55 SQL> commit;
 
Commit complete
 
Executed in 0 seconds

----可以對比上述結果,發現x$bh某些列的值發現了變更,比如changes列,cstate列,tch列;
SQL> /
 
ADDR                   INDX    INST_ID HLADDR                BLSIZ NXT_HASH         PRV_HASH         NXT_REPL         PRV_REPL               FLAG      FLAG2      LOBID      RFLAG      SFLAG   LRU_FLAG        TS#      FILE#    DBARFIL     DBABLK      CLASS      STATE  MODE_HELD    CHANGES     CSTATE LE_ADDR          DIRTY_QUEUE SET_DS                  OBJ BA               CR_SCN_BAS CR_SCN_WRP CR_XID_USN CR_XID_SLT CR_XID_SQN CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ CR_UBA_REC     CR_SFL CR_CLS_BAS CR_CLS_WRP   LRBA_SEQ   LRBA_BNO   HSCN_BAS   HSCN_WRP   HSUB_SCN US_NXT           US_PRV           WA_NXT           WA_PRV           OQ_NXT           OQ_PRV           AQ_NXT           AQ_PRV             OBJ_FLAG        TCH        TIM   CR_RFCNT  SHR_RFCNT
---------------- ---------- ---------- ---------------- ---------- ---------------- ---------------- ---------------- ---------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- ----------- ---------------- ---------- ---------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------- ---------- ---------- ---------- ----------
000000001EEA6D00        316          1 000007FFFB255BD8       8192 000007FFFB25D148 000007FFFB25D148 000007FFE7FCADA0 000007FFE7FCAB40   33554433          0          0          0          0          0          8         10         10     220408          8          1          0          1          0 00                         0 000007FFFBDA5978      67419 000007FFE7A9C000          0          0          0          0          0          0          0          0          0          0          0          0        116      39584    2552797          0          1 000007FFE7FCABA8 000007FFE7FCABA8 000007FFE7FCABB8 000007FFE7FCABB8 000007FFF69EAE78 000007FFE7FCAB68 000007FFF69EAE58 000007FFE7FCAB78        242          2 1359375475          0          0
000000001EEA6D00        925          1 000007FFFB355DC0       8192 000007FFFB35D8C8 000007FFFB35D8C8 000007FFE7F80690 000007FFE7F80430   33554433          0          0          0          0          0          8         10         10     220413          1          1          0          1          0 00                         0 000007FFFBDA4BD8      67419 000007FFE72C6000          0          0          0          0          0          0          0          0          0          0          0          0        116      39594    2552797          0          1 000007FFE7F80498 000007FFE7F80498 000007FFE7F804A8 000007FFE7F804A8 000007FFE7F80918 000007FFF69EEAE0 000007FFE7F80928 000007FFF69EEAC0        242          1 1359375380          0          0
000000001EEA6D00       1952          1 000007FFFB4FA9B8       8192 000007FFFB4FF248 000007FFFB4FF248 000007FFE7F80A20 000007FFE7F807C0   33554433          0          0          0          0          0          8         10         10     220410          4          1          0          1          0 00                         0 000007FFFBDA4BD8      67419 000007FFE72CC000          0          0          0          0          0          0          0          0          0          0          0          0        116      39584    2552797          0          1 000007FFE7F80828 000007FFE7F80828 000007FFE7F80838 000007FFE7F80838 000007FFF69EEAE0 000007FFE7F80588 000007FFF69EEAC0 000007FFE7F80598        242          2 1359375475          0          0
000000001EEA6D00       2567          1 000007FFFB5FABA0       8192 000007FFFB5FF9C8 000007FFFB5FF9C8 000007FFE7FCAB40 000007FFE7FCA8E0   33554433          0          0          0          0          0          8         10         10     220415          1          1          0          0          4 00                         0 000007FFFBDA5978      67419 000007FFE7A98000          0          0          0          0          0          0          0          0          0          0          0          0        116      39594    2552837          0          1 000007FFE7FCA948 000007FFE7FCA948 000007FFE7FCA958 000007FFE7FCA958 000007FFE7FCAB68 000007FFF69EAE78 000007FFE7FCAB78 000007FFF69EAE58        242          2 1359375475          0          0
000000001EEA6D00       3568          1 000007FFFB7976D0       8192 000007FFFB79E148 000007FFFB79E148 000007FFE7FEF4B0 000007FFE7FEF250   33554433          0          0          0          0          0          8         10         10     220412          1          1          0          1          0 00                         0 000007FFFBDA6048      67419 000007FFE7E72000          0          0          0          0          0          0          0          0          0          0          0          0        116      39594    2552797          0          1 000007FFE7FEF2B8 000007FFE7FEF2B8 000007FFE7FEF2C8 000007FFE7FEF2C8 000007FFF69E9CF8 000007FFF69E9CF8 000007FFF69E9CD8 000007FFF69E9CD8        242          1 1359375380          0          0
000000001EEA6D00       4555          1 000007FFFB93C2C8       8192 000007FFFB93FAC8 000007FFFB93FAC8 000007FFE7FA60A0 000007FFE7FA5E40   33554433          0          0          0          0          0          8         10         10     220409          9          1          0          1          0 00                         0 000007FFFBDA52A8      67419 000007FFE76BC000          0          0          0          0          0          0          0          0          0          0          0          0        116      39584    2552787          0          1 000007FFE7FA5EA8 000007FFE7FA5EA8 000007FFE7FA5EB8 000007FFE7FA5EB8 000007FFF69E3BE8 000007FFE7FA5C08 000007FFF69E3BC8 000007FFE7FA5C18        242          2 1359375475          0          0
000000001EEA6D00       5164          1 000007FFFBA3C4B0       8192 000007FFFBA40248 000007FFFBA40248 000007FFE7FA5D10 000007FFE7FA5AB0   33554433          0          0          0          0          0          8         10         10     220414          1          1          0          1          0 00                         0 000007FFFBDA52A8      67419 000007FFE76B6000          0          0          0          0          0          0          0          0          0          0          0          0        116      39594    2552797          0          1 000007FFE7FA5B18 000007FFE7FA5B18 000007FFE7FA5B28 000007FFE7FA5B28 000007FFE7FA5F98 000007FFF69E3BE8 000007FFE7FA5FA8 000007FFF69E3BC8        242          1 1359375380          0          0
000000001EEA6D00       6154          1 000007FFFBBD90A8       8192 000007FFFBBDE9C8 000007FFFBBDE9C8 000007FFE7FCAC70 000007FFE7FCAA10   33554433          0          0          0          0          0          8         10         10     220411          1          1          0          1          0 00                         0 000007FFFBDA5978      67419 000007FFE7A9A000          0          0          0          0          0          0          0          0          0          0          0          0        116      39594    2552797          0          1 000007FFE7FCAA78 000007FFE7FCAA78 000007FFE7FCAA88 000007FFE7FCAA88 000007FFE7FCAC98 000007FFE7FCAA38 000007FFE7FCACA8 000007FFE7FCAA48        242          1 1359375380          0          0
 
8 rows selected

---刪除此表
20:18:53 SQL> drop table t_other purge;
 
Table dropped
 
Executed in 1.311 seconds
----又是哪些列發生了變化呢,flag,lru_flag,class,state,obj_flag,其它一些列的值初置為0,比如:tch
SQL> /
 
ADDR                   INDX    INST_ID HLADDR                BLSIZ NXT_HASH         PRV_HASH         NXT_REPL         PRV_REPL               FLAG      FLAG2      LOBID      RFLAG      SFLAG   LRU_FLAG        TS#      FILE#    DBARFIL     DBABLK      CLASS      STATE  MODE_HELD    CHANGES     CSTATE LE_ADDR          DIRTY_QUEUE SET_DS                  OBJ BA               CR_SCN_BAS CR_SCN_WRP CR_XID_USN CR_XID_SLT CR_XID_SQN CR_UBA_FIL CR_UBA_BLK CR_UBA_SEQ CR_UBA_REC     CR_SFL CR_CLS_BAS CR_CLS_WRP   LRBA_SEQ   LRBA_BNO   HSCN_BAS   HSCN_WRP   HSUB_SCN US_NXT           US_PRV           WA_NXT           WA_PRV           OQ_NXT           OQ_PRV           AQ_NXT           AQ_PRV             OBJ_FLAG        TCH        TIM   CR_RFCNT  SHR_RFCNT
---------------- ---------- ---------- ---------------- ---------- ---------------- ---------------- ---------------- ---------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- ----------- ---------------- ---------- ---------------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------------- ---------- ---------- ---------- ---------- ----------
000000001EEA6D00        389          1 000007FFFB255BD8       8192 000007FFFB25D148 000007FFFB25D148 000007FFE7FCAB40 000007FFE5FCBAB0          0          0          0          0          0          4          8         10         10     220408          8          0          0          1          0 00                         0 000007FFFBDA5978      67419 000007FFE7A9C000          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0 000007FFE7FCABA8 000007FFE7FCABA8 000007FFE7FCABB8 000007FFE7FCABB8 000007FFE7FCAC98 000007FFE7FCAC98 000007FFE7FCACA8 000007FFE7FCACA8        240          0 4294967295          0          0
000000001EEA6D00       1133          1 000007FFFB355DC0       8192 000007FFFB35D8C8 000007FFFB35D8C8 000007FF67F66100 000007FFE7F808F0          0          0          0          0          0          4          8         10         10     220413          1          0          0          1          0 00                         0 000007FFFBDA4BD8      67419 000007FFE72C6000          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0 000007FFE7F80498 000007FFE7F80498 000007FFE7F804A8 000007FFE7F804A8 000007FFE7F80588 000007FFE7F80588 000007FFE7F80598 000007FFE7F80598        240          0 4294967295          0          0
000000001EEA6D00       2370          1 000007FFFB4FA9B8       8192 000007FFE7F808B8 000007FFFB4FF248 000007FFE7FCAC70 000007FFFBDA5E40          0          0          0          0          0          4          8         10         10     220410          4          0          0          1          0 00                         0 000007FFFBDA5978      67419 000007FFE5AB4000          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0 000007FFE5FCB9E8 000007FFE5FCB9E8 000007FFE5FCB9F8 000007FFE5FCB9F8 000007FFE5FCBAD8 000007FFE5FCBAD8 000007FFE5FCBAE8 000007FFE5FCBAE8        240          0 4294967295          0          0
000000001EEA6BB8       2371          1 000007FFFB4FA9B8       8192 000007FFFB4FF248 000007FFE5FCBA78 000007FFE7F80560 000007FFFBDA50A0          0          0          0          0          0          4          8         10         10     220410          4          0          0          1          0 00                         0 000007FFFBDA4BD8      67419 000007FFE72CC000          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0 000007FFE7F80828 000007FFE7F80828 000007FFE7F80838 000007FFE7F80838 000007FFE7F80918 000007FFE7F80918 000007FFE7F80928 000007FFE7F80928        240          0 4294967295          0          0
000000001EEA6D00       3128          1 000007FFFB5FABA0       8192 000007FFFB5FF9C8 000007FFFB5FF9C8 000007FF67FAF3E0 000007FFE7FCAB40          0          0          0          0          0          4          8         10         10     220415          1          0          0          0          4 00                         0 000007FFFBDA5978      67419 000007FFE7A98000          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0 000007FFE7FCA948 000007FFE7FCA948 000007FFE7FCA958 000007FFE7FCA958 000007FFE7FCAA38 000007FFE7FCAA38 000007FFE7FCAA48 000007FFE7FCAA48        240          0 4294967295          0          0
000000001EEA6D00       4353          1 000007FFFB7976D0       8192 000007FFFB79E148 000007FFFB79E148 000007FF67FD3D50 000007FFFBDA6510          0          0          0          0          0          4          8         10         10     220412          1          0          0          1          0 00                         0 000007FFFBDA6048      67419 000007FFE7E72000          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0 000007FFE7FEF2B8 000007FFE7FEF2B8 000007FFE7FEF2C8 000007FFE7FEF2C8 000007FFE7FEF3A8 000007FFE7FEF3A8 000007FFE7FEF3B8 000007FFE7FEF3B8        240          0 4294967295          0          0
000000001EEA6D00       5550          1 000007FFFB93C2C8       8192 000007FFFB93FAC8 000007FFFB93FAC8 000007FFE7FA5BE0 000007FFFBDA5770          0          0          0          0          0          4          8         10         10     220409          9          0          0          1          0 00                         0 000007FFFBDA52A8      67419 000007FFE76BC000          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0 000007FFE7FA5EA8 000007FFE7FA5EA8 000007FFE7FA5EB8 000007FFE7FA5EB8 000007FFE7FA5F98 000007FFE7FA5F98 000007FFE7FA5FA8 000007FFE7FA5FA8        240          0 4294967295          0          0
000000001EEA6D00       6314          1 000007FFFBA3C4B0       8192 000007FFFBA40248 000007FFFBA40248 000007FF67F8AA70 000007FFE7FA5F70          0          0          0          0          0          4          8         10         10     220414          1          0          0          1          0 00                         0 000007FFFBDA52A8      67419 000007FFE76B6000          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0 000007FFE7FA5B18 000007FFE7FA5B18 000007FFE7FA5B28 000007FFE7FA5B28 000007FFE7FA5C08 000007FFE7FA5C08 000007FFE7FA5C18 000007FFE7FA5C18        240          0 4294967295          0          0
000000001EEA6D00       7524          1 000007FFFBBD90A8       8192 000007FFFBBDE9C8 000007FFFBBDE9C8 000007FFE7FCAA10 000007FFE7FCAC70          0          0          0          0          0          4          8         10         10     220411          1          0          0          1          0 00                         0 000007FFFBDA5978      67419 000007FFE7A9A000          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0          0 000007FFE7FCAA78 000007FFE7FCAA78 000007FFE7FCAA88 000007FFE7FCAA88 000007FFE7FCAB68 000007FFE7FCAB68 000007FFE7FCAB78 000007FFE7FCAB78        240          0 4294967295          0          0
 
9 rows selected

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9240380/viewspace-753459/,如需轉載,請註明出處,否則將追究法律責任。

相關文章