Let Your Oracle Backups Be Up in the Clouds

Feb 10, 2010 / By Alisher Yuldashev

Tags: ,

There are a lot of discussions going on in the Internet regarding whether we can trust third parties to look after our data. I am not going to add fuel to the fire. I am going to show you how simple it is to backup an Oracle database to the Storage Cloud using the Oracle Secure Backup (OSB) Cloud Module.

First, you need to sign up for an Amazon S3 account and get an Access Key ID and a Secret Access Key. Check AWS pricing first.

Next, download the OSB Cloud Module and unzip it.

[oracle@lin32 distrib]$ ls -l
total 2428
-rw-r--r-- 1 oracle oinstall 2480195 Jan 19 18:13 osbws_installer.zip
[oracle@lin32 distrib]$ unzip osbws_installer.zip
Archive:  osbws_installer.zip
  inflating: osbws_readme.txt
  inflating: osbws_install.jar

Next, create a shell script with the java command using your parameters:

  1. AKI is the Access Key ID you received from Amazon S3.
  2. SAK is the Secret Access Key from Amazon S3.
  3. User is your OTN user.
  4. Password is your OTN password.
[oracle@lin32 distrib]$ vi osbws_install.sh
[oracle@lin32 distrib]$ cat osbws_install.sh
java -jar osbws_install.jar -AWSID AKI -AWSKey SAK -otnUser User -otnPass Password -walletDir $ORACLE_HOME/dbs/osbws_wallet
[oracle@lin32 distrib]$ chmod u+x osbws_install.sh

Now run the script to install the module.

[oracle@lin32 distrib]$ ./osbws_install.sh
Oracle Secure Backup Database Web-Service Install Tool
OTN userid is valid.
AWS credentials are valid.
Creating new registration for this S3 user.
Created new log bucket.
Registration ID: ***
S3 Logging Bucket: oracle-log-alisher--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/dbhome_1/dbs/osbws_wallet.
OSB web-services initialization file /u01/app/oracle/product/11.2.0/dbhome_1/dbs/osbwsDB19TST.ora created.

To use the OSB Cloud Module you need to set up an RMAN configuration for the SBT type device.

RMAN> configure channel device type SBT parms 'SBT_LIBRARY=/u01/app/oracle/product/11.2.0/dbhome_1/lib/libosbws11.so ENV=(OSB_WS_PFILE=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/osbwsDB19TST.ora)';

new RMAN configuration parameters:
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS  'SBT_LIBRARY=/u01/app/oracle/product/11.2.0/dbhome_1/lib/libosbws11.so ENV=(OSB_WS_PFILE=/u01/app/oracle/product/11.2.0/dbhome_1/dbs/osbwsDB19TST.ora)';
new RMAN configuration parameters are successfully stored

The OSB Cloud Module is installed and configured. Let’s take a full compressed backup of the database. It is recommended to encrypt the backup when the backup is put in the Cloud.

RMAN> set encryption on for all tablespaces algorithm 'AES128' identified by * only;
executing command: SET encryption

RMAN> backup device type sbt tag 'BACKUP_DB19TST_000_012010015857' database;
Starting backup at 20-JAN-10
allocated channel: ORA_SBT_TAPE_1
channel ORA_SBT_TAPE_1: SID=41 device type=SBT_TAPE
channel ORA_SBT_TAPE_1: Oracle Secure Backup Web Services Library
channel ORA_SBT_TAPE_1: starting compressed full datafile backup set
channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/oradata/DB19TST/datafile/o1_mf_system_5lbbz08j_.dbf
input datafile file number=00002 name=/u01/oradata/DB19TST/datafile/o1_mf_sysaux_5lbbzny4_.dbf
input datafile file number=00003 name=/u01/oradata/DB19TST/datafile/o1_mf_undotbs1_5lbc027k_.dbf
input datafile file number=00004 name=/u01/oradata/DB19TST/datafile/o1_mf_users_5lbc0yh0_.dbf
channel ORA_SBT_TAPE_1: starting piece 1 at 20-JAN-10
channel ORA_SBT_TAPE_1: finished piece 1 at 20-JAN-10
piece handle=0ul3uhcs_1_1 tag=BACKUP_DB19TST_000_012010015857 comment=API Version 2.0,MMS Version 2.0.0.0
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:17:08
channel ORA_SBT_TAPE_1: starting compressed full datafile backup set
channel ORA_SBT_TAPE_1: specifying datafile(s) in backup set
including current control file in backup set
including current SPFILE in backup set
channel ORA_SBT_TAPE_1: starting piece 1 at 20-JAN-10
channel ORA_SBT_TAPE_1: finished piece 1 at 20-JAN-10
piece handle=0vl3uid0_1_1 tag=BACKUP_DB19TST_000_012010015857 comment=API Version 2.0,MMS Version 2.0.0.0
channel ORA_SBT_TAPE_1: backup set complete, elapsed time: 00:00:45
Finished backup at 20-JAN-10

So, you can see that using the OSB Cloud Module is both very simple and fully compatible with existing backup scripts and EM.

And when you need to recover the database, the backup comes just as if it were on tape, only it comes down from the Cloud.

8 Responses to “Let Your Oracle Backups Be Up in the Clouds”

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>