-
Website
http://www.dannorris.com/ -
Original page
http://www.dannorris.com/2008/07/21/tns-listener-configuration-for-oracle-rac/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
oraclebase
2 comments · 7 points
-
fuadar
1 comment · 1 points
-
TongucY
2 comments · 1 points
-
dougk
4 comments · 1 points
-
Brian Bent
2 comments · 1 points
-
-
Popular Threads
RAC implementation on Solaris and the note appears to be a
platform-specific issue. Thanks for the tip. Would you always recommend
that there be an IPC listening endpoint that's the first one in the
listener.ora then?
If all goes well, we won't experience any 10 minute delays in fail-over as were seen during the last test cycle. That round of testing was done prior to configuring redundant network interfaces (public (IPMP) and private (Vcs PrivNIC)).
that issue yet. I am interested in how your testing goes and if the
workaround you found will address and resolve your issue. If you have
time and don't mind, please let me know, either via email or a follow up
posting here, how things went. Others finding this posting may want to
see if the issue was finally resolved with the workaround you mentioned.
Thanks!
I completed the fail-over testing. Adding the IPC entry in listener.ora reduced fail-over time from 3.5 minutes to 30 seconds when both redundant public interface cables are disconnected. When the node fails-over, the vip moves to another node and the listener goes offline.
When the public interfaces cables are reconnected, there is no fail-back. To get the vip to move back, the listener has to be restarted manually. It works this way both with and without the IPC entry in listener.ora.
From your experience, is this normal behavior?
/Doug
rebooted or crashed), so the restarting you found as required happens
naturally. It's been more than a year since I did the test you're
describing, but I think that's the same outcome I found (on Linux). The
VIP should relocate back to the proper member when service is restored,
but the listener resource will likely need to be restarted manually to
restore service.
Really useful tips...and specifally step5 for the forcefully registration....
But I have one issue on RAC setup that is I am not able to connect my RAC DAtabase and getting error like : ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
I used to connect with SQL* prompt like this :
sqlplus "sys/sys123@newracdb as sysdba"
I am just able to connect one time after that whenever I am trying to connect with DATABASE always getting this error .
please let me know the possible causes.... I already try wtih ur tips even...
Thanks...
local_listener or remote_listener parameter for one of the instances.
You should double-check your configuration and verify that "lsnrctl
services <listener_name>" shows the expected information (namely, a
service with the proper list of instances below it).
Hope that helps.
However, I have a few dumb questions. And I would greatly appreciate if you could answer them.
Background:
In my 2-node RAC cluster, I see that someone (before me) had setup the listener with two hosts information as below:
LISTENER_node1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
(ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521)(IP = FIRST))
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.100)(PORT = 1521)(IP = FIRST))
)
)
...in which the first entry is of VIP address from node1, and the second IP address is a Public IP for node1.
Same goes to node2 with values; node2 and Public IP to 192.168.10.101
Questions:
1- First of all, what's the reason for inconsistency between teh two addresses, as one being hostname and the second an IP address? Any specific reason?
2- Why would someone setup the listener pointing to both addresses on node1? Should it be 1 for node1 and second for node2?
3- What does 'FIRST' mean at the end of each line?
4- What is IPC protocol used for in listener and what is EXTPROC1 key?
5- When I run the command "lsnrctl status" it shows me 2 handlers for a service on node1, and 1 handler on node2, and vice-versa on node2. Why do I see two handlers? Is it a discrepency?
6- For some of my databases the service names are one word, and for some DBs, they show up as e.g. abcd.xyz.org. Why? How can I simply rename them to one word instead of something like a domain name?
7- According to the discussion between you and 'dougk', should it be VIP or public IP that a listener should use?
I would greatly greatly appreciate if you could answer these questions.
Warmest Regards,
Pinky
1 - No reason is apparent. Probably was created by a wizard or assistant somewhere. I prefer IP addresses personally as it eliminates one more layer of lookups and possible errors.
2 - I think this may be the default NetCA setup. As mentioned, it is not my preferred configuration.
3 - IP=FIRST is a poorly documented feature. See Metalink 300729.1. Basically, the listener does stupid things by default and IP=FIRST makes it do what it should have done in the first place :).
4 - This listen endpoint is to support external procedures (judging by the name). If you don't use external procedures, you can remove this listening endpoint from the configuration as well.
5 - To be certain, this is probably due to the way the local_listener and remote_listener parameters are configured. However, I don't think it's a problem. Most likely, only one of the handlers will be used normally (you should see 0 connections made to one of the two handlers on each node).
6 - Check the domain_name parameter in the init (or sp) file. Those without domain names will show up as "one word" (without domain name) and those that have domain_name set will show up as you mentioned above.
7 - Always VIP, never public IP. In his case, he had to have both VIP and an IPC listening endpoint (similar to the IPC endpoint you have shown above) in order to work around some platform-specific issue, but that's not normally the case on other platforms.
Thanks for reading. Hope these help!
Dan
However, I still have doubts about a few things that I orginally asked.
1- So you are saying that other than specifying the addresses instead of hostnames they should be VIPs, unless I am using EXTPROC key in my listener file, and point all "HOST =" to VIPs of all nodes of cluster? What if I still use VIPs while having EXTPROC key set? How would I know whether I really need EXTPROC or not? If I remove EXTPROC from listener, where else do I have to propogate the changes?
3- In my case, you would see that both addresses are declared as IP=FIRST. Isn't that ambiguous?
4- I could not fully understand the point number 4. Could you please explin again?
5- Let me paste exact results so you see what I was saying.
Node1
=====
Service "prod_x.nipa.org" has 2 instance(s).
Instance "prod1", status READY, has 2 handler(s) for this service...
Instance "prod2", status READY, has 1 handler(s) for this service...
Service "prod_x.nipa.org" has 2 instance(s).
Instance "prod1", status READY, has 1 handler(s) for this service...
Instance "prod2", status READY, has 2 handler(s) for this service...
...Now referrig to what you were saying that even with two handlers, it should have only one connection (if I understood it right), how can I see how many connections a handler has?
6- I tried to look for domain_name in parameter file, but couldn't find it, however, I found "service_names" which shows the two services supported by that instance. Where can I find the properties setup of the service names?
Thank you very much for your help. I loved the way you answered my question in the previous reply. I woul dbe waiting for your replied again impatiently.
Bundle of thanks!
Pinky
2 - You didn't have a #2 :)
3 - No. Per the ML note I cited, you'd have to specify IP=FIRST for each ADDRESS section.
4 - EXTPROC IPC listening endpoints are for external procedures in the database. If you don't use them, you can remove this listening endpoint from the listener. There aren't many good ways to figure out if you use them. You could check DBA_LIBRARIES to see if there are libraries defined by you/application. There are usually some default libraries defined at installation time by Oracle. You could also remove it from the listener in your test environment and test the application to see if it continues to function correctly if you really aren't sure.
5 - Sorry, I was thinking of the "lsnrctl services" output. Run that command and you'll probably see that connections are being made to one of the services and not the other.
6 - I'm guessing that service_names includes "prod_x.nipa.org". That's fine too. However, you could set domain_name = nipa.org and then set service_names to just "prod_x" and you'd get the same result. Not sure what properties you're looking for, but you should check out DBA_SERVICES in the database for information about the service characteristics (failover, load balancing goals, etc.) if you're on 10g or higher.
True that I didn't have #2, because you answered it before :-)
About #6, its very wierd that I have two DBs on a cluster, and for one DB the db_domain parameter is specified as nipa.org and for that I don't have to include the domain name in the service name, but for 2nd DB on the same cluster, there is no db_domain parameter specified, and so I have to use that in service name.
Questions:
---------------
1- How come such in consistency allowed by the system even though both DBs exist on same two-node cluster, that one has a db_domain and the other doesn't? Another funny thing is that, on my dev environment, both DBs have db_domain set, and this causes a problem. (Please see at the end of this post)
2- what if I take the db_domain information out from the parameter file?
a) Would my DB crash?
b) What elements need to be restarted after the change?
Problem as mentioned in #1
---------------------------------------
When I create a DB_link on the DB that has the db_domain parameter set, the db_link name automatically adds up the name of the domain. e.g. if i specify the name of link as "My_DB_Link", it would make it as "My_DB_Link.nipa.org". And because of this, one of my object (view) that uses it, becoems invalid. Although I tried to change the name of the automatically updated db_link in the view creation script, but it still doesn't work.
Could you help me with that.
Also, please tell me if this is the right forum to discuss that issue as its not related to TNS.
Thanks again...
Pinky
2 - db_domain and service_names are both able to be modified on the fly. In RAC, you shouldn't modify service_names directly, but rather modify the services via the srvctl utility and modify their attributes via dbms_service calls. To see immediate effects of your changes, use "alter system register;" to force the smon process to re-register with the listener(s) immediately. It'd be very wise to make your test or dev env look like prod does right now, then practice the changes there before going to prod.
I don't think I understand the dblink problem. If the problem is that the view refers to the wrong dblink name, then modify the view. You should be able to validate the dblink with "select username from user_users@dblink.nipa.org;"
This isn't a forum...we're already stretching the real spirit of the "comments" on this blog entry. You should consult the OTN forums (forums.oracle.com) for detailed support issues like this one or join the Oracle-L list on freelists.org.
Good luck!
Could you tell by seeing the lsnrctl status results below that why prod_x.nipa.org has only one instance, whereas prod_y has two instances?
Service "prod_x.nipa.org" has 1 instance(s).
Instance "prodx1", status READY, has 1 handler(s) for this service...
Service "prod_y" has 2 instance(s).
Instance "prody1", status READY, has 2 handler(s) for this service...
Instance "prody2", status READY, has 1 handler(s) for this service...
prod_x.nipa.org also used to have two instances, but after a restart yesterday, the other has gone...
TIA
Pinky
service (it isn't running on instance 2) or b) the configuration of the
remote_listener parameter on the instances. You should review the
whitepaper on services from Jeremy Schneider at
http://www.ardentperf.com/pub/services-schneide... for more information.
Dan
Anybody out there however who has experiance in setting it up in a environment with two different networks that are not connected.
I use the VIPs on the first network but real host IPs on the second. On client side if the client is only on one network i use the appropriate addresses, if its on both however i use all 4 addresses. I think i saw some article somewhere that explains how to set up additional VIP addresses that i could use on the second network, if one network fails completely though i would still have the long wait, so the gain would only be for the one scenario not all. More important : How does the listener redirects the client to a listener on another node if it thinks thats better, i suppose it tells the client leave me alone and connect there, but if there in this case is the other network which is not available on this particular client, the connection would fail, correct ?
for connecting, the listener uses the information provided in the
local_listener parameter that was sent by that remote instance when it
registered.
For example, if you have a two node cluster (nodeA and nodeB) with
instances rac1 and rac2 on them, then rac2 will register with the
listener on nodeA as well as the listener on its node (nodeB). When that
registration happens, the rac2 instance will look up the remote_listener
parameter to find out which listeners it has to register with. During
those registrations, it will send the information in its local_listener
parameter to the listeners with which it registers and it is the
local_listener information held by the listeners that will be used to
instruct clients where they have to go for redirection.
In short, the local_listener isn't just for local connections--it is
also used for telling remote clients where to find the local instance.
Hope that helps.
Thanks
I have a strange behavior with my listener on my rac system.
I have a two node RAC. When I stop the listener on node two and do a lsnrctl service listener_name on node one I get the following :
Service "virlab" has 2 instance(s).
Instance "virla1", status READY, has 4 handler(s) for this service...
Handler(s):
"D001" established:0 refused:0 current:0 max:972 state:ready
DISPATCHER <machine: tau.dgeq.qc.ca, pid: 6685>
(ADDRESS=(PROTOCOL=tcp)(HOST=tau.dgeq.qc.ca)(PORT=50406))
"D000" established:0 refused:0 current:0 max:972 state:ready
DISPATCHER <machine: tau.dgeq.qc.ca, pid: 6683>
(ADDRESS=(PROTOCOL=tcp)(HOST=tau.dgeq.qc.ca)(PORT=50405))
"DEDICATED" established:0 refused:0 state:ready
LOCAL SERVER
"DEDICATED" established:0 refused:0 state:ready
REMOTE SERVER
(address=(protocol=tcp)(host=10.53.228.124)(port=1521))
Instance "virla2", status READY, has 3 handler(s) for this service...
Handler(s):
"D001" established:0 refused:0 current:0 max:972 state:ready
DISPATCHER <machine: psy.dgeq.qc.ca, pid: 10115>
(ADDRESS=(PROTOCOL=tcp)(HOST=psy.dgeq.qc.ca)(PORT=34066))
"D000" established:0 refused:0 current:0 max:972 state:ready
DISPATCHER <machine: psy.dgeq.qc.ca, pid: 10113>
(ADDRESS=(PROTOCOL=tcp)(HOST=psy.dgeq.qc.ca)(PORT=34065))
"DEDICATED" established:0 refused:0 state:blocked
REMOTE SERVER
(address=(protocol=tcp)(host=10.53.228.102)(port=1521))
As you can see the dedicated handle for instance virla2 is blocked?
My problem is that I have a system that required (arcsde from esri) that my connection be dedicated so I have the following entry in the tnsnames.ora file :
geo =
(DESCRIPTION =
(address_list =
(ADDRESS = (PROTOCOL = TCP)(HOST = psy.dgeq.qc.ca)(PORT = 1521))
)
(CONNECT_DATA =
(instance_NAME = virla1)
(service_name = virlab)
(server = dedicated)
)
)
So I get an ora-12520.
Did you encounter a similar situation?
André
Hope that helps.
When i check out with lsnrctl> status ----- no listner message i got.
but we are able to connect to db remotely
thanks
LISTENER_NODENAME" if you follow the standard conventions used by NetCA
during a typical install.
Dan
I need to alert not only when the overall rac system is unavailable but also when one of the instances on a node is not available while overall the rac system is available(thro other isntances).
I already have developed a monitoring solution for single instance oracle database where the script connects to an oracle instance and if unable to then raises alert. Can i have a similar approach for rac -- where in i can specify the overall sid of the rac to check the overall avaialability and individual sid of each instance to check the individual availability ?
entry that references all instances/servers to check overall
availability and also separately check each individual instance to
determine availability.
You might also consider using clusterware callouts to alert you.
Scripts placed in ora_crs_home/racg/usrco will be run whenever
clusterware detects a resource offline. That may be easier than
writing your own custom polling method.
Please excuse my typos, I sent this from my iPhone.
Thanks