關於資料庫丟失控制檔案的測試
資料庫丟失控制檔案的情況有幾種:
1.刪除
2.重新命名
3.清空
4.控制檔案所在的磁碟損壞.
另外,資料庫的控制檔案可能會有兩個、三個或多個的情況.
下面是我的測試結果
1.刪除
如果是刪除的話,如果刪除掉一個或者都刪掉,資料庫不會宕,依舊會正常執行,一直到下次重啟的時候,資料庫在檢查丟失控制檔案會報錯然後無法啟動,需要恢復;因此,刪除控制檔案不會對當前的資料庫執行產生影響,但是需要注意下次重啟的時候會報錯並無法啟動。
2.重新命名
重新命名也不會影響當前資料庫的正常執行,並且資料庫會依舊更新重新命名後的那個檔案,這個應該是由於系統的inode沒有改變的緣故。
同樣的現象trace檔案也同樣出現,如果跟蹤了一個sid的trace,生成的trace檔案我們將其移到另一個目錄或者重新命名成另外一個檔案,只要跟蹤的那個sid不退出,資料庫依舊會寫重新命名後的那個trace檔案.
3.清空
清空控制檔案,無論是清空一個,還是清空所有的控制檔案,清空完成之後再執行一次alter system checkpoint;之後,資料庫就會宕掉,報如下的錯誤:
Sat Jan 7 18:31:59 2012
Hex dump of (file 0, block 1) in trace file /home/oracle/admin/TESTDB/bdump/testdb_ckpt_10207.trc
Corrupt block relative dba: 0x00000001 (file 0, block 1)
Completely zero block found during control file header read
Sat Jan 7 18:31:59 2012
Errors in file /home/oracle/admin/TESTDB/bdump/testdb_ckpt_10207.trc:
ORA-00202: control file: '/u01/oracle/TESTDB/cfile/ora_control1.ctl'
Sat Jan 7 18:31:59 2012
Errors in file /home/oracle/admin/TESTDB/bdump/testdb_ckpt_10207.trc:
ORA-00227: corrupt block detected in control file: (block 1, # blocks 1)
ORA-00202: control file: '/u01/oracle/TESTDB/cfile/ora_control1.ctl'
CKPT: terminating instance due to error 227
Instance terminated by CKPT, pid = 10207
4.控制檔案所在的磁碟損壞
無論有幾個控制檔案,兩個或者三個;在損壞的磁碟上的控制檔案有一個或者全部都在損壞的磁碟上,都會導致資料庫馬上宕掉。
同時在alert日誌中報如下的錯誤:
ORA-00206: error in writing (block 3, # blocks 1) of control file
ORA-00202: control file: '/u01/oracle/TESTDB/cfile/ora_control2.ctl'
ORA-27072: File I/O error
Linux Error: 5: Input/output error
Additional information: 4
Additional information: 3
Additional information: -1
ORA-00206: error in writing (block 3, # blocks 1) of control file
ORA-00202: control file: '/u01/oracle/TESTDB/cfile/ora_control1.ctl'
ORA-27072: File I/O error
Linux Error: 5: Input/output error
Additional information: 4
Additional information: 3
Additional information: -1
Sat Jan 7 15:22:55 2012
CKPT: terminating instance due to error 221
Instance terminated by CKPT, pid = 8601
在ckpt生成的trace檔案中生成下面的錯誤:
Dump file /home/oracle/admin/TESTDB/bdump/testdb_ckpt_10054.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
ORACLE_HOME = /home/oracle/oracle/product/10.2.0/db_1
System name: Linux
Node name: localhost.localdomain
Release: 2.6.9-89.0.0.0.1.ELhugemem
Version: #1 SMP Tue May 19 04:38:38 EDT 2009
Machine: i686
Instance name: TESTDB
Redo thread mounted by this instance: 1
Oracle process number: 7
Unix process pid: 10054, image: oracle@localhost.localdomain (CKPT)
*** 2012-01-07 18:03:28.521
*** SERVICE NAME:(SYS$BACKGROUND) 2012-01-07 18:03:28.518
*** SESSION ID:(165.1) 2012-01-07 18:03:28.517
ORA-00206: error in writing (block 3, # blocks 1) of control file
ORA-00202: control file: '/u01/oracle/TESTDB/cfile/ora_control1.ctl'
ORA-27072: File I/O error
Linux Error: 5: Input/output error
Additional information: 4
Additional information: 3
Additional information: -1
error 221 detected in background process
ORA-00221: error on write to control file
ORA-00206: error in writing (block 3, # blocks 1) of control file
ORA-00202: control file: '/u01/oracle/TESTDB/cfile/ora_control1.ctl'
ORA-27072: File I/O error
Linux Error: 5: Input/output error
Additional information: 4
Additional information: 3
Additional information: -1
關於磁碟損壞的測試是在vmware虛擬機器上進行,測試方法如下:
1.用虛擬機器單獨給linux系統新增一塊磁碟;
2.將磁碟mount到某一個檔案系統上,如/u01;
3.將控制檔案放在這個檔案系統/u01上;
4.啟動資料庫,之後進行模擬磁碟故障;
5.在虛擬機器上刪除硬碟。然後在linux系統中df -m雖然還能看到檔案系統線上,但其實已經相當於是磁碟損壞了.在刪除磁碟的同時,資料庫丟擲錯誤並abort.
6.模擬測試結束.
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23850820/viewspace-1057488/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 新建的表空間(或資料檔案)丟失以及控制檔案丟失,有新建表空間(或資料檔案)前的控制文
- 關於丟失表空間資料檔案的處理方式
- Sql Server資料庫檔案丟失的恢復方法SQLServer資料庫
- MongoDB資料庫報錯,資料庫檔案丟失資料恢復案例MongoDB資料庫資料恢復
- DATA GUARD主庫丟失資料檔案的恢復(3)
- DATA GUARD主庫丟失資料檔案的恢復(1)
- DATA GUARD主庫丟失資料檔案的恢復(2)
- 【資料庫資料恢復】Sql Server資料庫檔案丟失的資料恢復過程資料庫資料恢復SQLServer
- 電腦檔案丟失資料恢復資料恢復
- 資料庫資料恢復—MongoDB資料庫檔案丟失,啟動報錯的資料恢復案例資料庫資料恢復MongoDB
- 【資料庫資料恢復】mdb_catalog.wt檔案丟失的MongoDB資料恢復案例資料庫資料恢復MongoDB
- 關於資料庫壓力測試的故事資料庫
- Sqlserver系統資料庫和使用者資料庫日誌檔案全部丟失的恢復SQLServer資料庫
- 關於Docx動態控制word模板檔案的資料
- 2.5.10.2 關於資料庫時區檔案資料庫
- 關於 iconv 轉碼導致資料丟失的問題
- 檔案傳輸軟體如何有效防止資料丟失?
- macOS Big Sur系統如何恢復丟失的資料檔案?Mac
- TSPITR方式資料庫找回誤操作丟失的資料資料庫
- oracle控制檔案的損壞或完全丟失的恢復辦法Oracle
- 開源滲透測試工具--關於資料庫資料庫
- 關於大資料測試,你一定要試試python的fake庫大資料Python
- 關於 5月10號 資料丟失問題反饋
- Oracle undo 表空間資料檔案丟失強制啟動資料庫(沒有未提交的事務)Oracle資料庫
- 【資料庫資料恢復】LINUX EXT3檔案系統下ORACLE資料庫誤操作導致資料丟失的資料恢復案例資料庫資料恢復LinuxOracle
- 【北亞資料恢復】MongoDB資料遷移檔案丟失的MongoDB資料恢復案例資料恢復MongoDB
- 【伺服器資料恢復】xfs檔案系統資料丟失的資料恢復案例伺服器資料恢復
- ORA-1122/ORA-1208 資料檔案頭寫丟失故障
- Django資料庫連線丟失問題Django資料庫
- 檔案丟失不用怕:超實用的Mac資料恢復軟體!Mac資料恢復
- 華納雲:防止資料庫資料丟失的幾個方法資料庫
- 測試在丟失歸檔日誌的情況下,跳過部分歸檔日誌進行資料恢復資料恢復
- 3.1.2.1 關於資料庫初始化引數檔案和啟動的關係資料庫
- 丟失的隨身碟檔案如何恢復?
- 各個資料庫存二進位制大檔案的效能測試資料庫
- 救援丟失的Docx和Xlsx檔案的最佳方法
- 【資料庫資料恢復】斷電導致Oracle資料庫資料丟失的資料恢復案例資料庫資料恢復Oracle
- 基於linux系統,fsck後資料丟失的資料恢復方案Linux資料恢復
- oracle dg庫資料檔案建立失敗ORA-01111Oracle