Backup and Restore Oracle Databases using Oracle Database Backup Cloud Service

Oracle Database Cloud Service is been around for sometime now and its shaping out to be a true enterprise cloud backup service for oracle databases. It is a secure, scalable, on-demand storage solution for backing up Oracle databases to Oracle Cloud. Purpose of this blog to show you how
to use Oracle Database Cloud Service to backup or restore your Oracle databases. This blog will only cover backup and restore process and I am assuming that you have install Oracle Cloud Backup Module for Database backup service. if not please use following blog to configure Oracle Cloud Backup Module (http://blog.umairmansoob.com/configure-oracle-database-backup-cloud-service/).

Note : – Make sure to enable auto control backup on and save DBID, you will need them to restore databases. You will also need to provide password to encrypt backups, you will also need same password to restore that database.   

Let starts doing a full backup of a test database then we can drop target databases complete to test our restore process.

Perform FULL Database Backup with AUTO Control file backup enable 

SET ENCRYPTION ON IDENTIFIED BY passw0rd ONLY;
configure compression algorithm 'MEDIUM';
CONFIGURE CONTROLFILE AUTOBACKUP ON;
run
{
allocate channel ch1 device type sbt parms='SBT_LIBRARY=/u01/app/oracle/OPC/lib/libopc.so,ENV=(OPC_PFILE=/u01/app/oracle/product/12.1.0/db_1/dbs/opctestdb1.ora)';
BACKUP AS COMPRESSED BACKUPSET DATABASE PLUS ARCHIVELOG;
release channel ch1;
}

Let delete target database  using DBCA, so we can test our restore process. 

Now we can start restore database process , as i mentioned it earlier you will need password and DBID to restore database from Database Backup service.

Startup database instance in nomount mode 

RMAN> startup nomount force
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/app/oracle/product/12.1.0/db_1/dbs/inittestdb1.ora'
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started

Total System Global Area 1073741824 bytes
Fixed Size 2932632 bytes
Variable Size 281018472 bytes
Database Buffers 784334848 bytes
Redo Buffers 5455872 bytes

Set DBID and password to start restore process.

RMAN> set dbid 687787463;
executing command: SET DBID
RMAN> set decryption identified by passw0rd;
executing command: SET decryption

Restore spfile from backup 

RUN {
allocate channel ch1 device type sbt parms='SBT_LIBRARY=/u01/app/oracle/product/12.1.0/db_1/opc/lib/libopc.so,ENV=(OPC_PFILE=/u01/app/oracle/product/12.1.0/db_1/dbs/opctestdb1.ora)';
RESTORE SPFILE FROM AUTOBACKUP; 
}

Create audit dump directory and startup instance in nomount mode

mkdir -p /u01/app/oracle/admin/testdb1/adump
RMAN> shutdown 
RMAN> startup nomount

Restore Control file from AUTOBACKUP and mount database 

 RUN {
allocate channel ch1 device type sbt parms='SBT_LIBRARY=/u01/app/oracle/OPC/lib/libopc.so,ENV=(OPC_PFILE=/u01/app/oracle/product/12.1.0/db_1/dbs/opctestdb1.ora)';
RESTORE CONTROLFILE FROM AUTOBACKUP; 
Alter database mount;
}

Restore and Recover Database 

RUN {
allocate channel ch1 device type sbt parms='SBT_LIBRARY=/u01/app/oracle/OPC/lib/libopc.so,ENV=(OPC_PFILE=/u01/app/oracle/product/12.1.0/db_1/dbs/opctestdb1.ora)';
restore database;
recover database;
}

Open Database using resetlogs 

RMAN> alter database open resetlogs;
Statement processed