20161114File Space Bitmap Block修復機制2
[20161114]File Space Bitmap Block修復機制2.txt
--前幾天在測試File Space Bitmap Block時執行了,execute dbms_space_admin.TABLESPACE_REBUILD_BITMAPS('SUGAR')
--這樣點陣圖區全部設定為1,顯示都是F。
--上次提到,execute dbms_space_admin.TABLESPACE_REBUILD_BITMAPS('SUGAR')會修改點陣圖區全部設定為1,顯示都是F。
--而記憶體中相應資料塊是正確的,只要執行alter system checkpoint;就會"糾正這個錯誤".我還做了1個極端測試,就是
--execute dbms_space_admin.TABLESPACE_REBUILD_BITMAPS('SUGAR')後,另外一個會話強制執行shutdown abort。
--測試這個時候備份的情況,忘記先drop表了,補充測試.
1.環境:
SCOTT@book> @ &r/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
CREATE TABLESPACE SUGAR DATAFILE
'/mnt/ramdisk/book/sugar01.dbf' SIZE 40M AUTOEXTEND ON NEXT 16M MAXSIZE UNLIMITED
LOGGING
ONLINE
EXTENT MANAGEMENT LOCAL AUTOALLOCATE
BLOCKSIZE 8K
SEGMENT SPACE MANAGEMENT AUTO
FLASHBACK ON;
create table t1 tablespace sugar as select rownum id ,lpad('A',32,'A') name from dual connect by level<=1e5;
--建立大小5M的表。
create table t2 tablespace sugar as select rownum id ,lpad('B',32,'B') name from dual connect by level<=2e5;
create table t3 tablespace sugar as select rownum id ,lpad('C',32,'C') name from dual connect by level<=2e5;
alter system checkpoint;
2.做一個極端測試:
drop table t1 purge ;
drop table t2 purge ;
drop table t3 purge ;
SYS@book> execute dbms_space_admin.TABLESPACE_REBUILD_BITMAPS('SUGAR');
PL/SQL procedure successfully completed.
SYS@book> shutdown abort
ORACLE instance shut down.
$ bvi -b 24576 -s 8192 /mnt/ramdisk/book/sugar01.dbf
00006000 1E A2 00 00 03 00 80 01 55 46 62 00 00 00 01 04 79 41 00 00 06 00 00 00 80 00 00 00 00 00 00 00 ........UFb.....yA..............
00006020 00 F8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF FF FF FF FF FF FF ................................
00006040 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................................
00006060 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................................
00006080 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................................
000060A0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................................
000060C0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................................
000060E0 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................................
00006100 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................................
00006120 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF ................................
--可以發現是FF。然後重新啟動資料庫到mount狀態。
SYS@book> startup mount
ORACLE instance started.
Total System Global Area 634732544 bytes
Fixed Size 2255792 bytes
Variable Size 197133392 bytes
Database Buffers 427819008 bytes
Redo Buffers 7524352 bytes
Database mounted.
RMAN> backup datafile 6 format '/u01/backup/d6_A.bak' ;
Starting backup at 2016-11-14 14:56:06
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/mnt/ramdisk/book/sugar01.dbf
channel ORA_DISK_1: starting piece 1 at 2016-11-14 14:56:07
channel ORA_DISK_1: finished piece 1 at 2016-11-14 14:56:08
piece handle=/u01/backup/d6_A.bak tag=TAG20161114T145607 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2016-11-14 14:56:08
$ ls -l /u01/backup/d6_A.bak
-rw-r----- 1 oracle oinstall 26066944 2016-11-14 14:56:07 /u01/backup/d6_A.bak
--大小26066944/1024/1024=24.859375M,可以發現備份時依賴這個點陣圖區掃描。
--注:前面的分析有誤,感謝別人糾正這個錯誤,做測試太不嚴謹了,我前面的測試實際上oracle對null block是不備份的的。
$ strings /u01/backup/d6_A.bak | grep 'AAAAAAAAAAAAA' |wc
100000 170040 3624269
$ strings /u01/backup/d6_A.bak | grep 'BBBBBBBBBBBBB' |wc
200000 340080 7243655
$ strings /u01/backup/d6_A.bak | grep 'CCCCCCCCCCCCC' |wc
200000 340080 7243655
SYS@book> alter database open ;
Database altered.
SYS@book> alter system checkpoint;
System altered.
$ bvi -b 24576 -s 8192 /mnt/ramdisk/book/sugar01.dbf
00006000 1E A2 00 00 03 00 80 01 57 46 62 00 00 00 01 04 79 41 00 00 06 00 00 00 80 00 00 00 00 00 00 00 ........WFb.....yA..............
00006020 00 00 00 00 00 F8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
00006040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
00006060 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
00006080 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
000060A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
000060C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
000060E0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................................
--很奇怪這次點陣圖區修復了。是否drop table t1 purge時沒有寫盤。重複測試在drop完成後加入檢查點,這樣建表是沒有問題的。
RMAN> backup datafile 6 format '/u01/backup/d6_B.bak' ;
Starting backup at 2016-11-14 15:03:06
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=1 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/mnt/ramdisk/book/sugar01.dbf
channel ORA_DISK_1: starting piece 1 at 2016-11-14 15:03:07
channel ORA_DISK_1: finished piece 1 at 2016-11-14 15:03:08
piece handle=/u01/backup/d6_B.bak tag=TAG20161114T150306 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2016-11-14 15:03:08
$ ls -l /u01/backup/d6_B.bak
-rw-r----- 1 oracle oinstall 1089536 2016-11-14 15:03:07 /u01/backup/d6_B.bak
--可以發現這次備份不僅僅1M上下。
SCOTT@book> create table t4 tablespace sugar as select rownum id ,lpad('D',32,'D') name from dual connect by level<=1e5;
Table created.
3.重新測試再drop後加入檢查點:
--步驟參考上面。僅僅在drop後加入alter system checkpoint;
--建立表空間,建表t1,t2,t3,
drop table t1 purge ;
drop table t2 purge ;
drop table t3 purge ;
alter system checkpoint;
SYS@book> execute dbms_space_admin.TABLESPACE_REBUILD_BITMAPS('SUGAR');
PL/SQL procedure successfully completed.
SYS@book> shutdown abort
ORACLE instance shut down.
--
SYS@book> startup
ORACLE instance started.
Total System Global Area 634732544 bytes
Fixed Size 2255792 bytes
Variable Size 197133392 bytes
Database Buffers 427819008 bytes
Redo Buffers 7524352 bytes
Database mounted.
Database opened.
SCOTT@book> create table t4 tablespace sugar as select rownum id ,lpad('D',32,'D') name from dual connect by level<=1e5;
create table t4 tablespace sugar as select rownum id ,lpad('D',32,'D') name from dual connect by level<=1e5
*
ERROR at line 1:
ORA-00600: internal error code, arguments: [ktfbbssearch-9], [0], [624], [63488], [], [], [], [], [], [], [], []
--確實如此。
RMAN> backup datafile 6 format '/u01/backup/d6_C.bak' ;
Starting backup at 2016-11-14 15:23:58
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=46 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/mnt/ramdisk/book/sugar01.dbf
channel ORA_DISK_1: starting piece 1 at 2016-11-14 15:23:59
channel ORA_DISK_1: finished piece 1 at 2016-11-14 15:24:00
piece handle=/u01/backup/d6_C.bak tag=TAG20161114T152359 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2016-11-14 15:24:00
$ ls -l /u01/backup/d6_C.bak
-rw-r----- 1 oracle oinstall 26066944 2016-11-14 15:24:00 /u01/backup/d6_C.bak
--可以發現備份達到25M。
SYS@book> execute dbms_space_admin.TABLESPACE_REBUILD_BITMAPS('SUGAR');
PL/SQL procedure successfully completed.
RMAN> backup datafile 6 format '/u01/backup/d6_D.bak' ;
Starting backup at 2016-11-14 15:25:05
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00006 name=/mnt/ramdisk/book/sugar01.dbf
channel ORA_DISK_1: starting piece 1 at 2016-11-14 15:25:05
channel ORA_DISK_1: finished piece 1 at 2016-11-14 15:25:06
piece handle=/u01/backup/d6_D.bak tag=TAG20161114T152505 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 2016-11-14 15:25:06
$ ls -l /u01/backup/d6_D.bak
-rw-r----- 1 oracle oinstall 1089536 2016-11-14 15:25:05 /u01/backup/d6_D.bak
--修復後一切正常,再次說明備份透過讀取資料檔案的問題資訊,確定讀取的資料塊。而前一次測試存在錯誤。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/267265/viewspace-2128411/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [20161111File Space Bitmap Block修復機制BloC
- 1108File Space Bitmap Block損壞能修復嗎2BloC
- 1104File Space Bitmap Block損壞能修復嗎BloC
- 1110File Space Bitmap Block損壞能修復嗎3BloC
- 2_深入解析Oracle ASSM結構之Level 2 Bitmap BlockOracleSSMBloC
- Checkpoint log:invalid bitmap page錯誤修復
- Objective-C block 實現機制ObjectBloC
- Availability and Optimization of Free Space in a Data Block(五)AIBloC
- Availability and Compression of Free Space in a Data BlockAIBloC
- BBED (Oracle Block Brower and EDitor Tool) :資料塊修復工具OracleBloC
- mongoDB當機修復MongoDB
- iOS __block修飾符iOSBloC
- 手機SD卡修復SD卡
- Android圖片編碼機制(Bitmap,Skia,libJpeg)Android
- [20201222]KTFB Bitmapped File Space Bitmap的恢復.txtAPP
- 【BBED】使用bbed解決 the amount of space used is not equal to block sizeBloC
- 【Flink入門修煉】2-3 Flink Checkpoint 原理機制
- 安全模式如何修復電腦 開機如何進入系統修復模式
- rman 恢復機制與恢復測試
- InnoDB 崩潰恢復機制
- Oracle例項恢復機制Oracle
- struts2架構網站漏洞修復詳情與利用漏洞修復方案架構網站
- 二進位制修復中文亂碼的問題
- RocketMQ(4.8.0)——Broker 的關機恢復機制MQ
- win10自動修復無法修復你的電腦 華碩win10自動修復無法開機Win10
- PrestaShop網站漏洞修復如何修復REST網站
- win10開機轉圈卡死如何修復 win10開機轉圈卡死修復的方法Win10
- 【MySQL(2)| MySQL索引機制】MySql索引
- oracle工作機制(2)Oracle
- 電腦開機提示自動修復解決方法 電腦開機提示自動修復怎麼辦?
- Oracle 11g ADG Automatic Block Repair(ABMR自動塊修復)功能測試OracleBloCAI
- 修復IAT
- 從dataguard備份的恢復機制
- MongoDB副本集故障恢復機制概述MongoDB
- Android熱修復原理(一)熱修復框架對比和程式碼修復Android框架
- win10一直卡在磁碟修復怎麼修復_win10一直卡在磁碟修復開不了機如何處理Win10
- XTTS全備開啟BCT後等待事件 block change tracking buffer spaceTTS事件BloC
- yii2 快取機制快取