Oracle 11gR2 使用RMAN Duplicate复制数据库(二)

2015-07-16 12:08:01 · 作者: · 浏览: 9
ce 979
SQL> alter system switch logfile;
alter system switch logfile;


System altered.


SQL>


System altered.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +FRA001/archive
Oldest online log sequence 980
Next log sequence to archive 981
Current log sequence 981


六、配置静态监听
RAC节点监听信息如下:


$ cd $ORACLE_HOME/network/admin
LISTENER =
? (DESCRIPTION_LIST =
? ? (DESCRIPTION =
? ? ? (ADDRESS = (PROTOCOL = TCP)(HOST = scan.woo.com)(PORT = 1521))
? ? ? (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
? ? )
? )
?
SID_LIST_LISTENER =
? (SID_LIST =
? ? (SID_DESC =
? ? ? ? (GLOBAL_DBNAME = woo.com)
? ? ? ? (ORACLE_HOME = /DBSoft/oracle/product/11.2.0/db_1)
? ? ? ? (SID_NAME = woo)
? ? ? )
? )
ADR_BASE_LISTENER = /DBSoft/oracle


单节点监听信息如下:


LISTENER =
? (DESCRIPTION_LIST =
? ? (DESCRIPTION =
? ? ? (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.7.55)(PORT = 1521))
? ? ? (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
? ? )
? )
?
SID_LIST_LISTENER =
? (SID_LIST =
? ? (SID_DESC =
? ? ? ? (GLOBAL_DBNAME = woo.com)
? ? ? ? (ORACLE_HOME = /DBSoft/oracle/product/11.2.0/db_1)
? ? ? ? (SID_NAME = woo)
? ? ? )
? )
ADR_BASE_LISTENER = /DBSoft/oracle


配置所有节点tnsname信息如下:


WOO =
? (DESCRIPTION =
? ? (ADDRESS_LIST =
? ? ? (ADDRESS = (PROTOCOL = TCP)(HOST = scan.woo.com)(PORT = 1521))
? ? )
? ? (CONNECT_DATA =
? ? ? (SERVICE_NAME = woo)
? ? )
? )
?
DUPLICATE =
? (DESCRIPTION =
? ? (ADDRESS_LIST =
? ? ? (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.7.55)(PORT = 1521))
? ? )
? ? (CONNECT_DATA =
? ? ? (SERVER = DEDICATED)
? ? ? (SERVICE_NAME = woo)
? ? )
? )


六、启动数据库到nomount状态


SQL> startup nomount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.


Total System Global Area 954155008 bytes
Fixed Size 1368632 bytes
Variable Size 306187720 bytes
Database Buffers 641728512 bytes
Redo Buffers 4870144 bytes
SQL>exit? ? ? ? ? ? ? ? ? ? ? ? ? ---------必须退出
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options


七、 在RAC端任意节点通过RMAN连接到目标实例和辅助实例,执行duplicate命令复制数据库


[oracle@db01 ~]$ rman target sys/oracle@woo auxiliary sys/oracle@standby



Recovery Manager: Release 11.2.0.4.0 - Production on Wed Jun 3 19:39:00 2015



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



connected to target database: WOO (DBID=4218366793)
connected to auxiliary database: WOO (not mounted)



RMAN>
RMAN> duplicate target database to woo from active database nofilenamecheck;



Starting Duplicate Db at 03-JUN-15
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=19 device type=DISK



contents of Memory Script:
{
? sql clone "alter system set? db_name =
?''WOO'' comment=
?''Modified by RMAN duplicate'' scope=spfile";
? sql clone "alter system set? db_unique_name =
?''WOO'' comment=
?''Modified by RMAN duplicate'' scope=spfile";
? shutdown clone immediate;
? startup clone force nomount
? backup as copy current controlfile auxiliary format? '/DBSoft/oracle/oradata/woo/control01.ctl';
? restore clone controlfile to? '/DBSoft/oracle/fast_recovery_area/woo/control02.ctl' from
?'/DBSoft/oracle/oradata/woo/control01.ctl';
? alter clone database mount;
}
executing Memory Script
sql statement: alter system set? db_name =? ''WOO'' comment= ''Modified by RMAN duplicate'' scope=spfile



sql statement: alter system set? db_unique_name