# Age-based HANA Backup Automation

The primary objective of regularly taking backups is to ensure the creation of duplicate copies of data that can be quickly recovered in case of database failure, unforeseen events, or security breaches. These failures can occur for various reasons, including system crashes, hardware or software malfunctions, data corruption, or incidents caused by human error.

By preserving backup copies, organizations can ensure the ability to restore data and recover their databases to a previous state before a database failure occurs. Regular backups are crucial in protecting against data loss and maintaining business continuity.

On the other hand, database backup automation can help to streamline and simplify your backup process. By automating the backups, organizations can achieve consistent and reliable backups without relying on human intervention, reducing the risk of human error and oversight.

Automated backups are a critical component of a comprehensive disaster recovery plan, contributing to Disaster Recovery Preparedness. In the event of data loss or system failure, having up-to-date and automated backups enables organizations to restore their databases following their Recovery Time Objective (RTO) and Recovery Point Objective (RPO), enabling them to quickly resume operations.

IT-Conductor allows users to automate backup processes, which can be instrumental in meeting compliance requirements. By providing a systematic and auditable backup process, the automated backups generated by IT-Conductor can generate logs and reports that serve multiple purposes, including auditing and demonstrating compliance with data protection regulations.

### **Prerequisites** <a href="#pre-requisite-requirements" id="pre-requisite-requirements"></a>

* Add the database to IT-Conductor for monitoring, management, and automation.
* Create a database user with BACKUP ADMIN privilege.
* A [Robot User](https://docs.itconductor.com/user-guide/account-administration/create-robot-users) should be created and associated with the application/DB/OS users with assigned roles/privileges to execute the local action on the system to be stopped/started.

  <figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FEmOPTpaMQJaZN1HUMytC%2Fimage.png?alt=media&#x26;token=c57683e2-c953-45d9-b13c-e8dda4df1d81" alt=""><figcaption><p>Figure 1: Start/Stop Process Definitions</p></figcaption></figure>
* The ownership of the process definition should be assigned to the [Robot User](https://docs.itconductor.com/user-guide/account-administration/create-robot-users).

### **Age-based HANA Backup Automation in Action** <a href="#age-based-hana-backup-automation-in-action" id="age-based-hana-backup-automation-in-action"></a>

IT-Conductor Backup automation tool offers flexible customization options, allowing organizations to tailor the backup process to their specific needs. This includes defining backup schedules, threshold overrides, and custom recovery activities.

The backup is triggered each time the age of the last complete backup exceeds the specified time in the threshold override.

#### Defining Backup SQL Script <a href="#defining-backup-sql-script" id="defining-backup-sql-script"></a>

In the context of age-based HANA backups, a backup SQL script is a set of instructions that automates the process of creating backups based on the age of the data in a HANA database.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FsVdkmcucLCPfsJNgC23l%2FBackup%20SQL%20Script.png?alt=media&#x26;token=4dc54bae-3cb6-4a60-8c6c-446824630bc5" alt=""><figcaption><p>Figure 2: Backup SQL Script</p></figcaption></figure>

#### Defining Thresholds and Recovery <a href="#defining-thresholds-and-recovery" id="defining-thresholds-and-recovery"></a>

[Creating Threshold Overrides](https://docs.itconductor.com/users-guide/notifications/creating-threshold-overrides) in IT-Conductor enables the alerting and triggering of recovery actions on monitored systems.

1. Define the threshold override and specify the Age of the last complete backup after which a new backup will be triggered.
2. Select the recovery action and associate the SQL Script with the threshold override.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2F7Dsa33s68VHWOvHrCHZf%2FThresholds%20and%20Recovery%20Configuration.png?alt=media&#x26;token=4667842f-d692-422b-89ad-424d8872ca35" alt=""><figcaption><p>Figure 3: Thresholds and Recovery Configuration</p></figcaption></figure>

#### Executing Backup Automation <a href="#executing-backup-automation" id="executing-backup-automation"></a>

Once the specified Age of the last complete backup elapses, the backup recovery activity is automatically triggered.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FqpQdQUvpiSrwqhynm9Wf%2FAge-based%20Backup%20Chart.png?alt=media&#x26;token=941050d9-91cf-4dc3-a3b2-cda665f91bd5" alt=""><figcaption><p>Figure 4: Age-based Backup Chart</p></figcaption></figure>

When the backup automation initiates, alerts are generated to notify subscribed users.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FyFkgVT5CT6upwcaOOUW8%2FGenerated%20Alerts.png?alt=media&#x26;token=02f3b5fb-8e6b-4ca4-acf9-de725babbfde" alt=""><figcaption><p>Figure 5: Generated Alerts</p></figcaption></figure>

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2F1IgQo931PWSRsAIwywZP%2FRecovery%20Activities%20Launched%20for%20HANA%20Backup.png?alt=media&#x26;token=2021ba0a-0e27-47ed-aea4-b642e6f85bb6" alt=""><figcaption><p>Figure 6: Recovery Activities Launched for HANA Backup</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.itconductor.com/user-guide/automation/age-based-hana-backup.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
