Two node setup
Nodes : host01, host02
RAC database : orcl
Overview :
— Find out VIPs of both the nodes
— Add entries in tnsnames.ora for two aliases : SIP and SVIP
SIP sends request to physical IP’s of the nodes
SVIP sends request to virtual IP’s (VIP’s) of the nodes
— Shutdown host02
— Try to connect using SIP – waits for network timeout before connecting to host01
Implementation:
[grid@host01 ~]$ srvctl config vip -n host01
VIP exists.:host01
VIP exists.: /192.9.201.254/192.9.201.254/255.255.255.0/eth0
[grid@host01 ~]$ srvctl config vip -n host02
VIP exists.:host02
VIP exists.: /192.9.201.250/192.9.201.250/255.255.255.0/eth0
– Add entries in tnsnames.ora for
– SVIP : An alias for orcl service using which, the client will try to
. connect to host02-vip (192.9.201.250 ) first.
. If host02 is down, host02-vip will failover to the other host (host01)
and on receiving No listener error, client will get try connecting to host01
– SIP : An alias for orcl service using which, the client will try to
. connect to host02 (Physical IP) first.
. If host02 is down, client gets notified after network time out
. Client tries and gets connected to host01 (Physical IP)
[grid@host01 admin]$ vi /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
SVIP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.9.201.250 )(PORT = 1521)
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.9.201.254 )(PORT = 1521)
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
SIP =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = host02)(PORT = 1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = host01)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)
– Shutdown node host02
[root@host02]#init 0
- Try to connect to the database using service sip
— Note that as host02 is down, client waits for network timeout before trying connection to host01 and time taken to connect to host01 is 25 seconds (23:42:57 – 23:42:32 )
SQL> set time on 23:42:32 SQL> conn system/sys@sip Connected. 23:42:57 SQL>
– Try to connect to the database using service svip
— Note that as host02 is down, host02 VIP immediately fails over to host01 and time taken to connect to host01 is of the order of milliseconds (23:43:38 – 23:43:38 )
23:43:38 SQL> conn system/sys@svip Connected. 23:43:38 SQL>
I hope this demonstration was useful.
Your comments and suggestions are always welcome !!!
References:
—————————————————————————————
Your blog is the best the among I have seen. Thanks alot for sharing your knowledge with us.
Thanks for your time and feedback Vijay. It is just a humble effort at sharing whatever little I know in simple words.
Regards
Anju
easy to understand for beginners , i liked the way you explain
I like the way you explain. Thank you
Thanks for your time.
Your comments and suggestions are always welcome.
Regards
Anju Garg
Hi,
all posts are very nice. Really i am very very thank full to you and to your blog.
Regards,
Somi.
Thanks Somi for your feedback.
Your comments and suggestions are always welcome.
Regards
Anju Garg
Your blog is awesome and nice.. its a lot of thing to get in one place..
Thanks Ganesh for your time.
Your comments and suggestions are always welcome.
Regards
Anju Garg
Hi Anju,
Your blog is very good and its explains lots to physical dbas. Thanks for your effort.
Have one doubt, in a 4-node/more cluster configuration, how many SCAN VIP and SCAN LISTENERS will be required and also how they will work and failover.
Thanks
– Anuradha
Your blogs are very clear and neat. Thanks for sharing the knowledge.
Thanks Prasanna for your time.
Your comments and suggestions are always welcome.
Regards
Anju Garg
The way of explaning RAC Concepts with examples are very good. Thx alot
Hi Anju,
I have a query with regards to using VIP on client side tnsnames.ora
We have a two node RAC instance, where the crs stack is down on node 1 (fht-pas-dbs-p01)
The vip of node 1 has failed over to node 2 ie crsctl stat res -t on node 2(fht-pas-dbs-p02) gives:
ora.fht-pas-dbs-p01.vip
1 ONLINE INTERMEDIATE fht-pas-dbs-p02 FAILED OVER
Now, if my tnsnames.ora is having entry like :
vip1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST =fht-pas-dbs-p01-vip)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = OASLIVE)
)
)
Even though the tnsnames.ora entry does not have entry for vip2 of second node, the client should still be able to connect to node 2, as the node 1 vip has failed over to node 2.
However, I am not able to connect using the vip1 tnsnames.ora entry as it gives error : TNS:no listener.
Can you please comment on it?
fht-pas-dbs-p01:oracle@OASLIVE1 > tnsping vip1
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =fht-pas-dbs-p01-vip)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = OASLIVE)))
TNS-12541: TNS:no listener
I have got the answer, its already mentioned in your explanation.
Thanks.