catalog start with 将RMAN备份集恢复到另一台机器
oracle10g 中rman的增强功能catalog start with
将备份集注册到控制文件
1.prepare
server1 backup the database and controlfile,
server2 create a new instance,
2.begin
copy server1's backupset to server2's,或许会发生ora-19693,解决方法,
- move all backup files to another dir (I did a subdir of current backup dir)
- crosscheck & delete expired to clear the catalog
- move files back
- crosscheck & list backup
C:\>sqlplus /nolog
SQL*Plus: Release 10.1.0.2.0 - Production on 星期六 11月 3 10:25:12 2007
Copyright (c) 1982, 2004, Oracle. All rights reserved.
SQL> conn / as sysdba
已连接到空闲例程。
SQL> startup nomount
ORACLE 例程已经启动。
已连接到空闲例程。
SQL> startup nomount
ORACLE 例程已经启动。
Total System Global Area 88080384 bytes
Fixed Size 787588 bytes
Variable Size 61864828 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
Fixed Size 787588 bytes
Variable Size 61864828 bytes
Database Buffers 25165824 bytes
Redo Buffers 262144 bytes
RMAN> restore controlfile to 'd:\oradata\resen\control01.ctl' from 'c:\backup\06J0407A_1_1';
SQL> alter database mount;
数据库已更改。
C:\>rman target /
恢复管理器: 版本10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
连接到目标数据库: RESEN (DBID=644166109)
RMAN> catalog start with 'c:\resen';
正在使用目标数据库控制文件替代恢复目录
搜索与样式 c:\resen 匹配的所有文件
数据库未知文件的列表
=====================================
文件名: C:\resen\RESEN_S1_T637661538_P1
文件名: C:\resen\RESEN_S2_T637661543_P1
文件名: C:\resen\RESEN_S3_T637661546_P1
文件名: C:\resen\RESEN_S4_T637661688_P1
搜索与样式 c:\resen 匹配的所有文件
数据库未知文件的列表
=====================================
文件名: C:\resen\RESEN_S1_T637661538_P1
文件名: C:\resen\RESEN_S2_T637661543_P1
文件名: C:\resen\RESEN_S3_T637661546_P1
文件名: C:\resen\RESEN_S4_T637661688_P1
是否确实要将上述文件列入目录 (输入 YES 或 NO)? YES
正在编制文件目录...
目录编制完毕
正在编制文件目录...
目录编制完毕
已列入目录的文件的列表
=======================
文件名: C:\resen\RESEN_S1_T637661538_P1
文件名: C:\resen\RESEN_S2_T637661543_P1
文件名: C:\resen\RESEN_S3_T637661546_P1
文件名: C:\resen\RESEN_S4_T637661688_P1
=======================
文件名: C:\resen\RESEN_S1_T637661538_P1
文件名: C:\resen\RESEN_S2_T637661543_P1
文件名: C:\resen\RESEN_S3_T637661546_P1
文件名: C:\resen\RESEN_S4_T637661688_P1
RMAN> crosscheck backup;
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: sid=162 devtype=DISK
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\BACKUP\RESEN_S1_T637661538_P1 recid=1 stamp=637661539
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S1_T637661538_P1 recid=6 stamp=637670047
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S1_T637661538_P1 recid=10 stamp=637670141
交叉校验备份段: 找到为 'AVAILABLE'
备份段 handle=C:\RESEN\RESEN_S1_T637661538_P1 recid=14 stamp=637670378
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\BACKUP\RESEN_S2_T637661543_P1 recid=2 stamp=637661544
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S2_T637661543_P1 recid=7 stamp=637670047
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S2_T637661543_P1 recid=11 stamp=637670141
交叉校验备份段: 找到为 'AVAILABLE'
备份段 handle=C:\RESEN\RESEN_S2_T637661543_P1 recid=15 stamp=637670378
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\BACKUP\RESEN_S3_T637661546_P1 recid=3 stamp=637661547
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S3_T637661546_P1 recid=8 stamp=637670048
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S3_T637661546_P1 recid=12 stamp=637670142
交叉校验备份段: 找到为 'AVAILABLE'
备份段 handle=C:\RESEN\RESEN_S3_T637661546_P1 recid=16 stamp=637670378
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\BACKUP\RESEN_S4_T637661688_P1 recid=4 stamp=637661689
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S4_T637661688_P1 recid=9 stamp=637670049
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S4_T637661688_P1 recid=13 stamp=637670142
交叉校验备份段: 找到为 'AVAILABLE'
备份段 handle=C:\RESEN\RESEN_S4_T637661688_P1 recid=17 stamp=637670379
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\BACKUP\C-644166109-20071103-00 recid=5 stamp=637661698
已交叉检验的 17 对象
通道 ORA_DISK_1: sid=162 devtype=DISK
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\BACKUP\RESEN_S1_T637661538_P1 recid=1 stamp=637661539
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S1_T637661538_P1 recid=6 stamp=637670047
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S1_T637661538_P1 recid=10 stamp=637670141
交叉校验备份段: 找到为 'AVAILABLE'
备份段 handle=C:\RESEN\RESEN_S1_T637661538_P1 recid=14 stamp=637670378
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\BACKUP\RESEN_S2_T637661543_P1 recid=2 stamp=637661544
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S2_T637661543_P1 recid=7 stamp=637670047
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S2_T637661543_P1 recid=11 stamp=637670141
交叉校验备份段: 找到为 'AVAILABLE'
备份段 handle=C:\RESEN\RESEN_S2_T637661543_P1 recid=15 stamp=637670378
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\BACKUP\RESEN_S3_T637661546_P1 recid=3 stamp=637661547
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S3_T637661546_P1 recid=8 stamp=637670048
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S3_T637661546_P1 recid=12 stamp=637670142
交叉校验备份段: 找到为 'AVAILABLE'
备份段 handle=C:\RESEN\RESEN_S3_T637661546_P1 recid=16 stamp=637670378
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\BACKUP\RESEN_S4_T637661688_P1 recid=4 stamp=637661689
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S4_T637661688_P1 recid=9 stamp=637670049
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\ORADATA\RESEN_S4_T637661688_P1 recid=13 stamp=637670142
交叉校验备份段: 找到为 'AVAILABLE'
备份段 handle=C:\RESEN\RESEN_S4_T637661688_P1 recid=17 stamp=637670379
交叉校验备份段: 找到为 'EXPIRED'
备份段 handle=C:\BACKUP\C-644166109-20071103-00 recid=5 stamp=637661698
已交叉检验的 17 对象
RMAN> report schema;
RMAN-06139: 警告: REPORT SCHEMA 的控制文件不是当前版本
数据库方案报表
文件 KB 表空间 RB segs 数据文件名称
---- ---------- -------------------- ------- -------------------
1 0 SYSTEM *** D:\ORADATA\RESEN\SYSTEM01.DBF
2 0 UNDOTBS1 *** D:\ORADATA\RESEN\UNDOTBS01.DBF
3 0 SYSAUX *** D:\ORADATA\RESEN\SYSAUX01.DBF
4 0 USERS *** D:\ORADATA\RESEN\USERS01.DBF
5 0 RESEN *** D:\ORADATA\RESEN\RESEN.DBF
6 0 H11H99 *** D:\ORADATA\RESEN\RESEN\DATAFILE\O1_
MF_H11H99_3KK9J4OM_.DBF
数据库方案报表
文件 KB 表空间 RB segs 数据文件名称
---- ---------- -------------------- ------- -------------------
1 0 SYSTEM *** D:\ORADATA\RESEN\SYSTEM01.DBF
2 0 UNDOTBS1 *** D:\ORADATA\RESEN\UNDOTBS01.DBF
3 0 SYSAUX *** D:\ORADATA\RESEN\SYSAUX01.DBF
4 0 USERS *** D:\ORADATA\RESEN\USERS01.DBF
5 0 RESEN *** D:\ORADATA\RESEN\RESEN.DBF
6 0 H11H99 *** D:\ORADATA\RESEN\RESEN\DATAFILE\O1_
MF_H11H99_3KK9J4OM_.DBF
RMAN> restore database;
启动 restore 于 03-11月-07
使用通道 ORA_DISK_1
使用通道 ORA_DISK_1
通道 ORA_DISK_1: 正在开始恢复数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集恢复的数据文件
正将数据文件00001恢复到D:\ORADATA\RESEN\SYSTEM01.DBF
正将数据文件00002恢复到D:\ORADATA\RESEN\UNDOTBS01.DBF
正将数据文件00003恢复到D:\ORADATA\RESEN\SYSAUX01.DBF
正将数据文件00004恢复到D:\ORADATA\RESEN\USERS01.DBF
正将数据文件00005恢复到D:\ORADATA\RESEN\RESEN.DBF
正将数据文件00006恢复到D:\ORADATA\RESEN\RESEN\DATAFILE\O1_MF_H11H99_3KK9J4OM_.DB
F
ORA-19624: 操作失败, 如果可能请重试
ORA-19504: 无法创建文件"D:\ORADATA\RESEN\RESEN\DATAFILE\O1_MF_H11H99_3KK9J4OM_.D
BF"
ORA-27040: 文件创建错误, 无法创建文件
OSD-04002: 无法打开文件
O/S-Error: (OS 3) 系统找不到指定的路径。
故障转移到上一个备份
通道 ORA_DISK_1: 正在指定从备份集恢复的数据文件
正将数据文件00001恢复到D:\ORADATA\RESEN\SYSTEM01.DBF
正将数据文件00002恢复到D:\ORADATA\RESEN\UNDOTBS01.DBF
正将数据文件00003恢复到D:\ORADATA\RESEN\SYSAUX01.DBF
正将数据文件00004恢复到D:\ORADATA\RESEN\USERS01.DBF
正将数据文件00005恢复到D:\ORADATA\RESEN\RESEN.DBF
正将数据文件00006恢复到D:\ORADATA\RESEN\RESEN\DATAFILE\O1_MF_H11H99_3KK9J4OM_.DB
F
ORA-19624: 操作失败, 如果可能请重试
ORA-19504: 无法创建文件"D:\ORADATA\RESEN\RESEN\DATAFILE\O1_MF_H11H99_3KK9J4OM_.D
BF"
ORA-27040: 文件创建错误, 无法创建文件
OSD-04002: 无法打开文件
O/S-Error: (OS 3) 系统找不到指定的路径。
故障转移到上一个备份
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 11/03/2007 10:40:49
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 6 found to restore
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 11/03/2007 10:40:49
RMAN-06026: some targets not found - aborting restore
RMAN-06023: no backup or copy of datafile 6 found to restore
RMAN-06023: no backup or copy of datafile 5 found to restore
RMAN-06023: no backup or copy of datafile 4 found to restore
RMAN-06023: no backup or copy of datafile 3 found to restore
RMAN-06023: no backup or copy of datafile 2 found to restore
RMAN-06023: no backup or copy of datafile 1 found to restore
RMAN> run{
2> set newname for datafile 6 to 'd:\oradata
3> ^C
C:\>rman target /
2> set newname for datafile 6 to 'd:\oradata
3> ^C
C:\>rman target /
恢复管理器: 版本10.1.0.2.0 - Production
Copyright (c) 1995, 2004, Oracle. All rights reserved.
连接到目标数据库: RESEN (DBID=644166109)
RMAN> run{
2> set newname for datafile 6 to 'd:\oradata\resen\h11h99.dbf';
3> restore database;
4> switch datafile all;
5> }
2> set newname for datafile 6 to 'd:\oradata\resen\h11h99.dbf';
3> restore database;
4> switch datafile all;
5> }
正在执行命令: SET NEWNAME
正在使用目标数据库控制文件替代恢复目录
正在使用目标数据库控制文件替代恢复目录
启动 restore 于 03-11月-07
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: sid=161 devtype=DISK
分配的通道: ORA_DISK_1
通道 ORA_DISK_1: sid=161 devtype=DISK
通道 ORA_DISK_1: 正在开始恢复数据文件备份集
通道 ORA_DISK_1: 正在指定从备份集恢复的数据文件
正将数据文件00001恢复到D:\ORADATA\RESEN\SYSTEM01.DBF
正将数据文件00002恢复到D:\ORADATA\RESEN\UNDOTBS01.DBF
正将数据文件00003恢复到D:\ORADATA\RESEN\SYSAUX01.DBF
正将数据文件00004恢复到D:\ORADATA\RESEN\USERS01.DBF
正将数据文件00005恢复到D:\ORADATA\RESEN\RESEN.DBF
正将数据文件00006恢复到D:\ORADATA\RESEN\H11H99.DBF
通道 ORA_DISK_1: 已恢复备份段 1
段句柄 = C:\RESEN\RESEN_S3_T637661546_P1 标记 = TAG20071103T081226
通道 ORA_DISK_1: 恢复完成
完成 restore 于 03-11月-07
通道 ORA_DISK_1: 正在指定从备份集恢复的数据文件
正将数据文件00001恢复到D:\ORADATA\RESEN\SYSTEM01.DBF
正将数据文件00002恢复到D:\ORADATA\RESEN\UNDOTBS01.DBF
正将数据文件00003恢复到D:\ORADATA\RESEN\SYSAUX01.DBF
正将数据文件00004恢复到D:\ORADATA\RESEN\USERS01.DBF
正将数据文件00005恢复到D:\ORADATA\RESEN\RESEN.DBF
正将数据文件00006恢复到D:\ORADATA\RESEN\H11H99.DBF
通道 ORA_DISK_1: 已恢复备份段 1
段句柄 = C:\RESEN\RESEN_S3_T637661546_P1 标记 = TAG20071103T081226
通道 ORA_DISK_1: 恢复完成
完成 restore 于 03-11月-07
数据文件 6 已转换成数据文件副本
输入数据文件副本 recid=7 stamp=637670644 文件名=D:\ORADATA\RESEN\H11H99.DBF
输入数据文件副本 recid=7 stamp=637670644 文件名=D:\ORADATA\RESEN\H11H99.DBF
RMAN>exit
如果细心的话,你会发现日志文件并没有恢复.
SQL>alter database open resetlogs;
之后数据库打开,日志文件创建.
至此,备份恢复完毕.