Solved

Set up Listener on Oracle RAC

Posted on 2013-01-09
7
1,898 Views
Last Modified: 2013-01-21
I have set up a 2 Node Oracle RAC and every thing is working fine. There are six database instances and I can connect to each database on each node. upon giving the  command lsntr status, i get the output as below. Please help me resolve this issue so that all my databases are listed in the listener.


LSNRCTL>
LSNRCTL> status
Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Solaris: Version 11.2.0.3.0 - Production
Start Date                09-JAN-2013 08:48:38
Uptime                    0 days 7 hr. 9 min. 10 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /oracle1/app/oracle/grid/product/11.2.0.3/db_1/network/admin/listener.ora
Listener Log File         /oracle1/app/base/diag/tnslsnr/ojpddcdbs303/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=10.123.87.2)(PORT=1521)))
The listener supports no services
The command completed successfully
0
Comment
Question by:KamalAgnihotri
  • 3
  • 2
  • 2
7 Comments
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
Comment Utility
What is the remote_listener spfile parameter set to for the instances?

I've not used RAC so I'm not sure what is specific about the listener for it other than what I've read.

http://docs.oracle.com/cd/E11882_01/network.112/e10836/listenercfg.htm#NETAG302
0
 
LVL 6

Accepted Solution

by:
Javier Morales earned 188 total points
Comment Utility
Hi,

There are two parameters for setting up listener in RAC environments for each instance:

LOCAL_LISTENER and REMOTE_LISTENER

LOCAL_LISTENER refers to the listener started up in the same VIP as the instance, and REMOTE_LISTENER to any other listener of the RAC environment (resolved by SCAN names).

Take a look at the /etc/hosts file in your RAC environment: It should look something like this:

#bond0 - PUBLIC
172.13.5.1 orcl01.osius.local orcl01
172.13.5.2 orcl02.osius.local orcl02

#VIP
172.13.5.3 orcl01-vip.osius.local orcl01-vip
172.13.5.4 orcl02-vip.osius.local orcl02-vip

#bond1 - PRIVATE
172.13.12.1 orcl01-pvt
172.13.12.2 orcl02-pvt

Open in new window


As you may see, there are three kind of IP's for each node: the public ip, the private one, and one virtual, to move across nodes if a single node goes down. With LOCAL_LISTENER in node 1 set to the VIP of node 1, the database would register services locally to that listener. REMOTE_LISTENER may be set up to what SCAN names would result. Something like that:

local_listener			     string	 (DESCRIPTION=(ADDRESS_LIST=(AD
						 DRESS=(PROTOCOL=TCP)(HOST=172.
						 13.5.3)(PORT=1521))))
remote_listener 		     string	 orcl-cluster-scan:1521

Open in new window



And so, you have also to set up SERVICES to register for one or more listeners. For example: you have 5 databases and want node 1 to support a service called "proc" or "user", then you should set up services to startup when instance starts. (in the example, database name is PRO and instances are PROD1 and PROD2.

[grid@orcl01 ~]$ srvctl status service -d pro
Service proc is running on instance(s) PRO1
Service user is running on instance(s) PRO1

Open in new window


And listener looks like this:

[grid@orcl01 ~]$ lsnrctl status

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 10-JAN-2013 08:48:39

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date                20-NOV-2012 10:29:12
Uptime                    50 days 22 hr. 19 min. 26 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/orcl01/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.13.5.1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.13.5.3)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "PRO" has 1 instance(s).
  Instance "PRO1", status READY, has 1 handler(s) for this service...
Service "PROXDB" has 1 instance(s).
  Instance "PRO1", status READY, has 1 handler(s) for this service...
Service "proc" has 1 instance(s).
  Instance "PRO1", status READY, has 1 handler(s) for this service...
Service "user" has 1 instance(s).
  Instance "PRO1", status READY, has 1 handler(s) for this service...
The command completed successfully

Open in new window


So, take a look that your listener doesn't support the +ASM service! Are you sure you're looking the right listener process?

Have a look at started services like this:

[grid@orcl01 ~]$[b] crs_stat -t[/b]
Name           Type           Target    State     Host        
------------------------------------------------------------
ora.DG_DATA.dg ora....up.type ONLINE    ONLINE    orcl01      
ora.DG_FRA.dg  ora....up.type ONLINE    ONLINE    orcl01      
ora....ER.lsnr ora....er.type ONLINE    ONLINE    orcl01      
ora....N1.lsnr ora....er.type ONLINE    ONLINE    orcl01      
ora....N2.lsnr ora....er.type ONLINE    ONLINE    orcl02      
ora....N3.lsnr ora....er.type ONLINE    ONLINE    orcl01      
ora....VOTE.dg ora....up.type ONLINE    ONLINE    orcl01      
ora.asm        ora.asm.type   ONLINE    ONLINE    orcl01      
[b]ora....roc.svc[/b] ora....ce.type ONLINE    ONLINE    orcl01      
[b]ora....ser.svc[/b] ora....ce.type ONLINE    ONLINE    orcl01      
[b]ora.pro.db[/b] ora....se.type ONLINE    ONLINE    orcl01      
ora.cvu        ora.cvu.type   ONLINE    ONLINE    orcl01      
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               
ora....network ora....rk.type ONLINE    ONLINE    orcl01      
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    orcl01      
ora.ons        ora.ons.type   ONLINE    ONLINE    orcl01      
ora....SM1.asm application    ONLINE    ONLINE    orcl01      
ora....01.lsnr application    ONLINE    ONLINE    orcl01      
ora.orcl01.gsd application    OFFLINE   OFFLINE               
ora.orcl01.ons application    ONLINE    ONLINE    orcl01      
ora.orcl01.vip ora....t1.type ONLINE    ONLINE    orcl01      
ora.orcl02.vip ora....t1.type ONLINE    ONLINE    orcl02     
ora....ry.acfs ora....fs.type ONLINE    ONLINE    orcl01      
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    orcl01      
ora.scan2.vip  ora....ip.type ONLINE    ONLINE    orcl02      
ora.scan3.vip  ora....ip.type ONLINE    ONLINE    orcl01    

Open in new window


And so advice the way to set up listeners, databases and services in a RAC environment is with srvctl command:

[grid@orcl01 ~]$ [b]srvctl[/b]
Usage: srvctl <command> <object> [<options>]
    commands: enable|disable|start|stop|relocate|status|add|remove|modify|getenv|setenv|unsetenv|config
    objects: database|instance|service|nodeapps|vip|network|asm|diskgroup|listener|srvpool|server|scan|scan_listener|oc4j|home|filesystem|gns|cvu
For detailed help on each command and object and its options use:
  srvctl <command> -h or
  srvctl <command> <object> -h

Open in new window


Hope it helps,
Javier
0
 

Author Comment

by:KamalAgnihotri
Comment Utility
Javier,

I found a work around. The LSNRCTL status command was giving the appropiate output on Node 2 but not on Node 1.  I simply copied the listener. ora file from Node 2, where LSNRCTL command was working and put it on Node 1. Stopped the listener and restarted it. It worked like a charm.  Do you find any issues with this approach. Below is the listener.ora file contents from the two nodes.

Listener.ora file On Node1:

ojpddcdbs303-oracle >more /oracle1/app/oracle/grid/product/11.2.0.3/db_1/network/admin/listener.ora
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))) # line added by Agent
LISTENER_SCAN3=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3)))) # line added by Agent
LISTENER_SCAN2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2)))) # 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_SCAN2=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON # line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON # line added by Agent
ojpddcdbs303-oracle >
ojpddcdbs303-oracle >

Listener.ora file On Node 2:  (This one was working fine)

ojpddcdbs304-oracle >more /oracle1/app/oracle/grid/product/11.2.0.3/db_1/network/admin/listener.ora
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
ojpddcdbs304-oracle >
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 6

Assisted Solution

by:Javier Morales
Javier Morales earned 188 total points
Comment Utility
Hi KamalAgnihotri,

I see your listener.ora files, and I wonder why they were different. That's why I suggested to set up listeners and services with the commands previously mentioned.

Are the listeners only set up by listener.ora to listen SCAN1 listener?
Have you tested to shutdown a server and make the RAC switchovers all services and listeners to node2?

a right listener.ora file should look like this:

[grid@orcl01 ~]$ more $ORACLE_HOME/network/admin/listener.ora
LISTENER=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER))))		# line added by Agent
LISTENER_SCAN3=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN3))))		# line added by Agent
LISTENER_SCAN2=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_SCAN2))))		# 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_SCAN2=ON		# line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER_SCAN3=ON		# line added by Agent
ENABLE_GLOBAL_DYNAMIC_ENDPOINT_LISTENER=ON		# line added by Agent

Open in new window


I would recommend you to ensure services and listeners, and test failover. A grid infrastructure has to manage properly 3 SCAN addresses in order to manage listeners securely.

Hope this helps,
Javier
0
 
LVL 76

Assisted Solution

by:slightwv (䄆 Netminder)
slightwv (䄆 Netminder) earned 62 total points
Comment Utility
>>Do you find any issues with this approach. Below is the listener.ora file contents from the two nodes.

For RAC, the 'common' listener needs to run from the grid infrastructure.

You have local listeners and a remote listener.  It appears you have set up the local ones and have not yet set up the common one.

Did you review the doc link I provided?

-------------------
Registering Information with a Remote Listener
 
A remote listener is a listener residing on one computer that redirects connections to a database instance on another computer. Remote listeners are typically used in an Oracle Real Application Clusters (Oracle RAC) environment.


Adding or Removing a Listener Using SRVCTL
 
Adding a listener means to add an entry for the listener to the grid infrastructure, enabling the agent to monitor this component.



I would also review:
Oracle® Real Application Clusters Administration and Deployment Guide

http://docs.oracle.com/cd/E11882_01/rac.112/e16795/toc.htm
0
 

Author Comment

by:KamalAgnihotri
Comment Utility
Javier,

Working on your advise, I am making progress. I got Listener showing all the services on Node1 but on Node2 there are duplicate entries like below:

Service "SYS$STRMADMIN.STRM_SWBPI_QUEUE.DBPRODB" has 1 instance(s).
  Instance "dbprodb2", status READY, has 2 handler(s) for this service...
Service "SYS$STRMADMIN.STRM_VESTS_QUEUE.DBPRODB" has 1 instance(s).
  Instance "dbprodb2", status READY, has 2 handler(s) for this service...
Service "areprod" has 2 instance(s).
  Instance "areprod1", status READY, has 1 handler(s) for this service...
  Instance "areprod2", status READY, has 2 handler(s) for this service...
Service "areprodXDB" has 2 instance(s).
  Instance "areprod1", status READY, has 1 handler(s) for this service...
  Instance "areprod2", status READY, has 1 handler(s) for this service...
Service "dbprodb" has 2 instance(s).
  Instance "dbprodb1", status READY, has 2 handler(s) for this service...
  Instance "dbprodb2", status READY, has 2 handler(s) for this service...
Service "dbprodbXDB" has 2 instance(s).
  Instance "dbprodb1", status READY, has 1 handler(s) for this service...
  Instance "dbprodb2", status READY, has 1 handler(s) for this service...
Service "dbprodc" has 2 instance(s).
  Instance "dbprodc1", status READY, has 2 handler(s) for this service...
  Instance "dbprodc2", status READY, has 2 handler(s) for this service...

This does not appear correct. Please help me fix this.
0
 
LVL 6

Assisted Solution

by:Javier Morales
Javier Morales earned 188 total points
Comment Utility
may you ensure listener is listening only to public and VIP addresses?

[root@orcl02 ~]# more /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1	localhost.localdomain	localhost
::1	localhost6.localdomain6	localhost6

# PUBLIC
172.13.8.5 orcl01. orcl01
172.13.8.6 orcl02. orcl02

# VIP
172.13.8.9 orcl01-vip. orcl01-vip
172.13.8.10 orcl02-vip. orcl02-vip

# PRIVATE
172.13.6.30 orcl01-pvt
172.13.6.31 orcl02-pvt

[root@orcl02 ~]# lsnrctl status

LSNRCTL for Linux: Version 11.2.0.2.0 - Production on 17-JAN-2013 15:05:55

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 11.2.0.2.0 - Production
Start Date                13-NOV-2012 10:32:29
Uptime                    65 days 4 hr. 33 min. 27 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/11.2.0/grid/network/admin/listener.ora
Listener Log File         /u01/app/grid/diag/tnslsnr/orcl02/listener/alert/log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.13.8.6)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=172.13.8.10)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
  Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "ORCL_RAC" has 1 instance(s).
  Instance "ORCL_RAC2", status READY, has 1 handler(s) for this service...
Service "ORCL_RACXDB" has 1 instance(s).
  Instance "ORCL_RAC2", status READY, has 1 handler(s) for this service...
Service "proc_serv1" has 1 instance(s).
  Instance "ORCL_RAC2", status READY, has 1 handler(s) for this service...
Service "general_serv1" has 1 instance(s).
  Instance "ORCL_RAC2", status READY, has 1 handler(s) for this service...
The command completed successfully

Open in new window

0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now