Skip to Main Content

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Tesla.

Asked: November 27, 2016 - 3:31 am UTC

Last updated: November 29, 2016 - 1:08 am UTC

Version: 12.1.0.2

Viewed 1000+ times

You Asked

Connor/Chris,
I have a two node RAC setup and I use SCAN (3 IPs registered in DNS) and I have not created any service TAF and in my TNS I have given my service name and not my db_name. I have the following queries to correct my understanding.

1. If I have SCAN and if my client connects to my database using then SCAN will ensure connect time failover(CTF) - meaning, if a connection is trying to establish with a node and of it fails, SCAN will try connecting to another available node and that is connect time failover and also connect time failover does not require any service to be created - Correct me on my understanding this if I'm wrong. I need to clear this.

2. If need to enable TAF for Run Time Failover (I wil refer it as RTF for the sake of question), I need to create either server side service where in the client need not change anything in the TNS string and the server side service will ensure run time failover happens to the available node as per the failover type and method. Correct me if i'm wrong.
2.(a). If I create two services for RTF, one for SESSION failover and another for SELECT failover, which one will be in effect? Both? Will it allow me to create two services for TAF with different failover type and methods?
2.(b). Once the service is created, should I add the service name in my Tnsnames for it to be in effect or just have the service running in both the nodes should do the trick?
2.(c). Is there any specific name with which I should create the service?

3. I need not explicitly mention LOAD_BALANCING=ON in my tnsnames.ora for load balancing as it happens by default even if I do not mention it and even if the client tns does not mention that. Correct me if i'm wrong

Thanks in advance!

and Connor said...

1. If I have SCAN and if my client connects to my database using then SCAN will ensure connect time failover(CTF)

Yes, every node/listener registers with the scan, so it "knows" about node availability. But whilst "not require any service to be created" is perhaps a true statement, you *always* want to create services. See next.

2) If need to enable TAF for Run Time Failover ...

Use server-side services, and control their configuration via srvctl. I generally steer clear of client-side settings, because it requires a lot of tnsnames.ora management, and discrepancies between what the cluster thinks a service does, and what the client think its does can mean messy results.

So create/configure/control/modify services via srvctl, and connect to them using service_name=... in tnsnames.ora. Steer clear of the default auto-created services because you have less control over them.

3) I need not explicitly mention LOAD_BALANCIN...

Correct. You can control load balancing, preferred instances etc for the service via srvctl. Keep that tnsnames.ora nice and simple.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

What should be in TNSnames?

Tesla, November 28, 2016 - 7:38 am UTC

Say I have the following tnsnames.ora in my two node RAC database,

DIVTEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DIVTEST-scan.DIVCORP.com)(PORT = 1721))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DIVTEST)
)
)

And I create a service as following:

Service_name – DIVTEST
Failover_type - Basic
Failover_method - session
Failover_retries – 180
Failover_delay - 5

and the service in running in both the nodes. Should I edit my tnsnames.ora (above mentioned) on my database server? like the below?
Or just have the service running in both the nodes will ensure TAF?

DIVTEST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DIVTEST-scan.DIVCORP.com)(PORT = 1721))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DIVTEST)
(FAILOVER_MODE=
(TYPE=session)
(METHOD=basic))))


2. Should the service-name in TNS and the service which I create for TAF using srvctl be the same?
Connor McDonald
November 29, 2016 - 1:08 am UTC

You dont need it in the tnsnames.ora. It can be managed by the service configuration

More to Explore

Analytics

Analytic SQL got you confused? Check out Connor McDonald's complete video course.