设为首页 加入收藏

TOP

恢复丢失的控制文件(二)
2014-11-24 00:56:43 来源: 作者: 【 】 浏览:75
Tags:恢复 丢失 控制 文件
cle/product/10G_single/dbs/c-539593454-20110413-00,稍后就利用这个备份进行恢复。

(2)进行了一堆操作和日志切换:

  1. SQL> alter system switch logfile;
  2. System altered.
  3. SQL> create table a as select * from tabs;
  4. Table created.
  5. SQL> alter system switch logfile;
  6. System altered.
  7. SQL> create table b as select * from a;
  8. Table created.
  9. SQL> alter system switch logfile;

当前的日志序列:

  1. SQL> select sequence# from v$log;
  2. SEQUENCE#
  3. ----------
  4. 24
  5. 22
  6. 23

(3)关闭数据库,模拟故障:

  1. SQL> shutdown abort;
  2. ORACLE instance shut down

删除控制文件。

(4)启动数据库,因为没有控制文件,所以只能打开到nomount状态,这也是恢复所必须的状态:

  1. SQL> startup
  2. ORACLE instance started.
  3. Total System Global Area 3221225472 bytes
  4. Fixed Size 2024200 bytes
  5. Variable Size 637537528 bytes
  6. Database Buffers 2566914048 bytes
  7. Redo Buffers 14749696 bytes
  8. ORA-00205: error in identifying control file,
    check alert log for more info

(5)恢复控制文件:

  1. [oracle@dbs cindytest]$ rman target /
  2. Recovery Manager: Release 10.2.0.1.0 - Production
    on Wed Apr 13 11:38:56 2011
  3. Copyright (c) 1982, 2005, Oracle. All rights reserved.
  4. connected to target database: ctest (not mounted)
  5. RMAN> restore controlfile from '/oracle/product/
    10G_single/dbs/c-539593454-20110413-00';
  6. Starting restore at 13-APR-11
  7. using target database control file instead of recovery catalog
  8. allocated channel: ORA_DISK_1
  9. channel ORA_DISK_1: sid=2486 devtype=DISK
  10. channel ORA_DISK_1: restoring control file
  11. channel ORA_DISK_1: restore complete, elapsed time: 00:00:03
  12. output filename=/zxm/cindytest/control01.ctl
  13. Finished restore at 13-APR-11

把数据库打开到mount状态:

  1. SQL> select status from v$instance;
  2. STATUS
  3. ------------
  4. STARTED
  5. SQL> alter database mount;
  6. Database altered.
  7. SQL> select sequence# from v$log;
  8. SEQUENCE#
  9. ----------
  10. 21
  11. 20
  12. 19 David备注:v$log是从control file中提取的,备份时control file中的redo log序号最大还在21,备份后又做了三次log switch,因此上面查到的是22-24,这里查到的是19-21.

(6)恢复数据库,如果不用using子句,rman会提示:

  1. SQL> recover database;
  2. ORA-00283: recovery session canceled due to errors
  3. ORA-01610: recovery using the BACKUP
    CONTROLFILE option must be done
  4. SQL> recover database using backup controlfile;
  5. ORA-00279: change 76850708247 generated at
    04/13/2011 09:52:40 needed for
  6. thread 1
  7. ORA-00289: suggestion : /zxm/cindytest/arch/1_21_747160176.dbf
  8. ORA-00280: change 76850708247 for thread 1 is in sequence #21
  9. Specify log: {=suggested | filename | AUTO | CANCEL}
  10. ORA-00279: change 76850708257 generated at
    04/13/2011 11:35:48 needed for
  11. thread 1
  12. ORA-00289: suggestion : /zxm/cindytest/arch/
    1_22_747160176.dbf
  13. ORA-00280: change 76850708257 for thread 1
    is in sequence #22
  14. ORA-00278: log file '/zxm/cindytest/arch/1_2
    1_747160176.dbf' no longer needed
  15. for this recovery
  16. Specify log: {=suggested | filename | AUTO | CANCEL}
  17. ORA-00279: change 76850708305 generated at 04/
    13/2011 11:36:01 needed for
  18. thread 1
  19. ORA-00289: suggestion : /zxm/cindytest/arch/1_23_747160176.dbf
  20. ORA-00280: change 76850708305 for thread 1 is in sequence #23
  21. ORA-00278: log file '/zxm/cindytest/arch/1_22_
    747160176.dbf' no longer needed
  22. for this recovery
  23. Specify log: {=suggested | filename | AUTO | CANCEL}
  24. ORA-00279: change 76850708336 generated at
    04/13/2011 11:36:21 needed for
  25. thread 1
  26. ORA-00289: suggestion : /zxm/cindytest/arch/1_24_747160176.dbf
  27. ORA-00280: change 76850708336 for thread 1 is in sequence #24
  28. ORA-00278: log file '/zxm/cindytest/arch/1_23_
    747160176.dbf
首页 上一页 1 2 3 4 5 6 下一页 尾页 2/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Oracle/JSP技术涉及日期和时间问.. 下一篇Oracle数据库中日期时间的操作比..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: