In today's data-driven world, ensuring the integrity and availability of critical business information is paramount. SAP ASE databases, the cornerstone of many SAP systems, hold immense value and require a robust backup and restore strategy to safeguard against data loss or system disruptions. Google Cloud disk snapshot can be used to perform seamless SAP ASE database backup and restore.
SAP ASE Database Backup using Google Cloud disk snapshots can provide the following benefits:
Before taking a storage snapshot copy, the database is put into a consistent state by quiescing the user database and master database. The following steps show how to perform database backup by using a disk snapshot.
The commands QUIESCE DATABASE simply put the database in a state that allows an external backup of the database device files.
The QUIESCE DATABASE command blocks all write accesses to the database(s) and synchronizes the contents of the data cache(s) with the database devices on disk. Users connected to the database remain online and can perform read operations. Write operations are blocked until the DBA releases the database(s). Alternatively, PREPARE DATABASE command can be used to avoid blocking of write operation.
Log on to SAP ASE as user sapsa and quiesce all non-temporary databases.
quiesce database <tag-name> hold master, model, <DBSID>, saptools, , sybsystemprocs, sybmgmtdb for external dump
go
Replace <DBSID> and <tag-name> in the above command with the name of your SAP database and some identifier for backup as tag name respectively.
Perform the disk snapshot of the persistent volume to back up all the databases in quiesced mode. Perform disk snapshot for all data and log devices.
Snapshots can be created from disks, even while they are attached to running instances. Snapshots are global resources, so they can be used to restore data to a new disk.
Review the instructions to take the snapshot in the link here.
gcloud compute snapshots create <snapshot-name> \
--source-disk <source-disk-name> \
--snapshot-type <snapshot-type> \
--source-disk-zone <source-zone>
Execute the following SQL command to release the quiesced databases to read/write access, after the external backup command has finished.
quiesce database <tag_name> release
go
Schedule the automatic log backup to disk or FileStore Enterprise as per SAP Note - 1588316
Perform restore of SAP ASE databases using disk snapshot as per below.
Create a persistent disk from the Google Cloud storage snapshot.
For more information on how to create a disk from a snapshot, see the link here.
Start the SAP ASE in quiesce mode with the command line option ‘-q’ and apply transaction log dumps that have been saved after the databases were quiesced.
Example:
cd $SYBASE/$SYBASE_ASE/install
echo "-q \" >> RUN_<SERVER>
restart the server
startserver -f RUN_<SERVER>
startserver -f RUN_<SERVER>_BS
If applicable, load the transaction log dumps to the SAP database using the command LOAD TRANSACTION.
Login to SAP ASE database using isql and run below commands
load transaction <DBNAME> from "/path"
Finally set all databases online using the SQL command:
online database <DBNAME>
go
Restart the SAP ASE server after removing the -q option from the RUN_<SERVER> file.
1588316 - SYB: Configure automatic database and log backups
3338972 - Client running QUIESCE DATABASE does / does not output status messages - SAP ASE
1887068 - SYB: Using external backup and restore with SAP ASE
2613297 - QUIESCE DATABASE: Waiting for at least one transaction in 'master' database to complete - SAP ASE
Thanks for reading. If you have any questions, please leave a comment below!
Authored by: