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方法打开;
- SQL> alter database open;
- alter database open
- *
- ERROR at line 1:
- ORA-01589: must use RESETLOGS or NORESETLOGS
option for database open
-
- SQL> alter database open noresetlogs;
- alter database open noresetlogs
- *
- ERROR at line 1:
- ORA-01588: must use RESETLOGS option for database open
-
- SQL> alter database open resetlogs;
-
- Database altered.
现在日志序列重新从1开始编号。
- SQL> select group#,sequence#,status from v$log;
-
- GROUP# SEQUENCE# STATUS
- ---------- ---------- ----------------
- 1 1 INACTIVE
- 2 2 CURRENT
- 3 0 UNUSED
9.6.5 例子2:用noresetlogs方法重建控制文件(1)
(1)继续测试,再做一次备份:
- RMAN> backup datafile 1;
-
- Starting backup at 13-APR-11
- using target database control file instead of recovery catalog
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: sid=2489 devtype=DISK
- channel ORA_DISK_1: starting full datafile backupset
- channel ORA_DISK_1: specifying datafile(s) in backupset
- input datafile fno=00001 name=/zxm/cindytest/system01.dbf
- channel ORA_DISK_1: starting piece 1 at 13-APR-11
- channel ORA_DISK_1: finished piece 1 at 13-APR-11
- piece handle=/oracle/product/10G_single/dbs/
0sm9lufk_1_1 tag=TAG20110413T120716 comment=NONE
- channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35
- Finished backup at 13-APR-11
-
- Starting Control File and SPFILE Autobackup at 13-APR-11
- piece handle=/oracle/product/10G_single/dbs
/c-539593454-20110413-01 comment=NONE
- Finished Control File and SPFILE Autobackup at 13-APR-11
(2)做一些操作和日志切换:
- SQL> create table aa as select * from a;
-
- Table created.
-
- SQL> create table bb as select * from b;
-
- Table created.
-
- SQL> alter system switch logfile;
-
- System altered.
-
- SQL> create table cc as select * from a;
-
- Table created.
-
- SQL> alter system switch logfile;
-
- System altered.
当前日志序列:
- SQL> select group#,sequence#,status from v$log;
-
- GROUP# SEQUENCE# STATUS
- ---------- ---------- ----------------
- 1 4 CURRENT
- 2 2 ACTIVE
- 3 3 ACTIVE
(3)关闭数据库,模拟故障:
- SQL> shutdown abort;
- exit
- ORACLE instance shut down.
- SQL> Disconnected from Oracle Database 10g
Enterprise Edition Release 10.2.0.1.0 - 64bit Production
- With the Partitioning, OLAP and Data Mining options
删除控制文件:
- SQL> startup
- ORACLE instance started.
-
- Total System Global Area 3221225472 bytes
- Fixed Size 2024200 bytes
- Variable Size 637537528 bytes
- Database Buffers 2566914048 bytes
- Redo Buffers 14749696 bytes
- ORA-00205: error in identifying control file,
check alert log for more info
(4)恢复控制文件:
- RMAN> restore controlfile from '/oracle/product
/10G_single/dbs/c-539593454-20110413-01';
-
- Starting restore at 13-APR-11
- using channel ORA_DISK_1
-
- channel ORA_DISK_1: restoring control file
- channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
- output filename=/zxm/cindytest/control01.ctl
- Finished restore at 13-APR-11
|