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

Breadcrumb

more

Connor and Chris don't just spend all day on AskTOM. You can also catch regular content via Connor's blog and Chris's blog. Or if video is more your thing, check out Connor's latest video and Chris's latest video from their Youtube channels. And of course, keep up to date with AskTOM via the official twitter account.

Question and Answer

Connor McDonald

Thanks for the question, Geraldo.

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

Answered by: Connor McDonald - Last updated: November 12, 2019 - 11:05 pm UTC

Category: Database Administration - Version: 18.4

Viewed 100+ times

Whilst you are here, check out some content from the AskTom team: Logwriter I/O

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 we 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]

and you rated our response

  (2 ratings)

Reviews

Follow Up

November 11, 2019 - 2:15 am UTC

Reviewer: Geraldo from Dominican Republic

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

Followup  

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

November 13, 2019 - 12:42 pm UTC

Reviewer: Geraldo Peralta

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