本文主要是介绍Configuring Oracle 11.2.0.3 3-Nodes RAC Primary to 2-Nodes RAC Physical Standby DataGuard on OL,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
操作环境
Primary | Standby | |
Clusterware | 11.2.0.3 Grid Infrastructure | 11.2.0.3 Grid Infrastructure |
Cluster Nodes | vzwc1,vzwc2,vzwc3(3-Nodes) | sd-vzwc1,sd-vzwc2(2-Nodes) |
SCAN | vzwc-cluster-scan | sd-vzwc-cluster-scan |
SCAN listener Host/port | SCAN VIP(1521) | SCAN VIP(1521) |
HOSTNAME | vzwc1,vzwc2,vzwc3 | sd-vzwc1,sd-vzwc2 |
PRIVATE IP | vzwc1-priv,vzwc2-priv,vzwc3-priv | sd-vzwc1-priv,sd-vzwc2-priv |
VIPs | vzwc1-vip,vzwc2-vip,vzwc3-vip | sd-vzwc1-vip,sd-vzwc2-vip |
DB_UNIQUE_NAME | nanjing | shanghai |
DB_NAME | zwc | zwc |
DB Instances | zwc1,zwc2,zwc3 | zwc1,zwc2 |
DB Storage | ASM | ASM |
File Management | OMF | OMF |
ASM DiskGroup for CRS | SYSDG | SYSDG |
ASM DiskGroup for DB Files | DATADG | DATADG |
ASM DiskGroup for FRA | FRADG | FRADG |
11gR2 RAC Version | 11.2.0.3 | 11.2.0.3 |
OS | Oracle Linux 5.8 (x86_64) | Oracle Linux 5.8 (x86_64) |
DataGuard配置前准备工作
Primary Database
安装和配置好3节点的Grid Infrastructure (11.2.0.3)
安装和配置好3节点的RAC Database
创建SYSDG,DATADG,FRADG ASM Diskgroup
配置数据库"zwc"在ASM上使用OMF
配置数据库参数LOCAL_LISTENER,REMOTE_LISTENER
Standby Database
安装和配置好2节点的Grid Infrastructure (11.2.0.3)
安装2节点的RAC Database Software
创建SYSDG,DATADG,FRADG ASM Diskgroup
配置Primary RAC database
Enable Force Logging
SQL> alter database force logging;
Database altered.
SQL> select inst_id,name,db_unique_name,force_logging,platform_name from gv$database order by 1;
INST_ID NAME DB_UNIQUE_NAME FORCE_LOGGING PLATFORM_NAME
---------- --------- --------------- --------------- -----------------
1 ZWC nanjing YES Linux x86 64-bit
2 ZWC nanjing YES Linux x86 64-bit
3 ZWC nanjing YES Linux x86 64-bit
修改初始化参数
DB_NAME=zwc
DB_UNIQUE_NAME=nanjing
LOG_ARCHIVE_CONFIG='DG_CONFIG=(nanjing,shanghai)'
LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=nanjing'
LOG_ARCHIVE_DEST_2='SERVICE=shanghai ARCH VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=shanghai'
LOG_ARCHIVE_DEST_STATE_1=ENABLE
LOG_ARCHIVE_DEST_STATE_2=ENABLE
REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE
LOG_ARCHIVE_FORMAT=%t_%s_%r.arc
LOG_ARCHIVE_MAX_PROCESSES=8
FAL_SERVER=shanghai
DB_FILE_NAME_CONVERT='shanghai','nanjing'
LOG_FILE_NAME_CONVERT= 'shanghai','nanjing'
STANDBY_FILE_MANAGEMENT=AUTO
SQL> alter system set LOG_ARCHIVE_CONFIG='DG_CONFIG=(nanjing,shanghai)' scope=both sid='*';
System altered.
SQL> alter system set LOG_ARCHIVE_DEST_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=nanjing' scope=both sid='*';
System altered.
SQL> alter system set LOG_ARCHIVE_DEST_2='SERVICE=shanghai ARCH VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=shanghai' scope=both sid='*';
System altered.
SQL> alter system set log_archive_format='%t_%s_%r.arc' scope=spfile sid='*';
System altered.
SQL> alter system set log_archive_max_processes=8 scope=both sid='*';
System altered.
SQL> alter system set fal_server=shanghai scope=both sid='*';
System altered.
SQL> alter system set db_file_name_convert='shanghai','nanjing' scope=spfile sid='*';
System altered.
SQL> alter system set log_file_name_convert='shanghai','nanjing' scope=spfile sid='*';
System altered.
SQL> alter system set standby_file_management=AUTO scope=both sid='*';
System altered.
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
[oracle@vzwc1 ~]$ srvctl stop database -d nanjing
[oracle@vzwc1 ~]$ srvctl start database -d nanjing
验证修改过的参数
[oracle@vzwc1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Mon Apr 29 22:37:43 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> set lines 200 pages 50 feedback off
SQL> col value for a100
SQL> col name for a50
SQL> select name, value
2 from v$parameter
3 where name in ('db_name',
4 'db_unique_name',
5 'log_archive_config',
6 'log_archive_dest_1',
7 'log_archive_dest_2',
8 'log_archive_dest_state_1',
9 'log_archive_dest_state_2',
10 'remote_login_passwordfile',
11 'log_archive_format',
12 'log_archive_max_processes',
13 'fal_server',
14 'db_file_name_convert',
15 'log_file_name_convert',
16 'standby_file_management')
17 /
NAME VALUE
-------------------------------------------------- ----------------------------------------------------------------------------------------------------
db_file_name_convert shanghai, nanjing
log_file_name_convert shanghai, nanjing
log_archive_dest_1 LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=nanjing
log_archive_dest_2 SERVICE=shanghai ARCH VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=shanghai
log_archive_dest_state_1 enable
log_archive_dest_state_2 enable
fal_server SHANGHAI
log_archive_config DG_CONFIG=(nanjing,shanghai)
log_archive_format %t_%s_%r.arc
log_archive_max_processes 8
standby_file_management AUTO
remote_login_passwordfile EXCLUSIVE
db_name zwc
db_unique_name nanjing
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 19
Next log sequence to archive 20
Current log sequence 20
创建Standby Read Log Groups
要比每个节点的Online Redo Log多一组,日志成员大小一样,这里指定ASM DISKGROUP路径
[grid@vzwc1 ~]$ asmcmd -p
ASMCMD [+] > mkdir +fradg/nanjing/STANDBYLOG
SQL> select max(bytes/1024/1024) "size MB", count(*) from v$log;
size MB COUNT(*)
---------- ----------
50 6
SQL> select group#,thread# from v$log order by 1,2;
GROUP# THREAD#
---------- ----------
1 1
2 1
3 2
4 2
5 3
6 3
6 rows selected.
SQL> alter system set standby_file_management=manual scope=both sid='*';
System altered.
SQL> alter database add standby logfile thread 1 group 7 '+fradg/nanjing/standbylog/standby_group_07.log' size 50M;
Database altered.
SQL> alter database add standby logfile thread 1 group 8 '+fradg/nanjing/standbylog/standby_group_08.log' size 50M;
Database altered.
SQL> alter database add standby logfile thread 1 group 9 '+fradg/nanjing/standbylog/standby_group_09.log' size 50M;
Database altered.
SQL> alter database add standby logfile thread 2 group 10 '+fradg/nanjing/standbylog/standby_group_10.log' size 50M;
Database altered.
SQL> alter database add standby logfile thread 2 group 11 '+fradg/nanjing/standbylog/standby_group_11.log' size 50M;
Database altered.
SQL> alter database add standby logfile thread 2 group 12 '+fradg/nanjing/standbylog/standby_group_12.log' size 50M;
Database altered.
SQL> alter database add standby logfile thread 3 group 13 '+fradg/nanjing/standbylog/standby_group_13.log' size 50M;
Database altered.
SQL> alter database add standby logfile thread 3 group 14 '+fradg/nanjing/standbylog/standby_group_14.log' size 50M;
Database altered.
SQL> alter database add standby logfile thread 3 group 15 '+fradg/nanjing/standbylog/standby_group_15.log' size 50M;
Database altered.
SQL> alter system set standby_file_management=auto scope=both sid='*';
System altered.
ASMCMD [+fradg/nanjing/standbylog] > ls -l
Type Redund Striped Time Sys Name
N standby_group_07.log => +FRADG/NANJING/ONLINELOG/group_7.299.814056907
N standby_group_08.log => +FRADG/NANJING/ONLINELOG/group_8.300.814056923
N standby_group_09.log => +FRADG/NANJING/ONLINELOG/group_9.301.814056931
N standby_group_10.log => +FRADG/NANJING/ONLINELOG/group_10.302.814056971
N standby_group_11.log => +FRADG/NANJING/ONLINELOG/group_11.303.814056979
N standby_group_12.log => +FRADG/NANJING/ONLINELOG/group_12.304.814056989
N standby_group_13.log => +FRADG/NANJING/ONLINELOG/group_13.305.814057005
N standby_group_14.log => +FRADG/NANJING/ONLINELOG/group_14.306.814057015
N standby_group_15.log => +FRADG/NANJING/ONLINELOG/group_15.307.814057021
创建备份目录,使用RMAN备份Primary Database和Standby Controlfile
[oracle@vzwc1 ~]$ mkdir -p /home/oracle/backup
[oracle@vzwc1 ~]$ rman target /
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Apr 29 23:02:29 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ZWC (DBID=569865455)
RMAN> run{
2> sql 'alter system switch logfile';
3> allocate channel c1 type disk format '/home/oracle/backup/Primary_bkp_for_stndby_%U';
4> backup database tag 'std_full_bkp';
5> backup current controlfile for standby;
6> sql 'alter system archive log current';
7> release channel c1;
8> }
using target database control file instead of recovery catalog
sql statement: alter system switch logfile
allocated channel: c1
channel c1: SID=60 instance=zwc1 device type=DISK
Starting backup at 29-APR-13
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=+DATADG/nanjing/datafile/system.256.813885651
input datafile file number=00002 name=+DATADG/nanjing/datafile/sysaux.257.813885653
input datafile file number=00005 name=+DATADG/nanjing/datafile/example.264.813885779
input datafile file number=00003 name=+DATADG/nanjing/datafile/undotbs1.258.813885655
input datafile file number=00006 name=+DATADG/nanjing/datafile/undotbs2.265.813886061
input datafile file number=00007 name=+DATADG/nanjing/datafile/undotbs3.266.813886065
input datafile file number=00008 name=+DATADG/nanjing/datafile/run.272.813886933
input datafile file number=00004 name=+DATADG/nanjing/datafile/users.259.813885655
channel c1: starting piece 1 at 29-APR-13
channel c1: finished piece 1 at 29-APR-13
piece handle=/home/oracle/backup/Primary_bkp_for_stndby_01o8b1uc_1_1 tag=STD_FULL_BKP comment=NONE
channel c1: backup set complete, elapsed time: 00:02:53
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel c1: starting piece 1 at 29-APR-13
channel c1: finished piece 1 at 29-APR-13
piece handle=/home/oracle/backup/Primary_bkp_for_stndby_02o8b23q_1_1 tag=STD_FULL_BKP comment=NONE
channel c1: backup set complete, elapsed time: 00:00:08
Finished backup at 29-APR-13
Starting backup at 29-APR-13
channel c1: starting full datafile backup set
channel c1: specifying datafile(s) in backup set
including standby control file in backup set
channel c1: starting piece 1 at 29-APR-13
channel c1: finished piece 1 at 29-APR-13
piece handle=/home/oracle/backup/Primary_bkp_for_stndby_03o8b24s_1_1 tag=TAG20130429T230708 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:03
Finished backup at 29-APR-13
sql statement: alter system archive log current
released channel: c1
RMAN>
创建Standby Database的pfile
SQL> create pfile='/home/oracle/pfile_standby' from spfile;
File created.
修改Primary Database各节点的tnsnames.ora文件,保证一致
NANJING =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc-cluster-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
)
)
LISTENER_ZWC1=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc1-vip)(PORT = 1521)))
LISTENER_ZWC2=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc2-vip)(PORT = 1521)))
LISTENER_ZWC3=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc3-vip)(PORT = 1521)))
NANJING1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc1)
)
)
NANJING2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc2-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc2)
)
)
NANJING3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc3-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc3)
)
)
SHANGHAI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc-cluster-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shanghai)
)
)
SHANGHAI1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shanghai)
(SID = zwc1)
)
)
SHANGHAI2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc2-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shanghai)
(SID = zwc2)
)
)
配置Standby RAC database
将主库的RMAN备份文件和pfile传送到Standby Database sd-vzwc1上
[oracle@vzwc1~]$ scp /home/oracle/pfile_standby oracle@192.168.1.41:$ORACLE_HOME/dbs/pfile_standby.ora
[oracle@vzwc1 ~]$ scp -r /home/oracle/backup oracle@192.168.1.41:/home/oracle
将Primary Database的口令文件传送到sd-vzwc1,sd-vzwc2
[oracle@vzwc1 ~]$ scp $ORACLE_HOME/dbs/orapwzwc1 oracle@192.168.1.41:$ORACLE_HOME/dbs/orapwzwc1
[oracle@vzwc1 ~]$ scp $ORACLE_HOME/dbs/orapwzwc1 oracle@192.168.1.42:$ORACLE_HOME/dbs/orapwzwc2
创建必要的dump和SID目录
On sd-vzwc1
[oracle@sd-vzwc1 ~]$ mkdir -p /u01/app/oracle/admin/shanghai/adump
[oracle@sd-vzwc1 ~]$ mkdir -p /u01/app/oracle/diag/rdbms/shanghai/zwc1
[oracle@sd-vzwc1 ~]$ cd /u01/app/oracle/diag/rdbms/shanghai/zwc1
[oracle@sd-vzwc1 zwc1]$ mkdir trace cdump
On sd-vzwc2
[oracle@sd-vzwc2 ~]$ mkdir -p /u01/app/oracle/admin/shanghai/adump
[oracle@sd-vzwc2 ~]$ mkdir -p /u01/app/oracle/diag/rdbms/shanghai/zwc2
[oracle@sd-vzwc2 ~]$ cd /u01/app/oracle/diag/rdbms/shanghai/zwc2
[oracle@sd-vzwc2 zwc2]$ mkdir trace cdump
修改Standby Database pfile
*.audit_file_dest='/u01/app/oracle/admin/shanghai/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DATADG/shanghai/controlfile/control01.ctl','+FRADG/shanghai/controlfile/control02.ctl'
*.db_block_size=8192
*.db_create_file_dest='+DATADG'
*.db_domain=''
*.db_file_name_convert='nanjing','shanghai'
*.db_name='zwc'
*.db_recovery_file_dest='+FRADG'
*.db_recovery_file_dest_size=4951375872
*.db_unique_name='shanghai'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=zwcXDB)'
*.fal_server='NANJING'
zwc1.instance_number=1
zwc2.instance_number=2
zwc1.local_listener='LISTENER_ZWC1'
zwc2.local_listener='LISTENER_ZWC2'
*.log_archive_config='DG_CONFIG=(nanjing,shanghai)'
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=shanghai'
*.log_archive_dest_2='SERVICE=nanjing ARCH VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=nanjing'
*.log_archive_format='%t_%s_%r.arc'
*.log_archive_max_processes=8
*.log_file_name_convert='nanjing','shanghai'
*.memory_target=838860800
*.nls_language='SIMPLIFIED CHINESE'
*.open_cursors=300
*.processes=800
*.remote_listener='sd-vzwc-cluster-scan:1521'
*.remote_login_passwordfile='exclusive'
*.sessions=885
*.standby_file_management='AUTO'
zwc2.thread=2
zwc1.thread=1
zwc2.undo_tablespace='UNDOTBS2'
zwc1.undo_tablespace='UNDOTBS1'
将Primary Database的tnsnames.ora文件传送到各Standby Database
[oracle@vzwc1 ~]$ scp $ORACLE_HOME/network/admin/tnsnames.ora
[oracle@vzwc1 ~]$ scp $ORACLE_HOME/network/admin/tnsnames.ora
编辑2节点Standby Database的tnsnames.ora文件
NANJING =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc-cluster-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
)
)
LISTENER_ZWC1=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc1-vip)(PORT = 1521)))
LISTENER_ZWC2=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc2-vip)(PORT = 1521)))
NANJING1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc1)
)
)
NANJING2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc2-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc2)
)
)
NANJING3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc3-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc3)
)
)
创建ASM目录
[grid@sd-vzwc1 ~]$ asmcmd -p
ASMCMD [+] > mkdir +datadg/shanghai
ASMCMD [+] > cd datadg/shanghai
ASMCMD [+datadg/shanghai] > mkdir PARAMETERFILE DATAFILE CONTROLFILE TEMPFILE ONLINELOG
ASMCMD [+datadg/shanghai] > ls -l
Type Redund Striped Time Sys Name
N CONTROLFILE/
N DATAFILE/
N ONLINELOG/
N PARAMETERFILE/
N TEMPFILE/
ASMCMD [+datadg/shanghai] > mkdir +fradg/shanghai
ASMCMD [+datadg/shanghai] > cd +fradg/shanghai
ASMCMD [+fradg/shanghai] > mkdir ARCHIVELOG CONTROLFILE ONLINELOG STANDBYLOG
ASMCMD [+fradg/shanghai] > ls -l
Type Redund Striped Time Sys Name
N ARCHIVELOG/
N CONTROLFILE/
N ONLINELOG/
N STANDBYLOG/
开始创建RAC Physical Standby Database
在sd-vzwc1启动zwc1到nomount
[oracle@sd-vzwc1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 30 00:20:41 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount pfile='$ORACLE_HOME/dbs/pfile_standby.ora'
ORACLE instance started.
Total System Global Area 835104768 bytes
Fixed Size 2232960 bytes
Variable Size 570428800 bytes
Database Buffers 260046848 bytes
Redo Buffers 2396160 bytes
创建备库spfile
SQL> create spfile='+datadg/shanghai/parameterfile/spfilezwc.ora' from pfile='$ORACLE_HOME/dbs/pfile_standby.ora';
File created.
使用RMAN的DUPLICATE DATABASE还原数据库
[oracle@sd-vzwc1 ~]$ rman target sys/oracle@nanjing1 auxiliary /
Recovery Manager: Release 11.2.0.3.0 - Production on Tue Apr 30 00:23:06 2013
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: ZWC (DBID=569865455)
connected to auxiliary database: ZWC (not mounted)
RMAN> duplicate target database for standby nofilenamecheck;
Starting Duplicate Db at 30-APR-13
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=36 instance=zwc1 device type=DISK
contents of Memory Script:
{
restore clone standby controlfile;
}
executing Memory Script
Starting restore at 30-APR-13
using channel ORA_AUX_DISK_1
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 /home/oracle/backup/Primary_bkp_for_stndby_03o8b24s_1_1
channel ORA_AUX_DISK_1: piece handle=/home/oracle/backup/Primary_bkp_for_stndby_03o8b24s_1_1 tag=TAG20130429T230708
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:16
output file name=+DATADG/shanghai/controlfile/control01.ctl
output file name=+FRADG/shanghai/controlfile/control02.ctl
Finished restore at 30-APR-13
contents of Memory Script:
{
sql clone 'alter database mount standby database';
}
executing Memory Script
sql statement: alter database mount standby database
RMAN-05529: WARNING: DB_FILE_NAME_CONVERT resulted in invalid ASM names; names changed to disk group only.
contents of Memory Script:
{
set newname for tempfile 1 to
"+datadg";
switch clone tempfile all;
set newname for datafile 1 to
"+datadg";
set newname for datafile 2 to
"+datadg";
set newname for datafile 3 to
"+datadg";
set newname for datafile 4 to
"+datadg";
set newname for datafile 5 to
"+datadg";
set newname for datafile 6 to
"+datadg";
set newname for datafile 7 to
"+datadg";
set newname for datafile 8 to
"+datadg";
restore
clone database
;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to +datadg in control file
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting restore at 30-APR-13
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to +datadg
channel ORA_AUX_DISK_1: restoring datafile 00002 to +datadg
channel ORA_AUX_DISK_1: restoring datafile 00003 to +datadg
channel ORA_AUX_DISK_1: restoring datafile 00004 to +datadg
channel ORA_AUX_DISK_1: restoring datafile 00005 to +datadg
channel ORA_AUX_DISK_1: restoring datafile 00006 to +datadg
channel ORA_AUX_DISK_1: restoring datafile 00007 to +datadg
channel ORA_AUX_DISK_1: restoring datafile 00008 to +datadg
channel ORA_AUX_DISK_1: reading from backup piece /home/oracle/backup/Primary_bkp_for_stndby_01o8b1uc_1_1
channel ORA_AUX_DISK_1: piece handle=/home/oracle/backup/Primary_bkp_for_stndby_01o8b1uc_1_1 tag=STD_FULL_BKP
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:57
Finished restore at 30-APR-13
contents of Memory Script:
{
switch clone datafile all;
}
executing Memory Script
datafile 1 switched to datafile copy
input datafile copy RECID=10 STAMP=814062383 file name=+DATADG/shanghai/datafile/system.257.814062261
datafile 2 switched to datafile copy
input datafile copy RECID=11 STAMP=814062387 file name=+DATADG/shanghai/datafile/sysaux.258.814062261
datafile 3 switched to datafile copy
input datafile copy RECID=12 STAMP=814062388 file name=+DATADG/shanghai/datafile/undotbs1.260.814062263
datafile 4 switched to datafile copy
input datafile copy RECID=13 STAMP=814062389 file name=+DATADG/shanghai/datafile/users.264.814062263
datafile 5 switched to datafile copy
input datafile copy RECID=14 STAMP=814062390 file name=+DATADG/shanghai/datafile/example.259.814062263
datafile 6 switched to datafile copy
input datafile copy RECID=15 STAMP=814062391 file name=+DATADG/shanghai/datafile/undotbs2.261.814062263
datafile 7 switched to datafile copy
input datafile copy RECID=16 STAMP=814062392 file name=+DATADG/shanghai/datafile/undotbs3.262.814062263
datafile 8 switched to datafile copy
input datafile copy RECID=17 STAMP=814062393 file name=+DATADG/shanghai/datafile/run.263.814062263
Finished Duplicate Db at 30-APR-13
RMAN>
修改2节点Standby Database的tnsname.ora文件
NANJING =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc-cluster-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
)
)
LISTENER_ZWC1=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc1-vip)(PORT = 1521)))
LISTENER_ZWC2=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc2-vip)(PORT = 1521)))
NANJING1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc1)
)
)
NANJING2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc2-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc2)
)
)
NANJING3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc3-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc3)
)
)
SHANGHAI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc-cluster-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shanghai)
)
)
SHANGHAI1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shanghai)
(SID = zwc1)
)
)
SHANGHAI2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc2-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shanghai)
(SID = zwc2)
)
)
启动Managed Recovery进程
因为使用RMAN的DUPLICATE DATABASE FOR STANDBY,所以Standby Databse的standbylog已经还原,不需要再创建
[oracle@sd-vzwc1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 30 00:39:21 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> alter database recover managed standby database using current logfile disconnect from session;
Database altered.
观察alert日志,发现主库正在传输归档日志
alter database recover managed standby database using current logfile disconnect from session
Attempt to start background Managed Standby Recovery process (zwc1)
Tue Apr 30 00:41:15 2013
MRP0 started with pid=45, OS id=12753
MRP0: Background Managed Standby Recovery process started (zwc1)
Serial Media Recovery started
Tue Apr 30 00:41:21 2013
Managed Standby Recovery starting Real Time Apply
Waiting for all non-current ORLs to be archived...
All non-current ORLs have been archived.
Tue Apr 30 00:41:25 2013
Completed: alter database recover managed standby database using current logfile disconnect from session
Tue Apr 30 00:41:26 2013
Media Recovery Log +FRADG/shanghai/archivelog/2013_04_30/thread_1_seq_21.275.814063031
Media Recovery Log +FRADG/shanghai/archivelog/2013_04_30/thread_2_seq_13.272.814063031
Media Recovery Log +FRADG/shanghai/archivelog/2013_04_30/thread_3_seq_11.276.814063031
Media Recovery Log +FRADG/shanghai/archivelog/2013_04_30/thread_1_seq_22.274.814063031
Media Recovery Log +FRADG/shanghai/archivelog/2013_04_30/thread_3_seq_12.278.814063031
Media Recovery Log +FRADG/shanghai/archivelog/2013_04_30/thread_2_seq_14.277.814063031
Media Recovery Log +FRADG/shanghai/archivelog/2013_04_30/thread_3_seq_13.273.814063031
Media Recovery Waiting for thread 2 sequence 15
验证RAC to RAC DataGuard配置
查看主库和备库的ARCHIVELOG是否传输丢失
On Primary Database
[oracle@vzwc1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 30 00:47:44 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> select thread#, max (sequence#) from v$archived_log where APPLIED='YES' group by thread#;
THREAD# MAX(SEQUENCE#)
---------- --------------
1 22
2 14
3 12
On Standby Database
[oracle@sd-vzwc1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 30 00:48:16 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> select thread#, max (sequence#) from v$archived_log where APPLIED='YES' group by thread#;
THREAD# MAX(SEQUENCE#)
---------- --------------
1 22
2 14
3 12
修改2节点Standby Database pfile
On Primary Database
[oracle@sd-vzwc1 dbs]$ cat initzwc1.ora
spfile='+datadg/shanghai/parameterfile/spfilezwc.ora'
On Standby Database
[oracle@sd-vzwc2 dbs]$ cat initzwc2.ora
spfile='+datadg/shanghai/parameterfile/spfilezwc.ora'
将Standby Database和Instances注册到OCR里
[oracle@sd-vzwc1 ~]$ srvctl add database -d shanghai -n zwc -o /u01/app/oracle/product/11.2.0/dbhome_1 -p +datadg/shanghai/parameterfile/spfilezwc.ora -r physical_standby -a DATADG,FRADG
[oracle@sd-vzwc1 ~]$ srvctl add instance -d shanghai -i zwc1 -n sd-vzwc1
[oracle@sd-vzwc1 ~]$ srvctl add instance -d shanghai -i zwc2 -n sd-vzwc2
[oracle@sd-vzwc1 ~]$ srvctl start database -d shanghai
[oracle@sd-vzwc1 ~]$ srvctl modify database -d shanghai -s mount
启动Active DataGuard
[oracle@sd-vzwc1 ~]$ srvctl start database -d shanghai -o open
[oracle@sd-vzwc1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.3.0 Production on Tue Apr 30 02:01:02 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> select name,database_role,open_mode from gv$database;
NAME DATABASE_ROLE OPEN_MODE
--------- ---------------- --------------------
ZWC PHYSICAL STANDBY READ ONLY
ZWC PHYSICAL STANDBY READ ONLY
SQL> alter database recover managed standby database using current logfile disconnect from session;
Database altered.
SQL> select name,database_role,open_mode,created from gv$database;
NAME DATABASE_ROLE OPEN_MODE CREATED
--------- ---------------- -------------------- -------------------
ZWC PHYSICAL STANDBY READ ONLY WITH APPLY 2013-04-27 23:22:23
ZWC PHYSICAL STANDBY READ ONLY WITH APPLY 2013-04-27 23:22:23
SQL> select HOST_NAME,INSTANCE_NAME,STARTUP_TIME,DATABASE_STATUS,STATUS from gv$instance;
HOST_NAME INSTANCE_NAME STARTUP_TIME DATABASE_STATUS STATUS
---------- ---------------- ------------------- ----------------- ------------
sd-vzwc1 zwc1 2013-04-30 02:02:50 ACTIVE OPEN
sd-vzwc2 zwc2 2013-04-30 02:02:50 ACTIVE OPEN
[root@sd-vzwc2 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATADG.dg
ONLINE ONLINE sd-vzwc1
ONLINE ONLINE sd-vzwc2
ora.FRADG.dg
ONLINE ONLINE sd-vzwc1
ONLINE ONLINE sd-vzwc2
ora.LISTENER.lsnr
ONLINE ONLINE sd-vzwc1
ONLINE ONLINE sd-vzwc2
ora.SYSDG.dg
ONLINE ONLINE sd-vzwc1
ONLINE ONLINE sd-vzwc2
ora.asm
ONLINE ONLINE sd-vzwc1 Started
ONLINE ONLINE sd-vzwc2 Started
ora.gsd
OFFLINE OFFLINE sd-vzwc1
OFFLINE OFFLINE sd-vzwc2
ora.net1.network
ONLINE ONLINE sd-vzwc1
ONLINE ONLINE sd-vzwc2
ora.ons
ONLINE ONLINE sd-vzwc1
ONLINE ONLINE sd-vzwc2
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE sd-vzwc1
ora.cvu
1 ONLINE ONLINE sd-vzwc1
ora.oc4j
1 ONLINE ONLINE sd-vzwc1
ora.scan1.vip
1 ONLINE ONLINE sd-vzwc1
ora.sd-vzwc1.vip
1 ONLINE ONLINE sd-vzwc1
ora.sd-vzwc2.vip
1 ONLINE ONLINE sd-vzwc2
ora.shanghai.db
1 ONLINE ONLINE sd-vzwc1 Open,Readonly
2 ONLINE ONLINE sd-vzwc2 Open,Readonly
检查Primary Database状态
SQL> select name,database_role,switchover_status,open_mode,created from gv$database;
NAME DATABASE_ROLE SWITCHOVER_STATUS OPEN_MODE CREATED
--------- ---------------- -------------------- -------------------- -------------------
ZWC PRIMARY TO STANDBY READ WRITE 2013-04-27 23:22:23
ZWC PRIMARY TO STANDBY READ WRITE 2013-04-27 23:22:23
ZWC PRIMARY TO STANDBY READ WRITE 2013-04-27 23:22:23
在主库测试创建表空间
SQL> create tablespace zwctest datafile '+datadg' size 10m;
Tablespace created.
查看备库alert log
Recovery of Online Redo Log: Thread 3 Group 13 Seq 16 Reading mem 0
Mem# 0: +FRADG/shanghai/standbylog/standby_group_13.log
Successfully added datafile 10 to media recovery
Datafile #10: '+DATADG/shanghai/datafile/zwctest.274.814068561'
Tue Apr 30 02:09:33 2013
Media Recovery Log +FRADG/shanghai/archivelog/2013_04_30/thread_1_seq_29.289.814068545
Media Recovery Log +FRADG/shanghai/archivelog/2013_04_30/thread_1_seq_30.290.814068557
Media Recovery Waiting for thread 1 sequence 31
主库备库配置文件
主库文件
listener.ora
ZWC_LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=ZWC_LISTENER)))) # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
tnsnames.ora
NANJING =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc-cluster-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
)
)
LISTENER_ZWC1=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc1-vip)(PORT = 1521)))
LISTENER_ZWC2=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc2-vip)(PORT = 1521)))
LISTENER_ZWC3=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc3-vip)(PORT = 1521)))
NANJING1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc1)
)
)
NANJING2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc2-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc2)
)
)
NANJING3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc3-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc3)
)
)
SHANGHAI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc-cluster-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shanghai)
)
)
SHANGHAI1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shanghai)
(SID = zwc1)
)
)
SHANGHAI2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc2-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shanghai)
(SID = zwc2)
)
)
/etc/hosts
#public IP
192.168.1.51 vzwc1
192.168.1.52 vzwc2
192.168.1.53 vzwc3
#private IP
10.10.10.51 vzwc1-priv
10.10.10.52 vzwc2-priv
10.10.10.53 vzwc3-priv
#VIP
192.168.1.151 vzwc1-vip
192.168.1.152 vzwc2-vip
192.168.1.153 vzwc3-vip
#scanip
192.168.1.159 vzwc-cluster vzwc-cluster-scan
#standby database
#public IP
192.168.1.41 sd-vzwc1
192.168.1.42 sd-vzwc2
#private IP
10.10.10.41 sd-vzwc1-priv
10.10.10.42 sd-vzwc2-priv
#VIP
192.168.1.141 sd-vzwc1-vip
192.168.1.142 sd-vzwc2-vip
#scanip
192.168.1.149 sd-vzwc-cluster sd-vzwc-cluster-scan
pfile
*.audit_file_dest='/u01/app/oracle/admin/nanjing/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DATADG/nanjing/controlfile/current.260.813885743','+FRADG/nanjing/controlfile/current.256.813885743'
*.db_block_size=8192
*.db_create_file_dest='+DATADG'
*.db_domain=''
*.db_file_name_convert='shanghai','nanjing'
*.db_name='zwc'
*.db_recovery_file_dest='+FRADG'
*.db_recovery_file_dest_size=4951375872
*.db_unique_name='nanjing'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=zwcXDB)'
*.fal_server='SHANGHAI'
zwc3.instance_number=3
zwc1.instance_number=1
zwc2.instance_number=2
zwc1.local_listener='LISTENER_ZWC1'
zwc2.local_listener='LISTENER_ZWC2'
zwc3.local_listener='LISTENER_ZWC3'
*.log_archive_config='DG_CONFIG=(nanjing,shanghai)'
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=nanjing'
*.log_archive_dest_2='SERVICE=shanghai ARCH VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=shanghai'
*.log_archive_format='%t_%s_%r.arc'
*.log_archive_max_processes=8
*.log_file_name_convert='shanghai','nanjing'
*.memory_target=838860800
*.nls_language='SIMPLIFIED CHINESE'
*.open_cursors=300
*.processes=800
*.remote_listener='vzwc-cluster-scan:1521'
*.remote_login_passwordfile='exclusive'
*.sessions=885
*.standby_file_management='AUTO'
zwc3.thread=3
zwc2.thread=2
zwc1.thread=1
zwc2.undo_tablespace='UNDOTBS2'
zwc1.undo_tablespace='UNDOTBS1'
zwc3.undo_tablespace='UNDOTBS3'
备库文件
listener.ora
ZWC_LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=ZWC_LISTENER)))) # line added by Agent
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
LISTENER_SCAN1=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN1)))) # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN1=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
tnsnames.ora
NANJING =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc-cluster-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
)
)
LISTENER_ZWC1=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc1-vip)(PORT = 1521)))
LISTENER_ZWC2=(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc2-vip)(PORT = 1521)))
NANJING1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc1)
)
)
NANJING2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc2-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc2)
)
)
NANJING3 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = vzwc3-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = nanjing)
(SID = zwc3)
)
)
SHANGHAI =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc-cluster-scan)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shanghai)
)
)
SHANGHAI1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc1-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shanghai)
(SID = zwc1)
)
)
SHANGHAI2 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = sd-vzwc2-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = shanghai)
(SID = zwc2)
)
)
/etc/hosts
#public IP
192.168.1.41 sd-vzwc1
192.168.1.42 sd-vzwc2
#private IP
10.10.10.41 sd-vzwc1-priv
10.10.10.42 sd-vzwc2-priv
#VIP
192.168.1.141 sd-vzwc1-vip
192.168.1.142 sd-vzwc2-vip
#scanip
192.168.1.149 sd-vzwc-cluster sd-vzwc-cluster-scan
#primary database
#public IP
192.168.1.51 vzwc1
192.168.1.52 vzwc2
192.168.1.53 vzwc3
#private IP
10.10.10.51 vzwc1-priv
10.10.10.52 vzwc2-priv
10.10.10.53 vzwc3-priv
#VIP
192.168.1.151 vzwc1-vip
192.168.1.152 vzwc2-vip
192.168.1.153 vzwc3-vip
#scanip
192.168.1.159 vzwc-cluster vzwc-cluster-scan
pfile
*.audit_file_dest='/u01/app/oracle/admin/shanghai/adump'
*.audit_trail='db'
*.cluster_database=true
*.compatible='11.2.0.0.0'
*.control_files='+DATADG/shanghai/controlfile/control01.ctl','+FRADG/shanghai/controlfile/control02.ctl'
*.db_block_size=8192
*.db_create_file_dest='+DATADG'
*.db_domain=''
*.db_file_name_convert='nanjing','shanghai'
*.db_name='zwc'
*.db_recovery_file_dest='+FRADG'
*.db_recovery_file_dest_size=4951375872
*.db_unique_name='shanghai'
*.diagnostic_dest='/u01/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=zwcXDB)'
*.fal_server='NANJING'
zwc1.instance_number=1
zwc2.instance_number=2
zwc1.local_listener='LISTENER_ZWC1'
zwc2.local_listener='LISTENER_ZWC2'
*.log_archive_config='DG_CONFIG=(nanjing,shanghai)'
*.log_archive_dest_1='LOCATION=USE_DB_RECOVERY_FILE_DEST VALID_FOR=(ALL_LOGFILES,ALL_ROLES) DB_UNIQUE_NAME=shanghai'
*.log_archive_dest_2='SERVICE=nanjing ARCH VALID_FOR=(ONLINE_LOGFILES,PRIMARY_ROLE) DB_UNIQUE_NAME=nanjing'
*.log_archive_format='%t_%s_%r.arc'
*.log_archive_max_processes=8
*.log_file_name_convert='nanjing','shanghai'
*.memory_target=838860800
*.nls_language='SIMPLIFIED CHINESE'
*.open_cursors=300
*.processes=800
*.remote_listener='sd-vzwc-cluster-scan:1521'
*.remote_login_passwordfile='exclusive'
*.sessions=885
*.standby_file_management='AUTO'
zwc2.thread=2
zwc1.thread=1
zwc2.undo_tablespace='UNDOTBS2'
zwc1.undo_tablespace='UNDOTBS1'
这篇关于Configuring Oracle 11.2.0.3 3-Nodes RAC Primary to 2-Nodes RAC Physical Standby DataGuard on OL的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!