A method of a quick nightly refresh of a training, stress testing
or conversion testing system.
We create a compressed backup to disk once, and then do a regular
automatic restore every night using this backup. The compressed
backup is about 20% of the original db. size. The backup uses 5
parallel streams to 5 devices. On a medium sized UNIX server
the backup takes about 90 minutes, the restore takes 50 minutes.
During the restore and backup the CPU is 100% utilized.(compressing)
It is quite a robust procedure.
THE BRBACKUP/BRRESTORE PARAMETER FILE (init.refresh):
########################################################################
# #
# SAP backup to disk, restore from disk #
# #
########################################################################
backup_mode = full
backup_type = offline
backup_dev_type = disk
backup_root_dir = (?/backup1, ?/backup2, ?/backup3, ?/backup4, ?/backup5)
compress = yes
compress_cmd = "compress -c $ > $"
uncompress_cmd = "uncompress -c $ > $"
compress_dir = (?/backup1, ?/backup2, ?/backup3, ?/backup4, ?/backup5)
cpio_disk_flags = -pdcu
exec_parallel = 5
*************************************************************************
BACKUP FROM COMMAND LINE:
brbackup -p /oracle/SID/dbs/init.refresh
*************************************************************************
THE RESTORE SCRIPT (scheduled from crontab):
# Stop SAP
su - SIDadm -c "stopsap_hostname_00"
wait
# Send a page to the SAP admin team if SAP does not stop
if [ -f /oracle/SID/dbs/sgadefSID.dbf ];then
/opt/telalert/bin/telalertc -i admingroup -m Failure to stop SID
exit 0
else
# Remove the db. components
find /oracle/SID -name "*.data[123456789]" -exec rm -f {} \;
find /oracle/SID -name "*log*m*dbf" -exec rm -f {} \;
find /oracle/SID -name "cntrl*.dbf" -exec rm -f {} \;
wait
# Do a restore
su - oraSID -c "brrestore -m full -p /oracle/SID/dbs/init.refresh \
-c -b bcxwxjyd.afd"
wait
# Insert some error handling code here!
# Start SAP
su - SIDadm -c "startsap_hostname_00"
# Insert some error handling code here!
fi