附日志:
为节约篇幅,日志中不重要的信息已经删除
Tue Nov 05 23:39:53 2013
ALTER DATABASE MOUNT
Successful mount of redo thread 1, with mount id 3965984777
Database mounted in Exclusive Mode
Lost write protection disabled
Completed: ALTER DATABASE MOUNT
###############################################
MOUNT后,使用RMAN进行备份
################################################
Tue Nov 05 23:51:25 2013
Completed: alter database open
###########################################################################################
备份后重新打开数据库
##################################################################
Tue Nov 05 23:57:37 2013
ARCH shutting down
ARC0: Archival stopped
Thread 1 closed at log sequence 32
Successful close of redo thread 1
Completed: ALTER DATABASE CLOSE NORMAL
ALTER DATABASE DISMOUNT
Completed: ALTER DATABASE DISMOUNT
Tue Nov 05 23:57:42 2013
Instance shutdown complete
######################################################
第一次删除用户,并关库。关库时:Thread 1 closed at log sequence 32
#######################################################
Lost write protection disabled
Completed: ALTER DATABASE MOUNT
##########################################################
打开库到MOUNT状态,准备进行RMAN下的不完全恢复。
######################################################
Wed Nov 06 00:04:34 2013
Full restore complete of datafile 6 /u01/oradata/bys1/test1.dbf. Elapsed time: 0:00:01
checkpoint is 3228505 第一步关库进行备份时的检查点是3228505
Full restore complete of datafile 4 /u01/oradata/bys1/users01.dbf. Elapsed time: 0:00:04
checkpoint is 3228505
last deallocation scn is 3050819
Wed Nov 06 00:05:07 2013
Full restore complete of datafile 3 /u01/oradata/bys1/undotbs01.dbf. Elapsed time: 0:00:28
checkpoint is 3228505
last deallocation scn is 3211783
Undo Optimization current scn is 3225591
Wed Nov 06 00:05:25 2013
Full restore complete of datafile 5 /u01/oradata/bys1/example01.dbf. Elapsed time: 0:00:51
checkpoint is 3228505
last deallocation scn is 2915000
¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥
下面可以看到对SYSTEM及SYSAUX的RESTORE过程:
Wed Nov 06 00:08:56 2013
Hex dump of (file 1, block 1) in trace file /u01/diag/rdbms/bys1/bys1/trace/bys1_ora_24483.trc
Corrupt block relative dba: 0x00400001 (file 1, block 1)
Bad header found during kcvxfh v8
Data in bad block:
type: 0 format: 2 rdba: 0x00400001
last change scn: 0x0000.00000000 seq: 0x1 flg: 0x05
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x00000001
check value in block header: 0xa741
computed block checksum: 0x0
Reading datafile '/u01/oradata/bys1/system01.dbf' for corruption at rdba: 0x00400001 (file 1, block 1)
Reread (file 1, block 1) found same corrupt data
Hex dump of (file 2, block 1) in trace file /u01/diag/rdbms/bys1/bys1/trace/bys1_ora_24483.trc
Corrupt block relative dba: 0x00800001 (file 2, block 1)
Bad header found during kcvxfh v8
Data in bad block:
type: 0 format: 2 rdba: 0x00800001
last change scn: 0x0000.00000000 seq: 0x1 flg: 0x05
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x00000001
check value in block header: 0xa781
computed block checksum: 0x0
Reading datafile '/u01/oradata/bys1/sysaux01.dbf' for corruption at rdba: 0x00800001 (file 2, block 1)
Reread (file 2, block 1) found same corrupt data
Hex dump of (file 1, block 1) in trace file /u01/diag/rdbms/bys1/bys1/trace/bys1_ora_24483.trc
Corrupt block relative dba: 0x00400001 (file 1, block 1)
Bad header found during kcvxfh v8
Data in bad block:
type: 0 format: 2 rdba: 0x00400001
last change scn: 0x0000.00000000 seq: 0x1 flg: 0x05
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x00000001
check value in block header: 0xa741
computed block checksum: 0x0
Reading datafile '/u01/oradata/bys1/system01.dbf' for corruption at rdba: 0x00400001 (file 1, block 1)
Reread (file 1, block 1) found same corrupt data
Hex dump of (file 2, block 1) in trace file /u01/diag/rdbms/bys1/bys1/trace/bys1_ora_24483.trc
Corrupt block relative dba: 0x00800001 (file 2, block 1)
Bad header found during kcvxfh v8
Data in bad block:
type: 0 format: 2 rdba: 0x00800001
last change scn: 0x0000.00000000 seq: 0x1 flg: 0x05
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x00000001
check value in block header: 0xa781
computed block checksum: 0x0
Reading datafile '/u01/oradata/bys1/sysaux01.dbf' for corruption at rdba: 0x00800001 (file 2, block 1)
Reread (file 2, block 1) found same corrupt data
Wed Nov 06 00:12:58 2013
Full restore complete of datafile 2 /u01/oradata/bys1/sysaux01.dbf. Elapsed time: 0:03:56
checkpoint is 3228505
last deallocation scn is 3222373
Full restore complete of datafile 1 /u01/oradata/bys1/system01.dbf. Elapsed time: 0:04:01
checkpoint is 3228505
last deallocation scn is 825711
Undo Optimization current scn is 3225591
Wed Nov 06 00:13:48 2013
alter database recover datafile list clear
Completed: alter database recover datafile list clear
alter database recover datafile list
1 , 2 , 3 , 4 , 5 , 6 完成恢复的文件号列表1 , 2 , 3 , 4 , 5 , 6
Completed: alter database recover datafile list
1 , 2 , 3 , 4 , 5 , 6
######################################################
以上即是restore database;语句执行时的ALERT日志。下面看RECOVER时的日志
######################################################
alter database recover if needed
start until change 3228983
Media Recovery Start
Serial Media Recovery started
Recovery of Online Redo Log: Thread 1 Group 2Seq 32Reading mem 0
Mem# 0: /u01/oradata/bys1/redo02.log
Incomplete Recovery applied until change 3228983 time 11/05/2013 23:55:37 从这一句也可以看到,不完整恢复到的SCN及时间。
Media Recovery Complete (bys1)
Completed: alter database recover if needed
start until change 3228983
####################################################
recover database until scn 3228983;语句执行时的ALERT日志
####################################################
Wed Nov 06 00:14:02 2013
alter database open
Errors in file /u01/diag/rdbms/bys1/bys1/trace/bys1_ora_24483.trc:
ORA-01589: must use RESETLOGS or NORESETLOGS option for database open
ORA-1589 signalled during: alter database open...
####################################################
以上是alter database open;语句打开库时的报错
####################################################
alter database open resetlogs
Archived Log entry 121 added for thread 1 sequence 32ID 0xec572000 dest 1:
RESETLOGS after incomplete recovery UNTIL CHANGE 3228983
Resetting resetlogs activation ID 3965132800 (0xec572000)
Errors in file /u01/diag/rdbms/bys1/bys1/trace/bys1_ora_24483.trc:
ORA-00367: checksum error in log file header
ORA-00322: log 1 of thread 1 is not current copy
ORA-00312: online log 1 thread 1: '/u01/oradata/bys1/redo01.log'
Wed Nov 06 00:14:10 2013
Errors in file /u01/diag/rdbms/bys1/bys1/trace/bys1_m000_24513.trc:
ORA-00316: log 1 of thread 1, type 0 in header is not log file 日志(用于线程)头部中的类型不是日志文件
ORA-00312: online log 1 thread 1: '/u01/oradata/bys1/redo01.log'
Errors in file /u01/diag/rdbms/bys1/bys1/trace/bys1_m000_24513.trc:
ORA-00322: log 2 of thread 1 is not current copy
ORA-00312: online log 2 thread 1: '/u01/oradata/bys1/redo02.log'
Errors in file /u01/diag/rdbms/bys1/bys1/trace/bys1_m000_24513.trc:
ORA-00322: log 3 of thread 1 is not current copy
ORA-00312: online log 3 thread 1: '/u01/oradata/bys1/redo03.log'
Checker run found 12 new persistent data failures
Wed Nov 06 00:14:16 2013
Errors in file /u01/diag/rdbms/bys1/bys1/trace/bys1_ora_24483.trc:
ORA-00367: checksum error in log file header
ORA-00322: log 2 of thread 1 is not current copy
ORA-00312: online log 2 thread 1: '/u01/oradata/bys1/redo02.log'
Errors in file /u01/diag/rdbms/bys1/bys1/trace/bys1_ora_24483.trc:
ORA-00367: checksum error in log file header
ORA-00322: log 3 of thread 1 is not current copy
ORA-00312: online log 3 thread 1: '/u01/oradata/bys1/redo03.log'
……
Thread 1 opened at log sequence 1 可以看到,当前REDO的序号在RESETLOS后被重置为了1.
Current log# 1 seq# 1 mem# 0: /u01/oradata/bys1/redo01.log
Successful open of redo thread 1
ARC1: Becoming the 'no FAL' ARCH
ARC1: Becoming the 'no SRL' ARCH
ARC2: Becoming the heartbeat ARCH
LOGSTDBY: Validating controlfile with logical metadata
LOGSTDBY: Validation complete
Completed: alter database open resetlogs
####################################################
以上是alter database open resetlogs语句执行时的ALERT日志
####################################################
Wed Nov 06 00:17:40 2013
Instance shutdown complete
Wed Nov 06 00:17:40 2013
Instance shutdown complete
Wed Nov 06 00:18:16 2013
ALTER DATABASE MOUNT
Successful mount of redo thread 1, with mount id 3965999368
Database mounted in Exclusive Mode
Lost write protection disabled
Completed: ALTER DATABASE MOUNT
##########################################################
在打开的库中又删除了已经恢复的用户,并关库;再打开库到MOUNT状态,准备进行RMAN下的不完全恢复
######################################################
Wed Nov 06 00:21:11 2013
Full restore complete of datafile 6 /u01/oradata/bys1/test1.dbf. Elapsed time: 0:00:01
checkpoint is 3228505
Full restore complete of datafile 4 /u01/oradata/bys1/users01.dbf. Elapsed time: 0:00:03
checkpoint is 3228505
last deallocation scn is 3050819
Wed Nov 06 00:21:55 2013
Full restore complete of datafile 3 /u01/oradata/bys1/undotbs01.dbf. Elapsed time: 0:00:46
checkpoint is 3228505
last deallocation scn is 3211783
Undo Optimization current scn is 3225591
Wed Nov 06 00:22:07 2013
Full restore complete of datafile 5 /u01/oradata/bys1/example01.dbf. Elapsed time: 0:00:57
checkpoint is 3228505
last deallocation scn is 2915000
Wed Nov 06 00:25:29 2013
Full restore complete of datafile 2 /u01/oradata/bys1/sysaux01.dbf. Elapsed time: 0:04:16
checkpoint is 3228505
last deallocation scn is 3222373
Full restore complete of datafile 1 /u01/oradata/bys1/system01.dbf. Elapsed time: 0:04:21
checkpoint is 3228505
last deallocation scn is 825711
Undo Optimization current scn is 3225591
Wed Nov 06 00:27:06 2013
alter database recover datafile list clear
Completed: alter database recover datafile list clear
alter database recover datafile list
1 , 2 , 3 , 4 , 5 , 6
Completed: alter database recover datafile list
1 , 2 , 3 , 4 , 5 , 6
######################################################
以上即是第二次restore database;语句执行时的ALERT日志。下面看RECOVER时的日志
######################################################
alter database recover if needed
start until change 3229504
Media Recovery Start
Serial Media Recovery started
Media Recovery start incarnation depth : 1, target inc# : 4, irscn : 3228983
ORA-279 signalled during: alter database recover if needed
start until change 3229504
...
alter database recover logfile '/u01/archbys1/arc_1_32_829941492.arc'
Media Recovery Log /u01/archbys1/arc_1_32_829941492.arc
Recovery of Online Redo Log: Thread 1 Group 1 Seq 1 Reading mem 0
Mem# 0: /u01/oradata/bys1/redo01.log
Incomplete Recovery applied until change 3229504 time 11/06/2013 00:17:09
Media Recovery Complete (bys1)
Completed: alter database recover logfile '/u01/archbys1/arc_1_32_829941492.arc'
####################################################
recover database until scn 3229504语句执行时的ALERT日志
####################################################
alter database open resetlogs
Archived Log entry 122 added for thread 1 sequence 1 ID 0xec64a53c dest 1:
RESETLOGS after incomplete recovery UNTIL CHANGE 3229504
Resetting resetlogs activation ID 3966018876 (0xec64a53c)
Errors in file /u01/diag/rdbms/bys1/bys1/trace/bys1_ora_24755.trc:
ORA-00367: checksum error in log file header
ORA-00322: log 1 of thread 1 is not current copy
ORA-00312: online log 1 thread 1: '/u01/oradata/bys1/redo01.log'
Wed Nov 06 00:27:44 2013
Errors in file /u01/diag/rdbms/bys1/bys1/trace/bys1_m000_24780.trc:
ORA-00316: log 1 of thread 1, type 0 in header is not log file
ORA-00312: online log 1 thread 1: '/u01/oradata/bys1/redo01.log'
Errors in file /u01/diag/rdbms/bys1/bys1/trace/bys1_m000_24780.trc:
ORA-00322: log 2 of thread 1 is not current copy
ORA-00312: online log 2 thread 1: '/u01/oradata/bys1/redo02.log'
Wed Nov 06 00:27:47 2013
Errors in file /u01/diag/rdbms/bys1/bys1/trace/bys1_ora_24755.trc:
ORA-00367: checksum error in log file header
ORA-00322: log 2 of thread 1 is not current copy
ORA-00312: online log 2 thread 1: '/u01/oradata/bys1/redo02.log'
Errors in file /u01/diag/rdbms/bys1/bys1/trace/bys1_m000_24780.trc:
ORA-00322: log 3 of thread 1 is not current copy
ORA-00312: online log 3 thread 1: '/u01/oradata/bys1/redo03.log'
Errors in file /u01/diag/rdbms/bys1/bys1/trace/bys1_ora_24755.trc:
ORA-00367: checksum error in log file header
ORA-00322: log 3 of thread 1 is not current copy
ORA-00312: online log 3 thread 1: '/u01/oradata/bys1/redo03.log'
Wed Nov 06 00:27:57 2013
Setting recovery target incarnation to 5
Wed Nov 06 00:27:57 2013
Assigning activation ID 3965999368 (0xec645908)
LGWR: STARTING ARCH PROCESSES
Wed Nov 06 00:27:57 2013
ARC0 started with pid=22, OS id=24788
ARC0: Archival started
LGWR: STARTING ARCH PROCESSES COMPLETE
ARC0: STARTING ARCH PROCESSES
Wed Nov 06 00:27:58 2013
ARC1 started with pid=23, OS id=24793
Thread 1 opened at log sequence 1 可以看到,当前REDO的序号在RESETLOS后被重置为了1.
Current log# 1 seq# 1 mem# 0: /u01/oradata/bys1/redo01.log
Successful open of redo thread 1
……
LOGSTDBY: Validating controlfile with logical metadata
LOGSTDBY: Validation complete
ARC3: Archival started
ARC0: STARTING ARCH PROCESSES COMPLETE
Completed: alter database open resetlogs
###########################################################
下面是第二次RESETLOGS后打开库后的日志:
###########################################################
Wed Nov 06 00:32:49 2013
Thread 1 advanced to log sequence 2 (LGWR switch)
Current log# 2 seq# 2 mem# 0: /u01/oradata/bys1/redo02.log
Wed Nov 06 00:32:49 2013
Archived Log entry 123added for thread 1 sequence 1 ID 0xec645908 dest 1: 可以看到归档的entry 没有被重置为1,这里对应的是查询v$archived_log 中的sequence#号,是连续的,未因RESETLOGS而改变。