本文描述dataguard的构建过程,使用的环境如下:
[root@rac2 ~]# cat /etc/issue
Oracle Linux Server release 6.7
Kernel \r on an \m
[root@rac2 ~]# uname -a
Linux rac2 3.8.13-68.3.4.el6uek.x86_64 #2 SMP Tue Jul 14 15:03:36 PDT 2015 x86_64 x86_64 x86_64 GNU/Linux
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
使用三台主机,配置相同,主机名依次为:rac1,rac2,standby
rac1和rac2构成oracle 11.2.0.4 版本的RAC集群,standby做备机
IP地址规划,SCAN必须配置在DNS中
# Public
192.168.56.11 rac1.us.oracle.com rac1
192.168.56.12 rac2.us.oracle.com rac2
# Private
10.0.0.11 rac1-priv.us.oracle.com rac1-priv
10.0.0.12 rac2-priv.us.oracle.com rac2-priv
# Virtual
192.168.56.21 rac1-vip.us.oracle.com rac1-vip
192.168.56.22 rac2-vip.us.oracle.com rac2-vip
#SCAN
192.168.56.31 rac-scan.us.oracle.com
192.168.56.32 rac-scan.us.oracle.com
192.168.56.33 rac-scan.us.oracle.com
#Standby
192.168.56.51 standby.us.oracle.com standby
==========================开始动手=================================
在RAC和DG之间配置网络
节点1在listener.ora中配置静态监听
查询service_names,ORACLE_HOME,ORACLE_SID
SQL> show parameter service_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string RAC
[oracle@rac1 ~]$ env | grep ORA
ORACLE_UNQNAME=RAC
ORACLE_SID=RAC1
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
[grid@rac1 admin]$ pwd
/u01/app/11.2.0/grid/network/admin
[grid@rac1 admin]$ vi listener.ora
修改listener.ora,在末尾填入如下内容,注意填入内容和查询到内容有对应关系
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=RAC)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=RAC1)
)
)
重新读取监听配置文件
[grid@rac1 admin]$ lsnrctl reload
观察监听状态
[grid@rac1 admin]$ lsnrctl status
监听中出现下面信息,证明静态监听配置成功
Service "RAC" has 1 instance(s).
Instance "RAC1", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
节点2用同样的方法配置静态监听
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string RAC
[oracle@rac2 ~]$ env | grep ORA
ORACLE_UNQNAME=RAC
ORACLE_SID=RAC2
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
[grid@rac2 ~]$ tail -10 /u01/app/11.2.0/grid/network/admin/listener.ora
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=RAC)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=RAC2)
)
)
[grid@rac2 ~]$ lsnrctl reload
[grid@rac2 ~]$ lsnrctl status
Service "RAC" has 1 instance(s).
Instance "RAC2", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
备用节点配置静态监听
[oracle@standby ~]$ env | grep ORA
ORACLE_UNQNAME=STANDBY
ORACLE_SID=STANDBY
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
[oracle@standby ~]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/
[oracle@standby admin]$ vi listener.ora
[oracle@standby admin]$ tail -10 listener.ora
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=STANDBY)
(ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1)
(SID_NAME=STANDBY)
)
)
[oracle@standby admin]$ lsnrctl reload
[oracle@standby admin]$ lsnrctl status
Service "STANDBY" has 1 instance(s).
Instance "STANDBY", status UNKNOWN, has 1 handler(s) for this service...
The command completed successfully
检查备用节点是否能解析SCAN地址
[root@standby ~]# nslookup rac-scan.us.oracle.com
Server: 192.168.1.1
Address: 192.168.1.1#53
** server can't find rac-scan.us.oracle.com: NXDOMAIN
修改DNS客户端配置,确保主备节点都能访问到DNS,并进行SCAN解析
[root@standby ~]# vi /etc/resolv.conf
[root@standby ~]# cat /etc/resolv.conf
; generated by /sbin/dhclient-script
nameserver 192.168.56.11
[root@standby ~]# nslookup rac-scan.us.oracle.com
Server: 192.168.56.11
Address: 192.168.56.11#53
Name: rac-scan.us.oracle.com
Address: 192.168.56.33
Name: rac-scan.us.oracle.com
Address: 192.168.56.31
Name: rac-scan.us.oracle.com
Address: 192.168.56.32
修改/etc/hosts文件保证能够互相ping通
[root@standby ~]# cat /etc/hosts
127.0.0.1 bj localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
# Public
192.168.56.11 rac1.us.oracle.com rac1
192.168.56.12 rac2.us.oracle.com rac2
# Private
10.0.0.11 rac1-priv.us.oracle.com rac1-priv
10.0.0.12 rac2-priv.us.oracle.com rac2-priv
# Virtual
192.168.56.21 rac1-vip.us.oracle.com rac1-vip
192.168.56.22 rac2-vip.us.oracle.com rac2-vip
192.168.56.51 standby.us.oracle.com standby
配置网络服务名,支持在主数据库和备用数据库之间使用SCAN进行日志传输和通信
[oracle@rac1 ~]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/
[oracle@rac1 admin]$ vi tnsnames.ora
[oracle@rac1 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
RAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.us.oracle.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC)
)
)
STANDBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby.us.oracle.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = STANDBY)
)
)
在各节点使用相同的tnsnames.ora,保证tnsping通畅
[oracle@rac1 admin]$ tnsping standby
[oracle@rac2 admin]$ tnsping standby
[oracle@standby admin]$ tnsping rac
除了已经创建的tnsnames.ora项,还需要创建支持备用数据库RMAN实例化的项。这些项必须使用节点VIP而不是SCAN VIP,因为这些TNS别名将被用来使用前一步创建的静态监听器项连接数据库。
[oracle@rac1 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
RAC =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.us.oracle.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC)
)
)
STANDBY =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby.us.oracle.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = STANDBY)
(INSTANCE_NAME = STANDBY)
)
)
RAC1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip.us.oracle.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC)
(INSTANCE_NAME = RAC1)
)
)
RAC2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip.us.oracle.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = RAC)
(INSTANCE_NAME = RAC2)
)
)
同步tnsnames.ora文件
[oracle@rac1 admin]$ scp tnsnames.ora oracle@rac2:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/
tnsnames.ora 100% 993 1.0KB/s 00:00
[oracle@rac1 admin]$ scp tnsnames.ora oracle@standby:/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/
oracle@standby's password:
tnsnames.ora 100% 993 1.0KB/s 00:00
确保数据库位于归档日志模式
[root@rac1 ~]# srvctl stop database -d rac
SQL> startup mount
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 599788624 bytes
Database Buffers 226492416 bytes
Redo Buffers 6565888 bytes
Database mounted.
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 6
Current log sequence 7
SQL> alter database archivelog;
Database altered.
强制启用日志记录
SQL> alter database force logging;
Database altered.
创建standby redo log
SQL> select max (bytes)/1024/1024 "SIZE(M)",count (1) from v$log;
SIZE(M) COUNT(1)
---------- ----------
50 4
SQL> select thread#,bytes/1024/1024 "SIZE(M)",SEQUENCE#,GROUP#,members from v$log;
THREAD# SIZE(M) SEQUENCE# GROUP# MEMBERS
---------- ---------- ---------- ---------- ----------
1 50 7 1 2
1 50 6 2 2
2 50 3 3 2
2 50 2 4 2
SQL> select MEMBER from v$logfile;
MEMBER
--------------------------------------------------------------------------------
+DATA/rac/onlinelog/group_2.262.897852779
+FRA/rac/onlinelog/group_2.258.897852779
+DATA/rac/onlinelog/group_1.261.897852779
+FRA/rac/onlinelog/group_1.257.897852779
+DATA/rac/onlinelog/group_3.265.897852899
+FRA/rac/onlinelog/group_3.259.897852899
+DATA/rac/onlinelog/group_4.266.897852899
+FRA/rac/onlinelog/group_4.260.897852899
8 rows selected.
SQL> alter database add standby logfile thread 1 group 5 size 50m,group 6 size 50m,group 7 size 50m;
Database altered.
SQL> alter database add standby logfile thread 2 group 8 size 50m,group 9 size 50m,group 10 size 50m;
Database altered.
SQL> select THREAD#,GROUP# from v$standby_log;
THREAD# GROUP#
---------- ----------
1 5
1 6
1 7
2 8
2 9
2 10
6 rows selected.
SQL> select MEMBER from v$logfile;
MEMBER
--------------------------------------------------------------------------------
+DATA/rac/onlinelog/group_2.262.897852779
+FRA/rac/onlinelog/group_2.258.897852779
+DATA/rac/onlinelog/group_1.261.897852779
+FRA/rac/onlinelog/group_1.257.897852779
+DATA/rac/onlinelog/group_3.265.897852899
+FRA/rac/onlinelog/group_3.259.897852899
+DATA/rac/onlinelog/group_4.266.897852899
+FRA/rac/onlinelog/group_4.260.897852899
+DATA/rac/onlinelog/group_5.268.898450225
+FRA/rac/onlinelog/group_5.261.898450225
+DATA/rac/onlinelog/group_6.269.898450225
+FRA/rac/onlinelog/group_6.262.898450225
+DATA/rac/onlinelog/group_7.270.898450225
+FRA/rac/onlinelog/group_7.263.898450225
+DATA/rac/onlinelog/group_8.271.898450317
+FRA/rac/onlinelog/group_8.264.898450317
+DATA/rac/onlinelog/group_9.272.898450319
+FRA/rac/onlinelog/group_9.265.898450319
+DATA/rac/onlinelog/group_10.273.898450319
+FRA/rac/onlinelog/group_10.266.898450319
20 rows selected.
创建pfile并进行修改
SQL> create pfile='/home/oracle/initRAC.ora' from spfile;
File created.
[oracle@rac1 ~]$ cat initRAC.ora
RAC2.__db_cache_size=289406976
RAC1.__db_cache_size=226492416
RAC2.__java_pool_size=4194304
RAC1.__java_pool_size=4194304
RAC2.__large_pool_size=8388608
RAC1.__large_pool_size=71303168
RAC1.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
RAC2.__pga_aggregate_target=335544320
RAC1.__pga_aggregate_target=335544320
RAC2.__sga_target=503316480
RAC1.__sga_target=503316480
RAC2.__shared_io_pool_size=0
RAC1.__shared_io_pool_size=0
RAC2.__shared_pool_size=188743680
RAC1.__shared_pool_size=188743680
RAC2.__streams_pool_size=0
RAC1.__streams_pool_size=0
*.audit_file_dest='/u01/app/oracle/admin/RAC/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.4.0'
*.control_files='+DATA/rac/controlfile/current.260.897852777','+FRA/rac/controlfile/current.256.897852777'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_name='RAC'
*.db_recovery_file_dest='+FRA'
*.db_recovery_file_dest_size=8490319872
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=RACXDB)'
RAC2.instance_number=2
RAC1.instance_number=1
*.memory_target=838860800
*.open_cursors=300
*.processes=150
*.remote_listener='rac-scan.us.oracle.com:1521'
*.remote_login_passwordfile='exclusive'
RAC2.thread=2
RAC1.thread=1
RAC1.undo_tablespace='UNDOTBS1'
RAC2.undo_tablespace='UNDOTBS2'
DB_UNIQUE_NAME=RAC
LOG_ARCHIVE_CONFIG='DG_CONFIG=(RAC,STANDBY)'
LOG_ARCHIVE_DEST_1=
'LOCATION=USE_DB_RECOVERY_FILE_DEST
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=RAC'
LOG_ARCHIVE_DEST_2=
'SERVICE=STANDBY ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=STANDBY'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
FAL_SERVER=STANDBY
STANDBY_FILE_MANAGEMENT=AUTO
由于源数据库的数据文件使用OMF进行管理,你不能使用DB_FILE_NAME_CONVERT参数完成文件名的转换(rename)。
[oracle@rac1 ~]$ cat initSTANDBY.ora
.audit_file_dest='/u01/app/oracle/admin/STANDBY/adump'
*.audit_trail='db'
*.compatible='11.2.0.4.0'
*.control_files='/u01/app/oracle/oradata/STANDBY/control01.ctl','/u01/app/oracle/fast_recovery_area/STANDBY/control02.ctl'
*.db_block_size=8192
*.db_create_file_dest='/u01/app/oracle/oradata'
*.db_domain=''
*.db_name='RAC'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=8490319872
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=standbyXDB)'
*.memory_target=838860800
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='exclusive'
*.undo_tablespace='UNDOTBS1'
DB_UNIQUE_NAME=RAC
LOG_ARCHIVE_CONFIG='DG_CONFIG=(RAC,STANDBY)'
LOG_ARCHIVE_DEST_1=
'LOCATION=/u01/app/oracle/fast_recovery_area
VALID_FOR=(ALL_LOGFILES,ALL_ROLES)
DB_UNIQUE_NAME=RAC'
LOG_ARCHIVE_DEST_2=
'SERVICE=STANDBY ASYNC
VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE)
DB_UNIQUE_NAME=STANDBY'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
FAL_SERVER=STANDBY
STANDBY_FILE_MANAGEMENT=AUTO
在备库创建相应的目录
[oracle@standby admin]$ mkdir -p /u01/app/oracle/oradata/STANDBY/
[oracle@standby admin]$ mkdir -p /u01/app/oracle/fast_recovery_area/STANDBY/
[oracle@standby admin]$ mkdir -p /u01/app/oracle/admin/STANDBY/adump
将密码文件,静态参数文件传递到备库
[oracle@rac1 ~]$ scp initSTANDBY.ora oracle@standby:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
oracle@standby's password:
initSTANDBY.ora 100% 1372 1.3KB/s 00:00
[oracle@rac1 ~]$ cd /u01/app/oracle/product/11.2.0/dbhome_1/dbs/
[oracle@rac1 dbs]$ ls
hc_RAC1.dat init.ora initRAC1.ora orapwRAC1
[oracle@rac1 dbs]$ scp orapwRAC1 oracle@standby:/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwSTANDBY
oracle@standby's password:
orapwRAC1 100% 1536 1.5KB/s 00:00
使用修改过的pfile文件启动数据库的1节点
SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup pfile='/home/oracle/initRAC.ora'
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2257840 bytes
Variable Size 599788624 bytes
Database Buffers 226492416 bytes
Redo Buffers 6565888 bytes
Database mounted.
Database opened.
SQL> create spfile from pfile;
File created.
执行rman duplicate 创建备库
[oracle@rac1 ~]$ rman target / auxiliary sys/oracle@standby
Recovery Manager: Release 11.2.0.4.0 - Production on Mon Dec 14 20:37:42 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: RAC (DBID=2485834793)
connected to auxiliary database: RAC (not mounted)
RMAN> duplicate target database for standby from active database dorecover nofilenamecheck;
Starting Duplicate Db at 2015-12-14 20:38:01
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=10 device type=DISK
contents of Memory Script:
{
backup as copy reuse
targetfile '/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwRAC1' auxiliary format
'/u01/app/oracle/product/11.2.0/dbhome_1/dbs/orapwSTANDBY' ;
}
executing Memory Script
Starting backup at 2015-12-14 20:38:02
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=154 instance=RAC1 device type=DISK
Finished backup at 2015-12-14 20:38:03
contents of Memory Script:
{
backup as copy current controlfile for standby auxiliary format '/u01/app/oracle/oradata/STANDBY/control01.ctl';
restore clone controlfile to '/u01/app/oracle/fast_recovery_area/STANDBY/control02.ctl' from
'/u01/app/oracle/oradata/STANDBY/control01.ctl';
}
executing Memory Script
Starting backup at 2015-12-14 20:38:04
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
copying standby control file
output file name=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/snapcf_RAC1.f tag=TAG20151214T203804 RECID=2 STAMP=898461485
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2015-12-14 20:38:06
Starting restore at 2015-12-14 20:38:06
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 2015-12-14 20:38:07
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
contents of Memory Script:
{
set newname for clone tempfile 1 to new;
switch clone tempfile all;
set newname for clone datafile 1 to new;
set newname for clone datafile 2 to new;
set newname for clone datafile 3 to new;
set newname for clone datafile 4 to new;
set newname for clone datafile 5 to new;
backup as copy reuse
datafile 1 auxiliary format new
datafile 2 auxiliary format new
datafile 3 auxiliary format new
datafile 4 auxiliary format new
datafile 5 auxiliary format new
;
sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u01/app/oracle/oradata/RAC/datafile/o1_mf_temp_%u_.tmp in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 2015-12-14 20:38:12
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/rac/datafile/system.256.897852709
output file name=/u01/app/oracle/oradata/RAC/datafile/o1_mf_system_08qoqrpl_.dbf tag=TAG20151214T203812
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+DATA/rac/datafile/sysaux.257.897852709
output file name=/u01/app/oracle/oradata/RAC/datafile/o1_mf_sysaux_09qoqrq4_.dbf tag=TAG20151214T203812
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:07
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DATA/rac/datafile/undotbs1.258.897852709
output file name=/u01/app/oracle/oradata/RAC/datafile/o1_mf_undotbs1_0aqoqrqb_.dbf tag=TAG20151214T203812
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+DATA/rac/datafile/undotbs2.264.897852847
output file name=/u01/app/oracle/oradata/RAC/datafile/o1_mf_undotbs2_0bqoqrqc_.dbf tag=TAG20151214T203812
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DATA/rac/datafile/users.259.897852709
output file name=/u01/app/oracle/oradata/RAC/datafile/o1_mf_users_0cqoqrqd_.dbf tag=TAG20151214T203812
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 2015-12-14 20:38:38
sql statement: alter system archive log current
contents of Memory Script:
{
backup as copy reuse
archivelog like "+FRA/rac/archivelog/2015_12_14/thread_1_seq_11.272.898461519" auxiliary format
"/u01/app/oracle/fast_recovery_area/1_11_897852779.arc" ;
catalog clone archivelog "/u01/app/oracle/fast_recovery_area/1_11_897852779.arc";
switch clone datafile all;
}
executing Memory Script
Starting backup at 2015-12-14 20:38:38
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=11 RECID=6 STAMP=898461518
output file name=/u01/app/oracle/fast_recovery_area/1_11_897852779.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 2015-12-14 20:38:39
cataloged archived log
archived log file name=/u01/app/oracle/fast_recovery_area/1_11_897852779.arc RECID=1 STAMP=898461519
datafile 1 switched to datafile copy
input datafile copy RECID=2 STAMP=898461519 file name=/u01/app/oracle/oradata/RAC/datafile/o1_mf_system_08qoqrpl_.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=3 STAMP=898461519 file name=/u01/app/oracle/oradata/RAC/datafile/o1_mf_sysaux_09qoqrq4_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=4 STAMP=898461519 file name=/u01/app/oracle/oradata/RAC/datafile/o1_mf_undotbs1_0aqoqrqb_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=5 STAMP=898461519 file name=/u01/app/oracle/oradata/RAC/datafile/o1_mf_users_0cqoqrqd_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=6 STAMP=898461519 file name=/u01/app/oracle/oradata/RAC/datafile/o1_mf_undotbs2_0bqoqrqc_.dbf
contents of Memory Script:
{
set until scn 1077706;
recover
standby
clone database
delete archivelog
;
}
executing Memory Script
executing command: SET until clause
Starting recover at 2015-12-14 20:38:40
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 11 is already on disk as file /u01/app/oracle/fast_recovery_area/1_11_897852779.arc
archived log file name=/u01/app/oracle/fast_recovery_area/1_11_897852779.arc thread=1 sequence=11
media recovery complete, elapsed time: 00:00:00
Finished recover at 2015-12-14 20:38:40
Finished Duplicate Db at 2015-12-14 20:38:45
观察备库状态
SQL> select status from v$instance;
STATUS
------------
MOUNTED
SQL> alter database open;
Database altered.
参考:
http://www.oracledba.org/11gR2/dr/11gR2_dataguard_RAC_to_RAC.html