[Oracle Active DataGuard 12.1 Installation on Centos 6.7]: Configuring Oracle network services for creating a duplicate of primary on standby
Configuring Listener on Primary
$ cd $ORACLE_HOME/network/admin
$ vi listener.ora
LISTENER =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=moscow.localdomain)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=master)
(ORACLE_HOME=/u01/oracle/database/12.1)
(SID_NAME=orcl12)
)
)
Configuring Listener on Standby
$ cd $ORACLE_HOME/network/admin
$ vi listener.ora
LISTENER =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=piter.localdomain)(PORT=1521))
(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC=
(GLOBAL_DBNAME=slave)
(ORACLE_HOME=/u01/oracle/database/12.1)
(SID_NAME=orcl12)
)
)
Configuring tnsnames.ora on Primary and Standby
$ vi tnsnames.ora
***
primary =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = moscow.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = master)
)
)
standby =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = piter.localdomain)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = slave)
)
)
Checking network services
$ lsnrctl stop
$ lsnrctl start
$ lsnrctl status
LSNRCTL for Linux: Version 12.1.0.2.0 - Production on 15-AUG-2015 15:31:07
Copyright (c) 1991, 2014, Oracle. All rights reserved.
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=moscow.localdomain)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.1.0.2.0 - Production
Start Date 15-AUG-2015 15:30:08
Uptime 0 days 0 hr. 0 min. 59 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /u01/oracle/database/12.1/network/admin/listener.ora
Listener Log File /u01/oracle/diag/tnslsnr/moscow/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=moscow.localdomain)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=extproc)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM", status READY, has 1 handler(s) for this service...
Service "master" has 2 instance(s).
Instance "orcl12", status UNKNOWN, has 1 handler(s) for this service...
Instance "orcl12", status READY, has 1 handler(s) for this service...
Service "master_DGB" has 1 instance(s).
Instance "orcl12", status READY, has 1 handler(s) for this service...
Service "orcl12XDB" has 1 instance(s).
Instance "orcl12", status READY, has 1 handler(s) for this service...
The command completed successfully
The master and slave services need to come up on each server. They don’t start immediately. Sometimes you need to wait about 5 minutes.
tnsping should work from both servers:
$ tnsping primary
$ tnsping standby
Should return OK.