Oracle使用RMAN复制数据库(四)

2014-11-24 08:53:38 · 作者: · 浏览: 5
525535_8ohtf2n9_.bkp 100% 9600KB 9.4MB/s 00:01

[oracle@ocmu ORA11GR2]$

scp -r 192.168.1.200:/u01/app/FRA/ORA11GR2/backupset .

oracle@192.168.1.200's password:

o1_mf_annnn_TAG20130331T153953_8oht29yn_.bkp 100% 256MB 9.8MB/s 00:26

o1_mf_nnndf_TAG20130331T154059_8oht4jr1_.bkp 100% 1142MB 7.7MB/s 02:29

o1_mf_annnn_TAG20130331T154533_8ohtdxrl_.bkp 100% 359KB 358.5KB/s 00:00

[oracle@ocmu ORA11GR2]$

6) 目标库启动到nomount模式

[oracle@ocmu ~]$ export ORACLE_SID=ORA11GR2

[oracle@ocmu ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sun Mar 31 16:29:42 2013

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to an idle instance.

SQL> startup nomount;

ORACLE instance started.

Total System Global Area 841162752 bytes

Fixed Size 1339768 bytes

Variable Size 532680328 bytes

Database Buffers 301989888 bytes

Redo Buffers 5152768 bytes

SQL>

7) 目标库运行duplicate命令

[oracle@ocmu ~]$ export ORACLE_SID=ORA11GR2

[oracle@ocmu ~]$ rman target sys/oracle@ora11gr2 auxiliary /

Recovery Manager: Release 11.2.0.1.0 - Production on Sun Mar 31 16:48:18 2013

Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

connected to target database: ORA11GR2 (DBID=116453860)

connected to auxiliary database: ORA11GR2 (not mounted)

RMAN> duplicate target database to ORA11GR2 pfile =/u01/app/oracle/product/11.2.0/db_1/dbs/initORA11GR2.ora

logfile

'/u01/app/oracle/oradata/ORA11GR2/redo01.log' size 50m,

'/u01/app/oracle/oradata/ORA11GR2/redo02.log' size 50m,

'/u01/app/oracle/oradata/ORA11GR2/redo03.log' size 50m

NOFILENAMECHECK;

Starting Duplicate Db at 31-MAR-13

using target database control file instead of recovery catalog

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=20 device type=DISK

contents of Memory Script:

{

sql clone "alter system set db_name =

''ORA11GR2'' comment=

''Modified by RMAN duplicate'' scope=spfile";

sql clone "alter system set db_unique_name =

''ORA11GR2'' comment=

''Modified by RMAN duplicate'' scope=spfile";

shutdown clone immediate;

startup clone force nomount

restore clone primary controlfile;

alter clone database mount;

}

executing Memory Script

sql statement: alter system set db_name = ''ORA11GR2'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set db_unique_name = ''ORA11GR2'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area 841162752 bytes

Fixed Size 1339768 bytes

Variable Size 536874632 bytes

Database Buffers 297795584 bytes

Redo Buffers 5152768 bytes

Starting restore at 31-MAR-13

allocated channel: ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: SID=18 device type=DISK

channel ORA_AUX_DISK_1: starting datafile backup set restore

channel ORA_AUX_DISK_1: restoring control file

channel ORA_AUX_DISK_1: reading from backup piece /u01/app/FRA/ORA11GR2/autobackup/2013_03_31/o1_mf_s_811525535_8ohtf2n9_.bkp

channel ORA_AUX_DISK_1: piece handle=/u01/app/FRA/ORA11GR2/autobackup/2013_03_31/o1_mf_s_811525535_8ohtf2n9_.bkp tag=TAG20130331T154535

channel ORA_AUX_DISK_1: restored backup piece 1

channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03

output file name=/u01/app/oracle/oradata/ORA11GR2/control01.ctl

output file name=/u01/app/oracle/oradata/ORA11GR2/control02.c