Thursday, September 23, 2021

SAP system is not responding - Log Volume is full & HANA DB.

 Log Volume is full & HANA DB, SAP system is not responding the follow the below steps to resolve the issue.


If we manually remove some file from the directory, data loss will happen & Hana system won't cam up after that. Recovery is the only option if we remove the file manually.

Issue - /hana/log - 100%

Solution -

Ø  Stop HANA DB
       HDB Stop 

Ø  Go to /hana/log/SID/mnt0001
      default location - /usr/sap/SID/global/hdb/log/mnt0001

 Ø  Move one volume temporarily that having more than 2 GB to another location  where  enough space is available.
  
   To start Hana DB at least 2 GB space is required, 
   Check the folder size using - du -ksh *

 Ø  Move a volume which consumes 2 GB of space 
       eg - hdb0002

      mv hdb0002 /usr/sap/SID/global/hdb/data
      or
      mv hdb0002 /hana/backup/SID (if you are using separate volume for log)

 Ø Create symbolic link to the new folder in the old location

    In -s hdb0002 /usr/sap/SID/global/hdb/data/hdb0002      /usr/sap/SID/global/hdb/log/mnt0001 /hdb0002 

 Ø  Start the HANA Database
        HDB start

 Ø   Wait until log backup are performed 

 Ø   Use the following SQL command to clean up the log volume 

    ALTER SYSTEM RECLAIM LOG;

 Ø   Stop the HANA database & Remove the symbolic link

    rm -f /usr/sap/SID/global/hdb/log/mnt0001 /hdb0002 

 Ø   Move  the log volume back to the original location

    mv hdb0002 /usr/sap/SID/global/hdb/log/mnt0001 

 Ø   Start the HANA Database again

    Now the Volume size will be fine.

Reference - SAP note 1679938

Renewing SAPRouter Certificate...

 Check the saprouter validity date using the below command,


./sapgenpse get_my_name -n validity

If it expired follow the below steps to renew the saprouter certificate,

1. Take a backup & delete the following files from saprouter folder

    certreq
    cread_v2
    local.pse
    srcert

2. Create a file with name certreq

     Run the below command to generate new certificate request,

./sapgenpse get_pse -v -r certreq -p local.pse “<Distinguished Name>”

3. Go to the SAP Service marketplace & go to Router option using below link,

https://support.sap.com/en/tools/connectivity-tools/saprouter.html

Click on "Apply for a SAProuter certificate"

4. Select SAProuter Distinguished Name & Click on option "Submit CSR",

5. Copy the text from 'certreq1' & past in the window, Click on "Request Certificate",

6. Copy the new text got from the window,

    Create a file with name - srcert
    save the text to the 'srcert' file

7. Install the certificate by running the below command,

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

8. Create the credentials for the SAProuter with below command,

   ./sapgenpse seclogin -p local.pse  -O <user>

9. Check the Certificate has been imported successfully using below command,

  ./sapgenpse get_my_name -n Issuer

10. verify the Validity Date using following command,

./sapgenpse get_my_name -n validity

SAP Router (Windows Server) Configuration.

 1.  Download the latest saprouter from the Marketplace,


Ø Login to the SAP Support Portal with the S-user ID which is assigned to your installation
Ø  Use the latest SAProuter version, which can be downloaded from the SAP Software Download Center
Ø  Support Packages & Patches 
Ø  A-Z Alphabetical List of Products 
Ø  S
Ø  SAPROUTER
Ø  SAPROUTER (latest version)
Ø  your preferred O.S. version
Ø  saprouter_XXX-XXXXXXXX.sar


2.  Download the latest SAP Cryptographic Library from the SAP Software Download Area,

Ø  Support Packages & Patches
Ø  A-Z Alphabetical List of Products
Ø  S
Ø  SAPCRYPTOLIB
Ø  COMMONCRYPTOLIB (latest version)
Ø  your preferred O.S. version
Ø  SAPCRYPTOLIBP_XXXX-XXXXXXXX.SAR

3. Executing the commands,

 ·   SAPCAR  -xvf saprouter_XXX-XXXXXXXX.sar will unpack the following files:
saprouter[.exe]

·    SAPCAR  -xvf SAPCRYPTOLIBP_XXXX-XXXXXXXX.SAR will unpack the following files:
[lib]sapcrypto.[dll|so|sl]
sapgenpse[.exe]


4. Create the new folder,

(e.g. /usr/sap/saprouter).  Copy the file that we are extract through SAPCAR


5. Set the environment variables for SNC_LIB and SECUDIR,

My computer (right click)---> properties---> advanced system setting ----> advanced ---> environment variables ---> new 

SECUDIR---> path  till saprouter folder
SNC_LIB----> path till sapcrypto.dll


6. Create saprouttab  file in saprouter folder in file format,

7. Download the Distinguished Name from the SMP,

www.service.sap.com/saprouter-sncadd


Distinguished Name------> CN=pamserver, OU=0001400618, OU=SAProuter, O=SAP, C=DE

8. Create “certreq” file,

Now create a “certreq” file  in the  file format  in saprouter folder

9. Request for router license,

Enter the command on the command prompt
Sapgenpse get_pse -v -r certreq -p local.pse “<Distinguished Name>”
eg : Sapgenpse get_pse -v -r certreq -p local.pse “CN=sapserver, OU=xxxxxxxxxx, OU=SAProuter, O=SAP, C=DE”


Now open the certreq file with notepad


Copy the text and past it into the marketplace


Click on Request Certificate 


Copy the text in the executed page

10. Create “srcert” file in the file format in the saprouter folder,

 Past the copyed text in the “srcert” file

11. Import the certificate using the below command,  

sapgenpse import_own_cert -c srcert -p local.pse


Confirm that the import was successful
e.g: CA-Response successfully imported into PSE "/usr/sap/saprouter2/local.pse"

9. Create credentials for your PSE and secure your credentials file,

sapgenpse seclogin -p local.pse -O <user_for _SAProuter>

 eg : sapgenpse seclogin –p E:\usr\sap\saprouter\local.pse –O administrator
 Type in your PIN/Passphrase when prompted
 This generates the cred_v2 file


10. Check the command,

sapgenpse get_my_name -v -n Issuer
This should result to
Issuer  : CN=SAProuter CA, OU=SAProuter, O=SAP Trust Community II, C=DE


11. Now we need to maintain the details in the saprouttab file,

Model from SAP Marketplace :


Eg:


12. Download the CA certificate from SAP note 2131531,


Download the object from the sap note  (last of the not)
Copy   smprootca.der  in to the saprouter folder

 Import the certificate
 sapgenpse maintain_pk -a smprootca.der -p local.pse

13. SAProuter service creation,

Enter  this command to the saprouter service creation

sc.exe create SAPRouter binPath= "saprouter.exe service -r -W 60000 -R saprouttab -K ^p:CN=sapserver, OU=xxxxxxxxxx, OU=SAProuter, O=SAP, C=DE^" start= auto obj= "NT AUTHORITY\LocalService"

Eg: sc.exe create SAPRouter binPath= "E:\usr\sap\saprouter\saprouter.exe service -r -W 60000 -R E:\usr\sap\saprouter\saprouttab -K ^p:CN=sapserver, OU=xxxxxxxxxx, OU=SAProuter, O=SAP, C=DE^" start= auto obj= "NT AUTHORITY\LocalService"


Then goto -----> Services
Right click on SAProuter service----> Propertice-----> logon
Type the user of saprouter and password


 Then goto “regedit”
 (Search on the system)

HKEY_LOCAL_MACHINE -----> SYSTEM -------> Services -------> saprouter ------>  double Click on image path



Remove the  “^”


14. Starting SAProuter,


15. Goto OSS1,

Parameter-----> Technical Setting
Fill the entries for the OSS connection


15.Goto SM59,

Select  ABAP Connections-----> Double click on SAPOSS------->  Connection Test


It show no errors in your Router Connection