当前位置: DBARoad > 备份恢复 > 文章正文

Backupset与Incarnation

                    作者 :OoNiceDream【转载时请务必以超链接形式标明文章原始出处和作者信息】
                    链接:http://www.dbaroad.me/archives/2009/07/backupset_incarnation.html

Reset database重新注册新的Incarnation之后,默认恢复时,即使我们指定了tag,也不会去使用之前incarnation的备份集。备份集总是对应一个特定的incarnation,无法在一个incarnation下恢复另一个incarnation下的备份集,但我们可以使用reset database to incarnation Inc,指定了incarnation后,就可以恢复那个incarnation下的备份集了。例如我们不完全恢复后,仍想使用老的备份集再进行恢复,就需要指定incarnation了。

举了例子,在reset database之后,没有进行新的备份,虽然list backup of controlfile有不少备份集,但却无法恢复:

RMAN> list incarnation;
 
 
数据库 Incarnations 列表
DB 关键字  Inc 关键字 DB 名  DB ID            CUR 重置 SCN   重置时间
------- ------- -------- ---------------- --- ---------- ----------
1       2       SKY      2987191772       NO  1248567    19-7-08
1       37      SKY      2987191772       NO  1270013    16-10-08
1       697     SKY      2987191772       NO  1442433    29-6-09
1       891     SKY      2987191772       YES 1443480    21-7-09
 
 
RMAN> run {
2>  allocate channel ch00 type DISK;
3>  allocate channel ch01 type DISK;
4>  allocate channel ch02 type DISK;
5>  restore controlfile from tag "DB_FULL_BACKUP";
6>  release channel ch00;
7>  release channel ch01;
8>  release channel ch02;
9> }
 
分配的通道: ch00
通道 ch00: sid=11 devtype=DISK
 
分配的通道: ch01
通道 ch01: sid=12 devtype=DISK
 
分配的通道: ch02
通道 ch02: sid=13 devtype=DISK
 
启动 restore 于 21-7-09
 
释放的通道: ch00
释放的通道: ch01
释放的通道: ch02
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 07/21/2009 16:05:34
RMAN-06026: some targets not found - aborting restore
RMAN-06024: no backup or copy of the controlfile found to restore

此时可以使用reset database to incarnation Inc,恢复到之前备份集对应的incarnation:

RMAN> reset database to incarnation 697;
 
数据库重设为恢复目录中的原型 697
 
RMAN> run {
2>  allocate channel ch00 type DISK;
3>  allocate channel ch01 type DISK;
4>  allocate channel ch02 type DISK;
5>  restore controlfile from tag "DB_FULL_BACKUP";
6>  release channel ch00;
7>  release channel ch01;
8>  release channel ch02;
9> }
 
分配的通道: ch00
通道 ch00: sid=11 devtype=DISK
 
分配的通道: ch01
通道 ch01: sid=12 devtype=DISK
 
分配的通道: ch02
通道 ch02: sid=13 devtype=DISK
 
启动 restore 于 21-7-09
 
通道 ch00: 正在开始恢复数据文件备份集
通道 ch00: 正在恢复控制文件
输出文件名=E:\CONTROL01.CTL
通道 ch00: 已恢复备份段 1
段 handle=D:\ORACLE_BAK\FULL_SKY_20090721_18_1 tag=DB_FULL_BACKUP 
params=NULL
通道 ch00: 恢复完成
正在复制控制文件
输出文件名=E:\CONTROL01.CTL
输出文件名=E:\CONTROL02.CTL
输出文件名=E:\CONTROL03.CTL
完成 restore 于 21-7-09
 
释放的通道: ch00
 
释放的通道: ch01
 
释放的通道: ch02
 
RMAN>

— The End —

关键字:
喜欢DBARoad的文章,那就通过 RSS Feed 功能订阅阅读吧!

我要评论

*

* 绝不会泄露


  • 订阅


      抓虾
      google reader
      my yahoo
      bloglines
      鲜果
      有道

站内搜索



返回首页 | 关于我 | 联系我 | 广告合作 | 网站地图 | 友情链接 | 版权声明 |