Rumah > Artikel > pangkalan data > 探索Oracle不完全恢复之--基于备份控制文件恢复
基于备份控制文件(unsing backup controlfile)的恢复 主要适用于:基于备份控制文件的恢复只要适用于以下情况:表空间被意外删
基于备份控制文件(unsing backup controlfile)的恢复
主要适用于:基于备份控制文件的恢复只要适用于以下情况:表空间被意外删除;所有控制文件全部损坏。
1、关闭数据库执行一次全库冷备份:
SQL> select file_name from dba_data_files;
FILE_NAME
--------------------------------------------------------------------------------
/DBBak2/oradata/WWL/users01.dbf
/DBBak2/oradata/WWL/sysaux01.dbf
/DBBak2/oradata/WWL/undotbs01.dbf
/DBBak2/oradata/WWL/system01.dbf
/DBBak2/oradata/WWL/WWL001.dbf
/DBBak2/oradata/WWL/WWL002.dbf
/DBBak2/oradata/WWL/WWL003.dbf
7 rowsselected.
SQL> shutdown immediate
Databaseclosed.
Databasedismounted.
Oracleinstance shut down.
SQL> !mkdir /DBBak2/oradata/WWL2
SQL> !cp /DBBak2/oradata/WWL/* /DBBak2/oradata/WWL2/
SQL> startup
ORACLEinstance started.
TotalSystem Global Area 100663296 bytes
FixedSize 1217884 bytes
VariableSize 88083108 bytes
DatabaseBuffers 8388608 bytes
RedoBuffers 2973696 bytes
Databasemounted.
Databaseopened.
SQL>
模拟删除表空间
SQL> drop tablespace wwl including contents;
Tablespacedropped.
还原之前备份的数据文件:
SQL> shutdown immediate
Databaseclosed.
Databasedismounted.
ORACLEinstance shut down.
SQL> !rm -rf /DBBak2/oradata/WWL/*.dbf
SQL> !rm -rf /DBBak2/oradata/WWL/*.ctl
SQL> !cp /DBBak2/oradata/WWL2/*.dbf /DBBak2/oradata/WWL/
SQL> !cp /DBBak2/oradata/WWL2/*.ctl /DBBak2/oradata/WWL/
SQL>
使用控制文件进行恢复:
SQL> startup
ORACLEinstance started.
TotalSystem Global Area 100663296 bytes
FixedSize 1217884 bytes
VariableSize 88083108 bytes
DatabaseBuffers 8388608 bytes
RedoBuffers 2973696 bytes
Databasemounted.
ORA-00338:log 5 of thread 1 is more recent than control file
ORA-00312:online log 5 thread 1: '/DBBak2/oradata/WWL/redo5a.log'
ORA-00312:online log 5 thread 1: '/DBBak2/oradata/WWL/redo5b.log'
SQL> recover database using backup controlfile until cancel;
ORA-00279:change 1782560 generated at 07/31/2012 14:37:24 needed for thread 1
ORA-00289:suggestion : /DBSoft/product/10.2.0/db_1/dbs/arch/1_3_790085314.dbf
ORA-00280:change 1782560 for thread 1 is in sequence #3
Specifylog: {
cancel
Mediarecovery cancelled.
SQL> alter database open resetlogs;
Databasealtered.
SQL>
至此已经恢复成功。
相关阅读:
探索Oracle之RMAN_01概念
探索Oracle之RMAN_02基本使用
探索Oracle之RMAN_03非一致性备份
探索Oracle之RMAN_04非一致性备份
探索Oracle之RMAN_05增量备份
探索Oracle之RMAN_06备份策略
探索Oracle之RMAN_07单个数据文件丢失恢复
探索Oracle之RMAN_07整个业务表空间丢失恢复
探索Oracle之RMAN_07 磁盘损坏数据丢失恢复
探索Oracle之RMAN_07 数据库所有文件全部丢失恢复
探索Oracle之RMAN_07 重做日志redu文件丢失恢复
探索Oracle之RMAN_07 参数文件丢失恢复
探索Oracle之RMAN_07控制文件丢失恢复
探索Oracle之RMAN_07 system表空间丢失恢复
,