Oracle 11g如何将dataguard的主库数据恢复到Oracle单机

需要将dataguard的主库数据恢复到Oracle单机实例中,所以记录下详细过程 1,从线上重新拉一个参数文件出来,copy到测试环境 SQL> create pfile='/oracle/pfile01.ora'from spfile; File created. SQL>

然后根据复制来的参数文件再在测试库上建立spfile

create spfile frompfile='/data/pfile01.ora'; SQL> create spfile frompfile='/data/impdp/pfile01.ora'; File created. SQL>

然后将测试库启动到nomount

SQL> startup nomount ORA-00845: MEMORY_TARGET not supported onthis system SQL> 2,恢复控制文件

restore controlfile to ‘/home/oradata/orcstu/control01.ctl’ from’/data/impdp/c-3391761643-20151126-01’

RMAN> restore controlfile to '/home/oradata/orcstu/control01.ctl' from'/data/impdp/c-3391761643-20151126-01' 2> ; Starting restore at 26-NOV-15 using channel ORA_DISK_1 channel ORA_DISK_1: restoring control file channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 Finished restore at 26-NOV-15 RMAN> RMAN> restore controlfile to '/oracle/app/oracle/flash_recovery_area/orcstu/control02.ctl' from '/data/impdp/c-3391761643-20151126-01'; Starting restore at 26-NOV-15 using channel ORA_DISK_1 channel ORA_DISK_1: restoring control file channel ORA_DISK_1: restore complete, elapsed time: 00:00:01 Finished restore at 26-NOV-15 RMAN> 3,注册归档

要将db状态改成mount才行

RMAN> alter database mount; database mounted released channel: ORA_DISK_1 RMAN>

1

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

catalog start with'/data/impdp/2015-11-26/'; RMAN> catalog start with'/data/impdp/2015-11-26/'; Starting implicit crosscheck backup at 26-NOV-15 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=767 device type=DISK Crosschecked 97 objects Finished implicit crosscheck backup at 26-NOV-15 Starting implicit crosscheck copy at 26-NOV-15 using channel ORA_DISK_1 Crosschecked 2 objects Finished implicit crosscheck copy at 26-NOV-15 searching for all files in the recovery area cataloging files... no files cataloged searching for all files that match the pattern /data/impdp/2015-11-26/ List of Files Unknown to the Database ===================================== File Name: /data/impdp/2015-11-26/rman_backup.log File Name: /data/impdp/2015-11-26/arch_orcstu_20151126_5036.bak File Name: /data/impdp/2015-11-26/full_orcstu_20151126_5037.bak File Name: /data/impdp/2015-11-26/arch_orcstu_20151126_5038.bak Do you really want to catalog the above files (enter YES or NO)? YES cataloging files... cataloging done List of Cataloged Files ======================= File Name: /data/impdp/2015-11-26/arch_orcstu_20151126_5036.bak File Name: /data/impdp/2015-11-26/full_orcstu_20151126_5037.bak File Name: /data/impdp/2015-11-26/arch_orcstu_20151126_5038.bak List of Files Which Where Not Cataloged ======================================= File Name: /data/impdp/2015-11-26/rman_backup.log RMAN-07517: Reason: The file header is corrupted RMAN> 4,开始恢复整个库

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/9478e6232080127c2f522a13024b5468.html