IT-Conductor Blog

SAP Basis Automation of HANA Backup and Cleanup

Posted by Terry Kempis on Aug 2, 2017 5:25:59 PM

 Automate Your SAP Basis and IT Operations Processes with IT-Conductor

It's cool if you can perform SAP monitoring and SAP HANA monitoring without installing an army of agents, but that's not enough, we want to enhance SAP Basis Automation using Cross-platform automation capabilities.  Whether you want to automate system copy post-processing with our SID-Refresh tool, or manage backups, it's easy once you are monitoring SAP with IT-Conductor.  The IT operations automation possibilities for the Basis team are limitless once customers realize up to 90% saving in the time and cost over traditional SAP monitoring solutions.

In this article we'll demonstrate HANA backup integration as well as cleanup of old backups.  These same principles and processes can be applied to other databases such as Oracle, SAP ASE, etc.


  1. Creating backup of HANA databases (single or multi-tenant) utilizing the ITC advanced feature ‘SQL Jobs’ presented in  ‘Advanced SAP Monitoring Features by IT-Conductor’.
  2. Clean-up of catalog and files of older backups, using hdbsql and Linux’s crontab for scheduling. Note – future release of ITC will includes ssh feature which allows scheduling of task within ITC, instead of using crontab.

Creating HANA backup within IT-Conductor

In each HANA database (SYSTEMDB, tenant DBs) defined within IT-Conductor, create an SQL backup job

IT-Conductor SAP Basis Automation HANA Backup Create SQL Job

SQL backup job – General section

IT-Conductor SAP Basis Automation HANA Backup Create SQL Job - General Section

SQL backup job – Activity section

IT-Conductor SAP Basis Automation HANA Backup Create SQL Job - Activity 1

IT-Conductor SAP Basis Automation HANA Backup Create SQL Job - Activity 2

SQL backup job –SQL query section

IT-Conductor SAP Basis Automation HANA Backup Create SQL Job - SQL

Notification via Email on SQL job completion

Since a backup can run varying amount of time depending on the size and capacity of the system, we recommend to backup in 'ASYNCHRONOUS' mode.  Thus the Email notification simply notifies that the backup has been submitted, and the remainder of the query continued.  Backup status would need to be checked separately later via a SQL report on the backup catalog.  In the example used here we provide the information about the last few successful backup to show historical backup time/duration and size so you can estimate how long the current backup will run.  IT-Conductor can string together multiple activities into a single process, which can check on the status of the predecessor activity.  This was demonstrated in prior blog post listed in the intro.

IT-Conductor SAP Basis Automation HANA Backup Create SQL Job - Notification

Backup cleanup

Maintaining a clean backup repository / catalog as well as the backup space is just common sense best practices for housekeeping.  This is easier said than done and many customers ignore to manage this task until they get notices of issues like backup space, failed backups, or just slow backup due to large catalog and target backup directory.

The following SQL deletes backups from the backup catalog and from the file system


To simplify and automate the process, a simple script was developed/used to

  1. Generate the SQL command with the desired backup_id
  2. Execute the generated SQL command

Preliminary steps

For each tenant database,

  1. Create backup user-id with backup and read-catalog privileges
  2. Store the backup user-id’s connection information using hdbuserstore

In this example, the system has three databases

  • SYSTEMDB – the system DB
  • HDB – tenant DB
  • XYZ – tenant DB

IT-Conductor SAP Basis Automation HANA Backup - Cleanup

Backup clean-up script

A backup clean-up script is created for each DB, with naming format ‘backup_cleanup_<dbname>.csh. Basically, it contains some validation and the two general steps

  1. Generate the SQL backup catalog delete command
    IT-Conductor SAP Basis Automation HANA Backup - Cleanup Catalog
    The generated SQL statement in XYZ_ID will contain below
    IT-Conductor SAP Basis Automation HANA Backup - Cleanup SQL
  2. Execute the cleanup/deletion with the following
    IT-Conductor SAP Basis Automation HANA Backup - Cleanup Command

Crontab for the clean-up tasks

Schedule the clean-up job using crontab.  For a better solution, we can use IT-Conductor ssh job feature of OS monitoring to incorporate shell script automation.

IT-Conductor SAP Basis Automation HANA Backup - Scheduling


Of course you can always pay for 3rd party SAP certified backup solutions that integrate with databases like as SAP HANA, such as Commvault, EMC, Veritas (Symantec), etc.  IT-Conductor can integrate with such systems via API if required, but keeping things simple by integrating built-in SAP HANA backup capabilities with a central monitoring and automation platform helps streamline IT operations.

SAP Basis Automation brings DevOps benefits to managing enterprise IT including:

  • Centralized repository of system administration scripts for the application and technology stack
  • Cross-platforms automation
  • Batch schedule management
  • Monitored execution logs
  • Centralized operations reporting

Since IT-Conductor is a cloud-based service, you too can start automating many tasks (FREE for the first 2 SAP Systems connected, remember there is no complex software installation needed, so just subscribe and give it a try).  We would love your feedback also of tasks that you'd like to see automated, yes we'd love the challenge, so SAP Basis, Let's Automate IT!

Send us your wish-list to or comment below!

If you think our Automation is cool, try our cloud-based SAP Monitoring, FREE for the first 2 SAP SID's

Let's Automate!


Terry Kempis

Written by Terry Kempis

Terry is a Senior SAP Basis Engineer with 15 years expertise working with very large SAP infrastructure (more than 230 SAP SIDs). He specializes in areas of performance, upgrades, unicode conversion, installation, DB2, BW, TREX and HANA migrations.

Topics: SAP HANA Monitoring, SAP HANA, SAP Basis Automation

FREE IT-Conductor Trial to Monitor SAP

Posts by Topic

see all

Recent Posts

Subscribe to Email Updates