This is a feature of the Oracle client, is for the ApplicationProgramProvides driver-level ha functions. You can directly configure it in tnsnames. ora, which is very convenient!
1. The client automatically selects a valid connection address
When there are multiple addresses, We can configure the Oracle client to try each address one by one until the available address is found!
(
(Source_route = on) # instructs the Oracle client to try to connect one by one until available addresses are found. Otherwise, only the first address is used.
(Address = (Protocol = TCP) (host = IP-1) (Port = 1521 ))
(Address = (Protocol = TCP) (host = IP-2) (Port = 1521 ))
....
)
Ii. Automatic reconnection of client sessions
When there are multiple addresses, We can configure the Oracle client to try each address one by one until the available address is found!
(
(Failover =On)# Indicates that Oracle customers can perform session reconnection. This function is enabled by default, but the reconnection mode is type = none, which means that the Failover function is not enabled. You must set the CONNECT_DATA parameter !!
(Address = (Protocol = TCP) (host = IP-1) (Port = 1521 ))
(Address = (Protocol = TCP) (host = IP-2) (Port = 1521 ))
....
(CONNECT_DATA =
(SERVICE_NAME = Service)
(Failover_mode =
(Type = {None| Session | select}) # function level of session reconnection.
(Method = {Basic| Preconnect}) # is the connection established during failover or in advance?
(Retries = 5) # Number of Retries
(Delay = 1) # retry Delay
)
)
Three Oracle clients support connection to Server Load balancer at the same time
(
(Load_balance = on) # instruct the Oracle client to perform Load Balancing for connection sessions
(Address = (Protocol = TCP) (host = IP-1) (Port = 1521 ))
(Address = (Protocol = TCP) (host = IP-2) (Port = 1521 ))
....
)