斷電引起ora-01200的資料庫恢復
一個10g的庫斷電後,開啟時出現ora-01200的錯誤:
SQL> connect / as sysdba;
已連線到空閒例程。
SQL> startup;
ORACLE 例程已經啟動。
Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 155192196 bytes
Database Buffers 448790528 bytes
Redo Buffers 7135232 bytes
資料庫裝載完畢。
ORA-01122: 資料庫檔案 17 驗證失敗
ORA-01110: 資料檔案 17: 'D:ORACLEPRODUCT10.2.0ORADATAORCLZL9EPRDAT.DBF'
ORA-01200: 255360 的實際檔案大小小於 264960 塊的正確大小
ORA-01200錯誤的官方解釋如下:
ORA-01200 actual file size of string is smaller than correct size of string blocks
Cause: The size of the file as returned by the operating system is smaller than the size of the file as indicated in the file header and the control file. Somehow the file has been truncated. Maybe it is the
result of a half completed copy.
Action: Restore a good copy of the datafile and do recovery as needed.
意思是說只有找備份進行恢復.看來問題比較嚴重, 這個檔案中儲存中ZLHIS的病歷資料,丟失了對客戶的損失太大. 作業系統的檔案大小小於資料檔案頭記錄的大小,我們可否在資料檔案末尾"增加"一段空的位元組呢?在linux下可以使用dd命令產生這種檔案,再附加到資料檔案末尾.windows下也提供了一個fsutil命令,可以用來產生指定位元組數的空檔案.
--1.首先需要計算,空檔案的位元組數:
(264960-255360) * 8192 = 78643200
--2.產生一個指定位元組數的空檔案.
C:Documents and SettingsAdministrator>fsutil file createnew c:append.dbf 78643200
已建立檔案 c:append.dbf
--3.附加到資料檔案末尾
C:Documents and SettingsAdministrator>type c:append.dbf >>D:ORACLEPRODUCT
10.2.0ORADATAORCLZL9EPRDAT.DBF
經過這麼處理後,資料庫已經可以mount起來了:
SQL> startup;
ORACLE 例程已經啟動。
Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 155192196 bytes
Database Buffers 448790528 bytes
Redo Buffers 7135232 bytes
資料庫裝載完畢。
ORA-01172: 執行緒 1 的恢復停止在塊 259285 (在檔案 17 中)
ORA-01151: 如果需要, 請使用介質恢復以恢復塊和還原備份
在開啟資料庫時候,發覺無法做例項恢復,提示恢復的檔案就是剛才損壞的資料檔案:
SQL> select name from v$datafile where file#=17;
NAME
--------------------------------------------------------------------------------
D:ORACLEPRODUCT10.2.0ORADATAORCLZL9EPRDAT.DBF
嘗試介質恢復, 出現了討厭的ORA-00600錯誤:
SQL> recover database;
ORA-00283: 恢復會話因錯誤而取消
ORA-12801: 並行查詢伺服器 P000 中發出錯誤訊號
ORA-10562: Error occurred while applying redo to data block (file# 17, block#
258754)
ORA-10564: tablespace ZL9EPRDAT
ORA-01110: data file 17: 'D:ORACLEPRODUCT10.2.0ORADATAORCLZL9EPRDAT.DBF'
ORA-10560: block type '0'
ORA-00600: internal error code, arguments: [4552], [1], [0], [], [], []
某些資料檔案塊已經損壞,無法應用redo中的日誌,這部分資料可能已經損壞,決定捨棄這部分資料.使用_allow_resetlogs_corruption引數跳過redo日誌檔案
SQL> alter system set "_allow_resetlogs_corruption"=true scope=spfile;
系統已更改。
SQL> shutdown immediate;
ORA-01109: 資料庫未開啟
已經解除安裝資料庫。
ORACLE 例程已經關閉。
SQL> startup mount;
ORACLE 例程已經啟動。
Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 155192196 bytes
Database Buffers 448790528 bytes
Redo Buffers 7135232 bytes
資料庫裝載完畢。
直接做不完全恢復,會提示歸檔日誌找不到,不用理會,嘗試用resetlogs開啟資料庫,還是失敗!! fuck!!
SQL> recover database until cancel;
ORA-00279: 更改 181426480 (在 06/11/2009 18:15:23 生成) 對於執行緒 1 是必需的
ORA-00289: 建議:
E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREAORCLARCHIVELOG2009_06_11O1_MF_1_
8980_%U_.ARC
ORA-00280: 更改 181426480 (用於執行緒 1) 在序列 #8980 中
指定日誌: {
auto
ORA-00308: 無法開啟歸檔日誌
'E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREAORCLARCHIVELOG2009_06_11O1_MF_1
_8980_%U_.ARC'
ORA-27041: 無法開啟檔案
OSD-04002: 無法開啟檔案
O/S-Error: (OS 2) 系統找不到指定的檔案。
ORA-00308: 無法開啟歸檔日誌
'E:ORACLEPRODUCT10.2.0FLASH_RECOVERY_AREAORCLARCHIVELOG2009_06_11O1_MF_1
_8980_%U_.ARC'
ORA-27041: 無法開啟檔案
OSD-04002: 無法開啟檔案
O/S-Error: (OS 2) 系統找不到指定的檔案。
ORA-01547: 警告: RECOVER 成功但 OPEN RESETLOGS 將出現如下錯誤
ORA-01194: 檔案 1 需要更多的恢復來保持一致性
ORA-01110: 資料檔案 1: 'D:ORACLEPRODUCT10.2.0ORADATAORCLSYSTEM01.DBF'
SQL> alter database open resetlogs;
alter database open resetlogs
*
第 1 行出現錯誤:
ORA-03113: 通訊通道的檔案結束
這時候,檢視後臺的alertORCL.log檔案,有如下錯誤:
Thu Jun 11 22:59:58 2009
Errors in file e:oracleproduct10.2.0adminorclbdumporcl_smon_2064.trc:
ORA-00600: internal error code, arguments: [4193], [34756], [34760], [], [], [], [], []
查詢metalink得到上述錯誤主要是跟undo有關:
PURPOSE:
This article discusses the internal error "ORA-600 [4193]", what
it means and possible actions. The information here is only applicable
to the versions listed and is provided only for guidance.
ERROR:
ORA-600 [4193] [a] [b]
VERSIONS:
versions 6.0 to 10.1
DESCRIPTION:
A mismatch has been detected between Redo records and Rollback (Undo)
records.
We are validating the Undo block sequence number in the undo block against
the Redo block sequence number relating to the change being applied.
This error is reported when this validation fails.
ARGUMENTS:
Arg [a] Undo record seq number
Arg [b] Redo record seq number
FUNCTIONALITY:
KERNEL TRANSACTION UNDO
IMPACT:
PROCESS FAILURE
POSSIBLE ROLLBACK SEGMENT CORRUPTION
設定undo表空間為手動管理,再打資料庫成功!!!
SQL> connect / as sysdba;
已連線到空閒例程。
SQL> startup mount;
ORACLE 例程已經啟動。
Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 155192196 bytes
Database Buffers 448790528 bytes
Redo Buffers 7135232 bytes
資料庫裝載完畢。
SQL> show parameter undo;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
undo_management string AUTO
undo_retention integer 900
undo_tablespace string UNDOTBS1
SQL> alter system set undo_management=manual scope=spfile;
系統已更改。
SQL> shutdown immediate;
ORA-01109: 資料庫未開啟
已經解除安裝資料庫。
ORACLE 例程已經關閉。
SQL> startup mount;
ORACLE 例程已經啟動。
Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 155192196 bytes
Database Buffers 448790528 bytes
Redo Buffers 7135232 bytes
資料庫裝載完畢。
SQL> alter database open;
資料庫已更改。
SQL> alter user system identified by his;
使用者已更改。
最後就是export資料,重建資料庫.
[@more@]來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7839206/viewspace-1023265/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【資料庫資料恢復】斷電導致Oracle資料庫資料丟失的資料恢復案例資料庫資料恢復Oracle
- 【資料庫資料恢復】突然斷電造成Syabse資料庫無法啟動的資料恢復案例資料庫資料恢復
- 【北亞資料恢復】異常斷電導致Oracle資料庫報錯的oracle資料恢復資料恢復Oracle資料庫
- 【北亞資料恢復】伺服器斷電導致Oracle資料庫報錯的資料恢復案例資料恢復伺服器Oracle資料庫
- 【資料庫資料恢復】SAP資料庫資料恢復案例資料庫資料恢復
- 【資料庫資料恢復】透過恢復NDF檔案修復資料庫的資料恢復過程資料庫資料恢復
- 寶塔資料庫恢復 mysql資料庫丟失恢復 mysql資料庫刪除庫恢復 寶塔mysql資料庫恢復資料庫MySql
- 【資料庫資料恢復】windows server下SqlServer資料庫的資料恢復資料庫資料恢復WindowsServerSQL
- 【資料庫資料恢復】如何恢復Oracle資料庫truncate表的資料資料庫資料恢復Oracle
- 【vSAN資料恢復案例】異常斷電導致vSAN底層資料損壞的資料恢復資料恢復
- 【北亞資料恢復】異常斷電導致linux伺服器無法啟動,資料庫損壞的資料恢復資料恢復Linux伺服器資料庫
- 【資料庫資料恢復】Sql Server資料庫資料恢復案例資料庫資料恢復SQLServer
- 【伺服器資料恢復】斷電導致伺服器癱瘓的資料恢復案例伺服器資料恢復
- 【資料庫資料恢復】Oracle資料庫誤truncate table的資料恢復案例資料庫資料恢復Oracle
- 【資料庫資料恢復】誤truncate table的Oracle資料庫資料恢復方案資料庫資料恢復Oracle
- 伺服器資料恢復—透過拼接資料庫碎片恢復SqlServer資料庫資料的資料恢復案例伺服器資料恢復資料庫SQLServer
- 資料庫修復資料恢復資料庫資料恢復
- 【資料庫資料恢復】sql server資料庫連線失效的資料恢復案例資料庫資料恢復SQLServer
- 【資料庫資料恢復】SqlServer資料庫無法讀取的資料恢復案例資料庫資料恢復SQLServer
- 【資料庫資料恢復】MongoDB資料庫檔案損壞的資料恢復案例資料庫資料恢復MongoDB
- MySQL資料庫的恢復MySql資料庫
- 伺服器資料恢復-斷電導致linux作業系統資料丟失的資料恢復案例伺服器資料恢復Linux作業系統
- 【伺服器資料恢復】伺服器意外斷電導致raid資訊丟失的資料恢復伺服器資料恢復AI
- 【伺服器資料恢復】意外斷電導致RAID模組資訊丟失的資料恢復案例伺服器資料恢復AI
- 【伺服器資料恢復】斷電導致raid資訊丟失的磁碟陣列資料恢復案例伺服器資料恢復AI陣列
- 資料庫資料恢復—附加資料庫錯誤823的SQL Server資料恢復案例資料庫資料恢復SQLServer
- 【資料庫資料恢復】SQL Server資料庫磁碟空間不足的資料恢復案例資料庫資料恢復SQLServer
- 【資料庫資料恢復】ASM磁碟組掉線的Oracle資料庫資料恢復案例資料庫資料恢復ASMOracle
- 【伺服器資料恢復】伺服器RAID因為斷電發生故障的資料恢復案例伺服器資料恢復AI
- 【伺服器資料恢復】意外斷電導致linux伺服器崩潰的資料恢復案例伺服器資料恢復Linux
- 【資料庫資料恢復】透過資料頁恢復Sql Server資料庫資料的過程資料庫資料恢復SQLServer
- 【資料庫資料恢復】oracle資料庫誤truncate table怎麼恢復資料?資料庫資料恢復Oracle
- 【資料庫資料恢復】linux系統下MYSQL資料庫資料恢復案例資料庫資料恢復LinuxMySql
- 【資料庫資料恢復】ASM例項不能掛載的Oracle資料庫資料恢復案例資料庫資料恢復ASMOracle
- 【資料庫資料恢復】LINUX環境下ORACLE資料庫誤刪除的資料恢復資料庫資料恢復LinuxOracle
- 【資料庫資料恢復】Sql Server資料庫檔案丟失的資料恢復過程資料庫資料恢復SQLServer
- 【資料庫資料恢復】MongoDB資料庫服務啟動失敗的資料恢復案例資料庫資料恢復MongoDB
- 【伺服器資料恢復】HP EVA伺服器儲存RAID資訊斷電丟失的資料恢復伺服器資料恢復AI
- 【資料庫資料恢復】MS SQL資料庫附加資料庫出錯怎麼恢復資料?資料庫資料恢復SQL