關於資料庫丟失控制檔案的測試
資料庫丟失控制檔案的情況有幾種:
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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 丟失一個控制檔案並恢復資料庫資料庫
- 恢復測試:擁有當時的全部歸檔,控制檔案,恢復丟失的資料檔案。
- 【原創】模擬控制檔案丟失的資料庫恢復資料庫
- 新建的表空間(或資料檔案)丟失以及控制檔案丟失,有新建表空間(或資料檔案)前的控制文
- 引數檔案控制檔案和資料檔案丟失的恢復
- 關於丟失表空間資料檔案的處理方式
- 重建控制檔案,並且不乾淨的關閉資料庫測試資料庫
- rman恢復:資料檔案丟失,控制檔案丟失,聯機日誌檔案丟失(非當前使用與當前使用)
- 恢復丟失的控制檔案
- dataguard之物理備庫丟失資料檔案
- 控制檔案丟失恢復
- 【控制檔案丟失恢復】
- 關於using backup controlfile(丟失控制檔案和資料檔案)
- 資料檔案丟失的恢復
- Sql Server資料庫檔案丟失的恢復方法SQLServer資料庫
- . 資料庫臨時表空間的資料檔案的丟失資料庫
- 控制檔案全部丟失的恢復
- 控制檔案部分丟失的恢復
- 控制檔案丟失的RMAN恢復
- 資料檔案損壞、丟失
- 模擬資料檔案丟失
- 完全恢復之所有資料庫檔案丟失資料庫
- 資料庫各種檔案丟失恢復大全。資料庫
- 無備份丟失部分資料檔案和控制檔案恢復 [轉]
- UNDO表空間資料檔案丟失處理(二)正常關閉資料庫資料庫
- MongoDB資料庫報錯,資料庫檔案丟失資料恢復案例MongoDB資料庫資料恢復
- 控制檔案丟失恢復(二)
- 控制檔案丟失處理方法
- 控制檔案全部丟失恢復
- 關於MySQL啟動時,丟失資料檔案不報錯的現象MySql
- oracle資料庫正常關閉狀態下丟失undo檔案的恢復Oracle資料庫
- DATA GUARD主庫丟失資料檔案的恢復(2)
- DATA GUARD主庫丟失資料檔案的恢復(3)
- DATA GUARD主庫丟失資料檔案的恢復(1)
- dfm檔案資料丟失問題
- 資料檔案丟失如何恢復
- 丟失已歸檔日誌檔案下恢復資料庫資料庫
- 資料庫啟動時丟失資料檔案模擬實驗資料庫