ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 用物理备库的文件来恢复主库

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

原创 Linux操作系统 作者:aaqwsh 时间:2011-04-09 10:35:52 0 删除 编辑

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

 

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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-11-24

  • 博文量
    132
  • 访问量
    262636