以下的相關內容主要介紹的是,解決由於一次誤操作而引起的Oracle數據庫大恢復的另外一種語法即,重建控制文件(重建控制文件之前,備份controlfile和online redolog)的實際操作方案。
引用
- Create controlfile reuse set database "LDBRA"
- MAXINSTANCES 8
- MAXLOGHISTORY 1
- MAXLOGFILES 16
- MAXLOGMEMBERS 3
- MAXDATAFILES 100
- Datafile
- '/ora10g/app/oradata/ldbra/system01.dbf',
- '/ora10g/app/oradata/ldbra/undotbs01.dbf',
- '/ora10g/app/oradata/ldbra/sysaux01.dbf',
- '/ora10g/app/oradata/ldbra/users01.dbf',
- '/ora10g/app/oradata/ldbra/example01.dbf',
- '/ora10g/app/product/10.2.0/db_1/dbs/ company.dbf',
- '/ora10g/app/product/10.2.0/db_1/dbs/streams.dbf'
- LOGFILE GROUP 1 ('/ora10g/app/oradata/ldbra/redo01.log')
SIZE 51200K,- GROUP 2 ('/ora10g/app/oradata/ldbra/redo02.log')
SIZE 51200K,- GROUP 3 ('/ora10g/app/oradata/ldbra/redo03.log')
SIZE 51200K RESETLOGS;
用上述相關語句來解決由於一次誤操作而引起的Oracle數據庫大恢復的操作似乎重建成功了!但是進行recover的時候報錯了!
引用
- SQL> RECOVER DATABASE USING BACKUP CONTROLFILE;
- ORA-00283: recovery session canceled due to errors
- ORA-00600: internal error code, arguments: [kcvhvdf_1],
[], [], [], [], [], [],- []
可以看到控制文件在重建的過程中進行了dbid重置
引用
- SQL> select dbid from v$database;
- DBID
- 1498845164
問題到這裡似乎失去了頭緒,呵呵,拷回之前備份的控制文件替換剛建的控制文件。因為我采用的是resetlog選項創建控制文件,從理論上來講,應該是會重置redolog的,即重新創建redolog。但是目前采用此選項確報ORA-01227錯誤。不可思議!後來一想可能是跟數據文件中的dbid為0有關。於是采用終極修復方法,bbed!首先將所有數據文件的dbid用bbed工具重置為1488207495,其次將fuzzy標記打為0x2000(因為數據庫被ckpt進程異常終止,將標記打為0x2000表示數據庫是shutdown immediate關閉),采用上述方法之後控制文件成功創建!
引用
- SQL> STARTUP NOMOUNT
- CREATE CONTROLFILE REUSE DATABASE "LDBRA" RESETLOGS
ARCHIVELOG- MAXLOGFILES 16
- MAXLOGMEMBERS 3
- MAXDATAFILES 100
- MAXINSTANCES 8
- MAXLOGHISTORY 292
- LOGFILE
- Oracle instance started.
- Total System Global Area 1073741824 bytes
- Fixed Size 1271616 bytes
- Variable Size 461375680 bytes
- Database Buffers 608174080 bytes
- Redo Buffers 2920448 bytes
- GROUP 1 '/ora10g/app/oradata/ldbra/redo01.log' SIZE 50M,
- GROUP 2 '/ora10g/app/oradata/ldbra/redo02.log' SIZE 50M,
- GROUP 3 '/ora10g/app/oradata/ldbra/redo03.log' SIZE 50M
- -- STANDBY LOGFILE
- DATAFILE
- '/ora10g/app/oradata/ldbra/system01.dbf',
- '/ora10g/app/oradata/ldbra/undotbs01.dbf',
- '/ora10g/app/oradata/ldbra/sysaux01.dbf',
- '/ora10g/app/oradata/ldbra/users01.dbf',
- '/ora10g/app/oradata/ldbra/example01.dbf',
- '/ora10g/app/product/10.2.0/db_1/dbs/company.dbf',
- '/ora10g/app/product/10.2.0/db_1/dbs/streams.dbf'
- CHARACTER SET ZHS16GBK
- 21 ;
- Control file created.
嘗試打Oracle開數據庫
- SQL> alter database open RESETLOGS;
出現數據庫掛起狀態,後台alert日志顯示[2662]錯誤,呵呵,看到這個錯誤,希望就來了!
引用
- SMON: enabling cache recovery
- Tue Mar 9 03:11:38 2010
- Errors in file /ora10g/app/admin/ldbra/udump/
ldbra_ora_13676.trc:- ORA-00600: internal error code, arguments:
[2662], [2268], [3799096903], [2268], [3799098345],
[8388617], [], []- Tue Mar 9 03:11:40 2010
- Errors in file /ora10g/app/admin/ldbra/udump/
ldbra_ora_13676.trc:- ORA-00600: internal error code, arguments: [2662],
[2268], [3799096903], [2268], [3799098345], [8388617],
[], []- Tue Mar 9 03:11:40 2010