You are on page 1of 4

Legacy systems:

Chapter:
Section:
Subsection:

kernel upgrade R/3 + UNIX

Capgemini : SAP TCC Basis Support


Technical
Technical Documents

Web link: http://domino.eu.mars/isi/COMR3DOC.NSF/$WEBAllDocsByKey/50749BF1FE17E3F4C3257375004FAEBD?


OpenDocument

Body:

KERNEL UPGRADE PROC


FOR R/3 + UNIX
Prerequisites
SAP system
SAP system version
Kernel current version
Kernel version after upgrade
New kernel location
New kernel file name
SAP existing kernel location
Root account/password
Outage date and time
SGEN processing needed
CIP Leader

BIP
640
167

/sapmnt/$ORACLE_SID/exe
NOT NEEDED
Naumenko Dmitry

Skills required
SAP basis
Unix operating system

Useful OSS notes


19466

Downloading SAP kernel patches

Preparation stage (only by CIP leader)


CIP
1)
2)
3)
4)
5)
6)

leader should perform the following.


Order outage and get approval from system owner
Ensure that system has successful backup
Download new kernel SAP OSS site
Unpack kernel, then create single kernel archive file (sapcar -cvf file.CAR . )
Upload single kernel archive to SAP TCC DEPOT
Check procedure and update if needed

UPGRADE PROCEDURE
A. Introduction
The SAP Kernel means all executable programs located in /sapmnt/$DB_SID/exe
During this procedure new kernel files will be put to /saptmp/$DB_SID/new_kernel
and backup copy of existing kernel - to /saptmp/$DB_SID/old_kernel

B. Requirements
Accesses needed:
SAP R/3
: normal user in order to test the system after new Kernel installation
UNIX accesses
: <sid>adm, ora<sid>, root
SAPTCC DEPOT : FTP access for kernel files download

C. Pre-upgrade actions
Duration: 1 hour

Please perform pre-upgrade actions in advance, before outage !


1) Logon SAP application server as sidadm and make a copy of existing kernel:
cd /saptmp/$ORACLE_SID
(if this directory doesn't exist - create it)
rm -R new_kernel
(cleaning up, use chmod -R 777 if problems with read-only files)
rm -R old_kernel
mkdir old_kernel
pwd
ls
cp -R /sapmnt/$ORACLE_SID/exe/* old_kernel
2) Download new kernel files:
cd /saptmp/$ORACLE_SID
mkdir new_kernel
cd new_kernel
ftp mou042.na.mars (you will be asked for user and password. Use sidadm for SGU system)
binary
cd <new_kernel_location>
(see prerequisites to know new kernel path)
get <new_kernel_file_name>
(see prerequisites to know new kernel file name)
bye
3) Ensure that downloaded CAR/SAR files can be unpacked successfully. To do this use the following

commands:
cd /saptmp/$ORACLE_SID/new_kernel
mkdir test

cd test
Try to unpack new kernel:
SAPCAR -xvf ../<new_kernel_file>
If you get error messages during unpacking - download it once more from SAPTCC_depot.

After kernel is unpacked OK - delete test directory:


cd /saptmp/$ORACLE_SID/new_kernel
rm -R test
4) Try to logon SAP system, check that system is available and your personal ID is working.
5) Make sure that root access is working:
su - root
(see pre-requisites to know root login)
id

D. Kernel Upgrade Procedure


Duration: 1 hour
1) Stop alerting, link:
2) Stop CCMS montoring:
su - sidadm
cd /usr/sap/$ORACLE_SID/SYS/profile
ps -ef|grep ccm4x
(you will see profile name for ccm4x agent)
sapccm4x -stop pf=<instance_profile>
3) Stop SAP system and Oracle, use start/stop instructions from SAPTCC database.
4) Stop SAPOSCOL process:
saposcol -k
5) Make sure that no active SAP processes exist for system to be upgraded (pay attention, that some hosts
contain more then one SAP system):
ps -ef|grep sap
6) When you upgrade to the new kernel, problem with the statistics collector might occur. Therefore, please delete
the stat file:
cd /usr/sap/$ORACLE_SID/<INSTANCE_NAME>/data
rm stat
7) Switch to root access:
su - root
cd /sapmnt/$ORACLE_SID/exe
ls
8) Make a copy of SAPCAR:
cp SAPCAR /saptmp/$ORACLE_SID/new_kernel
9) Unpack new kernel (see pre-requisites to know new kernel file name):
cd /sapmnt/$ORACLE_SID/exe
/saptmp/$ORACLE_SID/new_kernel/SAPCAR -xvf /saptmp/$ORACLE_SID/new_kernel/<new_kernel_file>
Solution for possible issue:
If you receive error during any of above unpacking steps, reporting that some of the files (executables or shared
libraries) are locked and cannot be overwritten, please find out a process, that locks them via "/usr/sbin/fuser
locked_file_name" command - it will report PID of locking process. You can do "ps -afe | grep PID" to findout name
of locking process. Stop that locking process using proper procedure and redo failed unpacking step.

10) Change security attributes as root:


cd /sapmnt/$ORACLE_SID/exe
chown -R sidadm:sapsys *
chmod -R 775 *
./saproot.sh $ORACLE_SID
(or /bin/sh saproot.sh $DB_SID)
11) Start SAP system (use start/stop instructions from SAPTCC database)
12) If SAP services or SAP system won't start, or you can't logon SAP system you should do these steps:
A. Copy existing failed kernel from directory /sapmnt/$ORACLE_SID/exe to /saptmp/
$ORACLE_SID/failed_kernel
B. Copy old kernel from directory /saptmp/$ORACLE_SID/old_kernel to /sapmnt/$ORACLE_SID/exe.

E. Post-Upgrade activities: Duration: 30 min


1) Logon SAP system
2) Check SAP kernel status. Use menu "System -> Status".
Example for CGT upgraded to kernel with patchlevel 193:

Ensure that kernel release and patchlevel are correct (see pre-requisites to know new kernel release and patchlevel).
Note: For 40B systems you can't see the last digit of kernel level. As workaround you can logon as sidadm and issue
disp+work |grep "patch level"
3) Check system log in SM21 for error messages
4) Check SM50 and make sure all the work processes have started. Check tracefiles
for a couple of DIA processes, menu "Process -> Trace -> Display file"
5) Check the transport tool. Logon SAP host as sidadm and execute the following:
cd /usr/sap/trans/bin
ls
40B:
tp connect $ORACLE_SID pf=<PROFILE> (for example: tp connect BID pf=TP_DOMAIN_BIP.PFL)
Other:
tp connect $ORACLE_SID
(for example: tp connect DE1)
(return code should be 0)

cd /tmp
R3trans -dv
(Return code should be 0000)

Trans.log will be created in current dir, check it if you get other then 0000 return.
6) Check brtools and database connectivity:
su - sidadm
brconnect -u / -c -f check
7) Check BRSPACE by extending any datafile (please choose small one).
For example you can extend the first datafile of PSAPDOCUI tablespace by 2 Mb.
To identify datafile name use tx DB02.
Menu in BR*Tools: "Space management -> Alter datafile".
If problems occur - please fix them.
8) Restart SAP&Oracle to check startsap/stopsap scripts:
su - sidadm
stopsap
startsap
Notify CIP leader (see pre-requisites) about completion of kernel upgrade.
9) Enable alerting: **********Completed.*******************