Technical Articles
NW-Java SAP-Application to connect/access two ASE Database-servers on HA ( SRS )
Hi Friends,
I have tried to find good documentation or a blog on the below demonstration. I was not able to find documents in 1 place for SAP NW Java Application connect process for ASE Always-On or SRS Solution. So, I have accumulated the needed steps here,
The below documentation is considering,
A. SID= ND1, Environment= Linux
B. ASE database Server1 virtual hostname= nd1db1
C. ASE database Server2 virtual hostname= nd1db2
D. Where Applicable :→
SAP-JAVA Application connecting to 2 ASE database servers with HA-Replicated Solution
E. Why :→
In cloud solution, To allow SAP-Application to connect to 2 databases so that there is always a database available for the Application, known as ASE Always-On. It allows us to do servers reboot or any change activities without any practical downtime to End-users. It ensures that there is always a database server available in case a DB-Node goes down. ASE HA setup sync for SAP Java-Application, hence no DB-pacemaker_cluster for Cloud database Servers. On-premise physical hardware we could take pacemaker solution for ASE, but it might become more costly in Cloud solutions to achieve such
F. How :→
Pre-requisites :→ 2 ASE DB-Servers installed with same SID &Patch-Level. Request Server management to create Additional mount-points for Replication on both DB Servers. This will be used for the Java Application-Servers to connect with HA-Rep Solution available (ASE Always-On), make the both DB Nodes available on replication3 days before to ensure smooth handling. Post activity plan is to test the HA solution online on a later on date, say after couple of days observation. Since there will be configtool changes, please make sure prior to activity configtool is running fine & for that JAVA_HOME env is set properly. Its because editing SAP-Application Secstore with the help of configtool is much easy than doing it manually.
Step 1 :→ Take backup of Secstore.key & Secstore.properties, in OS-Level,
Step 2 :→ Modify the Configtool in any 1 of SAP-Application servers& save changes,
Old value in configtool for secstore,
jdbc:sybase:Tds:nd1db1:4901/ND1?ENABLE_FUNCTIONALITY_GROUP=1
New value in configtool for Secstore, this contains both Database-Servers details,
jdbc:sybase:Tds:nd1db1:4901,nd1db2:4901/ND1?ENABLE_FUNCTIONALITY_GROUP=1&HADR_MODE=NONE
Step 3 :→ Save the configtool changes & modify .dbenv.sh & .dbenv.csh files in PAS & AAS servers located in /home/<SIDadm>
In /home/<SIDadm>/.dbenv.sh, the values will be as below,
dbs_syb_server=nd1db1:nd1db2
export dbs_syb_server
dbs_syb_port=4901:4901
export dbs_syb_port
dbs_syb_ha=1
export dbs_syb_ha
rsdb_ssfs_connect=1
export rsdb_ssfs_connect
RSEC_SSFS_DATAPATH=/usr/sap/ND1/SYS/global/security/rsecssfs/data
export RSEC_SSFS_DATAPATH
RSEC_SSFS_KEYPATH=/usr/sap/ND1/SYS/global/security/rsecssfs/key
export RSEC_SSFS_KEYPATH
fi
In /home/<SIDadm>/.dbenv.csh, the values will be as below,
setenvdbs_syb_server nd1db1:nd1db2
setenvdbs_syb_dbname ND1
setenvdbs_syb_port 4901:4901
setenvrsdb_ssfs_connect 1
setenv dbs_syb_ha 1
setenv RSEC_SSFS_DATAPATH /usr/sap/ND1/SYS/global/security/rsecssfs/data
setenv RSEC_SSFS_KEYPATH /usr/sap/ND1/SYS/global/security/rsecssfs/key
endif
Note :→ The above value has to be set in both PAS & AAS server /home/<SIDadm> files
Step 4 :→ Stop SAP Application in PAS & AAS(for Configtool changes, i.e., SAP-Application Secstore changes) à reboot both PAS & AAS servers(for env new values to be in effect) → Start the PAS & AAS
Step 5 :→ Check the replication status, do failover, check the Application is going down or not.
Step 6 :→ Take initial backup for both the DB servers,
G. Replication/Failover Commands from root user on OS-Level :→
♦ Check active Transaction Command :→
/usr/sap/hostctrl/exe/saphostctrl -function LiveDatabaseUpdate -dbname ND1 -dbtypesyb -updatemethod Check -updateoption TASK=CHECK_ACTIVE_TX
♦ Replication status Check Command :→
/usr/sap/hostctrl/exe/saphostctrl -function LiveDatabaseUpdate -dbname ND1 -dbtypesyb -updatemethod Check -updateoption TASK=REPLICATION_STATUS
♦ Do Failover command :→
usr/sap/hostctrl/exe/saphostctrl -function LiveDatabaseUpdate -dbname ND1 -dbtypesyb -updatemethod Execute -updateoption TASK=FAILOVER
♦ To know Primary/Stand-by DB-Node :→
ND1_SITE2-[Standby]-sybnd1-ND1>hadr_status ND1
GroupName ServerName Mode State ServerMap
——————– ——————– ——————– ——————– ——————–
ND1_group ND1_SITE1DR Primary Active tcp nd1db1.fqdn-hostname
ND1_group ND1_SITE2DR Standby Inactive tcp nd1db2.fqdn-hostname
Note :→ that you can check/execute-failover command mentioned above via any of the DB-servers.
H. Related SAP Note & help doc :→ 1891560
https://www.sap.com/documents/2016/09/be890415-8b7c-0010-82c7-eda71af511fa.html
I. Kept in Mind :→ The SAP-Application does not go down,in-case 1 of the DB-servers get stopped/rebooted. Since as per normal Single-DB instance installation, if DB goes down SAP-Application also goes down with it. Here the database remains always available for the Application. This ensures Zero downtime from databases/DB-Servers to SAP-Application prospective. During the switch the User might face a bit slow for some very few seconds depending on data-Load & DB-size, but nonetheless the application does not go down during switch & probably the End-User might also not recognize if some switch like this happened in backend.This setting in Application allows the SAP Java-Application to connect to 2 DB-servers that are replicated, hence the End-User details are always available for use.
J. Changes in Configtool(FQDN or not) :→ In case your fqdn is getting resolved, you can use fqdn in Configtool also for Secstore creation. In case its only resolving hostname only from both the hosts, then you can use hostname only without FQDN.
K. Last & Important GID & UID :→ 1 Last & important is that to keep the GID(Group-ID) of sapsys same in Primary & secondary database hosts. Also we should use the same UID(User-ID) for sapadm OS-User as well
Friends, your valuable feedback & any suggestion is most welcome
Thanks,
Kaushik