I believe there are similar question about this. But I need more explanation about my plan.
I have an 11g Oracle database running with one listener on port 1522. And currently using one interface (one IP for the server). Some client using another segment of IP, which always use router to communicate with server. Every morning, my router get heavy load because some different segment user create connection to database's IP.
From this situation, I want to add new interface for the server and assigned same IP segment for those client. From netstat I assume that no need extra configuration from oracle side. Here is the netstat result.
I will only add the IP address from OS side. And change the tnsnames.ora of client to connect to new IP address of server.
Is my scenario will work well? Or will I need to reconfigure the listener and database to work with my situation?
Best Answer
You need to add that new IP in your
listener.ora
file and modifytnsnames.ora
file to load balance the connection requests to two different IPs.Let's say I have database server and one listener is serving at 192.168.30.133/Port 1522. Next, I want to add new interface with IP 192.168.30.144.
Then I need to add the second IP address to my
listener.ora
file as shown below.In order to balance the load of client connections between these two IP address you need to modify
tnsnames.ora
file at client site as shown below.Let's try to connect to the database and see whether the connection requests is distributed to these IPs or not.
Lets try to connect to the database.
Now lets check which IP address was chosen to server the request.
Go to
$ORACLE_BASE/diag/tnslsnr/DB_NAME/listener1/trace
.We can see that 192.168.30.144 was used to serve the request.
Let's log out and try again to connect to the database.
Listener.log
Now we can see 192.168.30.133 is used.
Note: As @Colin 'T Hart said. You can use same port number for both IPs.