Skip to Main Content
  • Questions
  • Connection retry when database services failover

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Geraldo.

Asked: November 08, 2019 - 1:20 pm UTC

Last updated: November 12, 2019 - 11:05 pm UTC

Version: 18.4

Viewed 1000+ times

You Asked

Hello, Ask Tom, Team.

I have a two-node RAC running a database service with one preferred instance and one available instance. It is supposed that RAC automatically failovers the services to available when preferred instance crashes.

1. Will the app fail connecting to database or is there a way to configure retry until the failover is done?

Thanks in advanced.

and Connor said...

You can control this with the service definition. From the docs:


srvctl add service -db db_unique_name -service service_name [-eval] 
   -serverpool server_pool [-cardinality {UNIFORM | SINGLETON}] 
   [-edition edition_name] [-netnum network_number]
   [-role "[PRIMARY][,PHYSICAL_STANDBY][,LOGICAL_STANDBY][,SNAPSHOT_STANDBY]"
   [-policy {AUTOMATIC | MANUAL}] [-notification {TRUE | FALSE}] 
   [-clbgoal {SHORT | LONG}] [-failovertype {NONE|SESSION|SELECT|TRANSACTION}]
   [-rlbgoal {NONE | SERVICE_TIME | THROUGHPUT}] [-dtp {TRUE | FALSE}]
   [-failovermethod {NONE | BASIC}]          <<<======
   [-failoverretry failover_retries]         <<<======
   [-failoverdelay failover_delay]           <<<======
   [-pdb pluggable_database]                 
   [-sql_translation_profile sql_translation_profile] 
   [-global {TRUE | FALSE}] [-maxlag max_lag_time] [-commit_outcome {TRUE|FALSE}]
   [-retention retention_time] [-replay_init_time replay_initiation_time]
   [-session_state {STATIC | DYNAMIC}] [-pqservice pq_service] 
   [-pqpool pq_pool_list] [-force]

Rating

  (2 ratings)

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

Comments

Follow Up

Geraldo, November 11, 2019 - 2:15 am UTC

Ok. Thanks foe the response.

So, As I see, this is at database service side.

1. Do I need to specify some option in tnsnames.ora file in client side? or Can I just connect to the database in a normal way using SCAN and it will be transparent for the app?

DBPROD =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = scanprod.domain.local)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = myservice)
)
)
Connor McDonald
November 12, 2019 - 11:05 pm UTC

Thats right. You *can* add parameters to tnsnames.ora, but generally preferable to have this in the service definition in the cluster.

Follow Up

Geraldo Peralta, November 13, 2019 - 12:42 pm UTC

Thanks.

So, I will use the parameters at database service side.

More to Explore

Administration

Need more information on Administration? Check out the Administrators guide for the Oracle Database