[20181207]12c bootstrap$段頭都會記錄在哪裡.txt
[20181207]12c bootstrap$段頭都會記錄在哪裡.txt
--//oracle資料庫啟動需要知道sys.bootstrap$段頭,一般會記錄在system檔案的檔案頭,可以透過內部檢視
--//x$kcvfh.FHRDB顯示,而12c呢? 先來看看11g的情況:
1. 環境:
SCOTT@book> @ 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
SYS@book> select fhrdb,fhfno,hxfnm from x$kcvfh order by 2;
FHRDB FHFNO HXFNM
---------- ---------- ----------------------------------------
4194824 1 /mnt/ramdisk/book/system01.dbf
0 2 /mnt/ramdisk/book/sysaux01.dbf
0 3 /mnt/ramdisk/book/undotbs01.dbf
0 4 /mnt/ramdisk/book/users01.dbf
0 5 /mnt/ramdisk/book/example01.dbf
0 6 /mnt/ramdisk/book/tea01.dbf
6 rows selected.
--//可以發現僅僅記錄在file#=1的system表空間(你可以往系統表空間裡面加入資料檔案,可以發現僅僅file#=1記錄這個資訊)
--//貼一個生產系統的例子:
SYS@dbcn1> select fhrdb,fhfno,hxfnm from x$kcvfh where hxfnm like '%system%' order by 2;
FHRDB FHFNO HXFNM
---------- ---------- --------------------------------------------------
4194824 1 +DATAC1/XxXX/datafile/system.308.862160493
0 29 +DATAC1/Xxxx/datafile/system01.bdf
--//4194824= alter system dump datafile 1 block 520
--//透過bbed觀察也可以驗證上面的情況:
BBED> set dba 4194824
DBA 0x00400208 (4194824 1,520)
BBED> set dba 1,1
DBA 0x00400001 (4194305 1,1)
BBED> p dba 1,1 kcvfh.kcvfhrdb
ub4 kcvfhrdb @96 0x00400208
BBED> set dba 0x00400208
DBA 0x00400208 (4194824 1,520)
BBED> p dba 2,1 kcvfh.kcvfhrdb
ub4 kcvfhrdb @96 0x00000000
--//資料檔案2為空.
SYS@book> select SEGMENT_NAME,HEADER_FILE,HEADER_BLOCK from dba_segments where segment_name='BOOTSTRAP$' and owner='SYS';
SEGMENT_NAME HEADER_FILE HEADER_BLOCK
-------------------- ----------- ------------
BOOTSTRAP$ 1 520
--//而12c,18c呢? 基本現在12c以上都建議使用pdb.
2.12c環境:
SCOTT@test01p> @ ver1
PORT_STRING VERSION BANNER CON_ID
------------------------------ -------------- -------------------------------------------------------------------------------- ----------
IBMPC/WIN_NT64-9.1.0 12.2.0.1.0 Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 0
2.測試:
SYS@test> SELECT rfile#,file#, CHECKPOINT_CHANGE#, CHECKPOINT_TIME,CREATION_CHANGE# , RESETLOGS_CHANGE#,status, CHECKPOINT_COUNT,fuzzy,name,tablespace_name FROM v$datafile_header ;
RFILE# FILE# CHECKPOINT_CHANGE# CHECKPOINT_TIME CREATION_CHANGE# RESETLOGS_CHANGE# STATUS CHECKPOINT_COUNT FUZ NAME TABLESPACE_NAME
------ ----- ------------------ ------------------- ---------------- ----------------- ------ ---------------- --- -------------------------------------------------- -------------------
1 1 2393063 2018-10-16 20:20:13 9 1 ONLINE 92 YES D:\APP\ORACLE\ORADATA\TEST\SYSTEM01.DBF SYSTEM
1 2 1102125 2018-10-06 23:24:44 227 1 ONLINE 37 NO D:\APP\ORACLE\ORADATA\TEST\PDBSEED\SYSTEM01.DBF SYSTEM
3 3 2393063 2018-10-16 20:20:13 4748 1 ONLINE 92 YES D:\APP\ORACLE\ORADATA\TEST\SYSAUX01.DBF SYSAUX
4 4 1102125 2018-10-06 23:24:44 4762 1 ONLINE 37 NO D:\APP\ORACLE\ORADATA\TEST\PDBSEED\SYSAUX01.DBF SYSAUX
5 5 2393063 2018-10-16 20:20:13 6090 1 ONLINE 92 YES D:\APP\ORACLE\ORADATA\TEST\UNDOTBS01.DBF UNDOTBS1
6 6 1102125 2018-10-06 23:24:44 6212 1 ONLINE 37 NO D:\APP\ORACLE\ORADATA\TEST\PDBSEED\UNDOTBS01.DBF UNDOTBS1
7 7 2393063 2018-10-16 20:20:13 28597 1 ONLINE 91 YES D:\APP\ORACLE\ORADATA\TEST\USERS01.DBF USERS
1 8 2394047 2018-10-16 20:22:11 1103550 1 ONLINE 71 YES D:\APP\ORACLE\ORADATA\TEST\TEST01P\SYSTEM01.DBF SYSTEM
4 9 2394047 2018-10-16 20:22:11 1103553 1 ONLINE 71 YES D:\APP\ORACLE\ORADATA\TEST\TEST01P\SYSAUX01.DBF SYSAUX
6 10 2394047 2018-10-16 20:22:11 1103555 1 ONLINE 71 YES D:\APP\ORACLE\ORADATA\TEST\TEST01P\UNDOTBS01.DBF UNDOTBS1
11 11 2394047 2018-10-16 20:22:11 1105613 1 ONLINE 70 YES D:\APP\ORACLE\ORADATA\TEST\TEST01P\USERS01.DBF USERS
11 rows selected.
--//file#=1,2,8屬於system表空間.
SYS@test> select fhrdb,fhfno from x$kcvfh order by 2;
FHRDB FHFNO
------------ ------------
4194824 1
4194824 2
0 3
4194824 4
0 5
4194824 6
0 7
4194824 8
4194824 9
4194824 10
4194824 11
11 rows selected.
--//而12c呢,PDB的資料檔案全部有,file#=4對應PDB=PDBSEED的SYSAUX表空間的資料檔案.
--//file#=6對應PDB=PDBSEED的UNDOTBS1表空間資料檔案.
--//也就是file# 3,5,7沒有,這些都是cdb下的資料檔案.
SYS@test> @ dfb10 4194824
RFILE# BLOCK#
------------ ------------
1 520
TEXT
------------------------------------------------------------
alter system dump datafile 1 block 520 ;
3.使用bbed驗證看看:
--//windows 下 bbed無法識別資料檔案的OS塊頭,存在1個塊的偏移,看資料檔案頭塊要+1.
BBED> p dba 1,2 kcvfh.kcvfhrdb
ub4 kcvfhrdb @96 0x00400208
BBED> p dba 2,2 kcvfh.kcvfhrdb
ub4 kcvfhrdb @96 0x00400208
BBED> p dba 4,2 kcvfh.kcvfhrdb
ub4 kcvfhrdb @96 0x00400208
BBED> p dba 6,2 kcvfh.kcvfhrdb
ub4 kcvfhrdb @96 0x00400208
BBED> p dba 8,2 kcvfh.kcvfhrdb
ub4 kcvfhrdb @96 0x00400208
BBED> p dba 9,2 kcvfh.kcvfhrdb
ub4 kcvfhrdb @96 0x00400208
BBED> p dba 10,2 kcvfh.kcvfhrdb
ub4 kcvfhrdb @96 0x00400208
BBED> p dba 11,2 kcvfh.kcvfhrdb
ub4 kcvfhrdb @96 0x00400208
BBED> set dba 0x00400208
DBA 0x00400208 (4194824 1,520)
--//都是0x00400208,對應dba就是1,520,也就是bootstrap$的位置.
--//在cdb下檢視:
SYS@test> select header_file,header_block from dba_segments where owner='SYS' and segment_name='BOOTSTRAP$';
HEADER_FILE HEADER_BLOCK
------------ ------------
1 520
--//在PDB=test01p下檢視:
SCOTT@test01p> select header_file,header_block from dba_segments where owner='SYS' and segment_name='BOOTSTRAP$';
HEADER_FILE HEADER_BLOCK
----------- ------------
8 520
--//12c為什麼這樣設計,搞不懂.
4.再看看18c的情況:
SYS@orclcdb> select banner from v$version where rownum<=1;
BANNER
--------------------------------------------------------------------------------
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
SYS@orclcdb> column name format a80
SYS@orclcdb> SELECT rfile#,file#, CHECKPOINT_CHANGE#, CHECKPOINT_TIME,CREATION_CHANGE# , RESETLOGS_CHANGE#,status, CHECKPOINT_COUNT,fuzzy,name,tablespace_name FROM v$datafile_header where TABLESPACE_NAME='SYSTEM';
RFILE# FILE# CHECKPOINT_CHANGE# CHECKPOINT_TIME CREATION_CHANGE# RESETLOGS_CHANGE# STATUS CHECKPOINT_COUNT FUZ NAME TABLESPACE_NAME
---------- ---------- ------------------ ------------------- ---------------- ----------------- ------ ---------------- --- -------------------------------------------------------------------------------- --------------------
1 1 1342732614 2018-12-07 07:07:04 8 1477662 ONLINE 2471 YES +DATA/ORCLCDB/DATAFILE/system.273.985030351 SYSTEM
1 5 1557588 2018-08-24 19:45:15 1508071 1477662 ONLINE 11 NO +DATA/ORCLCDB/64A52F53A7693286E053CDA9E80AED76/DATAFILE/system.270.985030667 SYSTEM
1 38 1342732614 2018-12-07 07:07:04 1314973853 1477662 ONLINE 907 YES +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/system.275.985549575 SYSTEM
SYS@orclcdb> column HXFNM format a82
SYS@orclcdb> select fhrdb,fhfno,hxfnm from x$kcvfh where FHRDB=4194824;
FHRDB FHFNO HXFNM
---------- ---------- ----------------------------------------------------------------------------------
4194824 1 +DATA/ORCLCDB/DATAFILE/system.273.985030351
4194824 5 +DATA/ORCLCDB/64A52F53A7693286E053CDA9E80AED76/DATAFILE/system.270.985030667
4194824 6 +DATA/ORCLCDB/64A52F53A7693286E053CDA9E80AED76/DATAFILE/sysaux.269.985030667
4194824 8 +DATA/ORCLCDB/64A52F53A7693286E053CDA9E80AED76/DATAFILE/undotbs1.267.985030667
4194824 38 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/system.275.985549575
4194824 39 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/sysaux.278.985549575
4194824 40 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/undotbs1.277.985549575
4194824 41 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/users.276.985549575
4194824 42 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy.279.985551679
4194824 43 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_05.281.985551715
4194824 44 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_06.280.985551731
4194824 45 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_07.282.985551735
4194824 46 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_08.283.985551737
4194824 47 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_09.284.985551757
4194824 48 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_10.285.985551797
4194824 49 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_11.289.985551845
4194824 50 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_12.290.985551895
4194824 51 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_13.291.985551949
4194824 52 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_14.292.985552009
4194824 53 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_15.293.985552077
4194824 54 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_16.294.985552149
4194824 55 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_17.295.985552231
4194824 56 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_18.296.985552313
4194824 57 +DATA/ORCLCDB/74A69DC145F5662BE0558253DD747177/DATAFILE/xx_yyyy_indx.297.985553863
24 rows selected.
SYS@orclcdb> select fhrdb,fhfno,hxfnm from x$kcvfh where FHRDB<>4194824;
FHRDB FHFNO HXFNM
---------- ---------- ----------------------------------------------------------------------------------
0 3 +DATA/ORCLCDB/DATAFILE/sysaux.259.985030395
0 4 +DATA/ORCLCDB/DATAFILE/undotbs1.271.985030421
0 7 +DATA/ORCLCDB/DATAFILE/users.260.985030421
--//可以發現僅僅cdb下的除了FHFNO=1,其它檔案頭沒有寫入root_rdba資訊,剩下的資料檔案頭都寫入root_rdba資訊.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2284478/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20181021]臨時表lob段建立在哪裡.txt
- [20180612]刪除bootstrap$記錄無法啟動.txtboot
- [20200423]12c刪除不需要的記錄.txt
- [20190505]ts 命令在哪裡.txt
- [20181207]sqlplus下顯示資料精度.txtSQL
- [20201104]磁碟空間消耗在哪裡.txt
- python工作目錄在哪裡Python
- [20210412]分析會話佔用的共享記憶體段.txt會話記憶體
- [20211021]關於undo段頭事務表.txt
- 億萬富翁的財富都集中在哪裡?
- [20210902]為什麼會使用多個共享記憶體段.txt記憶體
- win10錄影在哪裡_win10開啟攝像頭錄影的步驟Win10
- [20210421]分析會話佔用的共享記憶體段2.txt會話記憶體
- 電腦微信聊天記錄在哪個資料夾裡面
- 線段 做題記錄
- [Bootstrap 5 學習記錄](一)搭建框架boot框架
- 【Bootstrap5】精細學習記錄boot
- python模組安裝目錄在哪裡Python
- 膝上型電腦攝像頭怎麼開啟 筆記本攝像頭設定在哪裡筆記
- [20191213]共享池繫結變數的值在哪裡.txt變數
- [20210325]SCHEDULER$_PROGRAM_ARG SCHEDULER$_JOB_ARG在哪裡.txt
- 被 C# 的 ThreadStatic 標記的靜態變數,都存放在哪裡了?C#thread變數
- [20190104]ipcs檢視共享記憶體段.txt記憶體
- [20210429]檔案頭塊不會快取.txt快取
- [20180614]刪除bootstrap$記錄無法啟動2boot
- win10錄製的視訊在哪裡_win10錄屏在哪個資料夾Win10
- win10錄製的影片在哪裡_win10錄屏在哪個資料夾Win10
- [20220610]tmux記錄操作內容.txtUX
- Win10攝像頭如何開啟_WIN10攝像頭在哪裡Win10
- [20181026]12c Attribute Clustering特性.txt
- 12C SQL Translation Framework.txtSQLFramework
- [20181010]12c clone pdb.txt
- [20190524]DISABLE TABLE LOCK(12c).txt
- [20190703]12c Hybrid histogram.txtHistogram
- [20190624]12c group by優化 .txt優化
- [20210119]sqlplus 12c LOBPREFETCH.txtSQL
- [20191216]共享池繫結變數的值在哪裡2.txt變數
- 透過DNS TXT記錄執行powershellDNS