Linux下设置归档路径不生效,归档模式下的Rman备份集在异机恢复(原库和目的库的路径不一致)...

8.启动数据库到mount状态并注册备份集

RMAN> alter database mount;

database mounted

released channel: ORA_DISK_1

注册备份集,因为控制文件中的保留的备份信息是原库的,我们这里需要重新注册新库路径下的备份集

RMAN> catalog start with '/u02/ftp/';

Starting implicit crosscheck backup at 29-JUN-12

allocated channel: ORA_DISK_1

channel ORA_DISK_1: sid=155 devtype=DISK

Crosschecked 29 objects

Finished implicit crosscheck backup at 29-JUN-12

Starting implicit crosscheck copy at 29-JUN-12

using channel ORA_DISK_1

Finished implicit crosscheck copy at 29-JUN-12

searching for all files in the recovery area

cataloging files...

no files cataloged

searching for all files that match the pattern /u02/ftp/

List of Files Unknown to the Database

=====================================

File Name: /u02/ftp/full_backup_20120628_35

File Name: /u02/ftp/full_backup_20120628_37

File Name: /u02/ftp/full_backup_20120628_34

File Name: /u02/ftp/arc_backup_20120628_38

File Name: /u02/ftp/arc_backup_20120628_40

File Name: /u02/ftp/full_backup_20120628_36

File Name: /u02/ftp/full_backup_20120628_31

File Name: /u02/ftp/full_backup_20120628_33

File Name: /u02/ftp/arc_backup_20120628_39

File Name: /u02/ftp/full_backup_20120628_32

File Name: /u02/ftp/full_backup_20120628_30

Do you really want to catalog the above files (enter YES or NO)? yes

cataloging files...

cataloging done

List of Cataloged Files

=======================

File Name: /u02/ftp/full_backup_20120628_35

File Name: /u02/ftp/full_backup_20120628_37

File Name: /u02/ftp/full_backup_20120628_34

File Name: /u02/ftp/arc_backup_20120628_38

File Name: /u02/ftp/arc_backup_20120628_40

File Name: /u02/ftp/full_backup_20120628_36

File Name: /u02/ftp/full_backup_20120628_31

File Name: /u02/ftp/full_backup_20120628_33

File Name: /u02/ftp/arc_backup_20120628_39

File Name: /u02/ftp/full_backup_20120628_32

File Name: /u02/ftp/full_backup_20120628_30

9.列出当前的所有数据文件

SQL> column name format a60;

SQL> select file# as "file/grp#", name from v$datafile;

file/grp# NAME

---------- ------------------------------------------------------------

1 /u01/app/Oracle/oradata/oracl/system01.dbf';

2 /u01/app/oracle/oradata/oracl/undotbs01.dbf';

3 /u01/app/oracle/oradata/oracl/sysaux01.dbf';

4 /u01/app/oracle/oradata/oracl/users01.dbf';

5 /u01/app/oracle/oradata/oracl/hxl01.dbf';

6 /u01/app/oracle/oradata/oracl/hxl02.dbf';

7 /u01/app/oracle/oradata/oracl/hxl03.dbf';

8 /u01/app/oracle/oradata/oracl/hxl04.dbf';

9 /u01/app/oracle/oradata/oracl/hxl05.dbf';

10 /u02/app/oracle/oradata/oracl/hxl06.dbf';

11 /u02/app/oracle/oradata/oracl/hxl07.dbf';

file/grp# NAME

---------- ------------------------------------------------------------

12 /u02/app/oracle/oradata/oracl/hxl08.dbf';

13 /u02/app/oracle/oradata/oracl/hxl09.dbf';

14 /u02/app/oracle/oradata/oracl/hxl10.dbf';

可以看到,当前控制文件中记录的数据文件的路径是原来的路径,我们在做恢复的时候需要指向新的路径.

10.恢复数据库

RMAN> run{

set newname for datafile  1 to '/u02/mydb/oradata/oracl/system01.dbf';

set newname for datafile  2 to '/u02/mydb/oradata/oracl/undotbs01.dbf';

set newname for datafile  3 to '/u02/mydb/oradata/oracl/sysaux01.dbf';

set newname for datafile  4 to '/u02/mydb/oradata/oracl/users01.dbf';

set newname for datafile  5 to '/u02/mydb/oradata/oracl/hxl01.dbf';

set newname for datafile  6 to '/u02/mydb/oradata/oracl/hxl02.dbf';

set newname for datafile  7 to '/u02/mydb/oradata/oracl/hxl03.dbf';

set newname for datafile  8 to '/u02/mydb/oradata/oracl/hxl04.dbf';

set newname for datafile  9 to '/u02/mydb/oradata/oracl/hxl05.dbf';

set newname for datafile 10 to '/u02/mydb/oradata/oracl/hxl06.dbf';

set newname for datafile 11 to '/u02/mydb/oradata/oracl/hxl07.dbf';

set newname for datafile 12 to '/u02/mydb/oradata/oracl/hxl08.dbf';

set newname for datafile 13 to '/u02/mydb/oradata/oracl/hxl09.dbf';

set newname for datafile 14 to '/u02/mydb/oradata/oracl/hxl10.dbf';

restore database;

switch datafile all;

recover database;

}

11.打开数据库

alter database open resetlogs;

-- The End --0b1331709591d260c1c78e86d0c51c18.png

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值