模擬控制檔案丟失進行恢復。
模擬三個控制檔案丟失
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 121636456 bytes
Database Buffers 155189248 bytes
Redo Buffers 7168000 bytes
ORA-00214: control file '/u01/oracle/oradata/orcl/control01.ctl' version 687
inconsistent with file '/u01/oracle/oradata/orcl/control02.ctl' version 673
SQL> shutdown abort;
ORACLE instance shut down.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 121636456 bytes
Database Buffers 155189248 bytes
Redo Buffers 7168000 bytes
SQL> alter system set control_files='/u01/oracle/oradata/orcl/control03.ctl'scope=spfile;
System altered.
SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-00214: control file '/u01/oracle/oradata/orcl/control01.ctl' version 687
inconsistent with file '/u01/oracle/oradata/orcl/control02.ctl' version 673
SQL> alter system set control_files='/u01/oracle/oradata/orcl/control01.ctl'scope=spfile
2 ;
System altered.
SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-00214: control file '/u01/oracle/oradata/orcl/control01.ctl' version 687
inconsistent with file '/u01/oracle/oradata/orcl/control02.ctl' version 673
SQL> alter system set control_files='/u01/oracle/oradata/orcl/control02.ctl'scope=spfile
2 ;
System altered.
SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-00214: control file '/u01/oracle/oradata/orcl/control01.ctl' version 687
inconsistent with file '/u01/oracle/oradata/orcl/control02.ctl' version 673
SQL> select status from v$instance;
STATUS
------------
STARTED
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 121636456 bytes
Database Buffers 155189248 bytes
Redo Buffers 7168000 bytes
SQL> alter system set control_files='/u01/oracle/oradata/orcl/control03.ctl' scope=spfile;
System altered.
SQL> alter database mount;
Database altered.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01122: database file 1 failed verification check
ORA-01110: data file 1: '/u01/oracle/oradata/orcl/system01.dbf'
ORA-01207: file is more recent than control file - old control file
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 121636456 bytes
Database Buffers 155189248 bytes
Redo Buffers 7168000 bytes
Database mounted.
SQL> alter database open;
Database altered.
____________________________________________________________________________________________
控制檔案恢復後
今天檢視錶空間發現個MISSING00005資料檔案 --->原因:編輯控制檔案的時候被遺漏掉的資料檔案(example表空間)
SQL> select file_id,tablespace_name,file_name,online_status from dba_data_files;
FILE_ID TABLESPACE_NAME FILE_NAME ONLINE_
---------- -------------------- ---------------------------------------- -------
6 TEST /u01/oracle/oradata/orcl/test01.dbf ONLINE
4 USERS /u01/oracle/oradata/orcl/users01.dbf ONLINE
2 UNDOTBS1 /u01/oracle/oradata/orcl/undotbs01.dbf ONLINE
3 SYSAUX /u01/oracle/oradata/orcl/sysaux01.dbf ONLINE
1 SYSTEM /u01/oracle/oradata/orcl/system01.dbf SYSTEM
5 EXAMPLE /u01/oracle/db_1/dbs/MISSING00005 RECOVER
6 rows selected.
SQL> alter tablespace example rename datafile '/u01/oracle/db_1/dbs/MISSING00005' to '/u01/oracle/oradata/orcl/example01.dbf';
Tablespace altered.
SQL> select file_id,tablespace_name,file_name,online_status from dba_data_files;
FILE_ID TABLESPACE_NAME FILE_NAME ONLINE_
---------- -------------------- ---------------------------------------- -------
6 TEST /u01/oracle/oradata/orcl/test01.dbf ONLINE
4 USERS /u01/oracle/oradata/orcl/users01.dbf ONLINE
2 UNDOTBS1 /u01/oracle/oradata/orcl/undotbs01.dbf ONLINE
3 SYSAUX /u01/oracle/oradata/orcl/sysaux01.dbf ONLINE
1 SYSTEM /u01/oracle/oradata/orcl/system01.dbf SYSTEM
5 EXAMPLE /u01/oracle/oradata/orcl/example01.dbf RECOVER
6 rows selected.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/orcl/system01.dbf
/u01/oracle/oradata/orcl/undotbs01.dbf
/u01/oracle/oradata/orcl/sysaux01.dbf
/u01/oracle/oradata/orcl/users01.dbf
/u01/oracle/oradata/orcl/example01.dbf
/u01/oracle/oradata/orcl/test01.dbf
6 rows selected.
中間不知道什麼原因試了好多次才成功,這個還有待研究。
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 121636456 bytes
Database Buffers 155189248 bytes
Redo Buffers 7168000 bytes
ORA-00214: control file '/u01/oracle/oradata/orcl/control01.ctl' version 687
inconsistent with file '/u01/oracle/oradata/orcl/control02.ctl' version 673
SQL> shutdown abort;
ORACLE instance shut down.
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 121636456 bytes
Database Buffers 155189248 bytes
Redo Buffers 7168000 bytes
SQL> alter system set control_files='/u01/oracle/oradata/orcl/control03.ctl'scope=spfile;
System altered.
SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-00214: control file '/u01/oracle/oradata/orcl/control01.ctl' version 687
inconsistent with file '/u01/oracle/oradata/orcl/control02.ctl' version 673
SQL> alter system set control_files='/u01/oracle/oradata/orcl/control01.ctl'scope=spfile
2 ;
System altered.
SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-00214: control file '/u01/oracle/oradata/orcl/control01.ctl' version 687
inconsistent with file '/u01/oracle/oradata/orcl/control02.ctl' version 673
SQL> alter system set control_files='/u01/oracle/oradata/orcl/control02.ctl'scope=spfile
2 ;
System altered.
SQL> alter database mount;
alter database mount
*
ERROR at line 1:
ORA-00214: control file '/u01/oracle/oradata/orcl/control01.ctl' version 687
inconsistent with file '/u01/oracle/oradata/orcl/control02.ctl' version 673
SQL> select status from v$instance;
STATUS
------------
STARTED
SQL> shutdown abort;
ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 121636456 bytes
Database Buffers 155189248 bytes
Redo Buffers 7168000 bytes
SQL> alter system set control_files='/u01/oracle/oradata/orcl/control03.ctl' scope=spfile;
System altered.
SQL> alter database mount;
Database altered.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01122: database file 1 failed verification check
ORA-01110: data file 1: '/u01/oracle/oradata/orcl/system01.dbf'
ORA-01207: file is more recent than control file - old control file
SQL> shutdown abort
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218968 bytes
Variable Size 121636456 bytes
Database Buffers 155189248 bytes
Redo Buffers 7168000 bytes
Database mounted.
SQL> alter database open;
Database altered.
____________________________________________________________________________________________
控制檔案恢復後
今天檢視錶空間發現個MISSING00005資料檔案 --->原因:編輯控制檔案的時候被遺漏掉的資料檔案(example表空間)
SQL> select file_id,tablespace_name,file_name,online_status from dba_data_files;
FILE_ID TABLESPACE_NAME FILE_NAME ONLINE_
---------- -------------------- ---------------------------------------- -------
6 TEST /u01/oracle/oradata/orcl/test01.dbf ONLINE
4 USERS /u01/oracle/oradata/orcl/users01.dbf ONLINE
2 UNDOTBS1 /u01/oracle/oradata/orcl/undotbs01.dbf ONLINE
3 SYSAUX /u01/oracle/oradata/orcl/sysaux01.dbf ONLINE
1 SYSTEM /u01/oracle/oradata/orcl/system01.dbf SYSTEM
5 EXAMPLE /u01/oracle/db_1/dbs/MISSING00005 RECOVER
6 rows selected.
SQL> alter tablespace example rename datafile '/u01/oracle/db_1/dbs/MISSING00005' to '/u01/oracle/oradata/orcl/example01.dbf';
Tablespace altered.
SQL> select file_id,tablespace_name,file_name,online_status from dba_data_files;
FILE_ID TABLESPACE_NAME FILE_NAME ONLINE_
---------- -------------------- ---------------------------------------- -------
6 TEST /u01/oracle/oradata/orcl/test01.dbf ONLINE
4 USERS /u01/oracle/oradata/orcl/users01.dbf ONLINE
2 UNDOTBS1 /u01/oracle/oradata/orcl/undotbs01.dbf ONLINE
3 SYSAUX /u01/oracle/oradata/orcl/sysaux01.dbf ONLINE
1 SYSTEM /u01/oracle/oradata/orcl/system01.dbf SYSTEM
5 EXAMPLE /u01/oracle/oradata/orcl/example01.dbf RECOVER
6 rows selected.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/u01/oracle/oradata/orcl/system01.dbf
/u01/oracle/oradata/orcl/undotbs01.dbf
/u01/oracle/oradata/orcl/sysaux01.dbf
/u01/oracle/oradata/orcl/users01.dbf
/u01/oracle/oradata/orcl/example01.dbf
/u01/oracle/oradata/orcl/test01.dbf
6 rows selected.
中間不知道什麼原因試了好多次才成功,這個還有待研究。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29618264/viewspace-2089051/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 控制檔案丟失恢復
- 【控制檔案丟失恢復】
- 【原創】模擬控制檔案丟失的資料庫恢復資料庫
- 控制檔案丟失恢復(二)
- 恢復丟失的控制檔案
- 控制檔案全部丟失恢復
- 控制檔案全部丟失的恢復
- 控制檔案部分丟失的恢復
- 控制檔案丟失的RMAN恢復
- 當前控制檔案全部丟失恢復
- 【RMAN】SYSTEM表空間資料檔案丟失恢復模擬
- 恢復案例:無歸檔,掉電,控制檔案全部丟失恢復
- 【備份恢復】所有控制檔案丟失後 利用trace中的控制檔案備份執行恢復
- 恢復案例:無歸檔,丟失全部控制檔案、日誌檔案恢復案例
- 【備份恢復】 丟失一個控制檔案 之恢復操作
- 【備份恢復】丟失所有控制檔案,利用RMAN進行恢復操作
- 全部控制檔案丟失後的完全恢復(轉)
- 恢復之丟失全部控制檔案以及備份中的控制檔案
- 模擬資料檔案丟失
- RMAN恢復案例:無恢復目錄,丟失全部資料檔案、控制檔案、日誌檔案恢復
- 引數檔案控制檔案和資料檔案丟失的恢復
- 丟失一個控制檔案並恢復資料庫資料庫
- 只有rman備份集,控制檔案丟失的恢復
- 探索ORACLE之RMAN_07 控制檔案丟失恢復Oracle
- 備份恢復實驗(1)丟失部分控制檔案
- rman恢復--丟失控制檔案的恢復
- 控制檔案丟失恢復例項(3) - 使用重建控制檔案方式(noresetlogs)
- 【恢復】Redo日誌檔案丟失的恢復
- 非歸檔無備份下控制檔案丟失的恢復
- rman恢復:資料檔案丟失,控制檔案丟失,聯機日誌檔案丟失(非當前使用與當前使用)
- 資料檔案丟失的恢復
- Oracle Password檔案丟失的恢復Oracle
- 資料檔案丟失如何恢復
- 無備份丟失部分資料檔案和控制檔案恢復 [轉]
- RMAN恢復案例:丟失全部資料檔案恢復
- RMAN - "丟失控制檔案的恢復"
- 開啟 控制檔案自動備份下,引數檔案、控制檔案全部丟失恢復
- 恢復之利用備份在所有控制檔案丟失情況下恢復(四)