使用RMAN复制恢复开发库环境(2)

4.将库1的inittest.ora参数文件拷贝到库2,并按照其中配置的控制文件路径,将库1的控制文件(2)可以直接copy到库2对应路径下,包括文件名需要保持和参数文件总定义一致:

*.control_files='/u01/app/oracle/11.2.0.4/oradata/test/control01.ctl','/u01/app/oracle/11.2.0.4/fast_recovery_area/test/control02.ctl'

创建文件夹:

/u01/app/oracle/11.2.0.4/oradata/test /u01/app/oracle/11.2.0.4/fast_recovery_area/test /u01/app/oracle/11.2.0.4/admin/adump(/bdump/cdump/dpdump/udump)

5.库2启动nomount状态

SQL> startup nomount pfile='/u01/app/oracle/11.2.0.4/dbhome_1/dbs/initdep.ora'; ORACLE instance started. Total System Global Area 1620115456 bytes Fixed Size 2253704 bytes Variable Size 922750072 bytes Database Buffers 687865856 bytes Redo Buffers 7245824 bytes

6.库2执行恢复

[oracle@testvm001 dbs]$ rman target / Recovery Manager: Release 11.2.0.4.0 - Production on Mon Feb 1 17:10:21 2016 Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved. connected to target database: DEP (not mounted) RMAN> restore database; Starting restore at 01-FEB-16 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=10 device type=DISK RMAN-00571: ================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ====== RMAN-00571: ================================================== RMAN-03002: failure of restore command at 02/01/2016 17:10:28 ORA-01507: database not mounted

报错提示数据库需要置为mount状态。

7.库2置为mount状态

SQL> alter database mount; Database altered.

8.库2执行恢复

RMAN> restore database; Starting restore at 01-FEB-16 released channel: ORA_DISK_1 Starting implicit crosscheck backup at 01-FEB-16 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=10 device type=DISK Crosschecked 6 objects Finished implicit crosscheck backup at 01-FEB-16 Starting implicit crosscheck copy at 01-FEB-16 using channel ORA_DISK_1 Crosschecked 6 objects Finished implicit crosscheck copy at 01-FEB-16 searching for all files in the recovery area cataloging files... no files cataloged using channel ORA_DISK_1 channel ORA_DISK_1: starting datafile backup set restore channel ORA_DISK_1: specifying datafile(s) to restore from backup set channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/11.2.0.4/oradata/dep/system01.dbf channel ORA_DISK_1: restoring datafile 00002 to /u01/app/oracle/11.2.0.4/oradata/dep/sysaux01.dbf channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/11.2.0.4/oradata/dep/undotbs01.dbf channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/11.2.0.4/oradata/dep/users01.dbf channel ORA_DISK_1: restoring datafile 00005 to /u01/app/oracle/11.2.0.4/oradata/dep/dep_tbs01.dbf channel ORA_DISK_1: reading from backup piece /home/oracle/duplicate/df_t902681834_s10_p1 channel ORA_DISK_1: piece handle=/home/oracle/duplicate/df_t902681834_s10_p1 tag=TAG20160201T165714 channel ORA_DISK_1: restored backup piece 1 channel ORA_DISK_1: restore complete, elapsed time: 00:00:35 Finished restore at 01-FEB-16

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

转载注明出处:https://www.heiqu.com/719487c455e3c632f19ab96444dcf8ac.html