rman恢复的一个案例

在模拟丢失所有控制文件的时候出现了一些困难,这里记录一下

案例如下:

4所有的控制文件 are lost;

通过v$controlfile查出所有的,然后删除所有控制文件,通过控制文件的自动备份来恢复控制文件。


run {
 allocate channel v1 type disk;
restore controlfile  from '/u01/app/oracle/flash_recovery_area/ORCL/autobackup/2011_05_11/o1_mf_s_750888197_6wnyr5qv_.bkp';
 alter database mount;
 recover database;
alter database open resetlogs;}


用脚本全备之后删除所有的控制文件

重启之后,却发现没有控制文件系统是进不了mount状态的,犯了傻 ,这时候丢失数据文件的方法就不适用了

就按则示例的内容

restore controlfile from ''

从一组备份中恢复了控制文件

这时候alter database open却一直报错

因为恢复的控制文件和当前的数据库状态是不一致的,数据库无法经过一致性校验,也就启动不起来

试了很多种方法包括dra都不行


直到后来才想到控制文件和数据文件不一致的问题

在Mountz状态下查看了一下database和contreolfile的备份

想使用同一次的数据文件结合控制文件来恢复数据库

这里想到了在Linux 下使用 ls -lh来查看备份文件的状态 

确定了最近一次备份的同一组数据文件和控制文件 

具体的步骤 参考了一下其他的资料 这里直接复制了一下 


解决方法:

通过备份的controlfile进行恢复

RMAN> list backup of controlfile;

但是通过rman查看备份的controlfile信息时,却没有!

还好,在磁盘上找到一个控制文件的backup piece!

加载到rman metadata中:

RMAN> catalog backuppiece '/backup/rman_bak/ctl1_166.bak';

cataloged backuppiece
backup piece handle=/backup/rman_bak/ctl1_166.bak recid=191 stamp=859138553

RMAN> list backup of controlfile;

List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
162     Full    1.06M      DISK        00:00:01     23-SEP-14      
        BP Key: 191   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T174510
        Piece Name: /backup/rman_bak/ctl1_166.bak
  Control File Included: Ckp SCN: 645423       Ckp time: 23-SEP-14

查看备份信息:

RMAN> list backup of database ;

List of Backup Sets
===================
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
107     Incr 0  36.22M     DISK	00:06:19     23-SEP-14      
  BP Key: 107   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T160003
  Piece Name: /backup/rman_bak/lv0_PROD_112_859046404.bak
  List of Datafiles in backup set 107
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2    0  Incr 642399     23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf
  3    0  Incr 642399     23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf
  5    0  Incr 642399     23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
108     Incr 0  81.68M     DISK	00:06:30     23-SEP-14      
  BP Key: 108   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T160003
  Piece Name: /backup/rman_bak/lv0_PROD_111_859046404.bak
  List of Datafiles in backup set 108
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1    0  Incr 642397     23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf
  4    0  Incr 642397     23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
114     Incr 1  216.00K    DISK	00:00:01     23-SEP-14      
  BP Key: 114   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T161506
  Piece Name: /backup/rman_bak/lvl1_PROD_118_859047306.bak
  List of Datafiles in backup set 114
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1    1  Incr 642881     23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf
  4    1  Incr 642881     23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
115     Incr 1  1.09M      DISK	00:00:05     23-SEP-14      
  BP Key: 115   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T161506
  Piece Name: /backup/rman_bak/lvl1_PROD_119_859047306.bak
  List of Datafiles in backup set 115
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2    1  Incr 642883     23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf
  3    1  Incr 642883     23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf
  5    1  Incr 642883     23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
121     Incr 1  168.00K    DISK	00:00:01     23-SEP-14      
  BP Key: 121   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T163003
  Piece Name: /backup/rman_bak/lvl1_PROD_125_859048203.bak
  List of Datafiles in backup set 121
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1    1  Incr 643340     23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf
  4    1  Incr 643340     23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
122     Incr 1  240.00K    DISK	00:00:01     23-SEP-14      
  BP Key: 122   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T163003
  Piece Name: /backup/rman_bak/lvl1_PROD_126_859048203.bak
  List of Datafiles in backup set 122
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2    1  Incr 643342     23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf
  3    1  Incr 643342     23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf
  5    1  Incr 643342     23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
128     Incr 1  192.00K    DISK	00:00:01     23-SEP-14      
  BP Key: 128   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T164503
  Piece Name: /backup/rman_bak/lvl1_PROD_132_859049103.bak
  List of Datafiles in backup set 128
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1    1  Incr 643737     23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf
  4    1  Incr 643737     23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
129     Incr 1  240.00K    DISK	00:00:01     23-SEP-14      
  BP Key: 129   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T164503
  Piece Name: /backup/rman_bak/lvl1_PROD_133_859049103.bak
  List of Datafiles in backup set 129
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2    1  Incr 643739     23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf
  3    1  Incr 643739     23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf
  5    1  Incr 643739     23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
135     Incr 0  36.26M     DISK	00:01:40     23-SEP-14      
  BP Key: 135   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T170004
  Piece Name: /backup/rman_bak/lv0_PROD_140_859050004.bak
  List of Datafiles in backup set 135
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2    0  Incr 644121     23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf
  3    0  Incr 644121     23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf
  5    0  Incr 644121     23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
138     Incr 0  81.69M     DISK	00:02:18     23-SEP-14      
  BP Key: 138   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T170004
  Piece Name: /backup/rman_bak/lv0_PROD_139_859050004.bak
  List of Datafiles in backup set 138
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1    0  Incr 644119     23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf
  4    0  Incr 644119     23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
142     Incr 1  112.00K    DISK	00:00:01     23-SEP-14      
  BP Key: 142   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T171504
  Piece Name: /backup/rman_bak/lvl1_PROD_146_859050904.bak
  List of Datafiles in backup set 142
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1    1  Incr 644562     23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf
  4    1  Incr 644562     23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
143     Incr 1  1.09M      DISK	00:00:02     23-SEP-14      
  BP Key: 143   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T171504
  Piece Name: /backup/rman_bak/lvl1_PROD_147_859050904.bak
  List of Datafiles in backup set 143
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2    1  Incr 644564     23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf
  3    1  Incr 644564     23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf
  5    1  Incr 644564     23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
149     Incr 1  152.00K    DISK	00:00:01     23-SEP-14      
  BP Key: 149   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T173003
  Piece Name: /backup/rman_bak/lvl1_PROD_153_859051804.bak
  List of Datafiles in backup set 149
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1    1  Incr 645007     23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf
  4    1  Incr 645007     23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
150     Incr 1  240.00K    DISK	00:00:01     23-SEP-14      
  BP Key: 150   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T173003
  Piece Name: /backup/rman_bak/lvl1_PROD_154_859051804.bak
  List of Datafiles in backup set 150
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2    1  Incr 645009     23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf
  3    1  Incr 645009     23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf
  5    1  Incr 645009     23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
156     Incr 1  232.00K    DISK	00:00:01     23-SEP-14      
  BP Key: 156   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T174503
  Piece Name: /backup/rman_bak/lvl1_PROD_161_859052703.bak
  List of Datafiles in backup set 156
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  2    1  Incr 645407     23-SEP-14 /u01/app/oracle/oradata/prod/undotbs01.dbf
  3    1  Incr 645407     23-SEP-14 /u01/app/oracle/oradata/prod/sysaux01.dbf
  5    1  Incr 645407     23-SEP-14 /u01/app/oracle/oradata/prod/example01.dbf
BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
157     Incr 1  128.00K    DISK	00:00:01     23-SEP-14      
  BP Key: 157   Status: AVAILABLE  Compressed: YES  Tag: TAG20140923T174503
  Piece Name: /backup/rman_bak/lvl1_PROD_160_859052703.bak
  List of Datafiles in backup set 157
  File LV Type Ckp SCN    Ckp Time  Name
  ---- -- ---- ---------- --------- ----
  1    1  Incr 645405     23-SEP-14 /u01/app/oracle/oradata/prod/system01.dbf
  4    1  Incr 645405     23-SEP-14 /u01/app/oracle/oradata/prod/users01.dbf

控制文件的备份是在9月23日,17:45分,选择9月23日17:00的0级数据文件备份进行数据文件的转储!

转储控制文件:

 RMAN> shutdown abort;
Oracle instance shut down
RMAN> startup nomount;
connected to target database (not started)
Oracle instance started
Total System Global Area     570425344 bytes
Fixed Size                     2022480 bytes
Variable Size                184550320 bytes
Database Buffers             377487360 bytes
Redo Buffers                   6365184 bytes
RMAN> restore controlfile from '/backup/rman_bak/ctl1_166.bak';
Starting restore at 24-SEP-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=155 devtype=DISK
channel ORA_DISK_2: skipped, autobackup already found
channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:11
output filename=/u01/app/oracle/oradata/prod/control01.ctl
output filename=/disk1/prod/control02.ctl
output filename=/disk2/prod/control03.ctl
Finished restore at 24-SEP-14

转储数据文件:

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1
released channel: ORA_DISK_2

RMAN> restore database from tag='TAG20140923T170004';

Starting restore at 24-SEP-14
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=155 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=156 devtype=DISK
channel ORA_DISK_2: starting datafile backupset restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
restoring datafile 00001 to /u01/app/oracle/oradata/prod/system01.dbf
restoring datafile 00004 to /u01/app/oracle/oradata/prod/users01.dbf
channel ORA_DISK_2: reading from backup piece /backup/rman_bak/lv0_PROD_139_859050004.bak
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to /u01/app/oracle/oradata/prod/undotbs01.dbf
restoring datafile 00003 to /u01/app/oracle/oradata/prod/sysaux01.dbf
restoring datafile 00005 to /u01/app/oracle/oradata/prod/example01.dbf
channel ORA_DISK_1: reading from backup piece /backup/rman_bak/lv0_PROD_140_859050004.bak
channel ORA_DISK_1: restored backup piece 1
piece handle=/backup/rman_bak/lv0_PROD_140_859050004.bak tag=TAG20140923T170004
channel ORA_DISK_1: restore complete, elapsed time: 00:00:35
channel ORA_DISK_2: restored backup piece 1
piece handle=/backup/rman_bak/lv0_PROD_139_859050004.bak tag=TAG20140923T170004
channel ORA_DISK_2: restore complete, elapsed time: 00:00:35
Finished restore at 24-SEP-14

查看转储后的数据文件和控制文件的checkpoint:

SQL> col name for a50
SQL> r
  1* select name ,checkpoint_change# from v$datafile
NAME                                               CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
/u01/app/oracle/oradata/prod/system01.dbf                      645405
/u01/app/oracle/oradata/prod/undotbs01.dbf                     645407
/u01/app/oracle/oradata/prod/sysaux01.dbf                      645407
/u01/app/oracle/oradata/prod/users01.dbf                       645405
/u01/app/oracle/oradata/prod/example01.dbf                     645407
SQL> select name ,checkpoint_change# from v$datafile_header;
NAME                                               CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
/u01/app/oracle/oradata/prod/system01.dbf                      644119
/u01/app/oracle/oradata/prod/undotbs01.dbf                     644121
/u01/app/oracle/oradata/prod/sysaux01.dbf                      644121
/u01/app/oracle/oradata/prod/users01.dbf                       644119
/u01/app/oracle/oradata/prod/example01.dbf                     644121

对database做recover:

RMAN> recover database;

Starting recover at 24-SEP-14
using channel ORA_DISK_1
using channel ORA_DISK_2
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: /u01/app/oracle/oradata/prod/system01.dbf
destination for restore of datafile 00004: /u01/app/oracle/oradata/prod/users01.dbf
channel ORA_DISK_1: reading from backup piece /backup/rman_bak/lvl1_PROD_146_859050904.bak
channel ORA_DISK_2: starting incremental datafile backupset restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
destination for restore of datafile 00002: /u01/app/oracle/oradata/prod/undotbs01.dbf
destination for restore of datafile 00003: /u01/app/oracle/oradata/prod/sysaux01.dbf
destination for restore of datafile 00005: /u01/app/oracle/oradata/prod/example01.dbf
channel ORA_DISK_2: reading from backup piece /backup/rman_bak/lvl1_PROD_147_859050904.bak
channel ORA_DISK_1: restored backup piece 1
piece handle=/backup/rman_bak/lvl1_PROD_146_859050904.bak tag=TAG20140923T171504
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: /u01/app/oracle/oradata/prod/system01.dbf
destination for restore of datafile 00004: /u01/app/oracle/oradata/prod/users01.dbf
channel ORA_DISK_1: reading from backup piece /backup/rman_bak/lvl1_PROD_153_859051804.bak
channel ORA_DISK_2: restored backup piece 1
piece handle=/backup/rman_bak/lvl1_PROD_147_859050904.bak tag=TAG20140923T171504
channel ORA_DISK_2: restore complete, elapsed time: 00:00:02
channel ORA_DISK_2: starting incremental datafile backupset restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
destination for restore of datafile 00002: /u01/app/oracle/oradata/prod/undotbs01.dbf
destination for restore of datafile 00003: /u01/app/oracle/oradata/prod/sysaux01.dbf
destination for restore of datafile 00005: /u01/app/oracle/oradata/prod/example01.dbf
channel ORA_DISK_2: reading from backup piece /backup/rman_bak/lvl1_PROD_154_859051804.bak
channel ORA_DISK_1: restored backup piece 1
piece handle=/backup/rman_bak/lvl1_PROD_153_859051804.bak tag=TAG20140923T173003
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
channel ORA_DISK_2: restored backup piece 1
piece handle=/backup/rman_bak/lvl1_PROD_154_859051804.bak tag=TAG20140923T173003
channel ORA_DISK_2: restore complete, elapsed time: 00:00:02
channel ORA_DISK_1: starting incremental datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: /u01/app/oracle/oradata/prod/system01.dbf
destination for restore of datafile 00004: /u01/app/oracle/oradata/prod/users01.dbf
channel ORA_DISK_1: reading from backup piece /backup/rman_bak/lvl1_PROD_160_859052703.bak
channel ORA_DISK_2: starting incremental datafile backupset restore
channel ORA_DISK_2: specifying datafile(s) to restore from backup set
destination for restore of datafile 00002: /u01/app/oracle/oradata/prod/undotbs01.dbf
destination for restore of datafile 00003: /u01/app/oracle/oradata/prod/sysaux01.dbf
destination for restore of datafile 00005: /u01/app/oracle/oradata/prod/example01.dbf
channel ORA_DISK_2: reading from backup piece /backup/rman_bak/lvl1_PROD_161_859052703.bak
channel ORA_DISK_1: restored backup piece 1
piece handle=/backup/rman_bak/lvl1_PROD_160_859052703.bak tag=TAG20140923T174503
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
channel ORA_DISK_2: restored backup piece 1
piece handle=/backup/rman_bak/lvl1_PROD_161_859052703.bak tag=TAG20140923T174503
channel ORA_DISK_2: restore complete, elapsed time: 00:00:01
starting media recovery
archive log thread 1 sequence 92 is already on disk as file /disk1/prod/redo01.log
archive log thread 1 sequence 93 is already on disk as file /disk1/prod/redo02.log
channel ORA_DISK_1: starting archive log restore to default destination
channel ORA_DISK_1: restoring archive log
archive log thread=1 sequence=77
channel ORA_DISK_1: reading from backup piece /backup/rman_bak/arch1_165.bak
channel ORA_DISK_1: restored backup piece 1
piece handle=/backup/rman_bak/arch1_165.bak tag=TAG20140923T174507
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
archive log filename=/arch/1_77_858969934.dbf thread=1 sequence=77
unable to find archive log
archive log thread=1 sequence=78
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 09/24/2014 17:44:48
RMAN-06054: media recovery requesting unknown log: thread 1 seq 78 lowscn 645415

recover failure,提示缺少archivelog ,做不完全恢复!

RMAN> run {
2> set until sequence 78;
3> recover database;
4> }
executing command: SET until clause
Starting recover at 24-SEP-14
using channel ORA_DISK_1
using channel ORA_DISK_2
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 24-SEP-14

recover完成!

查看恢复后的database checkpoint:

SQL> select name ,checkpoint_change# from v$datafile;
NAME                                               CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
/u01/app/oracle/oradata/prod/system01.dbf                      645415
/u01/app/oracle/oradata/prod/undotbs01.dbf                     645415
/u01/app/oracle/oradata/prod/sysaux01.dbf                      645415
/u01/app/oracle/oradata/prod/users01.dbf                       645415
/u01/app/oracle/oradata/prod/example01.dbf                     645415
SQL> select name ,checkpoint_change# from v$datafile_header;
NAME                                               CHECKPOINT_CHANGE#
-------------------------------------------------- ------------------
/u01/app/oracle/oradata/prod/system01.dbf                      645415
/u01/app/oracle/oradata/prod/undotbs01.dbf                     645415
/u01/app/oracle/oradata/prod/sysaux01.dbf                      645415
/u01/app/oracle/oradata/prod/users01.dbf                       645415
/u01/app/oracle/oradata/prod/example01.dbf                     645415

打开数据库:

RMAN> alter database open resetlogs;

database opened

@数据库open成功,至此,数据库恢复完成!


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值