{"id":1889,"date":"2016-12-19T00:01:58","date_gmt":"2016-12-19T06:01:58","guid":{"rendered":"https:\/\/bijoos.com\/oraclenotes\/?p=1889"},"modified":"2026-02-07T15:27:13","modified_gmt":"2026-02-07T21:27:13","slug":"12-days-of-cloud-enabling-dbaas-backups","status":"publish","type":"post","link":"https:\/\/bijoos.com\/oraclenotes\/2016\/1889\/","title":{"rendered":"12 Days of #Cloud: Enabling #DBaaS Backups"},"content":{"rendered":"<h2>12 Days of #Cloud: Day 6<\/h2>\n<p>When I <a href=\"https:\/\/bijoos.com\/oraclenotes\/2016\/1782\">created the #DBaaS instance<\/a>, did not create a backup policy. I chose the backups as &#8220;None&#8221;. Now that some work has been done on the database, would like to create an adhoc\u00a0backup as well as want to schedule regular local disk backups.<\/p>\n<p>On-demand backup can be performed by running\u00a0script &#8220;\/var\/opt\/oracle\/bkup_api\/bkup_api bkup_start&#8221; as the root user.<\/p>\n<pre class=\"font-size:10 height-set:true height:200 lang:default highlight:0 decode:true\">[opc@CLDB4ACED ~]$ sudo -s\n[root@CLDB4ACED opc]#\n[root@CLDB4ACED opc]# \/var\/opt\/oracle\/bkup_api\/bkup_api bkup_start\nDBaaS Backup API V1.5 @2015 Multi-Oracle home\n-&gt; Action : bkup_start\n-&gt; logfile: \/var\/opt\/oracle\/bkup_api\/log\/bkup_api.log\nAPI INFO : Backups are not configured on this DB Instance. Nothing to do.\n*\n* RETURN CODE:0\n##################################################\n[root@CLDB4ACED opc]#\n<\/pre>\n<p>Oops, no backup configured! So, for the first time, we need to configure backup before we can perform a backup.<\/p>\n<p>Reference: <a href=\"https:\/\/docs.oracle.com\/en\/cloud\/paas\/database-dbaas-cloud\/csdbi\/change-backup-config-different-destination.html#GUID-4EA54788-109B-42B5-A21D-F5A05C878E94\" target=\"_blank\">Oracle Documentation<\/a><\/p>\n<p>Backup configuration is saved in file\u00a0\/var\/opt\/oracle\/ocde\/assistants\/bkup\/bkup.cfg. Let&#8217;s edit the file and add required parameters.<\/p>\n<pre class=\"font-size:10 height-set:true height:200 lang:default highlight:0 decode:true\">[opc@CLDB4ACED ~]$ sudo -s\n[root@CLDB4ACED opc]#\n[root@CLDB4ACED opc]# cd \/var\/opt\/oracle\/ocde\/assistants\/bkup\/\n[root@CLDB4ACED bkup]# ls *cfg\nbkup.cfg\n[root@CLDB4ACED bkup]# cat bkup.cfg\n# The bkup.cfg file will hold all the config info for BKUP\n[root@CLDB4ACED bkup]# cp -p bkup.cfg bkup.cfg.1\n[root@CLDB4ACED bkup]# vi bkup.cfg \n\n[root@CLDB4ACED bkup]# cat bkup.cfg\n# The bkup.cfg file will hold all the config info for BKUP\nbkup_cfg_files=yes\nbkup_disk=yes\nbkup_disk_recovery_window=2\nbkup_oss=no\nbkup_oss_url=oss_url\nbkup_oss_user=username\nbkup_oss_passwd=password\nbkup_oss_recovery_window=30\n[root@CLDB4ACED bkup]#\n\n[root@CLDB4ACED bkup]# chown root bkup.cfg\n[root@CLDB4ACED bkup]# chmod 0600 bkup.cfg\n\n[root@CLDB4ACED bkup]# .\/bkup -cfg bkup.cfg\nStarting BKUP\nLogfile is \/var\/opt\/oracle\/log\/bkup\/bkup_2016-12-06_17:01:47.log\nConfig file is bkup.cfg\ndbname: CDDB01\nDataguard configuration\nEnabled: 0\nMode: PRIMARY\nLooking for previous configuration:\nDirectory : \/home\/oracle\/bkup\/CDDB01\n  -&gt; obkup\n  -&gt; dbcfg.spec\n  -&gt; log\n -&gt; Found: 3 files\n -&gt; Moving previous configutarion to \/home\/oracle\/bkup\/CDDB01_20161206170154\nNo initial bkup of PFILE needed.\nConfiguring Backup to disk\nCommon RMAN Config\nInstantiating obkup\nInstantiating dbcfg.spec\nConfiguring backup of Config File\nUpdating Control File Record Keep Time\nEnabling block change tracking\nUpdating RMAN defaults\nAdding entry to crontab\nINFO: Archivelog management enabled.\nWarning: there are already 1 entries for crontab\n  -&gt; 0,30 * * * * root \/home\/oracle\/bkup\/CDDB01\/obkup -dbname=CDDB01 -archivelog\nAccessing to your Database ID ..\nThe DBaaS instance database id is: 4135691349\nDeleting unencrypted autobackups.\n#### Completed Execution.\n[root@CLDB4ACED bkup]#\n<\/pre>\n<p>BKUP_DISK is for local disk backup, and enabled local backup by setting this parameter to YES. Local disk backups are written to the Flash Recovery Area, which is \/u03\/app\/oracle\/fast_recovery_area directory. The parameter BKUP_OSS is to write backups to Oracle Cloud Storage.<\/p>\n<p>The bkup\u00a0script, backup assistant, created few cron jobs to do the backup periodically.<\/p>\n<pre class=\"font-size:10 height-set:true height:200 lang:default highlight:0 decode:true\">[root@CLDB4ACED etc]# cat \/etc\/crontab\nSHELL=\/bin\/bash\nPATH=\/sbin:\/bin:\/usr\/sbin:\/usr\/bin\nMAILTO=\"\"\nHOME=\/\n\n# For details see man 4 crontabs\n\n# Example of job definition:\n# .---------------- minute (0 - 59)\n# |  .------------- hour (0 - 23)\n# |  |  .---------- day of month (1 - 31)\n# |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...\n# |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat\n# |  |  |  |  |\n# *  *  *  *  * user-name command to be executed\n\n0,30 * * * * root \/home\/oracle\/bkup\/CDDB01\/obkup -dbname=CDDB01 -archivelog\n15 03 * * 6 oracle \/var\/opt\/oracle\/cleandb\/cleandblogs.pl\n54 2 * * * root \/var\/opt\/oracle\/bkup_api\/bkup_api bkup_start --dbname=CDDB01\n[root@CLDB4ACED etc]#\n<\/pre>\n<p>Let&#8217;s kick off the backup again.<\/p>\n<pre class=\"font-size:10 height-set:true height:200 lang:default highlight:0 decode:true\">[root@CLDB4ACED etc]# \/var\/opt\/oracle\/bkup_api\/bkup_api bkup_start --dbname=CDDB01\nDBaaS Backup API V1.5 @2015 Multi-Oracle home\n-&gt; Action : bkup_start\n-&gt; logfile: \/var\/opt\/oracle\/bkup_api\/log\/bkup_api.log\n** process started with PID: 23297\n** see log file for monitor progress\n-------------------------------------\n[root@CLDB4ACED etc]#\n\n[root@CLDB4ACED etc]# cat \/var\/opt\/oracle\/bkup_api\/log\/bkup_api.log\n... ... ...\nTue, 06 Dec 2016 17:17:25 DBaaS Backup API V1.5 @2015 Multi-Oracle home\nTue, 06 Dec 2016 17:17:25 -&gt; Action : bkup_start\nTue, 06 Dec 2016 17:17:25 -&gt; logfile: \/var\/opt\/oracle\/bkup_api\/log\/bkup_api.log\nTue, 06 Dec 2016 17:17:25 ** process started with PID: 23297\nTue, 06 Dec 2016 17:17:25 db35376e-bbd7-11e6-9159-c6b07b253285 -&gt; Starting execution of backup log in background\nTue, 06 Dec 2016 17:17:25 ** see log file for monitor progress\nTue, 06 Dec 2016 17:17:25 -------------------------------------\nTue, 06 Dec 2016 17:17:25 db35376e-bbd7-11e6-9159-c6b07b253285 STARTING BACKUP REQUEST\nTue, 06 Dec 2016 17:17:25 Creating Backup Api registry datatabase\nTue, 06 Dec 2016 17:17:25 UUID db35376e-bbd7-11e6-9159-c6b07b253285 written with PID 23297\nTue, 06 Dec 2016 17:17:33 db35376e-bbd7-11e6-9159-c6b07b253285 Checking if CDDB01 resource is available\nTue, 06 Dec 2016 17:17:33 db35376e-bbd7-11e6-9159-c6b07b253285 registering request into the database\nTue, 06 Dec 2016 17:17:37 db35376e-bbd7-11e6-9159-c6b07b253285 current backups 0\nTue, 06 Dec 2016 17:17:37 db35376e-bbd7-11e6-9159-c6b07b253285 command \/home\/oracle\/bkup\/CDDB01\/obkup -dbname=CDDB01\nTue, 06 Dec 2016 17:19:54 db35376e-bbd7-11e6-9159-c6b07b253285 The backup process failed\n<\/pre>\n<p>Backup failed! This time, it was due to insufficient local storage to hold the backup. Since I chose no backup option, Oracle Cloud Service did not allocate storage to perform backups to \/u03 file system. The database was created in ARCHIVELOG mode, and the Cloud Service setup a cron\u00a0job to remove the archivelog files hourly.<\/p>\n<p>It took a while to figure out how to add storage to \/u03 file system.\u00a0More storage is added to the standard file systems by using the &#8220;Scale up or down Resources&#8221; menu item.<\/p>\n<p id=\"ZNEaHml\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"alignnone size-full wp-image-1891 \" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_5856278f8e212.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>Added 50G to &#8220;Backup Storage Volume&#8221;, which is \/u03. 6G volume is now 56G.<\/p>\n<p id=\"eAUlDil\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"alignnone size-full wp-image-1892 \" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_585627ceccba3.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>Adding disk space alone is not sufficient, need to increase the Fast Recovery Area as well.<\/p>\n<p id=\"oMdOOvP\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"alignnone size-full wp-image-1893 \" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58562b468d0cb.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>Though backup is scheduled to run periodically using the cronjobs, lets kick off a backup to verify if the added storage in \/u03 resolved the backup issue.<\/p>\n<p id=\"fSbTmQe\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"alignnone size-full wp-image-1894 \" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58562b87ce33a.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>Voila, successful backup!<\/p>\n<p>DBaaS monitor console also shows the status.<\/p>\n<p id=\"MsRklsZ\"><img data-recalc-dims=\"1\" decoding=\"async\" class=\"alignnone size-full wp-image-1895 \" src=\"https:\/\/i0.wp.com\/bijoos.com\/oraclenotes\/wp-content\/uploads\/2016\/12\/img_58562c1b66243.png?w=1200&#038;ssl=1\" alt=\"\" \/><\/p>\n<p>The\u00a0\/home\/oracle\/bkup\/CDDB01\/obkup cron job performs operating system file backups. The file backups are based on two configuration files, and their contents are:<\/p>\n<pre class=\"font-size:10 height-set:true height:200 lang:default highlight:0 decode:true\">[root@CLDB4ACED CDDB01]# pwd\n\/home\/oracle\/bkup\/CDDB01\n\n[root@CLDB4ACED CDDB01]# cat dbcfg.spec\n### Oracle_Home configuration files.\n#\n# Doc Spec\ndbcfg.spec\n# DB id\ndbid\n#\n# Directories\n\/u01\/app\/oracle\/product\/12.2.0\/dbhome_1\/admin\/CDDB01\/xdb_wallet\n\/u01\/app\/oracle\/admin\/CDDB01\/xdb_wallet\n\/u01\/app\/oracle\/admin\/CDDB01\/db_wallet\n\/u01\/app\/oracle\/admin\/CDDB01\/opc_wallet\n# Note: tde_wallet must be backed up in a different location than DATA bkup.\n\/u01\/app\/oracle\/admin\/CDDB01\/tde_wallet\n\/u01\/app\/oracle\/admin\/CDDB01\/cat_wallet\n#\/u01\/app\/oraInventory\n#\n# Single files\n\/u01\/app\/oracle\/admin\/CDDB01\/opcCDDB01.ora\n\/u01\/app\/oracle\/product\/12.2.0\/dbhome_1\/dbs\/orapwCDDB01\n\/u01\/app\/oracle\/product\/12.2.0\/dbhome_1\/network\/admin\/listener.ora\n\/u01\/app\/oracle\/product\/12.2.0\/dbhome_1\/network\/admin\/sqlnet.ora\n\/u01\/app\/oracle\/product\/12.2.0\/dbhome_1\/network\/admin\/tnsnames.ora\n\/u01\/app\/oracle\/product\/12.2.0\/dbhome_1\/rdbms\/lib\/env_rdbms.mk\n\/u01\/app\/oracle\/product\/12.2.0\/dbhome_1\/rdbms\/lib\/ins_rdbms.mk\n#\n# Creg\n\/var\/opt\/oracle\/creg\/CDDB01.ini\n#\n[root@CLDB4ACED CDDB01]#\n[root@CLDB4ACED CDDB01]# cat oscfg.spec\n## OS Configuration Files\n#\n# Doc Spec\noscfg.spec\n#\n# Directories\n\/etc\/rc.d\n\/home\/oracle\/bkup\n#\n# Single files\n\/home\/oracle\/.bashrc\n\/etc\/crontab\n\/etc\/sysctl.conf\n\/etc\/passwd\n\/etc\/group\n\/etc\/oraInst.loc\n\/etc\/oratab\n\/etc\/fstab\n[root@CLDB4ACED CDDB01]#\n<\/pre>\n<p>As you can see, all important files from the Operating System are backed up. If you have directories to be backed up, add to the dbcfg.spec file.<\/p>\n<p>Enabling and performing cloud backups is also using similar steps. Update these parameters accordingly in the bkup.cfg file.<\/p>\n<pre class=\"font-size:10 lang:default highlight:0 decode:true \">bkup_oss=yes\nbkup_oss_url=oss_url\nbkup_oss_user=username\nbkup_oss_passwd=password\nbkup_oss_recovery_window=30<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>12 Days of #Cloud: Day 6 When I created the #DBaaS instance, did not create a backup policy. I chose the backups as &#8220;None&#8221;. Now that some work has been done on the database, would like to create an adhoc\u00a0backup as well as want to schedule regular local disk backups. On-demand backup can be performed &#8230; <a title=\"12 Days of #Cloud: Enabling #DBaaS Backups\" class=\"read-more\" href=\"https:\/\/bijoos.com\/oraclenotes\/2016\/1889\/\" aria-label=\"Read more about 12 Days of #Cloud: Enabling #DBaaS Backups\">Read more<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[55],"class_list":["post-1889","post","type-post","status-publish","format-standard","hentry","category-cloud-autonomous","tag-oracle-cloud"],"acf":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/1889","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/comments?post=1889"}],"version-history":[{"count":1,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/1889\/revisions"}],"predecessor-version":[{"id":2991,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/posts\/1889\/revisions\/2991"}],"wp:attachment":[{"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/media?parent=1889"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/categories?post=1889"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bijoos.com\/oraclenotes\/wp-json\/wp\/v2\/tags?post=1889"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}