Oracle RAC Load Balancing allows connections initiated from clients to be effectively allocated to instances with low listener load. There are two methods to achieve load balancing on the client. One is to configure the load_balance of the client, and the other is to configure the remote_listener parameter on the server. The two methods have their own advantages and disadvantages, and they are not mutually exclusive. Therefore, the two methods can be combined to achieve load balancing more effectively. This article describes the use of the two (oralce 10g rac ).
For separate tests on Server Load balancer between clients, see:
Load Balance)
Oracle RAC server connection Load Balance)
The tests in this article combine the scripts and samples used in the previous article, which is a summary of the previous two tests.
I. Configuration Requirements
1. The listeners on each node on the server can provide services normally. If you use non-default port 1521, refer to the non-default port monitoring configuration in oracle rac (listener. ora tnsnames. ora)
- Oracle @ bo2dbp: ~> More $ ORACLE_HOME/network/admin/listener. ora
- # Listener. ora. bo2dbp Network Configuration File:/u01/oracle/db/network/admin/listener. ora. bo2dbp
- # Generated by Oracle configuration tools.
- LISTENER_BO2DBP =
- (DESCRIPTION_LIST =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP) (HOST = bo2dbp-vip.2gotrade.com) (PORT = 1521) (IP = FIRST ))
- (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.51) (PORT = 1521) (IP = FIRST ))
- )
- )
- SID_LIST_LISTENER_BO2DBP =
- (SID_LIST =
- (SID_DESC =
- (SID_NAME = PLSExtProc)
- (ORACLE_HOME =/u01/oracle/db)
- (PROGRAM = extproc)
- )
- )
- Oracle @ bo2dbp: ~> Lsnrctl status
- Service "GOBO4" has 2 instance (s ).
- Instance "GOBO4A", status READY, has 2 handler (s) for this service...
- Instance "GOBO4B", status READY, has 1 handler (s) for this service...
2. remote_listener parameter settings on the server
The connection identifier of the remote_listener parameter is required to have corresponding entries in tnsnames. ora on the server side.
- SQL> show parameter listener
- NAME TYPE VALUE
- -----------------------------------------------------------------------------
- Local_listener string
- Remote_listener string remote_lsnr_gobo4
- Oracle @ bo2dbp: ~> More $ ORACLE_HOME/network/admin/tnsnames. ora
- # Tnsnames. ora Network Configuration File:/u01/oracle/db/network/admin/tnsnames. ora
- # Generated by Oracle configuration tools.
- Remote_lsnr_gobo4 =
- (ADDRESS_LIST =
- (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.61) (PORT = 1521 ))
- (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.62) (PORT = 1521 ))
- )
3. Enable load_balance in client tnsnames. ora
- Oracle @ SZDB: ~> Tail-11 $ ORACLE_HOME/network/admin/tnsnames. ora
- GOBO4 =
- (DESCRIPTION =
- (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.61) (PORT = 1521 ))
- (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.7.62) (PORT = 1521 ))
- (LOAD_BALANCE = yes)
- (CONNECT_DATA =
- (SERVER = DEDICATED)
- (SERVICE_NAME = GOBO4)
- )
- )