how to connect to primary database regardless of a switchover
Here is the tns string that I though would let me connect to a primary database regardless of where it is located
p_icef.WORLD =
(DESCRIPTION =
(LOAD_BALANCE=off) (FAILOVER=on)
(ADDRESS = (PROTOCOL = TCP)(HOST = HOST1)(PORT = 1576))
(ADDRESS = (PROTOCOL = TCP)(HOST = HOST2)(PORT = 1576))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = p_icef.world)
)
)
I have the service p_icef set up on both primary and standby databases. I wanted to connect to one of the databases (primary or standby) and if the database is not accessable (that is standby in recovery mode) to connect to the other one behind the scene. I thought that failover=ON would do the trick. However it does not seem to work; I can only connect to the database located on the host listed first (in my case - HOST1). If I change the order and put HOST2 (where I have a standby DB) on top, the connection fails.