Skip to Content

The SAP HANA Academy has published a new video in the series SAP HANA SPS 7 Backup and Recovery.

Backup and Recovery – Backup Configuration Files | SAP HANA

In this video you can view how to generate the ALTER SYSTEM ALTER CONFIGURATION statement for changed parameters.

The SQL file is attached to this document.

SQL.png

Syntax


select 'ALTER SYSTEM ALTER CONFIGURATION  ('''|| file_name ||''', '''||
        case layer_name
            when 'SYSTEM' then layer_name
            when 'HOST' then layer_name ||''', '''|| host
        end ||
        ''') SET ('''|| section ||''', '''|| key ||''') = '''||value ||''' WITH RECONFIGURE;'
        as "Configuration File Backup"
  from m_inifile_contents
where layer_name != 'DEFAULT'



We also show a simple sample backup script that copies HOST and SID configuration files.

The backup.sh file is attached to this document.


#!/bin/bash
# Simple sample backup script
# SAP HANA Academy
# http://academy.saphana.com
# Twitter: @saphanaacademy
# define backup prefix
TIMESTAMP="$(date +\%F\_%H\%M)"
BACKUP_PREFIX="SCHEDULED"
BACKUP_PREFIX="$BACKUP_PREFIX"_"$TIMESTAMP"
# source HANA environment
. /usr/sap/shared/DB1/HDB01/hdbenv.sh
# execute command with user key
# asynchronous runs job in background and returns prompt
hdbsql -U backup "backup data using file ('$BACKUP_PREFIX') ASYNCHRONOUS"
# create backup directory
BACKUP_DIR="$DIR_INSTANCE/backup"
BACKUP_DIR="$BACKUP_DIR"/INIFILE/"$TIMESTAMP"
SYS_BACKUP_DIR="$BACKUP_DIR/$SAPSYSTEMNAME"
HOST_BACKUP_DIR="$BACKUP_DIR/$VTHOSTNAME"
mkdir -p $BACKUP_DIR $SYS_BACKUP_DIR $HOST_BACKUP_DIR
# copy host configuration files
HOST_INI_DIR="$DIR_INSTANCE/$VTHOSTNAME"
cp $HOST_INI_DIR/*.ini $HOST_BACKUP_DIR
# copy system configuration files
SYS_INI_DIR="$DIR_INSTANCE"
SYS_INI_DIR="$(dirname "$SYS_INI_DIR")"
SYS_INI_DIR="$SYS_INI_DIR/SYS/global/hdb/custom/config"
cp $SYS_INI_DIR/*.ini $SYS_BACKUP_DIR
cp $SYS_INI_DIR/hdbconfiguration_* $SYS_BACKUP_DIR



Finally, we briefly discuss the SAP HANA hdbparam tool, which – for as far as I know – has not yet been documented.

/wp-content/uploads/2014/01/hdbparam_369321.png

SAP HANA Academy

Denys van Kempen

To report this post you need to login first.

5 Comments

You must be Logged on to comment or reply to a post.

      1. Kartik Natarajan

        Hi Denys,

        I haven’t used the above script, but tried with script attached with SAP note 1651055. It didn’t work in my system.

        Regards,

        Kartik

        (0) 
        1. Denys van Kempen

          Hi Kartik,

          I see.

          The note appears to date from the early days of SAP HANA:

          Please note: the script is only intended to demonstrate how backup control could be implemented. The responsibility to implement a backup solution appropriately lies with the implementation team. The script is also not intended to replace other scheduling mechanisms for database backups of SAP HANA Database such as the scheduling calendar of dbacockpit. Support for this script will not be provided via E-Mail or SAP Support tickets. Since its initial release, the script has only been provided by means of a consulting note. If have any questions regarding this script, please make use of the SAP HANA community in SAP Community Network (SCN). Version 4 from November 2014 is the final version of the script. There will not be any further changes.

          Have you studied the script?

          What exactly does not work?

          Why would you want the script for the C-shell?


          Regards,

          Denys

          (0) 
  1. rao sara

    It tells about the Backup interval settings, file based data backup settings and log based data backup setting.

    Recovery of HANA System

    • To recover SAP HANA database, the database needs to be shut down. Hence, during recovery, end users or SAP applications cannot access the database.
    • Recovery of SAP HANA database is required in the following situations −
    • A disk in the data area is unusable or disk in the log area is unusable.
    • As a consequence of a logical error, the database needs to be reset to its state at a particular point in time.
    • You want to create a copy of the database.

    Read More: SAP HANA Backup and Recovery

    (0) 

Leave a Reply