Create the Scripts to Back Up Oracle Database
You can create scripts that you use to back up your Oracle Database. You do not have to stop your database to perform a backup. Verify that the database is in the archive log mode. If it is not in the archive log mode, then change the database to the archive log mode before you back up the database. You create the following two scripts to back up Oracle Database:
- pre-db-backup-mode.sh - This script prepares and keeps the entire database in the backup mode.
- post-db-backup-mode.sh - This script removes the database from the backup mode.
You can specify the scripts to run on the Oracle Database nodes in Pre/Post Scripts Settings of the Backup Wizard.
Follow these steps:
- Log into the Backup Server as a root user.
- Create the pre-db-backup-mode.sh script using to the following code:
#!/bin/bash
orauser="oracle"
orasid="orcl"
su - ${orauser} << BOF 2>&1
export ORACLE_SID=$orasid
sqlplus /nolog << EOF 2>&1
connect / as sysdba
alter database begin backup;
exit;
EOF
BOF
Note: Specify the value for orauser and orasid variables as defined in your Oracle Database.
- Create the post-db-backup-mode.sh script using the following code:
#!/bin/bash
orauser="oracle"
orasid="orcl"
su - ${orauser} << BOF 2>&1
export ORACLE_SID=$orasid
sqlplus /nolog << EOF 2>&1
connect / as sysdba
alter database end backup;
exit;
EOF
BOF
Note: Specify the value for orauser and orasid variables as defined in your Oracle Database.
- Provide the execution permission to both the scripts.
- Place both scripts at the following location:
/opt/Arcserve/d2dserver/usr/prepost/
- Log into the Arcserve Unified Data Protection Agent for Linux web interface.
- Open the Backup Wizard and navigate to the Advanced tab.
- In the Pre/Post Scripts Settings option, select the pre-db-backup-mode.sh script file from the "Before snapshot is taken" dropdown list.
- In the Pre/Post Scripts Settings option, select the post-db-backup-mode.sh script file from the "After snapshot is taken" dropdown list.
- Submit the backup job.
The backup job is submitted.
The scripts are created to back up Oracle Database.
Note: Arcserve Unified Data Protection Agent for Linux supports the volume level snapshot. To ensure the data consistency, all data files of the database must be on one volume.
To restore the Oracle database, see How to Restore an Oracle Database Using Arcserve Unified Data Protection Agent for Linux.