用物理备库的文件来恢复主库

如果主库丢失数据文件或者文件坏掉时,可以拷贝物理备库对应的数据文件方式用来恢复主库:

 

SQL> alter system switch logfile;

System altered.

SQL> alter database datafile '/data/ora10g/RACDBSTD/TEST01.DBF' offline drop;

Database altered.

SQL>  alter system switch logfile;

System altered.

SQL> alter database datafile '/data/ora10g/RACDBSTD/TEST01.DBF' online;
alter database datafile '/data/ora10g/RACDBSTD/TEST01.DBF' online
*
ERROR at line 1:
ORA-01113: file 6 needs media recovery
ORA-01110: data file 6: '/data/ora10g/RACDBSTD/TEST01.DBF'


SQL> recover datafile 6;
ORA-00279: change 982515 generated at 04/09/2011 09:23:53 needed for thread 1
ORA-00289: suggestion : /data/ora10g/RACDBSTD/arch/1_3_745800569.dbf
ORA-00280: change 982515 for thread 1 is in sequence #3


Specify log: {=suggested | filename | AUTO | CANCEL}
auto
ORA-00279: change 982516 generated at 04/09/2011 09:25:04 needed for thread 1
ORA-00289: suggestion : /data/ora10g/RACDBSTD/arch/1_4_745800569.dbf
ORA-00280: change 982516 for thread 1 is in sequence #4
ORA-00278: log file '/data/ora10g/RACDBSTD/arch/1_3_745800569.dbf' no longer
needed for this recovery


ORA-00279: change 982601 generated at 04/09/2011 09:25:18 needed for thread 1
ORA-00289: suggestion : /data/ora10g/RACDBSTD/arch/1_5_745800569.dbf
ORA-00280: change 982601 for thread 1 is in sequence #5
ORA-00278: log file '/data/ora10g/RACDBSTD/arch/1_4_745800569.dbf' no longer
needed for this recovery


Log applied.
Media recovery complete.
SQL>
SQL> alter database datafile '/data/ora10g/RACDBSTD/TEST01.DBF' online;

Database altered.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/758322/viewspace-692004/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/758322/viewspace-692004/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值