We should patch our SAP ASE (Adaptive Server Enterprise) Sybase database from time to time as recommended by SAP. This helps in correcting bugs in certain patch levels. Please follow the complete blog to understand each and every step in patching your SAP ASE Sybase Database.
Download the latest patch level
Go to SAP Software downloads –> Databases –> Access downloads
Database and Database patches –> SAP Adaptive Server Enterprise
Click on “Database Patches” –> SAP ASE for Business Suite
Download the latest available patch for the database software (SAP ASE 16.0 for BUS. SUITE) as well as the DB client (SAP ASE 16 DBCLIENT BUS.SUITE)
DB software –> Select the system OS
DB client (ODBC & JDBC Drivers) –> Select your respective Operating System.
Download the update script
You will also need to download the upgrade script “syb_db_update.txt” file which is attached to note 1982469 and place it at below path:
Unix: /usr/sap/hostctrl/work/<SID>/
Windows: C:\Program Files\SAP\hostctrl\work\<SID>\
If the directory <SID> does not exist then manually create it.
Check and update SAPHostagent
Follow steps as mentioned in our blog
How to check SAP Hostagent version
How to update SAP Hostagent ?
Check it with the minimum required release version mentioned in note 2800483
Note: Continuing an update with SAP Host Agent 7.21 SP43 and higher is not supported if the update was started with a lower SAP Host Agent version! This means you either have to finish the update with SAP Host Agent 7.21 SP42 and lower or restart the update from scratch with higher versions. It’s best to not mix SAP Host Agent 7.21 SP42 with later versions when updating SAP ASE!
Update SAP Host Agent to the latest release according to SAP Note 2130510.
Maintain credentials for the SAP Host Agent according to SAP Note 1797040.
Backup
In worst case, if you need to roll back to the old existing version of SAP ASE, then you must take a backup of %SYBASE% directory.
Unix: /sybase/<SID>
Windows: <drive>:/Sybase/<SID>
For Windows, you may use “Windows Server Backup” application to take a local backup of Sybase directory.
How to check the current SAP ASE Sybase patch level ?
Log on as <sid>adm on the server and execute below command:
sqlsrvr.exe –version
Extract the DB software
Create a temp directory and extract the DB software SAR file using <sid>adm user.
Make sure the user syb<sid> has read & execute permissions on this temporary directory & its subdirectories.
Maintain Secure Storage
Validate the credentials in SAP Secure store with SAP Host agent SP35 or higher with below command:
<path to saphostctrl>/saphostctrl -user sapadm <sapadm password> -function LiveDatabaseUpdate -dbname <SAPSID> -dbtype syb-updateoption TASK=VALIDATE_SEC_STORES
If any account is missing, then you can add them with the following command to the list of the saphostagent.
saphostctrl -function SetDatabaseProperty -dbname <SID> -dbtype syb -dbuser SAPSR3 -dbpass <password> USER=SAPSR3
If in case secstore rsecssfs is being used, then check and confirm this using command “SET” and verify if you see rsec_ssfs_datapath maintained.
If secstore rsecssfx is being used use below command to check the required users are in the list.
rsecssfx list
If the users which are being used in the upgrade are not in list please add them through the following command:
rsecssfx put DB_CONNECT/DEFAULT_DB_USER SAPSR3 -plain
rsecssfx put DB_CONNECT/DEFAULT_DB_PASSWORD <password>
Check 1797040 for more information on this.
Note: User names are case sensitive. So use SAPSR3 instead of sapsr3.
Stop SAP
Stop SAP using SAP Management console.
Execute update process
Open cmd using <sid>adm user and change directory to “C:\Program files\SAP\hostctrl\exe and execute below command to check if the upgrade will be successful or will it fail due to some error. Its just a check and it won’t actually update any files.
saphostctrl -function LiveDatabaseUpdate -dbname <SID> -dbtype syb -updatemethod Check -updateoption TASK=CHECK_UPDATE_ASE -updateoption DROP_LOCATION=”D:\Temp\ASE_PATCH”
In our case, we had extracted it on D:\Temp\ASE_PATCH
Sometimes, you may get an error like below while executing “Check” update method.
Error: sapdbctrl: Failed to logon sa. Please provide valid sa credentials in the SAP Secure Store.
Error: saphostcontrol: LiveDatabaseUpdate failed <sapdbctrl exit code = 1>
Root cause: User sa credentials are not maintained correctly in the secure store using rsecssfx.
Solution: Update the credentials using below commands
rsecssfx put DB_CONNECT/SYB/SAUPDDB_USER sa -plain
rsecssfx put DB_CONNECT/SYB/SAUPDDB_PASSWORD <password>
If still it doesn’t work, then you may have to reset the sa password.
Execute actual upgrade
Below command will start the actual upgrade process
saphostctrl -user sapadm <password> -function LiveDatabaseUpdate -dbname <SAPSID> -dbtype syb -updatemethod Execute -updateoption TASK=UPDATE_ASE -updateoption DROP_LOCATION=”<drop location>”
Sometimes you may receive an error like not able to find drop location. So, In above command, remove “ “ and execute. After executing this command, it will take some time to produce below screen. So wait for few minutes (05-10 mins)
The update generates logs in:
C:\Program Files\SAP\hostctrl\work\liveupdate.log
<drive>:\sybase\<SID>\sapdbctrl-config\ASE_UPDATE.dat
<drive>:\sybase\<SID>\log\ASE.log
C:\Program Files\SAP\hostctrl\work\dev_sapdbctrl
Verification
Now check whether DB has been upgraded to the required patch level
Execute sqlsrvr.exe –version command
Update the JDBC and ODBC drivers
Log on as <sid>adm to the SAP system and go to the directory where we downloaded the DB client SAR file.
Extract the contents at location <drive>:\usr\sap\<SID>\sys\global\syb\NTAMD64 using SAPCAR
sapcar –xvf ASEBCxxxx.SAR -R <drive>:\usr\sap\<SID>\sys\global\syb\NTAMD64
Restart SAP
Start SAP using SAP Management console and check the version of database using “System –>Status”
Hi,
on Execute update process and the error “sapdbctrl: Failed to logon sa. Please provide valid sa credentials in the SAP Secure Store…” maybe you can add or link the information from “2512997 – How to ‘lock’ and ‘unlock’ ‘sa’ login – SAP ASE for BS”. This helped me a lot. Thanks for your detailed instructions.
Best regards,
Matthias