Thursday, March 17, 2022

sample listener.ora and tnsnames.ora file for RAC database

sample listener.ora and tnsnames.ora file for RAC database:


Node1:
======
[oracle@oraclenode1 ~]$ cd /u01/app/oracle/product/12.2.0.1/dbhome_1/network/admin/

[oracle@oraclenode1 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/12.2.0.1/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER_RACSB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oraclenode1-vip.localdomain.com)(PORT = 1523))
  )

ADR_BASE_LISTENER_RACSB = /u01/app/oracle

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_RACSB=ON                # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER_RACSB=SUBNET          # line added by Agent
[oracle@oraclenode1 admin]$

[oracle@oraclenode1 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.2.0.1/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

RACSB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = orclscan.localdomain.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = RACSB)
    )
  )

RACSB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oraclenode1-vip.localdomain.com)(PORT = 1523))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = RACSB)
      (SID = RACSB1)
    )
  )

RACSB2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oraclenode2-vip.localdomain.com)(PORT = 1523))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = RACSB)
      (SID = RACSB2)
    )
  )
[oracle@oraclenode1 admin]$

Node2:
======
[oracle@oraclenode2 ~]$ cd /u01/app/oracle/product/12.2.0.1/dbhome_1/network/admin/
[oracle@oraclenode2 admin]$

[oracle@oraclenode2 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/12.2.0.1/dbhome_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER_RACSB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oraclenode2-vip.localdomain.com)(PORT = 1523))
  )

ADR_BASE_LISTENER_RACSB = /u01/app/oracle

ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_RACSB=ON                # line added by Agent
VALID_NODE_CHECKING_REGISTRATION_LISTENER_RACSB=SUBNET          # line added by Agent
[oracle@oraclenode2 admin]$

[oracle@oraclenode2 admin]$ cat tnsnames.ora
# tnsnames.ora Network Configuration File: /u01/app/oracle/product/12.2.0.1/dbhome_1/network/admin/tnsnames.ora
# Generated by Oracle configuration tools.

RACSB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = orclscan.localdomain.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = RACSB)
    )
  )

RACSB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oraclenode1-vip.localdomain.com)(PORT = 1523))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = RACSB)
      (SID = RACSB1)
    )
  )

RACSB2 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oraclenode2-vip.localdomain.com)(PORT = 1523))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = RACSB)
      (SID = RACSB2)
    )
  )
[oracle@oraclenode2 admin]$

node1:
[oracle@oraclenode1 admin]$ ps -ef|grep tns
root        35     2  0 Feb18 ?        00:00:00 [netns]
oracle    1221     1  0 Feb20 ?        00:01:40 /u01/app/19.0.0.0/grid/bin/tnslsnr LISTENER_SCAN3 -no_crs_notify -inherit
oracle    1232     1  0 Feb20 ?        00:01:41 /u01/app/19.0.0.0/grid/bin/tnslsnr LISTENER_SCAN2 -no_crs_notify -inherit
oracle   13800     1  0 Feb20 ?        00:10:28 /u01/app/19.0.0.0/grid/bin/tnslsnr ASMNET1LSNR_ASM -no_crs_notify -inherit
oracle   25752     1  0 Mar15 ?        00:00:02 /u01/app/oracle/product/12.2.0.1/dbhome_1/bin/tnslsnr LISTENER_RACSB -inherit
oracle   26674  1482  0 00:15 pts/0    00:00:00 grep --color=auto tns
oracle   29163     1  0 Mar16 ?        00:00:00 /u01/app/19.0.0.0/grid/bin/tnslsnr LISTENER -inherit
[oracle@oraclenode1 admin]$

[oracle@oraclenode1 admin]$ lsnrctl status LISTENER_RACSB

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 17-MAR-2022 00:16:31

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oraclenode1-vip.localdomain.com)(PORT=1523)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_RACSB
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                15-MAR-2022 21:07:23
Uptime                    1 days 3 hr. 9 min. 7 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.2.0.1/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/oraclenode1/listener_racsb/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.38.4.138)(PORT=1523)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.38.4.110)(PORT=1523)))
Services Summary...
Service "RACSB" has 1 instance(s).
  Instance "RACSB1", status READY, has 1 handler(s) for this service...
Service "RACSBXDB" has 1 instance(s).
  Instance "RACSB1", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@oraclenode1 admin]$


node2:
[oracle@oraclenode2 admin]$ ps -ef|grep tns
root        35     2  0 Feb18 ?        00:00:00 [netns]
oracle    1460     1  0 Feb20 ?        00:00:55 /u01/app/19.0.0.0/grid/bin/tnslsnr LISTENER -no_crs_notify -inherit
oracle    1498     1  0 Feb20 ?        00:01:54 /u01/app/19.0.0.0/grid/bin/tnslsnr LISTENER_SCAN1 -no_crs_notify -inherit
oracle    1552     1  0 Feb20 ?        00:11:20 /u01/app/19.0.0.0/grid/bin/tnslsnr ASMNET1LSNR_ASM -no_crs_notify -inherit
oracle    8260     1  0 Mar15 ?        00:00:02 /u01/app/oracle/product/12.2.0.1/dbhome_1/bin/tnslsnr LISTENER_RACSB -inherit
oracle    8901 27466  0 00:15 pts/0    00:00:00 grep --color=auto tns
[oracle@oraclenode2 admin]$

[oracle@oraclenode2 admin]$ lsnrctl status LISTENER_RACSB

LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 17-MAR-2022 00:16:55

Copyright (c) 1991, 2016, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oraclenode2-vip.localdomain.com)(PORT=1523)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER_RACSB
Version                   TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date                15-MAR-2022 21:18:17
Uptime                    1 days 2 hr. 58 min. 38 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/12.2.0.1/dbhome_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/diag/tnslsnr/oraclenode2/listener_racsb/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.38.4.170)(PORT=1523)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.38.4.115)(PORT=1523)))
Services Summary...
Service "RACSB" has 1 instance(s).
  Instance "RACSB2", status READY, has 1 handler(s) for this service...
Service "RACSBXDB" has 1 instance(s).
  Instance "RACSB2", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@oraclenode2 admin]$

Regards,
Mallik

No comments:

Post a Comment

Running SQL and O/S Commands Within RMAN

Running SQL and O/S Commands Within RMAN Sometimes you may want to run an SQL statement from within RMAN. Use RMAN’s sql command to do this....