Backing Up an Autonomous Database Manually

This topic describes how to create manual backups of Autonomous Databases. You can use the Oracle Cloud Infrastructure Console or the API to perform these tasks.

Oracle Cloud Infrastructure automatically backs up your Autonomous Databases and retains these backups for 60 days. Automatic backups are weekly full backups and daily incremental backups. You can also create manual backups to supplement your automatic backups. Manual backups are stored in an Object Storage bucket that you create, and are retained for 60 days.

Note

During the backup operation, the database remains available. However, lifecycle management operations such as stopping the database, scaling it, or terminating it are disabled.

Prerequisites

  • To create or manage Autonomous Database backups, you must be given the required type of access in a policy  written by an administrator, whether you're using the Console or the REST API with an SDK, CLI, or other tool. If you try to perform an action and get a message that you don’t have permission or are unauthorized, confirm with your administrator the type of access you've been granted and which compartment  you should work in. See Authentication and Authorization for more information on user authorizations for the Oracle Cloud Infrastructure Database service. See Let database and fleet admins manage Autonomous Databases for sample Autonomous Database policies. See Details for the Database Service for detailed information on policy syntax.

  • To create a manual backup for an Autonomous Database, you must first configure an Object Storage bucket to serve as a destination for your manual backups. See Setting Up a Bucket to Store Manual Backups for instructions.

Using the Console

  1. Open the navigation menu. Under Oracle Database, click Autonomous Data Warehouse, Autonomous JSON Database, or Autonomous Transaction Processing.
  2. Choose your Compartment.
  3. In the list of Autonomous Databases, find the database that you want to back up.
  4. Click the name of the Autonomous Database to display the Autonomous Database details.
  5. In the database details page, click Create Manual Backup.

    The create Manual Backup dialog box is displayed.

    1. If you have properly configured your database for manual backups, continue to step 6.
    2. If the database is not properly configured for manual backups, a message box informs you that you must first configure the database before you can create a manual backup. See Setting Up a Bucket to Store Manual Backups for instructions.
    3. Click Close, configure your database according to the instructions, and click Create Manual Backup again.
  6. In the Create Manual Backup dialog box, enter a name for your backup. Avoid entering confidential information.
  7. In the Create Manual Backup dialog box, click Create.
    Note

    Your backup may take several hours to complete, depending on the size of your database.
  8. Optionally, you can check the state of your backup in the list of backups on the database details page. For some states, an information icon (encircled i) is displayed to provide additional details regarding the state or ongoing operations like deletions. The backup has one of the following states:

    • Creating
    • Active
    • Deleting
    • Deleted
    • Failed

Setting Up a Bucket to Store Manual Backups

You must create an Oracle Cloud Infrastructure Object Storage bucket to hold your Autonomous Database manual backups and configure your database to connect to it. This is a one-time operation.

To set up an object store and user credentials for your manual backups

Some of the steps in this procedure require you to connect to the database by using an Oracle Database client such as SQL Developer. See Connecting with Oracle SQL Developer (18.2 or later) for information and instructions on connecting to an Autonomous Transaction Processing database. See Connecting with Oracle SQL Developer (18.2 or later) for information and instructions on connecting to an Autonomous Data Warehouse database.

  1. If you have not already done so, generate an auth token for the Oracle Cloud Infrastructure Object Storage user to access the bucket you create in the next step. See To create an auth token to learn how to do this. (You will need this auth token for the database credential you create in step 4.)

  2. In the Oracle Cloud Infrastructure Console, create a bucket in your designated Object Storage Swift compartment to hold the backups.

    For example, if your backup bucket is named "backup_database1", the URL would be:

    Note

    When you create your bucket:

    • Pick Standard as the storage tier. Manual backups are only supported with buckets created in the standard storage tier.
    • Ensure that you use the database name, and not the display name, as the bucket name.
  3. Using an Oracle Database client, log in to the database as the administrator set the database DEFAULT_BACKUP_BUCKET property to the URL of your Object Storage bucket. The format of the tenancy URL is https://swiftobjectstorage.region.oraclecloud.com/v1/object_storage_namespace/bucket_name.

    For example:

    ALTER DATABASE PROPERTY SET default_backup_bucket='https://swiftobjectstorage.us-phoenix-1.oraclecloud.com/v1/ansh8lvru1zp/backup_database1';In the example, the Object Storage namespace is ansh8lvru1zp.
    Tip

    • To determine the Object Storage namespace string to use, click View Bucket in the actions (three dots) menu of the bucket you created in the previous step.
    • Do not include the bucket name in the URL.
    • Ensure that you follow the format indicated. Do not use a pre-authenticated request URL.
  4. With the tenancy user and the auth token referenced in step 1, create the credential for your Oracle Cloud Infrastructure Object Storage account. Use DBMS_CLOUD.CREATE_CREDENTIAL to create the credential.

    For example:

    
    BEGIN
    DBMS_CLOUD.CREATE_CREDENTIAL(
    credential_name => 'DEF_CRED_NAME',
    username => 'db1_user@oracle.com', 
    password => '<auth_token>'
    );
    END;
    /				

    For more information on creating this credential, see CREATE_CREDENTIAL Procedure.

  5. Set the database property default_credential to the credential you created in the previous step.

    For example:

    ALTER DATABASE PROPERTY SET DEFAULT_CREDENTIAL = 'ADMIN.DEF_CRED_NAME';

To list the current value for the default bucket, run the following command:

SELECT PROPERTY_VALUE from database_properties WHERE PROPERTY_NAME='DEFAULT_BUCKET';

After completing these steps you can take manual backups any time you want.

Manual Backup Notes

Database configuration notes:

  • If you previously configured manual backups using the DEFAULT_BUCKET property, you do not need to make any changes to perform manual backups with your existing configuration. In this case, the DEFAULT_BUCKET property is set to the value of Oracle Cloud Infrastructure Object Storage tenancy URL and the required bucket name is in the format of backup_databasename, where databasename is lowercase. However, Oracle recommends that you configure Autonomous Database for manual backups using the DEFAULT_BACKUP_BUCKET database property.
  • If you previously configured Autonomous Database to use manual backups using the DEFAULT_BUCKET property and created backups, then after configuring the DEFAULT_BACKUP_BUCKET property to use a new manual backup bucket, the old manual backups in the old bucket are not available for restore. If you want to use the old backups then you must change the value of the DEFAULT_BACKUP_BUCKET property to specify the URL of the old manual backup bucket.
  • If you previously configured Autonomous Database to use manual backups and you rename your Autonomous Database, then your backups will continue to work without changes.

Manual backup notes:

  • Each manual backup creates a full backup on your Oracle Cloud Infrastructure Object Storage bucket and the backup can only be used by the Autonomous Database instance when you initiate a point-in-time-recovery.
  • The retention period for manual backups is the same as for automatic backups, which is 60 days.
  • While backing up a database, the database is fully functional. However, during the backup the lifecycle management operations, such as stopping the database, are not allowed.