4 Backing Up Protected Databases

This chapter describes how to back up protected databases to Recovery Appliance.

This chapter contains the following topics:

Overview of Backing Up Protected Databases

After you configure the protected database, you can create and schedule protected database backups. Recovery Appliance uses the incremental-forever backup strategy for protected database backups. In this strategy, an initial level 0 incremental backup is followed by successive level 1 incremental backups.

To ensure that you can perform complete recovery for the protected database, include archived redo log files in all backups except when using real-time redo transport. While real-time redo transport sends archive logs to the Recovery Appliance, archive log backup operations of ”not backed up” files is still recommended.

Enterprise Manager Cloud Control (Cloud Control) provides a GUI for creating and scheduling backup jobs. When using the command line, create a script containing the RMAN backup commands required to implement your backup strategy and then schedule this script using any scheduling utility.

Note:

If the protected database is running in NOARCHIVELOG mode, then you must perform consistent backups which requires shutting down the protected database.

Backing Up the Protected Database Using Cloud Control

Cloud Control provides a preconfigured Oracle-Suggested Recovery Appliance Backup that implements the incremental-forever backup strategy for your protected database. Alternately, you can create and schedule full backups, incremental backups, backups of selected tablespaces or data files, or backups of archived redo logs files and control files.

This section contains the following tasks:

Using the Oracle-Suggested Backup Strategy for Protected Databases

The Oracle-Suggested Recovery Appliance Backup strategy is a regularly scheduled, incremental-forever backup strategy that backs up your protected database.

To implement the Oracle-Suggested Recovery Appliance Backup strategy:

  1. Access the home page for the protected database as described in "Accessing the Protected Database Home Page Using Cloud Control".
  2. Ensure that the configuration steps described in "Enrolling the Protected Database with Recovery Appliance (Cloud Control)" and "Configuring Backup and Recovery Settings for Protected Databases (Cloud Control)" are completed.
  3. From the Availability menu, select Backup & Recovery, and then Schedule Backup.

    The Schedule Backup page is displayed as shown in Figure 4-1.

    Figure 4-1 Schedule Protected Database Backup

    Description of Figure 4-1 follows
    Description of "Figure 4-1 Schedule Protected Database Backup"
  4. In the Oracle-Suggested Recovery Appliance Backup section, select Schedule Oracle-Suggested Backup.

    The Schedule Oracle-Suggested Recovery Appliance Backup: Options page is displayed.

  5. Specify the method used to back up redo data.
    • If real-time redo transport is not configured for the protected database, select Also back up all archived logs on disk.

    • If required, select Delete all archive logs from disk after they are successfully backed up.

  6. Click Next to display the Schedule Oracle-Suggested Recovery Appliance Backup: Schedule page.
  7. (Optional) Modify the default values provided in the Job Name and Job Description fields.
  8. Schedule the backup job.

    In the Schedule section, select Repeating, then set the frequency to repeat daily, and then select Indefinite.

  9. Click Next to display the Schedule Oracle-Suggested Recovery Appliance Backup: Review page.

    The Settings section displays the settings that will be used to create this backup. Cloud Control generates the RMAN script required to create and schedule this backup. You can view this script in the RMAN Script section.

  10. Click Submit Job.

    A backup job is created based on the settings in the Schedule section. The following message is displayed: The job has been successfully submitted.

  11. Click View Job to display the status of the backup job.

    The Summary section displays a job summary that includes the status, type of backup, database name, Recovery Appliance catalog user name, and other details.

    Click Job Report to display a detailed report of the backup steps performed.

Backing Up the Whole Protected Database Using Cloud Control

Cloud Control can be used to create and schedule backup jobs that can be run immediately or at a later time. Oracle recommends that you include archived redo logs in all full and incremental backups. Backing up redo data ensures that the recovery time is reduced.

This section describes how to schedule a backup job that creates a full backup of the protected database with archived redo log files. The backup job repeats every day for an indefinite period of time.

To backup the whole protected database along with archived redo logs:

  1. Access the home page for the protected database as described in "Accessing the Protected Database Home Page Using Cloud Control".
  2. Ensure that the configuration steps described in "Enrolling the Protected Database with Recovery Appliance (Cloud Control)" and "Configuring Backup and Recovery Settings for Protected Databases (Cloud Control)" are completed.
  3. From the Availability menu, select Backup & Recovery, and then Schedule Backup.

    The Schedule Backup page is displayed as shown in Figure 4-1.

  4. In the Customized Backup section, select Schedule Customized Backup.

    The Schedule Customized Backup: Options page is displayed.

  5. In the Backup Type section, select Full Backup.

    If you want to use this backup as the base of an incremental backup strategy, then select Use as the base of an incremental backup strategy.

  6. In the Backup Mode section, select Online Backup.
  7. In the Advanced section, select Also back up all archived logs on disk to back up the redo logs along with the protected database.
  8. Click Next to display the Schedule Customized Backup: Settings page.
  9. Select Recovery Appliance to store protected database backups on the Recovery Appliance with which the protected database is enrolled.
  10. Click Next to display the Schedule Customized Backup: Schedule page is displayed.
  11. (Optional) Edit the job name and description to provide user-defined names.
  12. In the Schedule section, click Repeating and enter the following information:
    • Frequency Type: By Weeks

    • Repeat Every: 1

    • Start Time: 1:00 am

    • Repeat Until: Indefinite

  13. Click Next to display the Schedule Customized Backup: Review page.

    The Settings section displays the settings that will be used to create this backup. Cloud Control generates the RMAN script required to perform this backup job. The RMAN Script section displays the generated script.

  14. Click Submit Job to create a backup job based on the settings provided in the Schedule section.

    The following message is displayed: The job has been successfully submitted.

  15. Click View Job to display the status of the backup job.

    The Summary section displays a job summary that includes the status, type of backup, protected database name, Recovery Appliance catalog user name, and so on.

    Click Job Report to display a detailed report of the backup steps performed.

Backing Up the Protected Database Using the Command Line

Use regular RMAN commands to create backups of your protected database. To schedule protected database backups, create a script that contains the required backup commands and then use any scheduling utility to schedule backups. You can create full backups, incremental backups, archived redo log backups, control file backups, or backups of specific data files and tablespaces. To implement the incremental-forever backup strategy, you need one level 0 incremental database backup and successive periodic level 1 incremental backups.

Because multiple protected databases are backed up to the same Recovery Appliance, backup piece names must be unique across all protected databases. Use the substitution variables %d_%U in the FORMAT string of BACKUP commands to ensure that backup piece names are unique.

See Also:

Oracle Database Backup and Recovery Reference for information about the substitution variables

To implement the incremental-forever backup strategy using the command line:

  1. Create a full backup of the protected database that will form the basis of the incremental-forever backup strategy as described in "Creating the Initial Full Backup of the Protected Database".
  2. Create and schedule regular level 1 incremental backups that include archived redo logs as described in "Creating Incremental Backups of the Protected Database".

Creating the Initial Full Backup of the Protected Database

This section describes how to create a one-time full backup of the whole protected database that includes archived redo logs. Assume that the protected database is in ARCHIVELOG mode and is configured to automatically back up the control file and server parameter file.

To create a full backup of the whole protected database:

  1. Connect RMAN to the protected database as TARGET and the Recovery Appliance catalog as CATALOG.
  2. Ensure that the configuration steps described in "Enrolling the Protected Database with Recovery Appliance (Command Line)" and "Configuring Backup and Recovery Settings for Protected Databases (Command Line)" are completed.
  3. Run the following command to allocate three SBT channels for the Recovery Appliance and then create a full backup of the protected database including archived redo log files:
    RUN
    {
     ALLOCATE CHANNEL c1 DEVICE TYPE sbt_tape 
       PARMS='SBT_LIBRARY=/u01/oracle/product/11.2.0.4/dbhome_1/lib/libra.so,
       ENV=(RA_WALLET=location=file:/u01/oracle/product/11.2.0.4/dbhome_1/dbs/ra 
       credential_alias=ra-scan:1521/zdlra5:dedicated)'
       FORMAT'%U_%d';
     ALLOCATE CHANNEL c2 DEVICE TYPE sbt_tape 
       PARMS='SBT_LIBRARY=/u01/oracle/product/11.2.0.4/dbhome_1/lib/libra.so,
       ENV=(RA_WALLET=location=file:/u01/oracle/product/11.2.0.4/dbhome_1/dbs/ra
       credential_alias=ra-scan:1521/zdlra5:dedicated)'
       FORMAT'%U_%d';
     ALLOCATE CHANNEL c3 DEVICE TYPE sbt_tape 
       PARMS='SBT_LIBRARY=/u01/oracle/product/11.2.0.4/dbhome_1/lib/libra.so,
       ENV=(RA_WALLET=location=file:/u01/oracle/product/11.2.0.4/dbhome_1/dbs/ra
       credential_alias=ra-scan:1521/zdlra5:dedicated)' 
       FORMAT'%U_%d';
     BACKUP DEVICE TYPE sbt
      TAG 'db_full_incr'
      CUMULATIVE INCREMENTAL LEVEL 1
      DATABASE FORMAT '%d_%U'
      PLUS ARCHIVELOG FORMAT '%d_%U' NOT BACKED UP;
    }
    

    The BACKUP ... INCREMENTAL LEVEL 1 command automatically creates a level 0 backup if no level 0 backup already exists.

Creating Incremental Backups of the Protected Database

This section describes how to create a script that performs level 1 incremental backups of the whole protected database and schedule this script to be run at 1 am every day. The backup includes archived redo log files. You can use any job scheduler, including adding your customized RMAN script in an RMAN job in Cloud Control, to schedule the RMAN script to be run at a specified time every day.

To create and schedule a level 1 incremental backup that includes archived redo log files:

  1. Ensure that the configuration steps described in "Enrolling the Protected Database with Recovery Appliance (Command Line)" and "Configuring Backup and Recovery Settings for Protected Databases (Command Line)" are completed.
  2. Ensure that at least one RMAN SBT channel that corresponds to the Recovery Appliance is configured as described in "Using RMAN Channels for Recovery Appliance Backup and Recovery Operations".
  3. Note:

    The backup command in this sections applies when the ZDLRA is the only backup destination. However, if implementing a dual backup strategy, follow either:

    Open a text editor and create and save a file with the following contents.

    Save the file in a directory that is accessible to the Oracle Database software and on which the Oracle software owner has the read permission. This script file is saved as /u01/app/oracle/product/11.2.0.4/db_home1/db_incr_daily.sh.

    export ORACLE_HOME=/u01/app/oracle/product/11.2.0.4/dbhome_1
    export ORACLE_SID=db1124sm
    export PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:$ORACLE_HOME/Opatch
    export LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/rdbms/lib:/lib:/usr/lib;
    export LD_LIBRARY_PATH
    export LOG_TRACE_DIR=$HOME/RA_TEST/RMAN_SCRIPTS/LOG
    dt=`date +%y%m%d%H%M%S`
    $ORACLE_HOME/bin/rman log=$LOG_TRACE_DIR/rman_bkincr_log_db1124sm_$dt.log <<EOF
    CONNECT TARGET /
    CONNECT CATALOG rauser/welcome1@ra-scan:1521/zdlra5:dedicated
    
    BACKUP DEVICE TYPE SBT
       TAG 'db_full_incr'
       CUMULATIVE INCREMENTAL LEVEL 1 
       DATABASE FORMAT %d_%U'
       PLUS ARCHIVELOG FORMAT '%d_%U' NOT BACKED UP;
    EOF
    
  4. Log in to the protected database host as a user who is a member of the OSBACKUPDBA operating system group.

    See Also:

    Oracle Database Administrator's Guide for information about the OSBACKUPDBA group

  5. Open a text editor, create a file with the following contents, and save the file using the name.crontab into your home directory. This example uses the crontab utility to schedule the RMAN script.
    MAILTO=first.last@example.com
    # MI HH DD MM DAY CMD
      00  1  *  *  *  /u01/app/oracle/product/11.2.0.4/db_home1/db_incr_daily.sh
    
  6. In a command window, change directory to your home directory and enter the following command to create a crontab file for this user from the contents of .crontab.
    # crontab .crontab
    

Monitoring Protected Database Backups Using Cloud Control

Cloud Control provides reporting capabilities and also enables you to monitor and change the status of protected database backup and recovery jobs.

Viewing Backup Reports for Protected Databases

Cloud Control provides a Backup Report that displays the details of all backup and recovery jobs that were run for a particular protected database. You can filter the data displayed in this report depending on the time period for which you want to see the reports.

To display the Backup Report for a protected database:

  1. Access the home page for the protected database as described in "Accessing the Protected Database Home Page Using Cloud Control".
  2. From the Availability menu, select Backup & Recovery, then select Backup Reports.

    The View Backup Report page is displayed.

  3. Filter the data displayed in the backup report using the fields in the Search section. You can filter by job status, type of backup job, or start time.
  4. Click Go to display the backup report.

    Figure 4-2 displays a Backup Report of incremental backup jobs that completed with warnings within the last one week. You can view additional details about a particular job by clicking a backup name in the Backup Name column.

    Figure 4-2 Protected Database Backup Report

    Description of Figure 4-2 follows
    Description of "Figure 4-2 Protected Database Backup Report"

Viewing the Status of Protected Database Backup Jobs

The Job Activity report displays details about the active, completed, and failed jobs for the protected database.

This report enables you to perform the following tasks:

  • view additional details for each job

  • suspend, resume, or stop currently active jobs

  • modify the status of scheduled jobs

To view that status of protected database jobs:

  1. Access the home page for the protected database as described in "Accessing the Protected Database Home Page Using Cloud Control".
  2. From the Oracle Database menu, select Job Activity.

    The Job Activity page is displayed.

  3. Use the Advanced Search section to provide criteria that filter the jobs displayed in the report.

    The following fields specify criteria that filter the jobs displayed in the report:

    • Owner: Select the owner of the job.

    • Start: Select the start time. Backup jobs scheduled to start during or after the selected time period are displayed. For example, select Last 7 Days to display jobs scheduled to start in the last 7 days.

    • Job Type: Select the type of job. For example, to display backup jobs select Database Backup.

    • Status: Select the status of the job. For example, to display the currently running jobs select Running.

  4. Click Go to generate the report according to the specified criteria. Figure 4-3 shows the Job Activity Report for database backup jobs.

    Figure 4-3 Job Activity Report for Protected Database Backup Jobs

    Description of Figure 4-3 follows
    Description of "Figure 4-3 Job Activity Report for Protected Database Backup Jobs"
  5. To view the details of a particular job execution, select the job and click View Results.

    To stop the execution of a particular job, select the job and click Stop. Similarly, you can use options to suspend, resume, or delete a job.