10g中也存在著CACHE物件
對於Oracle獨一無二的cache物件,在Oracle9i中一直是bootstrap$的一個引導block.
通過system表空間資料檔案的File headers可以觀察到cache物件的rdba.
那麼這個特性在Oracle10g也是同樣被延續下來的:
$ sqlplus /nolog
SQL*Plus: Release 10.2.0.3.0 - Production on Sun Mar 23 18:21:57 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
SQL> conn / as sysdba;
Connected.
SQL> select comp_name,version from dba_registry;
COMP_NAME
----------------------------------------------------------------------------
VERSION
------------------------------
Oracle XML Database
10.2.0.3.0
Oracle Data Mining
10.2.0.3.0
OLAP Catalog
10.2.0.3.0
COMP_NAME
----------------------------------------------------------------------------
VERSION
------------------------------
Oracle Ultra Search
9.2.0.6.0
Oracle Text
10.2.0.3.0
Spatial
10.2.0.3.0
COMP_NAME
----------------------------------------------------------------------------
VERSION
------------------------------
Oracle interMedia
10.2.0.3.0
Oracle Workspace Manager
10.2.0.1.0
Oracle Database Catalog Views
10.2.0.3.0
COMP_NAME
----------------------------------------------------------------------------
VERSION
------------------------------
Oracle Database Packages and Types
10.2.0.3.0
JServer JAVA Virtual Machine
10.2.0.3.0
Oracle XDK
10.2.0.3.0
COMP_NAME
----------------------------------------------------------------------------
VERSION
------------------------------
Oracle Database Java Packages
10.2.0.3.0
OLAP Analytic Workspace
10.2.0.3.0
Oracle OLAP API
10.2.0.3.0
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Productio
NLSRTL Version 10.2.0.3.0 - Production
現在轉儲一下system表空間的檔案頭:
SQL>alter session set events 'immediate trace name file_hdrs level 10'
找到其中部分內容
V10 STYLE. FILE HEADER:
Software vsn=153092096=0x9200000, Compatibility Vsn=134217728=0x8000000
Db ID=3056348506=0xb62c2d5a, Db Name='IRMDB'
Activation ID=0=0x0
Control Seq=2151=0x867, File size=79360=0x13600
File Number=1, Blksiz=8192, File Type=3 DATA
Tablespace #0 - SYSTEM rel_fn:1
Creation at scn: 0x0000.0000000a 05/13/2002 02:16:30
Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0
reset logs count:0x25acbede scn: 0x0000.0002b85d reset logs terminal rcv data:0x0 scn: 0x0000.00000000
prev reset logs count:0x1b856fc9 scn: 0x0000.00000001 prev reset logs terminal rcv data:0x0 scn: 0x0000.00000000
recovered at 03/23/2008 14:56:50
status:0x4 root dba:0x004001a1 chkpt cnt: 615 ctl cnt:614
begin-hot-backup file size: 0
Checkpointed at scn: 0x0000.052d9d31 03/23/2008 17:06:54
thread:1 rba:(0x189.173b.10)
enabled threads: 01000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000
看到這裡有一個很重要的root dba:0x004001a1,通過root dba可以快速定位到bootstrap$的位置從而可以進一步通過recursive的SQL來在記憶體中建立物件從而來引導資料庫的open.
分解這個root dba發現指向的是CACHE物件。
SQL> select dbms_utility.data_block_address_file(to_number('4001a1','xxxxxx')) file#,
2 dbms_utility.data_block_address_block(to_number('4001a1','xxxxxx')) block#
3 from dual;
FILE# BLOCK#
---------- ----------
1 417
SQL> select segment_name,header_file,header_block from dba_segments
2 where segment_type='CACHE';
SEGMENT_NAME
--------------------------------------------------------------------------------
HEADER_FILE HEADER_BLOCK
----------- ------------
1.417
1 417
轉儲這個block
SQL> alter system dump datafile 1 block 417;
System altered.
......
Compatibility entry for 'COMPATSG':
Size: 24 Release 0x134217728 By 0x153092096
Dump of memory from 0x0000000110416034 to 0x0000000110416038
110416030 00000000 [....]
Compatibility entry for 'BOOTSTRP':
Size: 24 Release 0x134217728 By 0x153092096
Dump of memory from 0x000000011041604C to 0x0000000110416050
110416040 00400179 [.@.y]
Compatibility entry for 'UNDODATA':
Size: 36 Release 0x153092096 By 0x153092096
Dump of memory from 0x0000000110416064 to 0x0000000110416074
110416060 00000053 00435870 05246BAE [...S.CXp.$k.]
110416070 00003BC8 [..;.]
......
發現00400179這個dba就是指向bootstrap$
通過上面的方法也不難得出bootstrap$位於資料檔案1的第377個block
大體上就是這樣。
因此可以得出一個結論在open database時,首先需要通過直接路徑讀取system表空間的root dba,進而通過單塊讀來獲得datafile 1 block 417,並通過417塊找到377這個bootstrap$的段頭進而讀取其中的內容,在記憶體中建立資料物件.所以我們可以看到System表空間中的資料檔案是非常的重要。平時要做好備份,否則一旦損壞將很難恢復。
通過system表空間資料檔案的File headers可以觀察到cache物件的rdba.
那麼這個特性在Oracle10g也是同樣被延續下來的:
$ sqlplus /nolog
SQL*Plus: Release 10.2.0.3.0 - Production on Sun Mar 23 18:21:57 2008
Copyright (c) 1982, 2006, Oracle. All Rights Reserved.
SQL> conn / as sysdba;
Connected.
SQL> select comp_name,version from dba_registry;
COMP_NAME
----------------------------------------------------------------------------
VERSION
------------------------------
Oracle XML Database
10.2.0.3.0
Oracle Data Mining
10.2.0.3.0
OLAP Catalog
10.2.0.3.0
COMP_NAME
----------------------------------------------------------------------------
VERSION
------------------------------
Oracle Ultra Search
9.2.0.6.0
Oracle Text
10.2.0.3.0
Spatial
10.2.0.3.0
COMP_NAME
----------------------------------------------------------------------------
VERSION
------------------------------
Oracle interMedia
10.2.0.3.0
Oracle Workspace Manager
10.2.0.1.0
Oracle Database Catalog Views
10.2.0.3.0
COMP_NAME
----------------------------------------------------------------------------
VERSION
------------------------------
Oracle Database Packages and Types
10.2.0.3.0
JServer JAVA Virtual Machine
10.2.0.3.0
Oracle XDK
10.2.0.3.0
COMP_NAME
----------------------------------------------------------------------------
VERSION
------------------------------
Oracle Database Java Packages
10.2.0.3.0
OLAP Analytic Workspace
10.2.0.3.0
Oracle OLAP API
10.2.0.3.0
SQL> select * from v$version;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
PL/SQL Release 10.2.0.3.0 - Production
CORE 10.2.0.3.0 Production
TNS for IBM/AIX RISC System/6000: Version 10.2.0.3.0 - Productio
NLSRTL Version 10.2.0.3.0 - Production
現在轉儲一下system表空間的檔案頭:
SQL>alter session set events 'immediate trace name file_hdrs level 10'
找到其中部分內容
V10 STYLE. FILE HEADER:
Software vsn=153092096=0x9200000, Compatibility Vsn=134217728=0x8000000
Db ID=3056348506=0xb62c2d5a, Db Name='IRMDB'
Activation ID=0=0x0
Control Seq=2151=0x867, File size=79360=0x13600
File Number=1, Blksiz=8192, File Type=3 DATA
Tablespace #0 - SYSTEM rel_fn:1
Creation at scn: 0x0000.0000000a 05/13/2002 02:16:30
Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0
reset logs count:0x25acbede scn: 0x0000.0002b85d reset logs terminal rcv data:0x0 scn: 0x0000.00000000
prev reset logs count:0x1b856fc9 scn: 0x0000.00000001 prev reset logs terminal rcv data:0x0 scn: 0x0000.00000000
recovered at 03/23/2008 14:56:50
status:0x4 root dba:0x004001a1 chkpt cnt: 615 ctl cnt:614
begin-hot-backup file size: 0
Checkpointed at scn: 0x0000.052d9d31 03/23/2008 17:06:54
thread:1 rba:(0x189.173b.10)
enabled threads: 01000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000
看到這裡有一個很重要的root dba:0x004001a1,通過root dba可以快速定位到bootstrap$的位置從而可以進一步通過recursive的SQL來在記憶體中建立物件從而來引導資料庫的open.
分解這個root dba發現指向的是CACHE物件。
SQL> select dbms_utility.data_block_address_file(to_number('4001a1','xxxxxx')) file#,
2 dbms_utility.data_block_address_block(to_number('4001a1','xxxxxx')) block#
3 from dual;
FILE# BLOCK#
---------- ----------
1 417
SQL> select segment_name,header_file,header_block from dba_segments
2 where segment_type='CACHE';
SEGMENT_NAME
--------------------------------------------------------------------------------
HEADER_FILE HEADER_BLOCK
----------- ------------
1.417
1 417
轉儲這個block
SQL> alter system dump datafile 1 block 417;
System altered.
......
Compatibility entry for 'COMPATSG':
Size: 24 Release 0x134217728 By 0x153092096
Dump of memory from 0x0000000110416034 to 0x0000000110416038
110416030 00000000 [....]
Compatibility entry for 'BOOTSTRP':
Size: 24 Release 0x134217728 By 0x153092096
Dump of memory from 0x000000011041604C to 0x0000000110416050
110416040 00400179 [.@.y]
Compatibility entry for 'UNDODATA':
Size: 36 Release 0x153092096 By 0x153092096
Dump of memory from 0x0000000110416064 to 0x0000000110416074
110416060 00000053 00435870 05246BAE [...S.CXp.$k.]
110416070 00003BC8 [..;.]
......
發現00400179這個dba就是指向bootstrap$
通過上面的方法也不難得出bootstrap$位於資料檔案1的第377個block
大體上就是這樣。
因此可以得出一個結論在open database時,首先需要通過直接路徑讀取system表空間的root dba,進而通過單塊讀來獲得datafile 1 block 417,並通過417塊找到377這個bootstrap$的段頭進而讀取其中的內容,在記憶體中建立資料物件.所以我們可以看到System表空間中的資料檔案是非常的重要。平時要做好備份,否則一旦損壞將很難恢復。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12361284/viewspace-216926/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Cache Buffers chains,存在共享模式?AI模式
- 物件存在位置物件
- 是否存在JSON物件JSON物件
- 隨著區塊鏈錢包的不斷髮展,其存在形式也呈現多樣化區塊鏈
- 遇著個oracle 10g bugOracle 10g
- javascript,檢測object物件中是否存在某個屬性JavaScriptObject物件
- Oracle 10G中 EXP物件時報ORA-00932Oracle 10g物件
- 如何判斷Javascript物件是否存在JavaScript物件
- 俺也談談 library cache lock 等待事件事件
- 猴年春晚吉祥物遭網友吐槽 谷歌躺著也中槍谷歌
- 判斷objectStore物件倉庫是否存在Object物件
- 求助Vector物件的存取,著急啊!物件
- 如果引入的其他js檔案中也存在window.onload事件如何處理JS事件
- 寫Cache快取物件測試例項快取物件
- mysql 查詢,字串帶著空格也能匹配上MySql字串
- 盯著抖音做爆款,山寨也能 Top 1?
- Library cache pin/lock 在Oracle 10g的增強Oracle 10g
- ObjectStateManager 中已存在具有同一鍵的物件。ObjectStateManager 無法跟蹤具有相同鍵的多個物件Object物件
- 如何判斷一個jquery物件是否存在jQuery物件
- js如何判斷一個物件是否存在JS物件
- 常見問題--oracle物件不存在Oracle物件
- “網際網路+”的時代,易佳互聯也隨著時代步伐前進著
- 通過Cache::Memcached方式 例項物件應用物件
- 讓座席管理工作聽得見也看得著
- 使用PowerShell更新已存在的組設定物件物件
- 【跟著我們學Golang】之物件導向Golang物件
- 跟著老貓來搞GO,"物件導向"Go物件
- ejb 的session bean 和儲存在servlet session中的一個java物件有何不同?SessionBeanServletJava物件
- 刨根問底:物件也可以當方法用?物件
- Android的RadioButton隨著選中狀態的改變字型顏色也改變Android
- PHP artisan cache:clear 避免把使用者登入資訊也清空PHP
- oracle中extents存在的理由Oracle
- ORA-08103物件不再存在問題分析物件
- oracle 10G rac ORA-12545:因目標主機或物件不存在,連線失敗問題總結Oracle 10g物件
- Square Off智慧國際象棋:隔著地球也能對戰下棋
- http header中cache設定HTTPHeader
- iOS 當中的 Cache 設計iOS
- Oracle中sequence cache的測試Oracle