cloud-table-hands
Cloud, Contributions, Oracle

Back-up to Cloud

Over the last few years, a proliferation of web services paved the way for saving enterprise back-ups. Oracle recently added the Oracle secure back-up (OSB) cloud module to its inventory of back-up solutions, which allows RMAN to write database back-ups directly to the Amazon storage cloud. It offers all the major features of RMAN and provides a cost-effective alternative to tape and online storage. This document highlights some of the steps involved in configuring RMAN backup to the Amazon cloud.

Requirements-

OS: OSB is currently supported on Linux & Window platforms.

JAVA: JDK 1.5 or higher is required to run the cloud module to configure the environment.

Note: Typically Oracle database 11gR2 installation may contain Java 1.5 JDK. This can be used in case the server doesn’t have the appropriate JDK installed. JDK location under Oracle home –
/u01/app/oracle/product/11.2.0.3/db1/jdk/bin.

Installed version can be verified as follows:

export JAVA_HOME=/u01/app/oracle/product/11.2.0.3/db1/jdk

$JAVA_HOME/bin/java -version
java version “1.5.0_30”
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_30-b03)
Java HotSpot(TM) 64-Bit Server VM (build 1.5.0_30-b03, mixed mode)

OTN login: A valid OTN account is required to download the web services library during the installation.

AWS: A valid login is required, which can be registered at http://aws.amazon.com/. Once the account is set up, download AWS identifiers (Access Key ID & Secret Access Key) on to the server where the cloud back-up needs to be configured.

S3 backup Installer: osbws_install.jar – This can be downloaded (OTN login is required to download) from the following location: http://www.oracle.com/technetwork/products/secure-backup/secure-backup-s3-484709.html?ssSourceSiteId=ocomen.

Wallet Directory: Create a directory under $ORACLE_HOME/dbs. This will be used by the installer to save the wallet file that contains AWS identifiers.
cd $ORACLE_HOME/dbs
mkdir AWS_RMAN_WALLET

Installation-

Installing the AWS cloud module is pretty straightforward. Some of the details that are gathered under requirements need to be passed as relevant arguments to the OSB installer (OSBWS_Installer.jar).

  • AWSID: This is the AWS access key id that needs to be downloaded from AWS
  • AWSKey: AWS secret access key that needs to be downloaded from AWS as well
  • otnUser: A valid email address that might have been used during the OTN account creation
  • otnPass: Relevant OTN password
  • walletDir: Wallet directory location that is created above as a part of requirements
  • libDir: This is typically $ORACLE_HOME/lib (could be different on Windows platform)

Prepare an executable shell script as a wrapper for setting up environment and running the installer.

cat config_aws.sh

#!/bin/bash
export ORACLE_SID=XXXXXX
export ORACLE_HOME=/u01/app/oracle/product/11.2.0.3/db1
export JAVA_HOME=/u01/app/oracle/product/11.2.0.3/db1/jdk
$JAVA_HOME/bin/java -jar osbws_install.jar -AWSID XXXXXXX -AWSKey XXXXXXXXXXXXXXXXXXX
-otnUser XXXX@XXXXX.com -otnPass SECRET -walletDir $ORACLE_HOME/dbs/AWS_RMAN_WALLET
-libDir $ORACLE_HOME/lib/

Verify all the arguments and execute the script…

./config_aws.sh

Oracle Secure Backup Database Web-Service Install Tool, build 2011-02-04.0001
AWS credentials are valid.
Creating new registration for this S3 user.
Created new log bucket.
Registration ID: XXXXX-XXXX-XXXX-XXXX-XXXXX
S3 Logging Bucket: oracle-log-XXX-1
Validating log bucket location …
Validating license file …
Create credential oracle.security.client.connect_string1
OSB web-services wallet created in directory /u01/app/oracle/product/11.2.0.3/db1/dbs/AWS_RMAN_WALLET.
OSB web-services initialization file /u01/app/oracle/product/11.2.0.3/db1/dbs/osbwsXXXXXX.ora created.

Downloading OSB Web Services Software Library from file osbws_linux64.zip.
Downloaded 21525230 bytes in 17 seconds. Transfer rate was 1266190 bytes/second.
Download complete.
Extracted file /u01/app/oracle/product/11.2.0.3/db1/lib/libosbws12.so

Backup

Once the installation is complete, RMAN backup can be run as follows…

rman target / nocatalog

Recovery Manager: Release 11.2.0.3.0 – Production on Thu Sep 12 17:38:29 2013

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database: XXXXXX (DBID=3275161976)
using target database control file instead of recovery catalog

RMAN> run {
allocate channel dev1 type
sbt parms=’SBT_LIBRARY=/u01/app/oracle/product/11.2.0.3/db1/lib/libosbws12.so,
SBT_PARMS=(OSB_WS_PFILE=/u01/app/oracle/product/11.2.0.3/db1/dbs/osbwsXXXXXX.ora)’;
backup tablespace users;
}2> 3> 4> 5> 6>

released channel: ORA_DISK_1
allocated channel: dev1
channel dev1: SID=416 device type=SBT_TAPE
channel dev1: Oracle Secure Backup Web Services Library
Starting backup at 12-SEP-13
channel dev1: starting full datafile backup set
channel dev1: specifying datafile(s) in backup set
input datafile file number=00004 name=+DATA/XXXXXX_pr/datafile/users.266.787577749
input datafile file number=00005 name=+DATA/XXXXXX_pr/datafile/users.311.810392265
input datafile file number=00006 name=+DATA/XXXXXX_pr/datafile/users.316.820977173
channel dev1: starting piece 1 at 12-SEP-13
channel dev1: finished piece 1 at 12-SEP-13
piece handle=64ojmbvt_1_1 tag=TAG20130912T180133 comment=API Version 2.0,MMS Version 3.0.0.0
channel dev1: backup set complete, elapsed time: 00:00:07
Finished backup at 12-SEP-13
released channel: dev1
NOTE: Channel parameters can be saved in the RMAN configuration as well to make the settings persistent across all the backup executions.

Backup Timing Comparison:

backup-timing-comparison

Conclusion

Configuring RMAN back-up to the cloud is pretty straightforward and can be used as a viable alternative to tape or online back-ups. When used in conjunction with RMAN encryption and compression may reduce the cloud storage costs and satisfy the compliance requirements.

About The Author

Kishore Kottapalli

Kishore Kottapalli has been an Oracle DBA for 15 years, handling all areas of Oracle database administration. He has a special interest in Oracle performance tuning & NoSQL databases.