sap.sap_operations.hana_backup module – Create SAP HANA database file backup

Note

This module is part of the sap.sap_operations collection.

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install sap.sap_operations.

To use it in a playbook, specify: sap.sap_operations.hana_backup.

New in sap.sap_operations 1.1.0

Synopsis

Parameters

Parameter

Comments

backend

string

Create the backup in the file or using the third-party backup tool with BACKINT interface.

Choices:

  • "FILE" ← (default)

  • "BACKINT"

binary_path

string

Path to hdbsql binary.

Default: ""

comment

string

Comment to be included into backup.

Default: ""

database_name

string

SAP HANA system tenant or SYSTEMDB to backup. If not provided SYSTEMDB is default value. From SYSTEMDB other tenants can be backed up. From tenant only itself can be backed up.

Default: "SYSTEMDB"

database_user

string

A user which to be used to connect to database. SYSTEM user is used if no user is specified.

database_user_password

string

Password for HANA SYSTEM database user. Or a user specified in database_user parameter.

destination

string

Directory where where backup data are stored for file backups. <hanasid>adm user should have write permissions to that directory.

Default: ""

hdbsqluserstore_key

string

hdbuserstore record to be used to connect to database.

host

string

Name of the host on which the database instance is running.

instance_number

string

Instance number of the database engine.

prefix

string

The data backup files are prepended with the prefix.

Previous backup files will be overwritten if prefix was already used before (for file backups).

Default: ""

tooloption

string

String that is forwarded to the third-party backup tool.

This parameter is used only in case type is BACKINT.

type

string

Backup type.

Delta backups can only be created after a data backup has been created.

Choices:

  • "INCREMENTAL"

  • "DIFFERENTIAL"

  • "FULL" ← (default)

wait

boolean

Wait for the operation to complete before returning.

If set to true, module will wait on backup task to complete.

If set to false, module will schedule the backup task and return immediately.

Please be aware you cannot run two backups in parallel for one SAP HANA database.

Choices:

  • false

  • true ← (default)

See Also

See also

sap.sap_operations.hana_backup

Create SAP HANA database file backup.

Examples

---
- name: Fetch the binary path of the hdbsql
  sap.sap_operations.parameter_info:
    instance_number: "00"
    name: DIR_INSTANCE
  register: dir_instance

- name: Create a full HANA backup for SYSTEMDB
  sap.sap_operations.hana_backup:
    database_user_password: CHANGEME
    prefix: MONDAY
    database_name: SYSTEMDB
    binary_path: "{{ dir_instance.parameter_value | first }}"

- name: Create a full HANA backup for RHE tenant
  sap.sap_operations.hana_backup:
    database_user_password: CHANGEME
    prefix: MONDAY
    binary_path: "{{ dir_instance.parameter_value | first }}"

- name: Create a full HANA backup for RHE tenant - all options used
  sap.sap_operations.hana_backup:
    database_user_password: CHANGEME
    database_name: RHE
    prefix: MONDAY
    destination: /backups
    comment: Created with ansible
    binary_path: "/my/custom/path"
    wait: false

Authors

  • Ondra Machacek (@machacekondra)