In Previous article we have seen Primary Database Preparation for Data Guard Configuration.
In this article we will see Oracle Net Configuration on Primary and Standby.
Step 1 : Configure tnsnames.ora file at Production.
[oracle@test1 ~]$ cat $ORACLE_HOME/network/admin/tnsnames.ora # tnsnames.ora Network Configuration File: /u01/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. TESTDB = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = testdb)(UR=A) ) ) STD_TESTDB = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = testdb)(UR=A) ) ) [oracle@test1 ~]$
Here we can see two net services. TESTDB for Primary Database Connection and STD_TESTDB for standby database configuration.
Step 2 : We need to add static entry for standby database in listener.ora file at standby side.
[oracle@localhost admin]$ cat listener.ora # listener.ora Network Configuration File: /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora # Generated by Oracle configuration tools. LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) SID_LIST_LISTENER= (SID_LIST= (SID_DESC= (ORACLE_HOME=/u01/oracle/product/11.2.0/db_1) (SID_NAME=testdb) ) ) ADR_BASE_LISTENER = /u01/oracle
Step 3 : Add net service entry in tnsnames.ora at standby side for Primary and Standby Database.
[oracle@localhost admin]$ cat tnsnames.ora testdb= (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.16)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = testdb)(UR=A) ) ) STD_TESTDB = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = testdb)(UR=A) ) ) [oracle@localhost admin]$
Step 4 : Start listener at standby side.
[oracle@localhost admin]$ lsnrctl start LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 21-APR-2018 23:14:29 Copyright (c) 1991, 2013, Oracle. All rights reserved. Starting /u01/oracle/product/11.2.0/db_1/bin/tnslsnr: please wait... TNSLSNR for Linux: Version 11.2.0.4.0 - Production System parameter file is /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora Log messages written to /u01/oracle/diag/tnslsnr/localhost/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 11.2.0.4.0 - Production Start Date 21-APR-2018 23:14:30 Uptime 0 days 0 hr. 0 min. 0 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /u01/oracle/product/11.2.0/db_1/network/admin/listener.ora Listener Log File /u01/oracle/diag/tnslsnr/localhost/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Services Summary... Service "testdb" has 1 instance(s). Instance "testdb", status UNKNOWN, has 1 handler(s) for this service... The command completed successfully [oracle@localhost admin]$
Step 5: Check tnsping for standby and primary from both side.
Primary Database :
[oracle@test1 admin]$ tnsping testdb TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 21-APR-2018 23:18:38 Copyright (c) 1997, 2013, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =localhost)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = testdb)(UR=A))) OK (0 msec) [oracle@test1 admin]$ tnsping std_testdb TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 21-APR-2018 23:18:45 Copyright (c) 1997, 2013, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = testdb)(UR=A))) OK (10 msec) [oracle@test1 admin]$
Standby Database.
[oracle@localhost admin]$ tnsping std_testdb TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 21-APR-2018 23:19:22 Copyright (c) 1997, 2013, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.10)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = testdb)(UR=A))) OK (0 msec) [oracle@localhost admin]$ tnsping testdb TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 21-APR-2018 23:20:20 Copyright (c) 1997, 2013, Oracle. All rights reserved. Used parameter files: Used TNSNAMES adapter to resolve the alias Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.1.16)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = testdb)(UR=A))) OK (10 msec) [oracle@localhost admin]$
In next articles we will see creating standby database using different methods.
Stay tuned for More articles on Oracle DataGuard
Thank you for giving your valuable time to read the above information.
If you want to be updated with all our articles send us the Invitation or Follow us:
Telegram Channel: https://t.me/helporacle
Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/
Joel Perez’s LinkedIn: Joel Perez’s Profile
LinkedIn Group: Oracle Cloud DBAAS
Facebook Page: OracleHelp