How to take RMAN Backup on DBCS in OCI to Object Storage


We are going to learn how we can take a RMAN backup on DBCS and store it in Object storage bucket in OCI


Source System Information:


DB version: 11.2.0.4

DB on OCI DBCS

Type of Database : Oracle EBS

Single Node



Steps:


1) Create an OCI Private bucket to store RMAN backup.


Click on Navigation Menu > Object Storage > Object Storage > Buckets

 







2) As My OCI region is singapore so my Object_Storage URL: 


https://objectstorage.ap-singapore-1.oraclecloud.com


Bucket Name: PROD_RMAN_BACKUP



3) Connect to DBCS System Database Node


login as: opc
sudo su - oracle


4) Change to the directory that contains the backup module opc_install.jar file.


cd /opt/oracle/oak/pkgrepos/oss/odbcs



In case you don’t have file you can download on on-prem from below link.


URL https://www.oracle.com/database/technologies/oracle-cloud-backup-downloads.html



5) Create directories to store library files and encryption key files.


mkdir -p /home/oracle/oci/lib

mkdir -p /home/oracle/oci/wallet




6) Install backup Module:



Syntax:

java -jar opc_install.jar -opcId <user_id> -opcPass '<auth_token>' -container <bucket_name> -walletDir ~/hsbtwallet/ -libDir ~/lib/ -configfile ~/config -host https://swiftobjectstorage.<region_name>.oraclecloud.com/v1/<object_storage_namespace>



java -jar opc_install.jar -opcId ebscmadmin -opcPass 'xyz' -container PROD_RMAN_BACKUP -walletDir /home/oracle/oci/wallet/ -libDir /home/oracle/oci/lib -configfile ~/config -host https://swiftobjectstorage.ap-singapore-1.oraclecloud.com/v1/adjae238ashj



7) Check library and wallet directory content to make sure library files and encryption wallet key files are placed under them.


cd /home/oracle/oci/lib

ls


cd ../wallet

ls



8) Configure RMAN



Using Oracle user on DBCS node.


rman target /


Configure RMAN to use the SBT device and point to the config file that was created when you installed the backup module. 

CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/home/oracle/lib/libopc.so, SBT_PARMS=(OPC_PFILE=/home/oracle/config)';


CONFIGURE DEFAULT DEVICE TYPE TO SBT_TAPE;

CONFIGURE BACKUP OPTIMIZATION ON;

CONFIGURE CONTROLFILE AUTOBACKUP ON;

CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F';

CONFIGURE ENCRYPTION FOR DATABASE ON;


More configuration can be changed based on requirements.



Sample RMAN Script


rman target / log=~/logs/proddb_${DATE}.log << EOF

SET ENCRYPTION IDENTIFIED BY "funebs123" ONLY;  -->Every Time we run we need to set this.

run

{

ALLOCATE CHANNEL c1 DEVICE TYPE 'SBT_TAPE' PARMS 'SBT_LIBRARY=/home/oracle/oci/lib/libopc.so, SBT_PARMS=(OPC_PFILE=/home/oracle/config)';

backup current controlfile format 'PROD_control_%d_%U.ctl';

BACKUP FORMAT PROD_full_%d_%u_%s_%p'  DATABASE  SPFILE  FORMAT 'PROD_SPFILE_%d_%u_%s_%p' PLUS ARCHIVELOG   FORMAT PROD_ARCH_%d_%u_%s_%p';

release channel ch1;

}

EOF










If you like please follow and comment