设为首页 加入收藏

TOP

恢复丢失的控制文件(四)
2014-11-24 00:56:43 来源: 作者: 【 】 浏览:67
Tags:恢复 丢失 控制 文件
y_area/IPCDB/archivelog/2014_01_12/o1_mf_1_17_9f4vjvms_.arc thread=1 sequence=17
archived log file name=/opt/app/oracle/fast_recovery_area/IPCDB/archivelog/2014_01_12/o1_mf_1_18_9f4vkbbg_.arc thread=1 sequence=18
archived log file name=/opt/app/oracle/fast_recovery_area/IPCDB/archivelog/2014_01_12/o1_mf_1_19_9f4vkr74_.arc thread=1 sequence=19
archived log file name=+DATA/ipcdb/onlinelog/group_2.268.835737765 thread=1 sequence=20
media recovery complete, elapsed time: 00:00:02
Finished recover at 12-JAN-14

(7)虽然进行的是完全恢复,没有数据丢失,但是因为使用了using子句,打开数据库时必须使用resetlogs方法打开;

  1. SQL> alter database open;
  2. alter database open
  3. *
  4. ERROR at line 1:
  5. ORA-01589: must use RESETLOGS or NORESETLOGS
    option for database open
  6. SQL> alter database open noresetlogs;
  7. alter database open noresetlogs
  8. *
  9. ERROR at line 1:
  10. ORA-01588: must use RESETLOGS option for database open
  11. SQL> alter database open resetlogs;
  12. Database altered.

现在日志序列重新从1开始编号。

  1. SQL> select group#,sequence#,status from v$log;
  2. GROUP# SEQUENCE# STATUS
  3. ---------- ---------- ----------------
  4. 1 1 INACTIVE
  5. 2 2 CURRENT
  6. 3 0 UNUSED

9.6.5 例子2:用noresetlogs方法重建控制文件(1)

(1)继续测试,再做一次备份:

  1. RMAN> backup datafile 1;
  2. Starting backup at 13-APR-11
  3. using target database control file instead of recovery catalog
  4. allocated channel: ORA_DISK_1
  5. channel ORA_DISK_1: sid=2489 devtype=DISK
  6. channel ORA_DISK_1: starting full datafile backupset
  7. channel ORA_DISK_1: specifying datafile(s) in backupset
  8. input datafile fno=00001 name=/zxm/cindytest/system01.dbf
  9. channel ORA_DISK_1: starting piece 1 at 13-APR-11
  10. channel ORA_DISK_1: finished piece 1 at 13-APR-11
  11. piece handle=/oracle/product/10G_single/dbs/
    0sm9lufk_1_1 tag=TAG20110413T120716 comment=NONE
  12. channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
  13. Finished backup at 13-APR-11
  14. Starting Control File and SPFILE Autobackup at 13-APR-11
  15. piece handle=/oracle/product/10G_single/dbs
    /c-539593454-20110413-01 comment=NONE
  16. Finished Control File and SPFILE Autobackup at 13-APR-11

(2)做一些操作和日志切换:

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

当前日志序列:

  1. SQL> select group#,sequence#,status from v$log;
  2. GROUP# SEQUENCE# STATUS
  3. ---------- ---------- ----------------
  4. 1 4 CURRENT
  5. 2 2 ACTIVE
  6. 3 3 ACTIVE

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

  1. SQL> shutdown abort;
  2. exit
  3. ORACLE instance shut down.
  4. SQL> Disconnected from Oracle Database 10g
    Enterprise Edition Release 10.2.0.1.0 - 64bit Production
  5. With the Partitioning, OLAP and Data Mining options

删除控制文件:

  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

(4)恢复控制文件:

  1. RMAN> restore controlfile from '/oracle/product
    /10G_single/dbs/c-539593454-20110413-01';
  2. Starting restore at 13-APR-11
  3. using channel ORA_DISK_1
  4. channel ORA_DISK_1: restoring control file
  5. channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
  6. output filename=/zxm/cindytest/control01.ctl
  7. Finished restore at 13-APR-11
首页 上一页 1 2 3 4 5 6 下一页 尾页 4/6/6
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Oracle/JSP技术涉及日期和时间问.. 下一篇Oracle数据库中日期时间的操作比..

评论

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