Previous Topic: Discover Nodes Using a ScriptNext Topic: Create the Scripts to Back Up MySQL Database


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:

You can specify the scripts to run on the Oracle Database nodes in Pre/Post Scripts Settings of the Backup Wizard.

Follow these steps:

  1. Log into the Backup Server as a root user.
  2. 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.

  3. 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.

  4. Provide the execution permission to both the scripts.
  5. Place both scripts at the following location:
    /opt/CA/d2dserver/usr/prepost/
    
  6. Log into the Arcserve UDP Agent (Linux) web interface.
  7. Open the Backup Wizard and navigate to the Advanced tab.
  8. In the Pre/Post Scripts Settings option, select the pre-db-backup-mode.sh script file from the "Before snapshot is taken" dropdown list.
  9. In the Pre/Post Scripts Settings option, select the post-db-backup-mode.sh script file from the "After snapshot is taken" dropdown list.
  10. Submit the backup job.

    The backup job is submitted.

The scripts are created to back up Oracle Database.

Note: Arcserve UDP Agent (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 UDP Agent (Linux).