PT Sterling Tulus Cemerlang
www.sterling-team.com

Whatsapp
+62-877-8655-5055

Email
sales-enquiry@sterling-team.com

Address
Sampoerna Strategic Square
South Tower Level 30
Jl Jend. Sudirman No. 45-46
Jakarta 12930 – Indonesia

500+ FREE Tips SAP Business One for you to Become SAP B1 Super User from Sterling Tulus Cemerlang (STEM)

HANA Housekeeping Using Python Script

SAP Business One Tips - STEM SAP Gold Partner Indonesia - Setup Automate Housekeeping on HANA Server with Phyton Script for SAP B1

The following tips will provides you a new knowledge about how to do an automated housekeeping job for your HANA server. These tips will be very useful for clean up your database logs, traces, alerts, internal events, etc.

Please follow these steps:

  1. Create Database Role and Database User to perform housekeeping
  2. Open terminal in Linux (or use Putty from Windows), and connect to HANA Linux Server using root. Execute commands below:
  3. Back to terminal, using root, change directory to / , and execute command below:
    Then, type in the following:Adjust the directory to your own HANA System directory for trace files, and save this file using command :wq!
  4. Create directory hanacleaner_history on directory /usr/sap and change its ownership into ndbadm:sapsys using command below:

    cd /usr/sap
    mkdir hanacleaner_history
    chown ndbadm:sapsys hanacleaner_history
  5. Download files from link : HERE 
    In those downloaded zip file, copy hanacleaner.py file to HANA Linux Server in directory:
    /usr/sap/NDB/HDB00/exe/python_supportChange hanacleaner.py ownership to ndbadm:sapsys
    Edit hanacleaner.py file, check parameters in lines 918, 921, and 964:Line 918 : zipBackupPath = cdalias(‘cdtrace’)Line 921 : dbuserkeys = [“HANACLEANER1KEY”] à Key stored in hdbuserstore in step 2 above.Line 964 : ignore_filesystems =  “”  –> Fill this “” using fullpath of filesystems that are 100% used (such as iso mounted filesystems)

    Save this file after you finished.

  6. Copy hanacleaner.sh from downloaded file (step 5 above) to HANA Linux server in any directory, such as /home/Schedule_Script/ and change its ownership to ndbadm:sapsys , and change this file into executable file using command chmod 777 hanacleaner.sh

    Edit this file, and adjust its parameter to your own policy.
    To learn more about this parameter, please check file hanacleaner.pdf in downloaded file (step 5 above).
  7. Edit crontab for user ndbadm, in directory /etc using command crontab -u ndbadm -e
    Insert this line into crontab for example:
    0 6 * * * /home/Schedule_Script/hanacleaner.sh
    This schedule will run using ndbadm as executor, every 6 AM in the morning, file hanacleaner.sh will be executed.
    To execute hanacleaner.sh manually, you must change user into ndbadm using command su ndbadm and execute hanacleaner.sh using command ./hanacleaner.sh, and it will write an output file in /usr/sap/hanacleaner_history/ directory each time it’s executed.

Also read:

Run Your Business With The Piece of Mind Using SAP Business One

This article was written by PT. Sterling Tulus Cemerlang
More details about SAP Business One,
email to: sales-enquiry@sterling-team.com or call +6221-5806336 or wa +6287786555055

, , ,