
SAP Kernel upgrade for ABAP system (Unix OS)
Here is the detailed procedure to upgrade kernel in SAP ABAP application having Unix as OS:
Step 1: Check the current kernel release and patch level
Login to SAP and choose menu System -> Status:
Kernel release 742
Sup.Pkg lvl. 200
DBSL Patch Level 110
So my system was on SAP Kernel release 7.42 with patch level 200 and DBSL on patch level 110.
Step 2: Download the new kernel
They are available under http://support.sap.com/swdc -> Support Packages & Patches -> Browse Download Catalog:


Here navigate to Additional Components -> SAP Kernel and choose the corresponding bit version (32 or 64) make variant (empty or EXT) and unicode or nonunicode (empty or UNICODE | UC) for your system.



The easiest way to get this information is to run disp+work command on operating system level with sidadm user or from SAP system using RSBDCOS0 report. For example:
[1]disp+work
disp+work information
kernel release 742
kernel make variant 742_REL
compiled on Linux GNU SLES-11 x86_64 cc4.3.4 use-pr150508 for linuxx86_64
compiled for 64 BIT
compilation mode UNICODE
compile time Jun 29 2015 23:01:53
update level 0
patch number 200
source id 0.200
RKS compatibility level 0
After choosing the correct kernel path navigate to corresponding kernel release, operating system and choose #Database_independent and database specific links:


I used SAPEXE.SAR and SAPEXEDB.SAR archives for updating. In addition, dw.sar lib_dbsl.sar and further archives can be used, but only the ones which are newer than the latest SAPEXE(DB) packages. All other executables are already part of SAPEXE(DB).


Download them to your SAP server.
Step 3: Make backup of current kernel
Check via AL11 transaction where DIR_CT_RUN (central kernel folder) points to:
DIR_CT_RUN /usr/sap/SID/SYS/exe/uc/linuxx86_64
This is where the kernel will be distributed to DIR_EXECUTABLE via sapcpe from.
Make backup of current DIR_CT_RUN:
hostname:sidadm 14> ls -al
total 306260
drwxr-xr-x 3 sidadm sapsys 4096 Nov 11 08:24 .
drwxr-xr-x 5 sidadm sapsys 4096 Jan 26 2015 ..
drwxr-xr-x 5 sidadm sapsys 12288 Oct 2 10:05 linuxx86_64
-rw-r–r– 1 sidadm sapsys 298799041 Nov 11 08:17 SAPEXE_300-20012215.SAR
-rw-r–r– 1 sidadm sapsys 14468589 Nov 11 08:17 SAPEXEDB_300-20012214.SAR
hostname:sidadm 15> mkdir linuxx86_64-bckp
hostname:sidadm 17> ls -al
total 306264
drwxr-xr-x 4 sidadm sapsys 4096 Nov 11 08:25 .
drwxr-xr-x 5 sidadm sapsys 4096 Jan 26 2015 ..
drwxr-xr-x 5 sidadm sapsys 12288 Oct 2 10:05 linuxx86_64
drwxr-xr-x 2 sidadm sapsys 4096 Nov 11 08:25 linuxx86_64-bckp
-rw-r–r– 1 sidadm sapsys 298799041 Nov 11 08:17 SAPEXE_300-20012215.SAR
-rw-r–r– 1 sidadm sapsys 14468589 Nov 11 08:17 SAPEXEDB_300-20012214.SAR
hostname:sidadm 18> cp -R linuxx86_64/* linuxx86_64-bckp
Step 4: Stop SAP system
hostname:sidadm 22> stopsap r3
Checking SID Database
Database is running
——————————————-
stopping the SAP instance D02
Shutdown-Log is written to /home/sidadm/stopsap_D02.log
——————————————-
/usr/sap/SID/D02/exe/sapcontrol -prot NI_HTTP -nr 02 -function Stop
Instance on host hostname stopped
Waiting for cleanup of resources
………….
stopping the SAP instance DVEBMGS00
Shutdown-Log is written to /home/sidadm/stopsap_DVEBMGS00.log
——————————————-
/usr/sap/SID/DVEBMGS00/exe/sapcontrol -prot NI_HTTP -nr 00 -function Stop
Instance on host hostname stopped
Waiting for cleanup of resources
…..
stopping the SAP instance ASCS01
Shutdown-Log is written to /home/sidadm/stopsap_ASCS01.log
——————————————-
/usr/sap/SID/ASCS01/exe/sapcontrol -prot NI_HTTP -nr 01 -function Stop
Instance on host hostname stopped
Waiting for cleanup of resources
..
Step 5: Extract kernel archives
First copy SAPCAR from DIR_CT_RUN outside of DIR_CT_RUN. This way extraction won’t stop due to “text file busy” error.
hostname:sidadm 29> cp linuxx86_64/SAPCAR SAPCAR
hostname:sidadm 30> ls -al
total 310552
drwxr-xr-x 4 sidadm sapsys 4096 Nov 11 08:43 .
drwxr-xr-x 5 sidadm sapsys 4096 Jan 26 2015 ..
drwxr-xr-x 5 sidadm sapsys 12288 Oct 2 10:05 linuxx86_64
drwxr-xr-x 5 sidadm sapsys 12288 Nov 11 08:26 linuxx86_64-bckp
-rwxr-xr-x 1 sidadm sapsys 4367136 Nov 11 08:43 SAPCAR
-rw-r–r– 1 sidadm sapsys 298799041 Nov 11 08:17 SAPEXE_300-20012215.SAR
-rw-r–r– 1 sidadm sapsys 14468589 Nov 11 08:17 SAPEXEDB_300-20012214.SAR
hostname:sidadm 32> ./SAPCAR -xfj SAPEXE_300-20012215.SAR -R ./linuxx86_64
Then extract the SAPEXE(DB) archives in DIR_CT_RUN:
SAPCAR: processing archive SAPEXE_300-20012215.SAR (version 2.01)
SAPCAR: 740 file(s) extracted
hostname:sidadm 33> ./SAPCAR -xfj SAPEXEDB_300-20012214.SAR -R linuxx86_64
SAPCAR: processing archive SAPEXEDB_300-20012214.SAR (version 2.01)
SAPCAR: 26 file(s) extracted
If you want to extract other archives as well check point 8. in SAP Kernel Update on Unix and Linux – Application Server Infrastructure – SCN Wiki
Step 6: Adjust permissions by root user
hostname:/usr/sap/SID/SYS/exe/uc # chmod -R 755 linuxx86_64
hostname:/usr/sap/SID/SYS/exe/uc # chown -R sidadm:sapsys linuxx86_64
hostname:/usr/sap/SID/SYS/exe/uc # ./linuxx86_64/saproot.sh SID
Preparing /usr/sap/SID/SYS/exe/uc/linuxx86_64/brbackup …
Preparing /usr/sap/SID/SYS/exe/uc/linuxx86_64/brarchive …
Preparing /usr/sap/SID/SYS/exe/uc/linuxx86_64/brconnect …
Preparing /usr/sap/SID/SYS/exe/run/brbackup …
Preparing /usr/sap/SID/SYS/exe/run/brarchive …
Preparing /usr/sap/SID/SYS/exe/run/brconnect …
Preparing icmbnd …
icmbnd.new does not exist – skipped
Set user ID bit on /usr/sap/SID/DVEBMGS00/exe/sapuxuserchk
Set user ID bit on /usr/sap/SID/D02/exe/sapuxuserchk
Set user ID bit on /usr/sap/SID/ASCS01/exe/sapuxuserchk
done
Step 7: Start SAP system
hostname:sidadm 46> startsap r3
Checking SID Database
Database is running
——————————————-
Starting Startup Agent sapstartsrv
OK
Instance Service on host hostname started
——————————————-
starting SAP Instance ASCS01
Startup-Log is written to /home/sidadm/startsap_ASCS01.log
——————————————-
/usr/sap/SID/ASCS01/exe/sapcontrol -prot NI_HTTP -nr 01 -function Start
Instance on host hostname started
Starting Startup Agent sapstartsrv
OK
Instance Service on host hostname started
——————————————-
starting SAP Instance DVEBMGS00
Startup-Log is written to /home/sidadm/startsap_DVEBMGS00.log
——————————————-
/usr/sap/SID/DVEBMGS00/exe/sapcontrol -prot NI_HTTP -nr 00 -function Start
Instance on host hostname started
Starting Startup Agent sapstartsrv
OK
Instance Service on host hostname started
——————————————-
starting SAP Instance D02
Startup-Log is written to /home/sidadm/startsap_D02.log
——————————————-
/usr/sap/SID/D02/exe/sapcontrol -prot NI_HTTP -nr 02 -function Start
Instance on host hostname started
Step 8: Check new kernel patch level
Login to SAP and choose menu System -> Status:
Kernel release 742
Sup.Pkg lvl. 300
DBSL Patch Level 300