30 Persistent Settings for RMAN Cloud Backups

After you install the Oracle Database Cloud Backup Module, use the RMAN CONFIGURE command to create a persistent RMAN configuration for cloud backup and restore operations.

30.1 About Configuring SBT Channel

RMAN requires the system backup to tape (SBT) channel to perform cloud backup and recovery operations.

Use the CONFIGURE command to create an automatic SBT channel that corresponds with a cloud backup destination.

While configuring the channel, use the SBT_LIBRARY parameter to specify the media library that enables RMAN to communicate with the cloud backup module. Oracle provides native SBT libraries for RMAN operations with Oracle Cloud (OCI) and Amazon S3 Cloud. The native SBT library files are available in the Oracle home directory as part of the target database installation. While configuring the SBT channel, you must provide the absolute path to the library file located in the Oracle home directory.

Use the ENV parameter (on UNIX and Linux) or the SBT_PARMS parameter (on Windows) to specify the location of the backup module configuration file that is created when you install the backup module. The configuration file contains the parameters required to authenticate RMAN operations with the chosen cloud service.

You can use the CONFIGURE command to change the RMAN default device type to SBT. This ensures that the RMAN environment is configured to create all backups to cloud by default. The backup destination is determined by the SBT channel that is currently in use.

This command configures an automatic SBT channel using the absolute path of the SBT library file located in the Oracle home directory. The ENV environment variable defines the backup module specific parameter (such as OPC_PFILE for OCI and OSB_WS_PFILE for Amazon S3) to indicate the location of the configuration file.
RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT'
PARMS 'SBT_LIBRARY=<SBT library file pathname>,
ENV=(<backup module prefix>_PFILE=absolute path of configuration file)';

Note:

You can skip the ENV parameter or the SBT_PARMS parameter if the configuration file is created in the default directory chosen by the backup module installer.

RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT'
PARMS 'SBT_LIBRARY=<SBT library file pathname>';
This command modifies the RMAN default device type to 'SBT'.
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO sbt;

You can configure multiple SBT channels. The default cloud backup destination is determined by the RMAN SBT device configuration that is currently in use. For example, if the SBT device type is configured to use the $ORACLE_HOME/lib/libopc.so library, then RMAN creates backups to Oracle Cloud Infrastructure Object Storage. To back up to a different location, such as Amazon S3, you can configure a separate SBT channel that corresponds to the SBT library for Oracle Secure Backup Cloud Module.

Note:

An automatic SBT channel creates a persistent default SBT device setting that applies to all backup and recovery operations. Alternatively, you can use the ALLOCATE CHANNEL command to manually allocate a one-time SBT channel before each backup or restore operation. This command shows a manually allocated SBT channel (on UNIX and Linux systems) for creating a backup to Oracle Cloud.
RMAN> RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE sbt
PARMS 'SBT_LIBRARY=$ORACLE_HOME/lib/libopc.so,
ENV=(OPC_PFILE=/myfiles/opc<ORACLE_SID>.ora)';
BACKUP DATABASE;
}

See Configuring Channels for detailed information about RMAN channels.

Configuring an Automatic SBT Channel for Oracle Cloud (OCI)

RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT'
PARMS 'SBT_LIBRARY=$ORACLE_HOME/lib/libopc.so, 
ENV=(OPC_PFILE=/myfiles/opc<ORACLE_SID>.ora)';
RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT'
PARMS 'SBT_LIBRARY=%ORACLE_HOME%\bin\oraopc.dll, 
SBT_PARMS=(OPC_PFILE=C:\myfiles\opc<ORACLE_SID>.ora)';

Configuring an Automatic SBT channel for Amazon S3 Cloud (AWS)

RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT'
PARMS 'SBT_LIBRARY=$ORACLE_HOME/lib/libosbws.so, 
ENV=(OSB_WS_PFILE=/myfiles/osbsws<ORACLE_SID>.ora)';
RMAN> CONFIGURE CHANNEL DEVICE TYPE 'SBT'
PARMS 'SBT_LIBRARY=%ORACLE_HOME%\bin\oraosbws.dll, 
SBT_PARMS=(OSB_WS_PFILE=C:\myfiles\osbsws<ORACLE_SID>.ora)';

30.2 About Securing Cloud Backups

To ensure backup security and data protection, Oracle recommends that you make RMAN backup encryption a standard part of your backup processes.

RMAN backup encryption provides enhanced security for your database backups, particularly if you are storing critical backup data on a cloud storage location. Encrypting RMAN backups can also assist you in meeting key audit and regulatory compliance requirements for the data of your organization.

You can use the CONFIGURE command to create persistent encryption settings for your RMAN backups.

Note:

Backups must be encrypted before they can be sent to Oracle Cloud using Oracle Database Backup Cloud Service. If a backup is not encrypted, then RMAN signals ORA-19511 with a descriptive error message as shown below.
RMAN-03009: failure of backup command on ORA_SBT_TAPE_1 channel at 08/15/2014 14:00:43
ORA-27030: skgfwrt: sbtwrite2 returned error
ORA-19511: non RMAN, but media manager or vendor specific failure, error text:
   KBHS-01602: backup piece 14p0jso8_1_1 is not encrypted

See Configuring Backup Encryption for information about encryption methodologies and choosing an encryption algorithm.

30.3 Configuring Compression for Cloud Backups

You can optionally use compression when backing up Oracle Databases to cloud. Compression conserves bandwidth by reducing the size of your backups before they are sent to the cloud. You can specify compression when you perform a backup.

Recovery Manager (RMAN) supports binary compression using one of the following compression levels: HIGH, MEDIUM, BASIC, and LOW. The recommended level for cloud backups is MEDIUM.

For example, the following RMAN commands configure compression using the MEDIUM algorithm:

RMAN> CONFIGURE COMPRESSION ALGORITHM 'MEDIUM';
RMAN> CONFIGURE DEVICE TYPE sbt BACKUP TYPE TO COMPRESSED BACKUPSET;

Backups must be in the form of backup sets, not image copies. For information about configuring compression for backups, see Configuring Compression Options.

30.4 Configuring Autobackups

Oracle recommends that you configure RMAN to automatically back up the database control file and server parameter file.

With a control file autobackup, RMAN can recover the database even if the current control file, recovery catalog, and server parameter file are inaccessible.

The autobackup feature is disabled by default. Use the CONFIGURE command to enable autobackup.

RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

See Configuring Control File and Server Parameter File Autobackups for information about autobackups.

30.5 Best Practices to Optimize Cloud Backup Rates

Because cloud backups are sent over the public internet, backup performance is affected by network bandwidth limitations. Use RMAN parallelism and compression to speed up cloud backups and restores.

To optimize performance:

  • Use multiple RMAN channels for higher parallelism, which results in full utilization of the network. You can configure as many RMAN channels as you want. For example, the following configuration uses eight channels in parallel to back up to the cloud:
    RMAN> CONFIGURE DEVICE TYPE sbt PARALLELISM 8;

    Try increasing the parallelism until you find the optimal transfer rate.

  • Use an RMAN compression level of MEDIUM.

  • Use multisection backups. With these, multiple RMAN channels are used in parallel to back up large data files in separate sections.

    You create multisection backups by specifying the SECTION SIZE parameter with the BACKUP command. For example, the following command specifies a backup section size of 1 GB:
    RMAN> BACKUP DEVICE TYPE sbt DATABASE SECTION SIZE 1g;
  • Use a backup strategy of weekly full and daily incremental backups. This results in faster backups and could save a significant amount of network bandwidth. Use the RMAN fast incremental backup feature (based on block change tracking) to optimize the performance of your daily incremental backups.

  • Also note it is recommended practice to include the RMAN format string %d and %U to ensure uniqueness of each backup piece.

  • Use a recovery catalog to store long-term backups. For information about recovery catalogs, see Managing a Recovery Catalog.

Note:

You can test network throughput by using the throughput measurement tool. See Testing Network Throughput in Managing and Monitoring Oracle Cloud.

30.6 Best Practices for Cloud Restores

Recovery best practices ensure that, in the event of a failure, the cloud backups required to recover your Oracle Database are available and usable.

Use the following recovery best practices:

  • Verify that the cloud backups are restorable.

    Before creating new cloud backups, run the RESTORE DATABASE PREVIEW VALIDATE HEADER command to ensure that the old backups are available and restorable.

  • Validate backups to check for physical and logical corruptions.

    Use the RMAN RESTORE DATABASE VALIDATE command to check the data files for physical corruptions. Run the RESTORE DATABASE VALIDATE CHECK LOGICAL command to check for logical corruptions.

  • Crosscheck your backups periodically.

    If you use non-RMAN techniques for your cloud backups, then ensure to run the RMAN CROSSCHECK BACKUP command to crosscheck the backups before restoring.

Related Topics