RAC configuration: node1: IP address 192.168.60.132, Instance name: rac1, Host Name: rac1node2: IP address 192.168.60.144, Instance name: rac2, Host Name: the rac2RAC service name is oratest. My application server is configured for apache + tomcat as follows: 1. After searching, I found the connection
RAC is configured as follows: node1: ip address 192.168.60.132, Instance name: rac1, Host Name: rac1 node2: ip address 192.168.60.144, Instance name: rac2, Host Name: the rac2 RAC service name is oratest. My application server is configured for apache + tomcat as follows: 1. After searching, I found the connection
The RAC configuration is as follows:
Node1: IP address 192.168.60.132, Instance name: rac1, Host Name: rac1
Node2: IP address 192.168.60.144, Instance name: rac2, Host Name: rac2
The RAC service name is oratest.
My application server is apache + tomcat
The configuration process is as follows:
1. After searching, we found that there are many connection RAC methods and copied the following jdbcURL:
Jdbc: oracle: thin: @ (description = (address_list = (address = (host = 192.168.60.132) (protocol = tcp) (port = 1521) (address = (host = 192.168.60.144) (protocol = tcp) (port = 1521) (load_balance = yes) (failover = yes) (connect_data = (service_name = oratest )))
However, tomcat reports the following error:
Io Exception: NL Exception was generated;
2. google and baidu on the Internet. Although the n method is found, the error is always prompted;
3. In desperation, open the database tnsname. ora and find that the configuration is as follows:
Oratest =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = rac1) (PORT = 1521 ))
(ADDRESS = (PROTOCOL = TCP) (HOST = rac2) (PORT = 1521 ))
(LOAD_BALANCE = yes)
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = oratest)
)
)
Modify jdbcUR:
Jdbc: oracle: thin: @ (description = (address_list = (address = (host = rac1) (protocol = tcp) (port = 1521) (address = (host = rac2) (protocol = tcp) (port = 1521) (load_balance = yes) (failover = yes) (connect_data = (service_name = oratest )))
The test result is successful;
Initially, the Database Service adopts the host name, while the IP address in jdbcURL will cause the NL Exception;
Suggestion: if there is a problem connecting RAC, it is best to use the connection string in tnsnames. ora to connect;
Do you have such a problem?