Sunday, 20 October 2024

SAP Kernel Upgrade Step by Step

SAP Kernel Upgrade 

Step by step procedure for SAP Kernel Upgrade


Check the current Kernel Version

Option 1. You can do this from SAP GUI by looking into System > Status >  


OR You can open transaction SM51 and click on Release Notes




Option 2. Run disp+work -V through sidadm user from OS level

 


Kernel version we have identified is 753 Patch 300

Download the Kernel and required archives from SAP Portal

1. Open SAP Portal through  https://me.sap.com/



Under Support Pack and Patches -> Under  Alphabetical Index {Follow the inline images}







Select SAP Kernel 7.53 Unicode  - Download Kernel Part-I and II of same patch level for DB independent and Dependent 



Download the database dependent same patch level  archive by selecting the database  



Now, We have SAPEXE_*.SAR and SAPEXEDB_*.SAR 


Perform backup of directory  


UNIX:        /sapmnt/<SID>/exe/uc/linuxx86_64

WINDOWS:   <DRIVE>:\usr\sap\<SID>\SYS\exe\uc\NTAMD64

                       Ex. F:\usr\sap\SID\SYS\exe\uc\NTAMD64


Extract Kernel Archives

 Extract the files in some other directory and then copy all contents to actual kernel directory as mentioned above.

Option 1.

Create new directory anywhere and extract the archives. It is recommended to run this  through SIDADM user.

SAPCAR -xvf  <Download_Archive_Location>/"SAPEXE*.SAR" -R <NEWKERNEL_DIR>

Ex. SAPCAR -xvf  /software/KERNEL/"SAPEXE*.SAR" -R /software/NEWKERNEL

then Copy extracted content to Kernel directory

cp -rvf  /<DIR>/NEWKERNEL/*  /sapmnt/<SID>/exe/uc/linuxx86_64/

Ex. cp -rvf  /software/NEWKERNEL/*  /sapmnt/<SID>/exe/uc/linuxx86_64/

Option 2.

Extract the archives directly into /sapmnt/<SID>/exe/uc/linuxx86_64/

Run this  through SIDADM user.

Change directory to /sapmnt/<SID>/exe/uc/linuxx86_64/

cd /sapmnt/<SID>/exe/uc/linuxx86_64/

the extract the archives

SAPCAR -xvf  /<Download_Archive_Location>/"SAPEXE*.SAR"

Ex. SAPCAR -xvf  /software/KERNEL/"SAPEXE*.SAR"


## For windows you can extract and copy paste as required. Kernel directory for windows - 

WINDOWS:   <DRIVE>:\usr\sap\<SID>\SYS\exe\uc\NTAMD64

Post Activities

This is Good practice to fix the permission, Run the script to root user to fix the permission.

 /usr/sap/<SID>/SYS/exe/run/saproot.sh  <SID>

Ex.  /usr/sap/PEP/SYS/exe/run/saproot.sh  PEP





Tuesday, 1 June 2021

How to reset SAP* user in S/4 HANA or SAP on HANA


Reset SAP* user when SAP is running on HANA Database

We are aware of the process to reset SAP* user in other SAP databases such as Oracle, MSSQL, Sybase etc.

This Blog contains the  information to get the sap* user unlocked when your are running SAP on HANA database.

Step 1. Get the DB schema name. Login to SAP system and then
                                                            Go to System -> Status




Pick up the schema user and schema name as shown above.

Here Schema name and user name  is SAPABAP1 


Step 2. Login to HANA studio with SAPABAP1 as a user name 

Right click on Database Connection and click on "Open SQL Console"


Step 3 : Execute Query in SQL console to display user first and then proceed with Update or Delete as needed.

a. Run select query to confirm whether you are on right path or not.

select * from USR02 where bname = 'SAP*' and mandt ='000'



b. Run Update query to Unlock the user by resetting the UFLAG

update USR02 set uflag=0 where mandt='000' and bname='SAP*'


This query will unlock the user SAP* user in client 000
You can do the same for other client or user

c. Run delete query to delete the user SAP* from Client 000 (If you don't know the password)

delete from "SAPABAP1"."USR02" where bname = 'SAP*' and mandt ='000'

Step 4. (Optional) This is for the users who has opted for deletion

Set the value of parameter login/no_automatic_user_sapstar to 0 and restart the SAP instance.

You will be able to access SAP* through pass as a password.


Feel free to contact for any question and concern.

Saturday, 7 June 2014

SAP Router - Installation and Configuration of SAP Router in Linux and Windows


SAP Router - Installation and Configuration in Linux and Windows

Step 1. Download newest version of SAPCAR, SAProuter xx.SAR  and  Cryptographic library from SAP Service marketplace https://support.sap.com/en/tools/connectivity-tools/saprouter.html


 Step 2 . Create a sub-directory saprouter in the location
For Windows : <drive>:\usr\sap     {i.e. E:\usr\sap\saprouter}

For Linux :   /usr/sap      {i.e. /usr/sap/saprouter}


and save all the SAR files (Downloaded in Step 1) in this directory.


Step 3 .
 Extract all SAR files using the command

SAPCAR.EXE  -xvf  <path of SARfilexxx.sar>

Example

Now, you have all required files and binaries in /usr/sap/saprouter

Step 4.
Set the the environment variable :
Windows :
SECUDIR=drive:\usr\sap\saprouter
LD_LIBRARY_PATH=drive:\usr\sap\saprouter
SNC_LIB=drive:\usr\sap\saprouter\libsapcrypto.so

Linux :
SECUDIR=/usr/sap/saprouter
LD_LIBRARY_PATH=/usr/sap/saprouter
SNC_LIB=/usr/sap/saprouter/libsapcrypto.so

Step 5.
Go through this link  https://support.sap.com/en/tools/connectivity-tools/saprouter.html
to Generate the SAProuter certificate.
Click on Apply Now Icon as shown in below mentioned figure.


 Step : 6 Generate certificate request at OS level using the command sapgenpse

-> sapgenpse get_pse -v -r certreq -p local.pse "your DN"

Example Command :
sapgenpse get_pse -v -r certreq -p local.pse "CN=hostname, OU=0000123456, OU=SAProuter, O=SAP, C=DE"

It will ask for a PIN enter the PIN and then press Enter.

Sample Output of Previous Command:

Got absolute PSE path "/usr/sap/saprouter/local.pse".
Please enter PSE PIN/Passphrase: ****
Please reenter PSE PIN/Passphrase: ****

!!! WARNING: For security reasons it is recommended to use a PIN/passphrase
!!! WARNING: which is at least 8 characters long and contains characters in
!!! WARNING: upper and lower case, numbers and non-alphanumeric symbols.

 Supplied distinguished name: "CN=hostname, OU=000123456, OU=SAProuter, O=SAP, C=DE"
 Creating PSE with format v2 (default)
 succeeded.
 certificate creation... ok
 PSE update... ok
 PKRoot... ok
Generating certificate request... ok.
Certificate Request:
 Signed Part:
  Subject:                             CN=hostname, OU=000123456, OU=SAProuter, O=SAP, C=DE
  Key:                                 rsaEncryption (2048 bits)
  Attributes:                          None
 Signature:
  Signature algorithm:                 sha256WithRsaEncryption (1.2.840.113549.1.1.11)
  Signature:                           <Not displayed>


As an Output this command creates  certreq file .
Open the certreq file in any text editor. Now copy the content of this  file and paste into the text box below the heading  Insert the Certificate Signing Request . You will get that window after Click on Apply now as mentioned in above picture.

Step 5 (Refer below mentioned figure)
                                                            
Now Click on Request Certificate .

You will get the certificate on the next screen in similar text field but the text
will look like
-----BEGIN CERTIFICATE-----
MIIIdAYJKoZIhvcNAQcCoIIIZTCCCGECAQExADALBgkqhkiG9w0BBwGggghJMIIDB
.
.
.
.
.

cGl17YC0GOnY8Ms3Hh6SWCdKLjmmsNg1Ya9k7ZeQE2bu08MACw7LD0pmp1sYfSXst
vMHJzvtpEZnH8RkYCvmyGbAKTbNuMQA=
-----END CERTIFICATE-----
This is your new certificate save as the whole content into file named as srcert

Step 7 : Import the certificate  
Run the following command to import the certificate

->sapgenpse import_own_cert -c srcert -p local.pse

Run the following command to get the information such as Issuer, S.no, Validity etc
-> sapgenpse get_my_name


Step 8 : Need to create the user credential for who will administer the sap router

->sapgenpse seclogin -p local.pse -O saprouter

This will create the file cred_v2

Step 9:  Start and Stop of Sap Router


Command to start the SAProuter :

-> saprouter -r -G routerlog -S 3299 -K "p:CN=hostname, OU=0000123456, OU=SAProuter, O=SAP, C=DE"

Command to start the SAProuter :

-> saprouter -s