THE WORLD DISCUSSES #PYTHIAN ON TWITTER. HAVE A QUESTION? USE OUR HASHTAG AND ASK AWAY.

Let Your Oracle Backups Be Up in the Clouds

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.

3 Responses

  1. [...] Alisher Yuldashev -Let Your Oracle Backups Be Up in the Clouds [...]

  2. Andrew Eells says:

    Alisher, given that you’ve obviously got this up and running yourself, can you provide any guidance on the problem I have?

    http://developer.amazonwebservices.com/connect/thread.jspa?threadID=46794

    As far as I can tell I have executed exactly the same steps as yourself.
    It looks as though your logging bucket is specific to your name though – S3 Logging Bucket: oracle-log-alisher–1 – how did that get set up with your name in it? Is that a step you had to accomplish beforehand?

    Appreciate any guidance you might be able to give!
    Thanks and kind regards,
    Andrew Eells

  3. Hi Andrew,

    Thank you for your question.
    I don’t think your issue is related to the OSB Cloud Module installation. It looks like there is a problem with your AWS account.
    I would recommend you contacting the AWS support.

    Alisher

Leave a Reply

Start NowWith Pythian - database design, management and emergency handling capabilities...

Live Updates

pythian: RT @pythiansimmons: Join @pythian's #Exadata webinar Aug 11. @fielding will share tips for implementation success http://bit.ly/exadata
more



Testimonials

  • Serge Racine

    DBA, Brookfield Energy

    We are very satisfied by the service given to us by Andre and Shakir in support of our recent data quality and reorganization initiative.... more