13 Archival Backups

The Archival Backup is a full backup with KEEP specified for a specific point in time and intended to be held in tape or cloud storage until a future point in time.

An archival backup is used to maintain a fixed recovery point on cloud or tape. It has advantages over the present operational strategy to satisfy any point-in-time recovery within the recovery_window_sbt period, because the archival backup doesn't have to regularly copy incremental backups and archived log backups.

For example, an organization has a security requirement to generate a monthly full backup and to keep five years of these monthly backups available in cloud storage. To achieve this, the organization schedules archival backup command to be executed at the end of each month with KEEP UNTIL SYSDATE+5 YEARS.

The Recovery Appliance supports archival backups sent to tape or cloud. Archival backups to disk are not supported, because they diminish the storage capacity and performance of the Recovery Appliance.

Note:

The databases must have archived log mode turned on. The CREATE_ARCHIVAL_BACKUP command requires archive logs to properly compute the necessary files to create a complete consistent backup for archival purposes. Databases with archive log mode off must continue to make KEEP backups of the protected database and then use the MOVE_BACKUP command to archive onto tertiary storage.

Managing Archival Backups

The two main methods for creating and maintaining archival backups are with an application, such as Enterprise Manager Cloud Control, or using the DBMS_RA API.

The steps for accessing and creating archival backups using Enterprise Manager Cloud Control are:

  1. Log in to your Cloud Control page.

    See Also:

    "Accessing the Recovery Appliance Home Page" for more information.

  2. From any Cloud Control page, use the Targets drop-down menu and select Recovery Appliances.

    The Recovery Appliances page appears.

  3. In the Name column, click the name of a Recovery Appliance.

    The Home page for the selected Recovery Appliance page appears.

    From this page you can see a snapshot of the entire Recovery Appliance, and also click links to obtain more information about a particular area.

  4. A Media Manager needs to exist or be created for the archival backup, because it defines parameters that are passed to media management software (e.g., Oracle Secure Backup) when backups are copied to media by the Recovery Appliance.

    From the Recovery Appliances drop-down menu, select Media Manager.

    The Media Manager page has the Media Manager Libraries table and Attribute Sets table. When creating or editing a Media Manager, you specify Name of the library, Maximum Channels that media library has access to, Restore Channels reserved for restore operations, Media Management Vendor Parameters, and Media Management Vendor Commands.

  5. Verify that an appropriate Media Manager exists for your archival backup to use.

  6. From the Recovery Appliances drop-down menu, select Protected Databases.

    This displays a table with all of the databases that the Recovery Appliance is currently protecting.

  7. Select the row in the Protected Databases table for the database that needs an archival backup. While highlighted, select the Archival Backups button from above the table.

    This opens the Archival Backups page that shows a table for the backups with Restore Point Name, Status, SCN, Restore Tag, Rention Time, and Created information.

  8. On the Archival Backups, click on the Create Archival Backup button.

    This opens the Create Archival Backup dialog with the options:

    • Backup on a recurring schedule: on a specific day and time in one or more months.

    • One-time archival Backup: for Point in Time, SCN, and Restore Point types of archival backups, and fields for Point in Time and Restore Point Name.

    For either option, the Retention Time section provides drop-down controls for other important settings on the archive such as Keep For and time period; and Properties on the archive such as Attribute Set (the specific Media Manager), Format, Encryption Algorithm, and Compression Algorithm.

    Note:

    The tape or cloud destination for the archival backup are specified through the Media Manager.

The CREATE_ARCHIVAL_BACKUP procedure creates the archival backup.

Archival backups are controlled by the KEEP_COMPLIANCE attribute in the protection policy: This attribute (when YES) prevents KEEP backups from having their KEEP UNTIL time adjusted down by a database administrator. (Reducing the KEEP UNTIL time is non-compliant and is a method to delete a backup by expiring it early and then its storage space can be reclaimed.) With KEEP_COMPLIANCE, the backups remain available in storage until the specified date, and only then is their storage space reclaimed.

In the following PL/SQL snippet, a single archival backup is created for the database DB_UNIQUE_NAME with a specific restoration period and an expiration date (KEEP_UNTIL_TIME).

DBMS_RA.CREATE_ARCHIVAL_BACKUP(
db_unique_name => DB_UNIQUE_NAME,
from_tag => NULL,
compression_algorithm => 'LOW',
encryption_algorithm => NULL,
restore_point => NULL,
restore_until_scn => NULL,
restore_until_time => TO_TIMESTAMP(last_day(sysdate-1)||' 11:59:59 PM'),
attribute_set_name => 'SEVEN_YEAR_VAULT_DRIVE',
format => NULL,
autobackup_prefix => NULL,
restore_tag => NULL,
keep_until_time => TO_TIMESTAMP(ADD_MONTHS(last_day(sysdate-1), 84)||' 11:59:59 PM'),
comments => NULL
max_redo_to_apply => 21);

The snippet above can become the body of a loop. In the following snippet for creating archival backups, the two SELECT instances identify databases with specific protection policies, and then filters for databases having restoration backups to archive. Each database R1.DB_UNIQUE_NAME from the selection set has an archival backup created.

BEGIN
FOR R1 IN 
(
WITH BACKUP_RANGE AS
(select  B.DB_UNIQUE_NAME,B.NZDL_ACTIVE,A.DB_KEY,B.policy_name,A.LOW_TIME,A.HIGH_TIME,
CASE WHEN TO_DATE('2022-10-31','YYYY-MM-DD') between low_time and high_time THEN 'PASSED' ELSE 'NO_RANGE' END as DISK_RANGE_STATUS,
to_char((SYSTIMESTAMP AT TIME ZONE TO_CHAR(B.timezone)) - B.minimum_recovery_needed, 'DD-MON-YY HH:MI:SS AM')  LAST_BACKUP_TIME
from 
RA_DISK_RESTORE_RANGE A, ra_database B
WHERE b.db_key = a.db_key
AND (B.policy_name like 'GOLD' or B.policy_name like 'SILVER')
ORDER BY B.DB_UNIQUE_NAME,HIGH_TIME DESC)
SELECT DB_UNIQUE_NAME,NZDL_ACTIVE,DB_KEY,POLICY_NAME,LOW_TIME,HIGH_TIME,DISK_RANGE_STATUS,LAST_BACKUP_TIME
from BACKUP_RANGE 
WHERE DISK_RANGE_STATUS='PASSED' AND NZDL_ACTIVE='YES'
ORDER BY DB_UNIQUE_NAME
)
LOOP
dbms_output.put_line('Submitting Archival Backup for:'||R1.DB_UNIQUE_NAME||'LAST_BACKUP_TIME:='||R1.LAST_BACKUP_TIME);

DBMS_RA.CREATE_ARCHIVAL_BACKUP(
db_unique_name => R1.DB_UNIQUE_NAME,
from_tag => NULL,
compression_algorithm => 'LOW',
encryption_algorithm => NULL,
restore_point => NULL,
restore_until_scn => NULL,
restore_until_time => TO_TIMESTAMP(last_day(sysdate-1)||' 11:59:59 PM'),
attribute_set_name => 'SEVEN_YEAR_VAULT_DRIVE',
format => NULL,
autobackup_prefix => NULL,
restore_tag => NULL,
keep_until_time => TO_TIMESTAMP(ADD_MONTHS(last_day(sysdate-1), 84)||' 11:59:59 PM'),
comments => NULL
max_redo_to_apply => 21);

dbms_output.put_line('=========================================');
END LOOP; 
END;
/