Introduction :
This blog will provide you the shell script to schedule MaxDB automatic backup with Linux OS. I have also explained how to create a DATA backup catalogue as well.
Contents in this blog :
- Creating a DATA backup catalogue for Maxdb database
- Script for automatic backup of Maxdb DATA
Steps to create a DATA backup catalogue :
- Login to the DBMCLI utility using control user or higher privilege user.
./dbmcli -d <SID> -u control,<PASSWORD>
- Command for creating a DATA backup template
Backup_template_create <datatemplatename> to file </location/filename> CONTENT DATA
Shell Script for automatic backup of MaxDB DATA backup
#!/bin/bash
# Define the dynamic file name
BACKUP_DIR="/maxdbbackup"
DATE=$(date +"%d-%m-%Y")
#Defining location and name of backup file with date & time
BACKUP_FILE="${BACKUP_DIR}/SID-DBBackup-${DATE}"
# MaxDB commands
/sapdb/SID/db/bin/dbmcli -d <SID> -u control,<password> <<EOF
backup_template_create DBACK TO FILE ${BACKUP_FILE} CONTENT DATA
db_connect
backup_start DBACK
EOF
In the above script, the below can be modified according to your system
DBBACK --> data backup template
Use this script with Cronjob schedule in linux with the required frequency according to your need.