8.修改tns;
cd $ORACLE_HOME/network/admin
vi tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.
JSTDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = scan.test.com)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = JSTDB)
)
)
JSTDB1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1.test.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac1-vip.test.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = JSTDB)
(INSTANCE_NAME = JSTDB1)
)
)
JSTDB2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2.test.com)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = rac2-vip.test.com)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = JSTDB)
(INSTANCE_NAME = JSTDB2)
)
)
JSTDG1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = JSTDG1)
)
)
PAYDB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = scan.test.com)(PORT = 1521))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PAYDB)
)
)
PAYDG1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = PAYDB)
)
)
9.备库添加监听;
cd $ORACLE_HOME/network/admin
vi listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/network/admin/listener.ora
# Generated by Oracle configuration tools.
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = standby)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = JSTDG1)
(ORACLE_HOME = /u01/app/oracle)
(SID_NAME = JSTDB)
)
(SID_DESC =
(GLOBAL_DBNAME = PAYDG1)
(ORACLE_HOME = /u01/app/oracle)
(SID_NAME = PAYDB)
)
)
ADR_BASE_LISTENER = /u01/app/oracle
备库重启监听服务
lsnrctl stop
lsnrctl start
10.在RAC节点1生成standby控制文件;
export ORACLE_SID=JSTDB1
rman target /
backup device type disk format '/u01/rman/ctl01.ctl' current controlfile for standby;
scp /u01/rman/ctl01.ctl standby:/u01/rman/
11.在standby创建相关目录;
@root用户
mkdir -p /u01/rman/JSTDB
chown -R oracle.oinstall /u01/rman/
mkdir -p /u01/arch/JSTDG1
chown -R oracle.oinstall /u01/arch/
@oracle用户
mkdir -p /u01/app/oracle/oradata/JSTDG1/datafile/
mkdir -p /u01/app/oracle/oradata/JSTDG1/onlinelog
mkdir -p /u01/app/oracle/admin/JSTDG1/adump
12.复制密码文件;