ITPub博客

首页 > 数据库 > Oracle > 关于数据库恢复的整理

关于数据库恢复的整理

原创 Oracle 作者:守望567 时间:2015-07-22 16:32:41 0 删除 编辑
1.不完全恢复
  根据时间恢复
    startup mount
    restore database until time "to_date('2015-07-22 18:00:00','yyyy-mm-dd hh24:mi:ss')";
    recover database until time "to_date('2015-07-22 18:00:00','yyyy-mm-dd hh24:mi:ss')";
    alter database open resetlogs;
   根据scn号恢复
    startup mount

     restore database until scn 1215217;
     recover database until scn 1215217;
     alter database open resetlogs;
    时间和scn之间的转换
     select timestamp_to_scn(to_date('2015-07-23 18:17:54','YYYY-mm-dd hh24:mi:ss')) from dual;
     select to_char(scn_to_timestamp(1215219),'YYYY-mm-dd hh24:mi:ss') from dual;
2.完全恢复
    restore database;
    recover database;
3.如有增量备份
    startup nomount;
    先恢复控制文件
    restore controlfile from '/backup/20150723/bak_lel1_CWGK_20150723_40.bak';
    这里先不要recover
    startup mount;
    catalog start with '/backup/20150723';  这里是1级备份的目录
    recover database;
    报了如下错误:
    archived log file name=/arch/1_52_885653855.dbf thread=1 sequence=52
archived log file name=/arch/1_53_885653855.dbf thread=1 sequence=53
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 07/23/2015 17:44:23
ORA-00283: recovery session canceled due to errors
RMAN-11003: failure during parse/execution of SQL statement: alter database recover logfile '/arch/1_53_885653855.dbf'

    alter database open resetlogs;

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

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

注册时间:2012-04-23

  • 博文量
    19
  • 访问量
    39909