ORACLE11G将dataguard的rman备份恢复到测试环境的单机oracle中的详细过程(二)

2015-11-21 01:32:53 · 作者: · 浏览: 13
/powerdes/control01.ctl' from'/data/impdp/c-3391761643-20150820-01';

RMAN> restore controlfile to'/data/oracle/powerdes/control01.ctl' from'/data/impdp/c-3391761643-20150820-01'

?

restore controlfile to'/home/oradata/powerdes/control01.ctl' from'/data/impdp/c-3391761643-20150820-01';

?

?

2> ;

?

之后需要启动到mount才能进行restore和recover操作,但是启动失败

RMAN> alter database mount

2> ;

?

RMAN-00571:===========================================================

RMAN-00569: =============== ERROR MESSAGESTACK FOLLOWS ===============

RMAN-00571:===========================================================

RMAN-03002: failure of alter db command at08/21/2015 11:12:13

ORA-00205: error in identifying controlfile, check alert log for more info

?

RMAN>

?

看到是因为控制文件不识别,去看下alert日志信息,

[root@testoracle1 /]# tail -f/oracle/app/oracle/diag/rdbms/pdunq/powerdes/trace/alert_powerdes.log

Checker run found 1 new persistent datafailures

Fri Aug 21 11:13:51 2015

alter database mount

Fri Aug 21 11:13:51 2015

ORA-00210: cannot open the specifiedcontrol file

ORA-00202: control file:'/home/oradata/powerdes/control01.ctl'

ORA-27037: unable to obtain file status

Linux-x86_64 Error: 2: No such file ordirectory

Additional information: 3

ORA-205 signalled during: alter databasemount...

?

从alert日志可以看出控制文件已经变成了生产环境的路径了,原因是spfile是从生产环境copy出来的,生产环境的spfile里面记录的控制文件路径和测试环境不同,所以这里为了快速恢复,要重新指定和生产环境一样路径的,重新生成新路径的控制文件。

控制文件

?

RMAN> restore controlfile to'/home/oradata/powerdes/control01.ctl' from'/data/impdp/c-3391761643-20150820-01';

?

Starting restore at 21-AUG-15

using channel ORA_DISK_1

?

channel ORA_DISK_1: restoring controlfile

channel ORA_DISK_1: restore complete,elapsed time: 00:00:01

Finished restore at 21-AUG-15

?

OK,看到控制文件restore成功了,接下来直接将数据库状态改成mount

?

RMAN> alter database mount;

?

database mounted

released channel: ORA_DISK_1

?

RMAN>

?

?

然后就可以开始restore整个库

?

?

2.4, 在新控制文件中注册数据文件备份和归档备份

要将db状态改成mount才行

catalog start with'/data/impdp/2015-08-20/';

?

RMAN> alter database mount

2> ;

?

using target database control file insteadof recovery catalog

database mounted

?

RMAN> catalog start with'/data/impdp/2015-08-20/';

?

Starting implicit crosscheck backup at20-AUG-15

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=129 devicetype=DISK

Crosschecked 98 objects

Finished implicit crosscheck backup at20-AUG-15

?

Starting implicit crosscheck copy at20-AUG-15

using channel ORA_DISK_1

Finished implicit crosscheck copy at20-AUG-15

?

searching for all files in the recoveryarea

cataloging files...

no files cataloged

?

searching for all files that match thepattern /data/impdp/2015-08-20/

?

List of Files Unknown to the Database

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

File Name:/data/impdp/2015-08-20/arch_POWERDES_20150820_4420.bak

File Name:/data/impdp/2015-08-20/rman_backup.log

File Name:/data/impdp/2015-08-20/arch_POWERDES_20150820_4418.bak

File Name:/data/impdp/2015-08-20/full_POWERDES_20150820_4419.bak

?

Do you really want to catalog the abovefiles (enter YES or NO)? YES

cataloging files...

cataloging done

?

List of Cataloged Files

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

File Name:/data/impdp/2015-08-20/arch_POWERDES_20150820_4420.bak

File Name:/data/impdp/2015-08-20/arch_POWERDES_20150820_4418.bak

File Name:/data/imp