Question

I am not a DB or even Oracle expert, but I wanted to understand when and why Oracle returns a different non-VIP address to the client, assuming this is correct behaviour?

listener.ora

LISTENER_DB-A =
(DESCRIPTION_LIST =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = DB-A-VIP)(PORT = 1521)(IP = FIRST))
       # this is the VIP 10.0.0.15
    )
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.0.0.10)(PORT = 1521)(IP = FIRST))
    )
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
  )
)

Here, after connecting to the IP address 10.0.0.15, the Oracle server returns the 10.0.0.10 address to the client. This is my network sniff of the said behaviour:

Client to Oracle

(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.0.15)(PORT=1521)))
(CONNECT_DATA=(CID=(PROGRAM=)(HOST=__jdbc__)(USER=))(SERVER=DEDICATED)
(SERVICE_NAME=my_db)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRIES=5)(DELAY=5))))

Oracle to Client

(DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=DB-A))(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.0.10)(PORT=1521)))

I know that this behaviour is not mandatory, as I've seen Oracle server respond without said redirection. What is the reason the server is acting this way? Thanks in advance!

Was it helpful?

Solution

It is even more complex when it comes to 11gR2 and SCAN listeners. But let's say that reason behind is load balancing. The listener will redirect client onto least loaded node.

Another reason can also be workload balancing. Imagine that you have two services (SERVICE_NAME) on our cluster. One called LOADERS and is used by processes which push data into the database. The other is called WEB and is used by application, which fetch data from database. Each service is located on different node. Then this redirect will guarantee that the database is used effectively and all the loaders use the same cluster node even if one of the nodes fails.

BTW: I think that the redirect message does not contain an IP address, but a hostname. Therefore there should not be any NAT between DB client and DB server and also they should use the same DNS server.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top