Managing Exadata Database Backups by Using bkup_api

You can use Exadata's backup utility, bkup_api, to back up databases on an Exadata Cloud Service instance to an existing bucket in the Oracle Cloud Infrastructure Object Storage service and to the local disk Fast Recovery Area.

For backups managed by Oracle Cloud Infrastructure, see Managing Exadata Database Backups.

This topic explains how to:

  • Create a backup configuration file that indicates the backup destination, when the backup should run, and how long backups are retained. If the backup destination is Object Storage, the file also contains the credentials to access the service.
  • Associate the backup configuration file with a database. The database will be backed up as scheduled, or you can create an on-demand backup.
Note

You must update the cloud-specific tooling on all the compute nodes in your Exadata Cloud Service instance before performing the following procedures. For more information, see Updating an Exadata Cloud Service Instance.

Prerequisites

  • The Exadata Cloud Service instance requires access to the Oracle Cloud Infrastructure Object Storage service. Oracle recommends using a service gateway with the VCN to enable this access. For more information, see Network Setup for Exadata Cloud Service Instances. In that topic, pay particular attention to:

  • An existing Object Storage bucket to use as the backup destination. You can use the Console or the Object Storage API to create the bucket. For more information, see Managing Buckets.
  • An auth token generated by Oracle Cloud Infrastructure. You can use the Console or the IAM API to generate the password. For more information, see Working with Auth Tokens.
  • The user name specified in the backup configuration file must have tenancy-level access to Object Storage. An easy way to do this is to add the user name to the Administrators group. However, that allows access to all of the cloud services. Instead, an administrator should create a policy like the following that limits access to only the required resources in Object Storage for backing up and restoring the database:

    Allow group <group_name> to manage objects in compartment <compartment_name> where target.bucket.name = '<bucket_name>'
    
    Allow group <group_name> to read buckets in compartment <compartment_name>

    For more information about adding a user to a group, see Managing Groups. For more information about policies, see Getting Started with Policies.

Default Backup Configuration

The backup configuration follows a set of Oracle best-practice guidelines:

  • Full (level 0) backup of the database followed by rolling incremental (level 1) backups on a seven-day cycle (a 30-day cycle for the Object Storage destination).
  • Full backup of selected system files.
  • Automatic backups daily at a specific time set during the database deployment creation process.

Retention period:

  • Both Object Storage and local storage: 30 days, with the 7 most recent days' backups available on local storage.
  • Object Storage only: 30 days.
  • Local storage only: Seven days.

Encryption:

  • Both Object Storage and local storage: All backups to cloud storage are encrypted.
  • Object Storage only: All backups to cloud storage are encrypted.

Managing Backups

To create a backup configuration file
Important

The following procedure must be performed on the first compute node in the Exadata Cloud Service instance's VM cluster or DB system resource. To determine the first compute node, connect to any compute node as the grid user and execute the following command:

$ $ORACLE_HOME/bin/olsnodes -n

The first node has the number 1 listed beside the node name.

  1. SSH to the first compute node in the VM cluster or DB system resource.

    ssh -i <private_key_path> opc@<node_1_ip_address>
  2. Log in as opc and then sudo to the root user.

    
    login as: opc
    
    [opc@dbsys ~]$ sudo su -
    
  3. Create a new backup configuration file in /var/opt/oracle/ocde/assistants/bkup/ as shown in the sample configuration file below. This example uses the file name bkup.cfg, but you can provide your own file name. The following file schedules a backup to both local storage and an existing bucket in Object Storage.

    The parameters are described below this procedure.

    [root@dbsys ~]# cd /var/opt/oracle/ocde/assistants/bkup/
    
    vi bkup.cfg
    bkup_disk=yes
    bkup_oss=yes
    bkup_oss_url=https://swiftobjectstorage.<region>.oraclecloud.com/v1/companyabc/DBBackups
    bkup_oss_user=<oci_user_name>
    bkup_oss_passwd=<password>
    bkup_oss_recovery_window=7
    bkup_daily_time=06:45
    
  4. Change the permissions of the file.

    [root@dbsys bkup]# chmod 600 bkup.cfg
    
  5. Use the following command to install the backup configuration, configure the credentials, schedule the backup, and associate the configuration with a database name.

    [root@dbsys bkup]# ./bkup -cfg bkup.cfg -dbname=<database_name>

    The backup is scheduled via cron and can be viewed at /etc/crontab.

When the scheduled backup runs, you can check its progress with the following command.

[root@dbsys bkup]# /var/opt/oracle/bkup_api/bkup_api bkup_status

The backup configuration file parameters are described in the following table:

Parameter Description
bkup_disk=[yes|no] Whether to back up locally to disk (Fast Recovery Area).
bkup_oss=[yes|no] Whether to back up to Object Storage. If yes, you must also provide the parameters bkup_oss_url, bkup_oss_user, bkup_oss_passwd, and bkup_oss_recovery_window.
bkup_oss_url=<swift_url>

Required if bkup_oss=yes.

The Object Storage URL including the tenant and bucket you want to use. The URL is:

https://swiftobjectstorage.<region_name>.oraclecloud.com/v1/<tenant>/<bucket>

where <tenant> is the lowercase tenant name (even if it contains uppercase characters) that you specify when signing in to the Console and <bucket> is the name of the existing bucket you want to use for backups.

bkup_oss_user=<oci_user_name>

Required if bkup_oss=yes.

The user name for the Oracle Cloud Infrastructure user account. This is the user name you use to sign in to the Oracle Cloud Infrastructure Console.

For example, jsmith@example.com for a local user or <identity_provider>/jsmith@example.com for a federated user.

To determine which type of user you have, see the following topics:

Note that the user must be a member of the Administrators group, as described in Prerequisites.

bkup_oss_passwd=<auth_token>

Required if bkup_oss=yes.

The auth token generated by using the Console or IAM API, as described in Prerequisites.

This is not the password for the Oracle Cloud Infrastructure user.

bkup_oss_recovery_window=n

Required if bkup_oss=yes.

The number of days for which backups and archived redo logs are maintained in the Object Storage bucket. Specify 1 to 30 days.

bkup_daily_time=hh:mm The time at which the daily backup is scheduled, specified in hours and minutes (hh:mm), in 24-hour format.
To create an on-demand backup

You can use the bkup_api utility to create an on-demand backup of a database.

  1. SSH to the first compute node in the Exadata VM cluster or DB system resource.

    ssh -i <private_key_path> opc@<node_1_ip_address>

    To determine the first compute node, connect to any compute node as the grid user and execute the following command:

    $ $ORACLE_HOME/bin/olsnodes -n

    The first node has the number 1 listed beside the node name.

  2. Log in as opc and then sudo to the root user.

    
    login as: opc
    
    [opc@dbsys ~]$ sudo su -
    
  3. You can let the backup follow the current retention policy, or you can create a long-term backup that persists until you delete it:

    • To create a backup that follows the current retention policy, enter the following command:

      # /var/opt/oracle/bkup_api/bkup_api bkup_start --dbname=<database_name>
    • To create a long-term backup, enter the following command:

      # /var/opt/oracle/bkup_api/bkup_api bkup_start --keep --dbname=<database_name>
  4. Exit the root-user command shell and disconnect from the compute node:

    # exit
    $ exit

By default, the backup is given a timestamp-based tag. To specify a custom backup tag, add the --tag option to the bkup_api command; for example, to create a long-term backup with the tag "monthly", enter the following command:

# /var/opt/oracle/bkup_api/bkup_api bkup_start --keep --tag=monthly

After you enter a bkup_api bkup_start command, the bkup_api utility starts the backup process, which runs in the background. To check the progress of the backup process, enter the following command:

# /var/opt/oracle/bkup_api/bkup_api bkup_status --dbname=<database_name>
To remove the backup configuration

A backup configuration can contain the credentials to access the Object Storage bucket. For this reason, you might want to remove the file after successfully configuring the backup.

[root@dbsys bkup]# rm bkup.cfg
To delete a local backup

To delete a backup of a database deployment on the Exadata Cloud Service instance, use the bkup_api utility.

  1. Connect to the first compute node in your Exadata VM cluster or DB system resource as the opc user.

    To determine the first compute node, connect to any compute node as the grid user and execute the following command:

    $ $ORACLE_HOME/bin/olsnodes -n

    The first node has the number 1 listed beside the node name.

  2. Start a root-user command shell:

    $ sudo -s#
  3. List the available backups:

    # >/var/opt/oracle/bkup_api/bkup_api recover_list --dbname=<database_name>

    where dbname is the database name for the database that you want to act on.

    A list of available backups is displayed.

  4. Delete the backup you want:

    # /var/opt/oracle/bkup_api/bkup_api bkup_delete --bkup=<backup-tag> --dbname=<database_name>

    where backup-tag is the tag of the backup you want to delete.

  5. Exit the root-user command shell:

    # exit$
To delete a backup in Object Storage

Use the RMAN delete backup command to delete a backup from the Object Store.

What Next?

If you used Object Storage as a backup destination, you can display the backup files in your bucket in the Console on the Storage page, by selecting Object Storage.

You can manually restore a database backup by using the RMAN utility. For information about using RMAN, see the Oracle Database Backup and Recovery User's Guide for Release 18.1, 12.2, 12.1, or 11.2.