Cloning Oracle Database to the Cloud

Pure Storage recently announced the general availability of Cloud Block Store™, Pure Storage’s block store offering in the cloud that enables organizations to run their mission-critical applications in the public cloud. Customers can move their data and applications running on the on-premise FlashArray™ seamlessly to Cloud Block Store. One of the biggest advantages of implementing […]


image_pdfimage_print

Pure Storage recently announced the general availability of Cloud Block Store™, Pure Storage’s block store offering in the cloud that enables organizations to run their mission-critical applications in the public cloud. Customers can move their data and applications running on the on-premise FlashArray™ seamlessly to Cloud Block Store.

One of the biggest advantages of implementing hybrid architectures is the agility it provides to keep up with the changing needs of the business. One such need, in the context of Oracle database, is spinning up a new instance for dev, test, QA, and more. In this blog post, I’m going to show you how quick and easy it is to create a clone of an Oracle database running on-premise in Pure Storage’s Cloud Block Store running in AWS.

Cloning Oracle Database Diagram

This blog post assumes that Cloud Block Store is already deployed. To set up Cloud Block Store, detailed instructions are in the Cloud Block Store Deployment and Configuration Guide for AWS.

Environment Setup

This is what the demo environment looks like. We have a production database running on-premises called VISPROD. We’ll create a development copy VISDEV on Cloud Block Store running on AWS.

On-premiseCloud Block Store
Database NameVISPRODVISDEV
Host IP address10.21.121.12610.0.3.105
Flash Array IP address10.21.121.10210.0.3.136

 

Prepare Environment in AWS

On AWS, we need to set up the database host before we can start to create database copies. I’ll briefly list the steps here:

(For more details on setting up a host for Oracle installation, refer to Installing Oracle Database 18c on FlashArray.)

  1. Create an AWS instance with an OS and version that is the same as the source database running on-premises. Apply any OS patches that have been applied on the source database host.
  2. Add this instance as a Host object in the FlashArray by going to Storage -> Hosts.
  3. Create new volumes for VISDEV that correspond to the volumes in the source database (VISPROD) Protection Group snapshot. Their sizes should exactly be the same.
  4. Connect these new volumes to the Host object created above.
  5. Run rescan-scsi-bus.sh on the host to rescan the scsi bus. Verify using lsscsi that these volumes are visible to the host.
  6. Create aliases in multipath.conf for each volume so that it is easier to reference them.
  7. Run service multipathd restart to restart the multipath service
  8. Verify using multipath -ll that the device is showing up with the right name and size.
  9. Ensure that recommendations provided in Oracle Database Recommended Settings for FlashArray have been implemented.
  10. Install the same version of Oracle Database on the AWS instance as installed on the source database host on-premises. OS user and group IDs should be created in the AWS instance should match those on-premises. If it is an ASM database, Grid Infrastructure needs to be installed as well.

This completes the host setup.

Now create an init.ora file for VISDEV. The easiest way to do this is to copy the init.ora for VISPROD and make the necessary changes.

On-premises FlashArray Setup

We’ll do one-time setups using the GUI, and script the tasks that need to be performed regularly so the entire process can be automated.

  1. Connect Cloud Block Store on AWS to the on-premises Flash Array as an asynchronous replication target.

Login to Cloud Block Store, and get the Connection Key

Copy the Connection Key

On the on-premise FlashArray, go to Storage -> Array and in the Connected Arrays section click on the Add icon.

Once connected, the Cloud Block Store should show up in the Connected Arrays list.

2. Create a protection group on the source Flash Array that includes all the database files of the Oracle database. Also, add Cloud Block Store as a replication target.

3. Take a snapshot of the Protection Group with the replicate to target option. We can use either Pure’s CLI or Python REST API to do this.

This will take a crash consistent snapshot of all the volumes of the database and would allow us to restore the database at point.

If there’s a need to restore the database as of a later point in time, the database should be put in Hot Backup mode before the above command is executed. This can be done by executing the “ALTER DATABASE BEGIN BACKUP.”

  1. After the snapshot is created, the database should be taken off the Hot Backup mode by executing the “ALTER DATABASE END BACKUP” command.
  2. To verify that the snapshot was replicated, on Cloud Block Store go to Storage -> Protection Groups.
  3. Find the Protection Group replicated from the on-premises FlashArray. It will have the format – <FlashArray Name>:<Protection Group Name>
  4. Click on it to go to the details page.

Under Protection Group Snapshots, we can see our snapshot. It will have the format – <FlashArray Name>:<Protection Group Name>.<suffix>. The table provides the status of replication in terms of bytes transferred as well as time consumed.

Once the Protection Group snapshot has been completely transferred, we can begin the process of creating the VISDEV database.

 

Creating VISDEV Database

  1. If VISDEV already exists, for example – when doing a refresh, first shut it down.
  2. Unmount the File Systems hosting the database. In case of ASM, unmount the ASM DISK GROUPS.
  3. Copy the volumes from the VISPROD Protection Group snapshot to corresponding volumes on Cloud Block Store. As we have pre-created the VISDEV volumes in an earlier step, we need to use the overwrite option while doing the volume copy.
  4. Mount the file systems. If using ASM, mount the ASM disk groups.
  5. Rename the directories to match VISDEV naming convention.
  6. Startup nomount the instance
  7. Create the controlfile for VISDEV
  8. Recover database using backup controlfile until cancel.
  9. Open the database with RESETLOGS option.

This may seem like a lot of steps, but they can easily be automated. I have created a demo video that automates the database refresh of three non-production copies running in Cloud Block Store.

The following is an example of how simple it is to use Pure Storage’s Python REST API. This script copies the volumes from the protection group snapshot replicated from on-premise to Cloud Block Store’s volumes.

Cloud Block Store runs the same Purity operating environment as an on-premise FlashArray, and provides the same management GUI, same API, and same data services like space-efficient snapshots, always-on encryption, and data reduction. In this blog post, we have seen how simple it is to clone an Oracle Database from on-premises to Cloud Block Store running on AWS. So head over to the AWS marketplace and check out the Cloud Block Store product page.

flash array test drive

Written By: