Moneycontrol Brokerage Recos

Saturday, February 3, 2018

[Oracle Cloud] : Creating On-Demand Backup using bkup_api utility



Creating On-Demand Backup : Oracle Database Cloud Service


In this article, I will be demonstrating one way of taking On-Demand backup of Oracle Database Cloud Service Database Deployment in Oracle Public Cloud. You can create on-demand backup of single instance Oracle Cloud database deployment using bkup_api utility. We will talk about taking on-demand backup of Oracle Real Application(RAC) database in Oracle Cloud in another article.

It might be required to take on-demand backup of your oracle cloud database deployment in case if you have not configured automatic Oracle Database deployment backup while creating the database deployment in oracle cloud or before any maintenance operations going to happen in your database deployment.

Note - You can't configure an automatic backup for an existing Oracle Database Deployment in oracle cloud once that is created with  Backup option "none" to not automatically backup the Oracle cloud database deployment during service creation time, you would have to configure the backups manually and set it via cron jobs / or use bkup_api automated cloud backup utility.

Here we will be using the bkup_api oracle cloud backup utility to backup our single instance Oracle cloud database deployment to Oracle Storage Cloud Container(You should have Oracle Database Backup Cloud Service already activate and cloud storage container created in order to take database deployment backup to oracle cloud storage) 



1 - Connect to the Compute Node of DBaaS instance as opc user.


2 – Switch to root user to run bkp_api utility as it requires root privilege to run otherwise you would get following self-explanatory error if backup attempt is made with opc user.

[opc@RAJDB121 ~]$ /var/opt/oracle/bkup_api/bkup_api i bkup_start

API::ERROR Api requires root rights or sudoer


Switch to root user as below.

[opc@RAJDB121 ~]$ sudo -s
[root@RAJDB121 opc]#


3 – Run the bkup_api utility with bkup_start option to start taking backup of the Oracle cloud database deployment.


[root@RAJDB121 opc]# /var/opt/oracle/bkup_api/bkup_api bkup_start

DBaaS Backup API V1.5 @2016 Multi-Oracle home

DBaaS Backup API V1.5 @2015 Multi-Oracle home

-> Action : bkup_start

-> logfile: /var/opt/oracle/bkup_api/log/bkup_api.log

UUID 12eceb08-050f-11e8-a8f6-c6b062e43847 for this backup

** process started with PID: 1270

** see log file for monitor progress


4 – Once you start the backup job then you can monitor the backup progress using its log file - /var/opt/oracle/bkup_api/log/bkup_api.log .

[root@RAJDB121 opc]# tail -f /var/opt/oracle/bkup_api/log/bkup_api.log

Mon, 29 Jan 2018 16:11:51 -------------------------------------

Mon, 29 Jan 2018 16:11:51 12eceb08-050f-11e8-a8f6-c6b062e43847 -> Starting execution of backup log in background

Mon, 29 Jan 2018 16:11:51 12eceb08-050f-11e8-a8f6-c6b062e43847 STARTING BACKUP REQUEST

Mon, 29 Jan 2018 16:11:51 UUID 12eceb08-050f-11e8-a8f6-c6b062e43847 written with PID 1270

Mon, 29 Jan 2018 16:11:51 12eceb08-050f-11e8-a8f6-c6b062e43847 Checking if RCDB121 resource is available

Mon, 29 Jan 2018 16:11:51 12eceb08-050f-11e8-a8f6-c6b062e43847 has a lock RCDB121

Mon, 29 Jan 2018 16:11:51 12eceb08-050f-11e8-a8f6-c6b062e43847 The process is no longer running removing lock

Mon, 29 Jan 2018 16:11:51 12eceb08-050f-11e8-a8f6-c6b062e43847 registering request into the database

Mon, 29 Jan 2018 16:11:59 12eceb08-050f-11e8-a8f6-c6b062e43847 current backups 1904

Mon, 29 Jan 2018 16:11:59 12eceb08-050f-11e8-a8f6-c6b062e43847 command /var/opt/oracle/ocde/assistants/bkup/obkup



5 – Another way to monitor the currently running backup job with bkup_status option of bkup_api utility as below.


[root@RAJDB121 opc]# /var/opt/oracle/bkup_api/bkup_api bkup_status  
 DBaaS Backup API V1.5 @2016 Multi-Oracle home  
 DBaaS Backup API V1.5 @2015 Multi-Oracle home  
 -> Action : bkup_status  
 -> logfile: /var/opt/oracle/bkup_api/log/bkup_api.log  
  Warning: unable to get current configuration of: catalog  
 * Current backup settings:  
 * Last registered Bkup: 01-29 16:11 API::1270:: Starting dbaas backup process  
 * Bkup state: running  
 **************************************************  
 * API History: API steps  
  API:: NEW PROCESS 1270  
  API:: Starting dbaas backup process  
 *************************************************  
 * Backup steps  
  -> API:: Oracle database state is up and running  
  -> API:: DB instance: RCDB121  
  -> API:: Determining if the filesystem is not full  
  -> API:: ...... OK  
  -> API:: Validating the backup repository ......  
 *  
 * RETURN CODE:0  
 ##################################################  
 [root@RAJDB121 opc]# /var/opt/oracle/bkup_api/bkup_api bkup_status  
 DBaaS Backup API V1.5 @2016 Multi-Oracle home  
 DBaaS Backup API V1.5 @2015 Multi-Oracle home  
 -> Action : bkup_status  
 -> logfile: /var/opt/oracle/bkup_api/log/bkup_api.log  
  Warning: unable to get current configuration of: catalog  
 * Current backup settings:  
 * Last registered Bkup: 01-29 16:11 API::1270:: Starting dbaas backup process  
 * Bkup state: finished  
 **************************************************  
 * API History: API steps  
  API:: NEW PROCESS 1270  
  API:: Starting dbaas backup process  
  API:: Your new dbaas backup tag is TAG20180129T161948  
  API:: BKUP COMPLETE YOUR BKUP TAG TAG20180129T161948  
 *************************************************  
 * Backup steps  
  -> API:: Oracle database state is up and running  
  -> API:: DB instance: RCDB121  
  -> API:: Determining if the filesystem is not full  
  -> API:: ...... OK  
  -> API:: Validating the backup repository ......  
  -> API::   All backup pieces are ok  
  -> API:: Performing backup to local storage (primary backup)  
  -> API:: Executing rman instructions  
  -> API:: ...... OK  
  -> API:: Backup to local storage is completed  
  -> API:: Clean MOTD.  
  -> API:: Performing backup to cloud storage (secondary backup)  
  -> API:: Executing rman instructions  
  -> API:: ......OK  
  -> API:: Backup to cloud storage is completed  
  -> API:: Clean MOTD.  
  -> API:: Starting backup of config files  
  -> API:: Executing rman instructions  
  -> API:: at time: 2018-01-29:16:20:40  
  -> API:: Determining the oracle database id  
  -> API:: DBID: 3348210600  
  -> API:: Creating directories to store config files  
  -> API:: Determining the oracle database id  
  -> API:: DBID: 3348210600  
  -> API:: Compressing config files into tar files  
  -> API:: .... OK  
  -> API:: Uploading config files to cloud storage  
  -> API:: Completed at time: 2018-01-29:16:20:58  
  -> API:: at time: 2018-01-29:16:20:58  
  -> API:: Config files backup ended successfully  
  -> API:: Clean MOTD.  
  -> API:: All requested tasks are completed  
 *  
 * RETURN CODE:0  
 ##################################################  
 [root@RAJDB121 opc]#  


Again, you can review the bkup_api log file to check if backup has been succeeded.

 [root@RAJDB121 opc]# tail /var/opt/oracle/bkup_api/log/bkup_api.log  
 Mon, 29 Jan 2018 16:21:06 12eceb08-050f-11e8-a8f6-c6b062e43847@ backups after execution 1908  
 Mon, 29 Jan 2018 16:21:06 12eceb08-050f-11e8-a8f6-c6b062e43847 rman tag TAG20180129T162020  
 Mon, 29 Jan 2018 16:21:06 12eceb08-050f-11e8-a8f6-c6b062e43847 rman tag TAG20180129T162040  
 Mon, 29 Jan 2018 16:21:06 12eceb08-050f-11e8-a8f6-c6b062e43847 rman tag TAG20180129T162033  
 Mon, 29 Jan 2018 16:21:06 12eceb08-050f-11e8-a8f6-c6b062e43847 rman tag TAG20180129T161948  
 Mon, 29 Jan 2018 16:21:07 12eceb08-050f-11e8-a8f6-c6b062e43847 Backup succeded TAG20180129T161948  
 Mon, 29 Jan 2018 16:21:11 DBaaS Backup API V1.5 @2016 Multi-Oracle home  
 Mon, 29 Jan 2018 16:21:11 DBaaS Backup API V1.5 @2015 Multi-Oracle home  
 Mon, 29 Jan 2018 16:21:11 -> Action : bkup_status  
 Mon, 29 Jan 2018 16:21:11 -> logfile: /var/opt/oracle/bkup_api/log/bkup_api.log  
 [root@RAJDB121 opc]#  


Hope you would find it informative........keep reading......


No comments:

Post a Comment