ORACLE database on AWS : Backup and Recovery

In this third blog post of the series Oracle database on the AWS Cloud we will take look at a few ways to backups/recover our oracle databases deployed in AWS cloud.

ORACLE on RDS :

For oracle RDS it’s as simple as pushing a button. By default  automated backups are enabled and retained for 7 days. We can use those backup to restore our database typically within 5 minutes of the current time.  

RDS put the oracle database in backup mode during the backup window before taking a snapshot. To try to guarantee a restore up to 5 minute the parameter “archive_lag_target” is set to 300 (5 minute) So you will see a lot of log switches ! This archive logs are then kept somewhere outside the instance for recovery purpose.

The price of RDS Database Snapshot is $0.10 per GB-Month. Depending on the database size and the change Rate the cost can be substantial !

ORACLE on EC2 :

For oracle on EC2 we have few more options :

1- Crash-consistent snapshots :

We can use a similar method to what’s is done on oracle RDS using EBS multi-volume crash-consistent snapshots. Bertrand Drouvot has a great article on that .

As explained in the blog post there is no need anymore to place the database in backup mode which reduce considerably the overhead in the source database.

Also be aware of the price of EBS Snapshots although lower than RDS : $0.053 per GB-month of data stored.

Some of the major advantage of this solution :

  • Simple :  Keep it simple, stupid (Simple to manage : allow to restore a database with few clicks ) .Same tool for different applications.
  • It allow Lazy loading : Data from an EBS snapshot is lazy loaded into an EBS volume. We prioritize loading active data to restore application functionality as soon as possible , reducing the RTO . Cold data will be restored later. If needed we can enable Fast Snapshot Restore.
  • Only the first EBS snapshot performs a full copy from EBS to S3. All further snapshots are efficient incremental forever snapshots, copying just the changed blocks from EBS to S3.

2- Rman backup directly to S3 :

To backup you oracle database directly to S3 we can use either AWS Storage Gateway or Oracle Secure Backup Cloud Module.

With AWS File Gateway we can have a file interface into Amazon Simple Storage Service (Amazon S3) . Basically in this case it will be an NFS mount point. It’s important to note “When a client writes data to a file via File Gateway, that data is first written to the local cache disk on the gateway itself. Once the data has been safely persisted to the local cache, only then does the File Gateway acknowledge the write back to the client. From there, File Gateway transfers the data to the S3 bucket asynchronously in the background, optimizing data transfer using multipart parallel uploads, and encrypting data in transit using HTTPS.”

In this case we pay for the amount of data written via the file gateway ($0.01 per GB) and the amount of S3 storage used. (Which is very low compared to the snapshot price. Example : About $0.024 per GB for S3 standard)

In the other hand the Oracle Secure Backup Cloud Module uses the RMAN SBT (system backup to tape) interface to extend the Amazon S3 functionality for Oracle backup operations. Compared to the File gateway the write are performed directly to S3 storage without intermediate caching which may slow down the operation but give more reliability .

The license price for OSB is 3,500 $ per rman channel and then you pay for the S3 storage used.

3- Rman backup indirectly to S3 :

We can also backup our database indirectly to S3 by doing a backup to local storage first and then transferring them to S3 using normal S3 upload request or by doing an EBS snapshot on the local backup disk.

That’s it 😀

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s