Comprehensive data protection for all workloads
stuartmacgreen
Expert
Posts: 149
Liked: 34 times
Joined: May 01, 2012 11:56 am
Full Name: Stuart Green
Contact:

Re: Create a MAXDB (SAP) backup

Post by stuartmacgreen » 4 people like this post

@Jurbat

Sure here is what we are running with.

/usr/sbin/pre-freeze-script

Code: Select all

# VMware Tools Freeze Script
# FILE: /usr/sbin/pre-freeze-script
# Script is owned by root:root and 755 perms

# Special Freeze script for SAP ONEDB instances.
# DEC 2020

DBSID=AXE
DBADMUSER=axeadm

export SNAP=/var/log/snap
NOW=$(date +"%F %a %T")
echo "---------------------------------------------" >> $SNAP
echo "$NOW  [START FREEZE $DBSID ]" >> $SNAP

sudo -i -u $DBADMUSER <<BOF_M 2>&1
dbmcli -d $DBSID -u CONTROL,p_a_s_s_w_o_r_d -i /home/$DBADMUSER/backup_begin_for_veeam.sh
BOF_M
##end
Create a .sh shell script file /home/$DBADMUSER/backup_begin_for_veeam.sh
For ease of next few lines enter the following at the linux CLI

Code: Select all

export DBADMUSER=axeadm
Prepare the shell script

Code: Select all

touch /home/$DBADMUSER/backup_begin_for_veeam.sh
chown $DBADMUSER:sapsys /home/$DBADMUSER/backup_begin_for_veeam.sh
chmod 750 /home/$DBADMUSER/backup_begin_for_veeam.sh
vi /home/$DBADMUSER/backup_begin_for_veeam.sh
backup_begin_for_veeam.sh

Code: Select all

# Script called from VMware Tools freeze
background_server_start AXE_HOSTNAME
background_server_execute AXE_HOSTNAME db_connect
background_server_get_reply AXE_HOSTNAME -wait
background_server_execute AXE_HOSTNAME backup_start AXE_SNAP data
background_server_get_reply AXE_HOSTNAME -wait

/usr/sbin/post-thaw-script

Code: Select all

# VMware Tools Thaw Script
# FILE: /usr/sbin/post-thaw-script
# Script is owned by root:root and 755 perms

# Special Thaw script for SAP ONEDB instances.
# DEC 2020

DBSID=AXE
DBADMUSER=axeadm

export SNAP=/var/log/snap
NOW=$(date +"%F %a %T")
echo "$NOW  [START THAW $DBSID ]" >> $SNAP
echo "---------------------------------------------" >> $SNAP

sudo -i -u $DBADMUSER <<BOF_M 2>&1
dbmcli -d $DBSID -u CONTROL,p_a_s_s_w_o_r_d -i /home/$DBADMUSER/backup_end_for_veeam.sh
BOF_M
##end
Prepare the shell script

Code: Select all

touch /home/$DBADMUSER/backup_end_for_veeam.sh
chown $DBADMUSER:sapsys /home/$DBADMUSER/backup_end_for_veeam.sh
chmod 750 /home/$DBADMUSER/backup_end_for_veeam.sh
vi /home/$DBADMUSER/backup_end_for_veeam.sh
backup_end_for_veeam.sh

Code: Select all

# Script called from VMware Tools thaw
background_server_execute AXE_HOSTNAME backup_finish AXE_SNAP ExternalBackupID OS_SAP_AXE_DB
background_server_get_reply AXE_HOSTNAME -wait
background_server_exit AXE_HOSTNAME

My SAP Basis guy is happy with the workings of this. Restores tested etc.

replace with your own SID and sidadm and also p_a_s_s_w_o_r_d
Post Reply

Who is online

Users browsing this forum: Bing [Bot], chris.childerhose, lando_uk, RobMiller86 and 126 guests