WebMethod connect to Oracle10g RAC

tolywang發表於2010-01-28

Issue
I've would like to know what is the url model for JDBC pools when we use a database Oracle 10g RAC.
Same question for repository server.
Resolution
For internal IS JDBC Pools (Core Audit, Process Audit, TN, XRef, Document History), only OEM version of DataDirect ConnectJDBC is supported. The JDBC connection string to use in this case should be like:
"jdbc:wm:oracle://192.168.7.64:1521;ServiceName=PRD;AlternateServers=(192.168.7.65:1521);LoadBalancing=true"

Note: There is an issue with CJDBC 3.4 that would affect all customers using Oracle RAC. Although the correct syntax for setting a URL for Oracle
RAC is as follows:
"jdbc:wm:oracle://HOST1:1521;ServiceName=SERVICENAME;AlternateServers=(HOST2:1521);LoadBalancing=true"
with 3.4 if you set the above URL, the IS JDBC pools throw an error. Instead of "AlternateServers", using "AlternateServer" ( Singular) the connection gets enabled, but the property is just ignored by the Driver. So in effect your customer is exposed to a failure in case the primary RAC node goes down.
This issue does not exist on the 3.3 toolkit. This issue is fixed in 3.5 and 3.6 versions CJDBC.

For webMethods JDBC Adapter, in your case to access to Oracle 10g, you need to use the specific Oracle JDBC Driver, from Oracle itself, and the JDBC connection string to use should be as:
jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.7.64)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.7.65)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=PRD)))

You can use Oracle RAC facility using following in 'Other Properties' when configuring JDBC adapter connection:
Using thin driver something like:
driverType=thin;url=jdbc:oracle:thin:@(DESCRIPTION=(LOAD_BALANCE=on)(ADDRESS=(PROTOCOL=TCP)(HOST=host1) (PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=host2) (PORT=1521))(CONNECT_DATA=(SERVICE_NAME=service)))
You can also use the OCI Driver, tnsnames file needs to have the entry for the nodes in the RAC. Then in the connection settings you need the following:
DataSource Class = oracle.jdbc.pool.OracleDataSource therProperties=tnsEntryName=EMPWR2D;driverType=oci  

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-626202/,如需轉載,請註明出處,否則將追究法律責任。

相關文章