诛仙破军用什么宠物:| Backupset与Incarnation | DBA之路:OoNiceDream |

来源:百度文库 编辑:九乡新闻网 时间:2024/05/08 07:14:35

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>