Before You Begin
This tutorial shows you how to back up an Oracle database to a container by using Oracle Database Backup Cloud Service. This tutorial takes approximately 15 minutes to complete.
Background
Oracle Database Backup Cloud Service is a secure, scalable, on-demand storage solution for backing up Oracle databases to Oracle Cloud. The service complements your existing backup strategy by providing an off-site storage location in the public cloud.
To use Oracle Database Backup Cloud Service you’ll subscribe to the service, install the Oracle Database Cloud Backup Module, and configure your environment to send backups to the cloud. You can then use familiar Recovery Manager (RMAN) commands to perform backup, restore, recovery, and maintenance operations.
You can also use the backup to create an Oracle Database Cloud Service database deployment and an Oracle Database Exadata Cloud Service database deployment.
What Do You Need?
Before you install the Oracle Database Cloud Backup Module, make sure you have what you need:
- A supported Oracle Database version and operating system. See Supported Databases and Operating Systems.
- An Oracle Technology Network (OTN) account or Oracle.com account
- An Oracle Database Backup Cloud Service account and storage capacity
- JDK 1.7 or later
- If you’re using the Standard Edition of Oracle Database, the required patch as described in My Oracle Support Doc ID 1640149.1 at http://support.oracle.com
- Values for the parameters required to run the Oracle Database Cloud Backup Module installer. See Parameters Used to Run the Backup Module Installer.
Download
the Oracle Database Cloud Backup Module Installer
- Navigate to the Oracle Database Cloud Backup Module page on the Oracle Technology (OTN) web site.
- Accept the license agreement, click All Supported Platforms,
and provide your OTN user name and password when prompted.
Description of the illustration OTN_Download.png - Download the ZIP file that contains the installer (opc_installer.zip) to your system.
- Extract the contents of the file.
[oracle@host01 opc]$ unzip opc_installer.zip Archive: opc_installer.zip inflating: opc_install.jar inflating: opc_readme.txt
Install
the Oracle Database Cloud Backup Module
- You must have a wallet directory in the $ORACLE_HOME/dbs
directory. If you do not, create one as shown in this example:
[oracle@host01 dbhome_1]$ cd $ORACLE_HOME/dbs [oracle@host01 dbs]$ mkdir wallet
- Install the Database Backup Cloud Module as shown in this
example:
[oracle@host01 opc]$ java -jar opc_install.jar -host https://example.storage.oraclecloud.com/v1/Storage-example019 -opcId 'dbcsadmin@example.com' -opcPass 'Pass_w0rd' -walletDir /u01/app/oracle/product/12.2.0/dbhome_1/dbs/wallet -libDir /u01/app/oracle/product/12.2.0/dbhome_1/lib
Configure
RMAN Settings
- Log in to Recovery Manager (RMAN).
- Configure RMAN for a backup to the cloud as shown in this
example. When you installed the Database Cloud Backup Module,
the opcorcl.ora file was created in the $ORACLE_HOME/dbs
directory.
RMAN> CONFIGURE CHANNEL DEVICE TYPE sbt PARMS='SBT_LIBRARY=/u01/app/oracle/product/12.2.0/dbhome_1/lib/libopc.so, SBT_PARMS=(OPC_PFILE=/u01/app/oracle/product/12.2.0/dbhome_1/dbs/opcorcl.ora)';
- If not configured, configure control file and server
parameter file (SPFILE) autobackup.
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
Configure
Backup Compression
You can optionally use compression when backing up Oracle databases to Oracle Database Backup Cloud Service. Compression conserves bandwidth by reducing the size of your backups before they are sent to the cloud.
If you have the Oracle Advanced Compression option, 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.
- If you have the Oracle Advanced Compression option,
configure MEDIUM level compression
RMAN> CONFIGURE COMPRESSION ALGORITHM 'MEDIUM';
- If you do not have the Oracle Advanced Compression option,
configure default compression.
RMAN> CONFIGURE COMPRESSION ALGORITHM 'BASIC';
- Configure RMAN to create compressed backup sets by default
on the SBT device type.
RMAN> CONFIGURE DEVICE TYPE sbt BACKUP TYPE TO COMPRESSED BACKUPSET;
Back
Up the Database
A default storage container is created automatically when you install the Oracle Database Cloud Backup Module, and backups are stored as objects in this default container.
- Log in to RMAN if you are not logged in.
- Set the encryption password as shown in this example:
RMAN> SET ENCRYPTION ON IDENTIFIED BY 'my_pswd' ONLY;
- Create a backup of the entire database:
RMAN> BACKUP DEVICE TYPE sbt DATABASE;
- After the backup completes, log out of RMAN.
View
the Backup
- Sign in to Oracle Cloud.
- Expand the navigation menu on the Dashboard page.
- Click Storage to open the service console.
- On the Containers tab you can view the container that was
created when you backed up the database, as shown in this
example:
Description of the illustration Storage_ContainerList.png - Log out of Oracle Cloud.