My Blog List

Wednesday, August 4, 2021

How to backup and restore BootVolume and BlockVolume in Oracle Cloud

Long time since i blogged, happened to backup and restore a DB instance in same Oracle cloud in same region so thought of updating it.

We need to start with which options we need to take, there are 3 options and i took Backup/Restore option since it is lower in cost and need to create DB instance copy in the same region. The other 2 options are cloning and using custom images. We will see backup and restore only in this blog.

Consider DB compute instance has one boot volume (2 TB) and one block volume (1 TB).

Compute instance : VM standard 2.2 (can be any)
Source Block Volume : DBBlockVolume
Source Boot Volume : DB (Boot Volume)

If only boot volume attached to a instance, it is very simple process . Assume if we have all the datafiles, controlfiles and logfiles of database in one single boot volume then if we restore this boot volume, then we can restore/start the DB.

Before we move on to Backup/Restore of Boot+Block, refer below 3 points for restoring boot volume only. I am not covering fully for only boot volume instance.

1. Take a backup of boot volume or select already taken boot volume backup.

2. Create new compute and while selecting image source, select boot volume and select the boot volume backup you already have.

3. Proceed with instance creation and we should be able to connect to instance and check the data and start the db.

Challenge occurs when we have both boot volume and block volume is attached to a compute. since both are in different volume we need to take backup at same point in time for both boot and block volume. We can achieve this by creating a Volume group and attach the boot and block volume to this VG. We can take the co-ordinate backup now, if we backup the Volume group. 

The steps are:

1.Create a Volume Group to make the backup/restore of both boot and block volume
SalesDB_VG is the Volume group name in our example.

Add the existing volume attached to current compute instance that are to be backed up.

Click +Volume button to add Block Volume or other volume w.r.t this instance you want to backup .


 

2. Backup the volume group.

Click create Volume group backup to backup the instance.

I have VG backup name as SalesDB_VG_Backup and selected  Full backup option since no backup available yet.

Once you backed up, you will see similar to below,
    SalesDB_VG_Backup
        DBBlockVolume_backup_20210803_110653
        DB (Boot Volume)_backup_20210803_110653


3. Restore the volume group from the volume group backup both Boot volume backup separately and Block volume separately.


4. Create a new instance from boot volume and block volumes from the restored backups.
 



I have used the same VNC which i used for source instance.

5. Post creation of instance activities:

Remember to change the public IP/ hostname in listener.ora and tnsnmaes,ora in the new resorted instance. This instance can be used for testing or UAT. You can restart the database to register database in my case i have a pdb you may get TNS-001189.

since it is a restored backup i used source instance putty ssh key itself.


No comments:

Post a Comment