ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RAC环境的恢复策略

RAC环境的恢复策略

原创 Linux操作系统 作者:yangtingkun 时间:2007-06-26 00:00:00 0 删除 编辑

对于RAC环境,不同的备份策略会导致备份文件的分步不同,如果频繁修改备份策略,或者备份策略混乱的话,会给恢复过程带来很大的困难。


对于RAC环境中的多种备份策略,前面已经通过10篇文章详细描述了,这里想要强调的是,备份策略的不同,会导致备份结果的分步不同,进而影响恢复的策略和步骤。

一般情况下,恢复策略和备份策略必须是对应的。如果备份策略进行了修改,那么恢复也应该采用相同的策略。

这样描述太过于抽象,举个例子,比如备份的时候用RMAN配置两个CHANNEL,每个CHANNEL都通过CONNECT语句指向一个实例,在备份的时候,两个CHANNEL同时运行,每个实例会将本CHANNEL读取的数据文件写到这个实例所在服务器所挂接的磁带上。

而在恢复过程中,每个节点都只能挂接自己备份的磁带,而无法恢复别的节点备份的磁带。也就是说,恢复也必须启动两个CHANNEL,每个连接到一个实例上,同时进行恢复。

为了避免出现问题,建议在变更备份策略后,马上对整个数据库进行一次备份。另外在恢复之前,可以考虑利用VALIDATE来验证恢复是否是可行的,下面这个例子就说明备份机制和恢复机制不同的话,会造成的问题:

bash-2.03$ export NLS_LANG=american
bash-2.03$ export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
bash-2.03$ rman target /

Recovery Manager: Release 10.2.0.3.0 - Production on Tue Jun 26 13:11:42 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

connected to target database: TESTRAC (DBID=4291216984, not open)

RMAN> run
2> {
3> set until time '2007-6-21 0:0:0';
4> restore database;
5> recover database;
6> }

executing command: SET until clause
using target database control file instead of recovery catalog

Starting restore at 2007-06-26 13:14:31
configuration for SBT_TAPE channel 2 is ignored
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: sid=313 instance=testrac2 devtype=SBT_TAPE
channel ORA_SBT_TAPE_1: VERITAS NetBackup for Oracle - Release 6.0 (2006110304)
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=305 instance=testrac2 devtype=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: sid=304 instance=testrac2 devtype=DISK

channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00005 to +DISK/testrac/datafile/users.267.618591279
restoring datafile 00006 to +DISK/testrac/datafile/zhejiang01.dbf
restoring datafile 00008 to +DISK/testrac/datafile/ndmain01.dbf
restoring datafile 00009 to +DISK/testrac/datafile/zhejiang03.dbf
restoring datafile 00010 to +DISK/testrac/datafile/ndindex01.dbf
restoring datafile 00012 to +DISK/testrac/datafile/zhejiang05.dbf
channel ORA_SBT_TAPE_1: reading from backup piece krikm8an_1_1
ORA-19870: error reading backup piece krikm8an_1_1
ORA-19507: failed to retrieve sequential file, handle="krikm8an_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +DISK/testrac/datafile/system.262.618591167
restoring datafile 00002 to +DISK/testrac/datafile/undotbs1.263.618591197
channel ORA_SBT_TAPE_1: reading from backup piece kvikmgua_1_1
ORA-19870: error reading backup piece kvikmgua_1_1
ORA-19507: failed to retrieve sequential file, handle="kvikmgua_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00003 to +DISK/testrac/datafile/sysaux.264.618591225
restoring datafile 00004 to +DISK/testrac/datafile/undotbs2.266.618591249
restoring datafile 00007 to +DISK/testrac/datafile/zhejiang02.dbf
restoring datafile 00011 to +DISK/testrac/datafile/zhejiang04.dbf
restoring datafile 00013 to +DISK/testrac/datafile/lt_index_ts01.dbf
restoring datafile 00014 to +DISK/testrac/datafile/zhejiang06.dbf
restoring datafile 00015 to +DISK/testrac/datafile/gpo.367.624623443
channel ORA_SBT_TAPE_1: reading from backup piece liikp6gh_1_3
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=liikp6gh_1_3 tag=TAG20070620T185927
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:31:05
failover to previous backup

channel ORA_DISK_1: restoring datafile 00001
input datafile copy recid=334 stamp=625680829 filename=/data1/backup/system.dbf
destination for restore of datafile 00001: +DISK/testrac/datafile/system.262.618591167
ORA-19505: failed to identify file "/data1/backup/system.dbf"
ORA-27037: unable to obtain file status
SVR4 Error: 2: No such file or directory
Additional information: 3
ORA-19600: input file is datafile-copy 334 (/data1/backup/system.dbf)
ORA-19601: output file is datafile 1 (+DISK/testrac/datafile/system.262.618591167)
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00006 to +DISK/testrac/datafile/zhejiang01.dbf
restoring datafile 00008 to +DISK/testrac/datafile/ndmain01.dbf
restoring datafile 00009 to +DISK/testrac/datafile/zhejiang03.dbf
restoring datafile 00010 to +DISK/testrac/datafile/ndindex01.dbf
restoring datafile 00012 to +DISK/testrac/datafile/zhejiang05.dbf
channel ORA_SBT_TAPE_1: reading from backup piece kjiklia0_1_1
ORA-19870: error reading backup piece kjiklia0_1_1
ORA-19507: failed to retrieve sequential file, handle="kjiklia0_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00005 to +DISK/testrac/datafile/users.267.618591279
channel ORA_SBT_TAPE_1: reading from backup piece knikm6aq_1_1
ORA-19870: error reading backup piece knikm6aq_1_1
ORA-19507: failed to retrieve sequential file, handle="knikm6aq_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to +DISK/testrac/datafile/undotbs1.263.618591197
channel ORA_SBT_TAPE_1: reading from backup piece krikm8an_1_1
ORA-19870: error reading backup piece krikm8an_1_1
ORA-19507: failed to retrieve sequential file, handle="krikm8an_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
failover to previous backup

channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00009 to +DISK/testrac/datafile/zhejiang03.dbf
channel ORA_SBT_TAPE_1: reading from backup piece k0ikjnpt_1_1
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=k0ikjnpt_1_1 tag=TAG20070618T171750
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:27:55
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00012 to +DISK/testrac/datafile/zhejiang05.dbf
channel ORA_SBT_TAPE_1: reading from backup piece jvikjnpv_1_1
ORA-19870: error reading backup piece jvikjnpv_1_1
ORA-19507: failed to retrieve sequential file, handle="jvikjnpv_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00006 to +DISK/testrac/datafile/zhejiang01.dbf
restoring datafile 00008 to +DISK/testrac/datafile/ndmain01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece juikjnpv_1_1
ORA-19870: error reading backup piece juikjnpv_1_1
ORA-19507: failed to retrieve sequential file, handle="juikjnpv_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00010 to +DISK/testrac/datafile/ndindex01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece kfiklhd6_1_1
ORA-19870: error reading backup piece kfiklhd6_1_1
ORA-19507: failed to retrieve sequential file, handle="kfiklhd6_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00002 to +DISK/testrac/datafile/undotbs1.263.618591197
restoring datafile 00005 to +DISK/testrac/datafile/users.267.618591279
channel ORA_SBT_TAPE_1: reading from backup piece kjiklia0_1_1
ORA-19870: error reading backup piece kjiklia0_1_1
ORA-19507: failed to retrieve sequential file, handle="kjiklia0_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +DISK/testrac/datafile/system.262.618591167
channel ORA_SBT_TAPE_1: reading from backup piece l4iko4cr_1_1
ORA-19870: error reading backup piece l4iko4cr_1_1
ORA-19507: failed to retrieve sequential file, handle="l4iko4cr_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
failover to previous backup

.

.

.

channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00010 to +DISK/testrac/datafile/ndindex01.dbf
channel ORA_SBT_TAPE_1: reading from backup piece iiik9hb2_1_2
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=iiik9hb2_1_2 tag=TAG20070614T202609
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:03:36
channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00005 to +DISK/testrac/datafile/users.267.618591279
channel ORA_SBT_TAPE_1: reading from backup piece j7ikirtu_1_1
ORA-19870: error reading backup piece j7ikirtu_1_1
ORA-19507: failed to retrieve sequential file, handle="j7ikirtu_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
failover to previous backup

channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00005 to +DISK/testrac/datafile/users.267.618591279
channel ORA_SBT_TAPE_1: reading from backup piece j3ikbop1_1_1
ORA-19870: error reading backup piece j3ikbop1_1_1
ORA-19507: failed to retrieve sequential file, handle="j3ikbop1_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
failover to previous backup

channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00005 to +DISK/testrac/datafile/users.267.618591279
channel ORA_SBT_TAPE_1: reading from backup piece ioikbn05_1_1
ORA-19870: error reading backup piece ioikbn05_1_1
ORA-19507: failed to retrieve sequential file, handle="ioikbn05_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
failover to previous backup

channel ORA_SBT_TAPE_1: starting datafile backupset restore
channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set
restoring datafile 00005 to +DISK/testrac/datafile/users.267.618591279
channel ORA_SBT_TAPE_1: reading from backup piece iiik9hb2_1_2
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=iiik9hb2_1_2 tag=TAG20070614T202609
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:02:35
Finished restore at 2007-06-26 15:32:39

Starting recover at 2007-06-26 15:32:39
using channel ORA_SBT_TAPE_1
using channel ORA_DISK_1
using channel ORA_DISK_2

starting media recovery

channel ORA_SBT_TAPE_1: starting archive log restore to default destination
channel ORA_SBT_TAPE_1: restoring archive log
archive log thread=2 sequence=253
channel ORA_SBT_TAPE_1: restoring archive log
archive log thread=1 sequence=338
channel ORA_SBT_TAPE_1: restoring archive log
archive log thread=2 sequence=254
channel ORA_SBT_TAPE_1: reading from backup piece jgikj1tq_1_1
channel ORA_SBT_TAPE_1: restored backup piece 1
piece handle=jgikj1tq_1_1 tag=TAG20070618T110427
channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:03:25
archive log filename=/data1/archivelog/2_253_618591128.dbf thread=2 sequence=253
archive log filename=/data1/archivelog/1_338_618591128.dbf thread=1 sequence=338
channel ORA_SBT_TAPE_1: starting archive log restore to default destination
channel ORA_SBT_TAPE_1: restoring archive log
archive log thread=1 sequence=339
channel ORA_SBT_TAPE_1: restoring archive log
archive log thread=1 sequence=340
channel ORA_SBT_TAPE_1: reading from backup piece jfikj1tt_1_1
ORA-19870: error reading backup piece jfikj1tt_1_1
ORA-19507: failed to retrieve sequential file, handle="jfikj1tt_1_1", parms=""
ORA-27029: skgfrtrv: sbtrestore returned error
ORA-19511: Error received from media manager layer, error text:
Backup file not found in NetBackup catalog
failover to previous backup
Oracle Error:
ORA-01547: warning: RECOVER succeeded but OPEN RESETLOGS would get error below
ORA-01152: file 1 was not restored from a sufficiently old backup
ORA-01110: data file 1: '+DISK/testrac/datafile/system.262.618591167'

RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 06/26/2007 15:37:07
RMAN-20506: no backup of archivelog found
RMAN-06053: unable to perform media recovery because of missing log
RMAN-06025: no backup of log thread 1 seq 340 lowscn 5215185427 found to restore
RMAN-06025: no backup of log thread 1 seq 339 lowscn 5214803171 found to restore

由于前面一段时间,在使用这个数据库进行备份的测试,前后采用多种备份策略执行了很多次的备份操作。而这个恢复操作使用的又是不完全恢复,因此Oracle没有选择最新的备份进行恢复,造成了目前的恢复策略和备份是的不一致,Oracle在大量的失败重试后,最终仍然是以错误结束了恢复操作。

想要解决这个问题,就必须采用合适的恢复策略:

RMAN> run
2> {
3> set until time '2007-6-21 0:0:0';
4> allocate channel c1 device type sbt connect 'sys/test@testrac1';
5> allocate channel c2 device type sbt connect 'sys/test@testrac2';
6> restore database;
7> recover database;
8> }

executing command: SET until clause

allocated channel: c1
channel c1: sid=313 instance=testrac1 devtype=SBT_TAPE
channel c1: VERITAS NetBackup for Oracle - Release 6.0 (2006110304)

allocated channel: c2
channel c2: sid=313 instance=testrac2 devtype=SBT_TAPE
channel c2: VERITAS NetBackup for Oracle - Release 6.0 (2006110304)

Starting restore at 2007-06-26 15:57:18

skipping datafile 3; already restored to file +DISK/testrac/datafile/sysaux.264.618591225
skipping datafile 4; already restored to file +DISK/testrac/datafile/undotbs2.266.618591249
skipping datafile 7; already restored to file +DISK/testrac/datafile/zhejiang02.dbf
skipping datafile 11; already restored to file +DISK/testrac/datafile/zhejiang04.dbf
skipping datafile 13; already restored to file +DISK/testrac/datafile/lt_index_ts01.dbf
skipping datafile 14; already restored to file +DISK/testrac/datafile/zhejiang06.dbf
skipping datafile 15; already restored to file +DISK/testrac/datafile/gpo.367.624623443
channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00005 to +DISK/testrac/datafile/users.267.618591279
restoring datafile 00006 to +DISK/testrac/datafile/zhejiang01.dbf
restoring datafile 00008 to +DISK/testrac/datafile/ndmain01.dbf
restoring datafile 00009 to +DISK/testrac/datafile/zhejiang03.dbf
restoring datafile 00010 to +DISK/testrac/datafile/ndindex01.dbf
restoring datafile 00012 to +DISK/testrac/datafile/zhejiang05.dbf
channel c1: reading from backup piece krikm8an_1_1
channel c1: restored backup piece 1
piece handle=krikm8an_1_1 tag=TAG20070619T161202
channel c1: restore complete, elapsed time: 01:29:13
channel c1: starting datafile backupset restore
channel c1: specifying datafile(s) to restore from backup set
restoring datafile 00001 to +DISK/testrac/datafile/system.262.618591167
restoring datafile 00002 to +DISK/testrac/datafile/undotbs1.263.618591197
channel c1: reading from backup piece kvikmgua_1_1
channel c1: restored backup piece 1
piece handle=kvikmgua_1_1 tag=TAG20070619T183906
channel c1: restore complete, elapsed time: 00:05:26
Finished restore at 2007-06-26 17:32:10

Starting recover at 2007-06-26 17:32:11

starting media recovery

channel c2: starting archive log restore to default destination
channel c2: restoring archive log
archive log thread=1 sequence=345
channel c2: restoring archive log
archive log thread=1 sequence=346
channel c2: restoring archive log
archive log thread=1 sequence=347
channel c2: restoring archive log
archive log thread=1 sequence=348
channel c2: restoring archive log
archive log thread=1 sequence=349
channel c2: restoring archive log
archive log thread=2 sequence=263
channel c2: restoring archive log
archive log thread=2 sequence=264
channel c2: restoring archive log
archive log thread=1 sequence=350
channel c2: restoring archive log
archive log thread=2 sequence=265
channel c2: restoring archive log
archive log thread=1 sequence=351
channel c2: restoring archive log
archive log thread=2 sequence=266
channel c2: restoring archive log
archive log thread=1 sequence=352
channel c2: reading from backup piece r7il6c1t_1_1
channel c2: restored backup piece 1
piece handle=r7il6c1t_1_1 tag=TAG20070625T185347
channel c2: restore complete, elapsed time: 00:02:35
archive log filename=/data1/archivelog/1_345_618591128.dbf thread=1 sequence=345
channel c2: starting archive log restore to default destination
channel c2: restoring archive log
archive log thread=2 sequence=259
channel c2: restoring archive log
archive log thread=2 sequence=260
channel c2: restoring archive log
archive log thread=2 sequence=261
channel c2: restoring archive log
archive log thread=2 sequence=262
channel c2: reading from backup piece r8il6c7n_1_1
channel c2: restored backup piece 1
piece handle=r8il6c7n_1_1 tag=TAG20070625T185347
channel c2: restore complete, elapsed time: 00:01:07
archive log filename=/data1/archivelog/2_259_618591128.dbf thread=2 sequence=259
archive log filename=/data1/archivelog/2_260_618591128.dbf thread=2 sequence=260
archive log filename=/data1/archivelog/1_346_618591128.dbf thread=1 sequence=346
archive log filename=/data1/archivelog/1_347_618591128.dbf thread=1 sequence=347
archive log filename=/data1/archivelog/2_261_618591128.dbf thread=2 sequence=261
archive log filename=/data1/archivelog/2_262_618591128.dbf thread=2 sequence=262
archive log filename=/data1/archivelog/1_348_618591128.dbf thread=1 sequence=348
archive log filename=/data1/archivelog/1_349_618591128.dbf thread=1 sequence=349
archive log filename=/data1/archivelog/2_263_618591128.dbf thread=2 sequence=263
archive log filename=/data1/archivelog/2_264_618591128.dbf thread=2 sequence=264
archive log filename=/data1/archivelog/1_350_618591128.dbf thread=1 sequence=350
archive log filename=/data1/archivelog/2_265_618591128.dbf thread=2 sequence=265
archive log filename=/data1/archivelog/1_351_618591128.dbf thread=1 sequence=351
archive log filename=/data1/archivelog/2_266_618591128.dbf thread=2 sequence=266
archive log filename=/data1/archivelog/1_352_618591128.dbf thread=1 sequence=352
media recovery complete, elapsed time: 00:00:58
Finished recover at 2007-06-26 17:37:08
released channel: c2
released channel: c1

RMAN> alter database open resetlogs;

database opened

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/4227/viewspace-69325/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
暂无介绍

注册时间:2007-12-29

  • 博文量
    1955
  • 访问量
    10423237