Enabling and Reconfiguring the Automatic Backups Feature
When you create an Oracle Database Classic Cloud Service database deployment, you specify whether automatic backups are configured by choosing a backup destination. After the deployment is created you can change the configuration by changing the deployment’s backup destination.
The instructions in this topic describe how to switch backup destinations for an existing database deployment. Specifically, the following changes are possible using the instructions in this topic:
-
From None to Both Cloud Storage and Local Storage
-
From None to Cloud Storage Only (not currently available for database deployments that use Oracle RAC)
-
From Both Cloud Storage and Local Storage to Cloud Storage Only
-
From Cloud Storage Only to Both Cloud Storage and Local Storage
For background information on the destinations, see About Backing Up Database Deployments on Database Classic Cloud Service.
Note:
The Oracle Database Classic Cloud Service console does not currently recognize changes to the backup destination made by using the bkup.cfg
file with the backup assistant. Therefore, the console will not reflect the new backup destination and may not display any backups taken, depending on what backup destination change you have made. If the backups are not displayed, you will not be able to use the Oracle Database Classic Cloud Service console to perform recovery.
Prerequisites
-
If you are switching to the backup destination Both Cloud Storage and Local Storage, you must increase the size of the local storage used for backups. Use the Extend Backup Storage Volume option of the Oracle Database Classic Cloud Service console’s scaling feature to add storage such that the backup storage is 1.7 times the size of your database storage. For instructions, see Scaling a Database Deployment.
Note:
Older deployments do not support the Extend Backup Storage Volume option, and an error is displayed when you try to use it. In this case, you must manually add backup storage. For instructions, see Increasing Local Storage for Backups on Older Database Deployments.
-
If you are switching to the backup destination Both Cloud Storage and Local Storage or Cloud Storage Only, you must have an Oracle Storage Cloud Service container in your account that is reserved for backups. If you don’t have one, you must create one. See Creating Containers in Using Oracle Storage Cloud Service, or see the tutorial Oracle Storage Cloud Service: Creating Containers Using the REST API.
The commands you use to change the backup destination depend on the type of database running in the database deployment.
Changing the Backup Configuration on Database Deployments Hosting Single-Instance Databases
Oracle Database Classic Cloud Service allows you to change the backup destination for your database deployments after creating them.
Before changing the backup destination, make sure you have performed applicable Prerequisites.
Changing the Backup Configuration on Database Deployments Hosting Oracle RAC Databases
This topic does not apply to Oracle Cloud Infrastructure or to Oracle Cloud at Customer.
Before changing the backup destination, make sure you have performed applicable Prerequisites.
Note:
If you have used the update rdk
subcommand of the raccli
utility to update the cloud tooling to 16.4.5 or later, you must manually update the opc installer for the Oracle Database Cloud Backup Module before you use the update backupconfig
subcommand. For instructions, see in Updating the cloud tooling on a deployment hosting Oracle RAC requires manual update of the Oracle Database Cloud Backup Module in Known Issues for Oracle Database Classic Cloud Service.
Increasing Local Storage for Backups on Older Database Deployments
This topic does not apply to Oracle Cloud Infrastructure.
To create a larger storage volume and use it for backups:
-
Create a storage volume for backups. Its size should be 1.7 times the space allocated for data storage.
Use the Create New Storage Volume option of the Oracle Database Classic Cloud Service console’s scaling feature to add a storage volume of the appropriate size. For instructions, see Scaling a Database Deployment.
-
Connect as the
opc
user to the compute node.For detailed instructions, see Connecting to a Compute Node Through Secure Shell (SSH).
-
Confirm the addition of the storage volume by listing the devices:
$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvdb 202:16 0 21G 0 disk ├─xvdb1 202:17 0 200M 0 part /boot ├─xvdb2 202:18 0 15.8G 0 part / └─xvdb3 202:19 0 4G 0 part [SWAP] xvdc 202:32 0 10G 0 disk └─xvdc1 202:33 0 10G 0 part /u04 xvdd 202:48 0 7G 0 disk └─xvdd1 202:49 0 7G 0 part /u03 xvde 202:64 0 30G 0 disk └─xvde1 202:65 0 30G 0 part /u01 xvdf 202:80 0 11G 0 disk └─xvdf1 202:81 0 11G 0 part /u02 xvdg 202:96 0 17G 0 disk └─xvdg1 202:97 0 17G 0 part /u05
-
Change from the
opc
user to theoracle
user:$ sudo su - oracle
-
As the
oracle
user, use RMAN to shut down the database instance:$ rman target=/ ... RMAN> shutdown immediate; using target database control file instead of recovery catalog database closed database dismounted Oracle instance shut down
Quit RMAN and exit the
oracle
user session:RMAN> quit; Recovery Manager complete. $ exit
-
As the
root
user, copy the content from/u03
(which you have been using for backup storage) to/u05
:# cp -R /u03/* /u05/
-
Unmount the
/u05
and/u03
mount points:# umount /u05/ # umount /u03/
Note:
The Linux unmount command isumount
(with no n). -
Mount the partition of new storage volume you just created to
/u03
, which Oracle Database Classic Cloud Service uses for backups. For example:# mount /dev/xvdg1 /u03
-
Look at the results:
# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT xvdb 202:16 0 21G 0 disk ├─xvdb1 202:17 0 200M 0 part /boot ├─xvdb2 202:18 0 15.8G 0 part / └─xvdb3 202:19 0 4G 0 part [SWAP] xvdc 202:32 0 10G 0 disk └─xvdc1 202:33 0 10G 0 part /u04 xvdd 202:48 0 7G 0 disk └─xvdd1 202:49 0 7G 0 part xvde 202:64 0 30G 0 disk └─xvde1 202:65 0 30G 0 part /u01 xvdf 202:80 0 11G 0 disk └─xvdf1 202:81 0 11G 0 part /u02 xvdg 202:96 0 17G 0 disk └─xvdg1 202:97 0 17G 0 part /u03
The old 7 GB partition
xvdd1
, which was previously mounted to/u03
, is no longer mounted at all. The new 17 GB partitionxvdg1
is now mounted to/u03
and will therefore be used for backups. Note that the space used forxvdd1
is now no longer available for any use. -
Set the ownership and permissions of the mount-point directory
/u03
. For example:# chown -R oracle:oinstall /u03 # chmod 755 /u03
-
As the
oracle
user, start SQL*Plus, connect to the database as SYSDBA, and start it. For example:$ sqlplus /nolog SQL*Plus: Release 12.1.0.2.0 Production on Sat Feb 21 13:19:51 2015 Copyright (c) 1982, 2014, Oracle. All rights reserved. SQL> connect sys/password as sysdba Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 3170893824 bytes Fixed Size 2929400 bytes Variable Size 1845497096 bytes Database Buffers 1308622848 bytes Redo Buffers 13844480 bytes Database mounted. Database opened.
-
If you want to see the current setting for the limit on the total space to be used by target database recovery files, show the values of the parameter
DB_RECOVERY_FILE_DEST
, for example:SQL> show parameter db_recovery_file_dest NAME TYPE VALUE ---------------------------- ----------- ------------------------------ db_recovery_file_dest string /u03/app/oracle/fast_recovery_ area db_recovery_file_dest_size big integer 7G
-
Increase the parameter
DB_RECOVERY_FILE_DEST_SIZE
to use the new extra space in/u03
, for example:SQL> alter system set db_recovery_file_dest_size=17G; System altered.
-
Show the new value:
SQL> show parameter db_recovery_file_dest; NAME TYPE VALUE ---------------------------- ----------- ------------------------------ db_recovery_file_dest string /u03/app/oracle/fast_recovery_ area db_recovery_file_dest_size big integer 17G
-
Quit SQL*Plus and log out:
SQL> quit; Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production $ exit