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:

Starting in release 12.2.1.1.2-201910, you can backup a TDE encrypted database to the Recovery Appliance. Using normal DBMS operations, you can select tablespaces to be converted to TDE Tablespace Encryption. Afterwards, the Recovery Appliance can provide an incremental forever strategy that covers both an unencrypted recovery window and an encrypted recovery window. However, you must follow the Oracle Database Advanced Security Guide to perform an explicit incremental level 0 backup of the database after the tablespace has been encrypted. This strategy increases the storage space needed, because encrypted blocks cannot be compressed.

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. The CONNECT CATALOG line below requires the appropriate password instead of myPassword.

    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/myPassword@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 and then select Backup Reports.
    This displays the DB login page.
  3. Enter the appropriate login credentials.

    The View Backup Report page is displayed.

    Figure 4-2 Protected Database Backup Reports

    Description of Figure 4-2 follows
    Description of "Figure 4-2 Protected Database Backup Reports"
  4. (Optional) Filter the list of backups in the report using the fields above each column. You can filter by Backup Name, Status, Command, Type, Target, Start Time, and Time Taken.
  5. (Optional) The View Range control can help you select an appropriate time period for the reports.
  6. (Optional) The Recovery Window control displays the settings for the recovery window as well as how many days it has protection.
  7. To view the details of any backup listed in the report, you click on it row.

    The bottom of the page displays a new area with three tabs of information about the selected backup.

    • End-to-End Summary
    • Outputs
    • Inputs

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.

Unprotecting Databases and Cleaning up

This task shows you how to complete the process of un-registering a database and deleting its backup files from the Recovery Appliance when the database no longer needs recovery protection. The Recovery Appliance uses the delta backup pieces to perform most of its recovery work, but achieves zero data loss by registering as a target for the real-time Redo logs.

When a database no longer needs recovery protection, the database and the Recovery Appliance need appropriate configuration changes. These changes:

  • Stop the database from sending its Redo logs to the Recovery Appliance.
  • Stop the database from generating backups.
  • Remove old backup files for the database from the Recovery Appliance, a multiple-day process.
  • Informs the Recovery Appliance to not save future backups from the database.

RMAN supports sending the archive logs to multiple destinations. log_archive_dest_1 is backup to the local disk drive, while log_archive_dest_2 through log_archive_dest_30 can be configured for other destinations, such as a physical standby server or the Recovery Appliance. RMAN views the Recovery Appliance as another Tape Backup device.

Disabling the Real-Time Redo Transport

This task configures the database to stop transporting the redo logs to the Recovery Appliance.

The Recovery Appliance uses the delta backup pieces to perform most of its recovery work, but achieves zero data loss by registering as a target for the real-time Redo logs. Therefore, when the database no longer needs recovery protection, the Redo transport should turned off.
  1. Log into the Enterprise Manager as sysman or equivalent target level access.
  2. Navigate to the database that no longer needs protection. In our example, its name begins with "cont001_".
  3. In the Backup Settings area and the Device tab, select the Recovery Appliance associated with the database.
  4. Uncheck the checkbox that says Enable Real-Time Redo Transport.

Figure 4-4 Enterprise Manager and turning off recovery protection

Description of Figure 4-4 follows
Description of "Figure 4-4 Enterprise Manager and turning off recovery protection"

Disabling the Backups

This task configures the database to stop sending the delta backup pieces to the Recovery Appliance, when the database no longer needs recovery protection.

This step jumps between RMAN and Enterprise Manager in order to highlight what happens to the configuration.

  1. (Optional) Log into RMAN and issue the following command.
    RMAN> show all;

    The output lists several configured options including something similar to the following entry:

    CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' FORMAT '%d_%u' PARMS
    "SBT_LIBRARY=/u01/app/oracle/product/18.0.0.0/dbhome_1/lib/librs.so,
    SBT_PARMS=[RA_WALLET='location-file:/u01/app/oracle/product/18.0.0.0/dbhome_1/dbs/zdlra
    credential_alias=<yourRA_01>:1521/zdlrax5:dedicate;)";
  2. From the Enterprise Manager session looking at the same database, click on the Clear Configuration button. In our example, the database name begins with "cont001_".

    Figure 4-5 Enterprise Manager and turning off recovery protection

    Description of Figure 4-5 follows
    Description of "Figure 4-5 Enterprise Manager and turning off recovery protection"

    This removes the SBT_TAPE (tape library) channel configuration.

If you return to RMAN and issue the same command.

RMAN> show all;

The output lists no longer contains the entry for the SBT_TAPE channel device that was used for theRecovery Appliance.

Un-registering the Database from the Recovery Appliance

When a database no longer needs recovery protection, you issue a command to unregister it from the Recovery Appliance that also deletes its old backup files. The deletion of backup files takes a significant period of time to complete, which is why it should be run in the background (wait = false).

  1. Log into sqlplus as rasys.
    [yourRA_01 ~]$ sqlplus rasys
  2. Issue the following API call with the name of yourDBname database.
    SQL> exec dbms_ra.delete_db( 
    db_unique_name =>'yourDBname', 
    wait=> FALSE); 
    
    PL/SQL procedure successfully completed. 

The removal of backup data from the Recovery Appliance in the background can take multiple days.

Meanwhile, yourDBname database is no longer allowed to backup to the Recovery Appliance.