DB2-z/OS: Seamless JDBC Database Failover for SAP Java stack
[asa failover] [DB2] [failover] [failover cluster] [failover failback] [HA] [Java] [MVS] [OS390] [system] [z] [z/OS]
Related:
- DB2-z/OS: DB2 Connect 9.1 JDBC Failover for SAP Java stackSymptom This SAP Note describes how to enable high availability...
- DB2-z/OS: Distribution of Java instances to DB2 membersSymptom If you have configured more than one SAP JAVA...
- DB2-z/OS: Running two or more DB2 members on one z/OS LPARSymptom This SAP Note describes how you can set up...
- 640PC Edition May 2008:Installation IBM DB2 on z/OSSymptom This SAP Note is valid for the following releases:...
- DB2-z/OS: Inconsistent fields with DDIC type RAW/LRAW/VARCSymptom You are requested by a SAP tool or documentation...
- DB2-z/OS: PLAN_TABLE & DSN_STATEMNT_TABLE for v9.1Symptom The note describes a fix that allows to create...
- DB2/390: HA for unplanned DB outage for java stackSymptom We strongly recommend to use the Db2 Connect V9...
- DB2-z/OS: Avoiding automatic recommendations for REORGSymptom With DB2 for z/OS, you can automate the scheduling...
Symptom
This SAP Note describes how to enable high availability for your Java application server in case of planned and unplanned outages of the DB2 for z/OS subsystem. High availability enablement is based on the seamless and cascaded failover feature of the IBM Data Server Driver for JDBC (JCC driver), which was introduced with DB2 Connect 9.5.
If you are still running DB2 Connect 9.1, please consider note 1339644.
Other terms
MVS OS/390 HA JAVA Failover z/OS System z DB2
Reason and Prerequisites
Your DB2 subsystem must be running in a data sharing environment.
For releases SAP Web AS 6.40, SAP NetWeaver 7.0 (2004s) and 7.1, the Java stack does not actively support high availability as does the ABAP stack. Therefore, high availability is achieved by exploiting the seamless and cascaded failover feature of the IBM Data Server Driver for JDBC (JCC driver), which reroutes connections to a standby member.
The seamless and cascaded failover feature of the JDBC driver is independent and works with both the CLI driver and the DB2 Connect gateway.
The following code levels are required to cover planned and unplanned outages:
APARs for DB2-z/OS V8:
PK35632 DB2 Z/OS SUPPORT FOR JCC CLIENT-REROUTE
PK47633 ALIAS PORT LISTENER IS NOT STARTED UNLESS USING DVIPA
APARs for DB2-z/OS V8 AND V9:
PK41236 DB2 Z/OS SYSPLEX SUPPORT FOR IBM DATA SERVER DRIVER FOR JDBC AND SQLJ
IBM Data Server driver for JDBC version 3.51.131999 (included in DB2 Connect V9.5 FP1 Special Build 20539) or later
Solution
This section below describes the steps that are necessary to enable planned and unplanned failover for JAVA instances.
Proceed as follows:
1. Stop your Java application server.2. Update your JDBC driver.3. Start the configtool:
Change the URL of the database connection:a) Choose ‘Secure Store’b) Choose key jdbc/pool/
“clientRerouteAlternateServerName=
Note that the primary member must be added to clientRerouteAlternateServerName to enable fallback to the primary member.
Also note that the DDF ports, which are identical in a data sharing group, need to be listed for all members.
By default, the JDBC driver tries to connect to a DB2 member for three times. The duration that it waits between the connection attempts is 0 seconds. If you would like to adjust this, you can set the connection properties maxRetriesForClientReroute and/or retryIntervalForClientReroute, respectively.
In the following example, wee assume these parameters:
SAPSID JHA
DB2 SSIDs DHA1, DHA2, DHA3
LOCATION DDFDHA
DDF PORTs 8162, 8162, 8162
Collection ID (*) SAPJJHADDFDHA
SCHEMA SAPJAVA
HOSTNAME of DHA1 ha1host
HOSTNAME of DHA2 ha2host
HOSTNAME of DHA3 ha3host
(*) Collection is set to
There is no need to change the values for currentPackageSet or currentSQLID to enable high availability for the Java Stack. Also keep the setting keepDynamic=yes.
The resulting url might look like this: “jdbc:db2://ha1host:8162/DDFDHA:keepDynamic=yes; currentSQLID=SAPJAVA;currentPackageSet=SAPJJHADDFDHA; clientRerouteAlternateServerName=ha1host,ha2host,ha3host; clientRerouteAlternatePortNumber=8162,8162,8162; queryCloseImplicit=false; enableSeamlessFailover=true; enableClientAffinitiesList=true;”
Choose ‘Add’.a) Save your changes in the configtool.1. Restart your Java application server.2. To trigger planned failover, stop the DDF on one member gracefully: “STOP DDF MODE(QUIESCE)” – which is the default mode. At the end of a transaction, a thread will reconnect to the next member if no resources are held anymore.3. Remark: Setting enableClientAffinitiesList to true ensures that only the members specified in the url – and in that order – will be considered.4. If you run two or more DB2 members of a data sharing group on the same z/OS LPAR, you can proceed as follows to ensure that you can uniquely identify a member:
Use the TCP PORT statement in the z/OS TCPIP profile to assign a different IP address to the DDF address spaces of the DB2 members. It is crucial to assign this IP address to both the SQL port (DSNJU003 option PORT) and Resync port (DSNJU003 option RESPORT) of DDF.
Example: PORT ……
8188 TCP DHA1DIST BIND 192.168.216.201
8188 TCP DHA2DIST BIND 192.168.216.202
Specify the unique IP address (or host names that you may define) in the JDBC connection property clientRerouteAlternateServername.
For details on the TCP PORT statement, see
http://publib.boulder.ibm.com/infocenter/zos/v1r9/index.jsp?topic=/com.ibm.zos.r9.halz001/portst.htm