Oracle Cloud Infrastructure (OCI): Using Automated Backups Cross-Regionally
This article delivers a comprehensive overview of the various database backup types available in Oracle Cloud Infrastructure (OCI). It examines the challenges tied to automated backups and provides a detailed, step-by-step guide on leveraging the mv2bucket utility to replicate automatic backups from an Oracle-managed bucket in the Ashburn region to a customer-managed bucket in the Phoenix region.
Oracle Database Backups in OCI
In Oracle Cloud, there are two primary types of database backups: Automated and Manual. For Exadata databases, automated backups are further categorized into two options: Autonomous Recovery Service and Oracle Object Storage.
Automated backups are initiated during the daily backup window, with the option to define a specific 2-hour scheduling window within which the backup process will begin. There are 12 scheduling windows available, each starting on an even-numbered hour (e.g., 0:00-2:00 AM or 8:00-10:00 AM). While the backup process starts within the selected window, completion may extend beyond it.
Manual backups, on the other hand, provide greater control over the timing and method of backup creation. You can initiate full or incremental backups at any time, independent of the automated schedule. These manual backups are stored in Oracle Object Storage, but they can also be downloaded or archived elsewhere as needed, offering flexibility in managing backup frequency and storage.
Manual backups can be replicated across regions using either Object Storage or File Storage replication policies, while Automated backups are stored in Oracle-managed Object Storage buckets within the same OCI region. However, Oracle has not yet introduced a built-in cloud tool for cross-region backup replication. At present, the only available solution is MV2Bucket, which allows access to the Oracle-managed bucket and enables replication to a customer-managed bucket across regions.
Real-world Example
Apps Associates has more than 20 years of experience in Oracle management, including Cloud Infrastructure and data storage. Consider these challenges, environments, and solutions we have addressed for customers:
Challenges:
- In OCI, automatic database backups are stored in Oracle-managed Object Storage, where customer access and privileges are highly restricted.
- OCI does not natively support restoring these backups across regions or to a compute node.
- The OCI console and OCI CLI do not provide functionality to transfer automatic backups from Oracle-managed buckets to customer-managed buckets.
Environment:
- Two-node Exadata system in the Ashburn region running Oracle Database version 19c, with automatic backups enabled.
- An Object Storage bucket in the Phoenix region configured with the standard storage tier.
- Two-node Exadata system in the Phoenix region, also running Oracle Database version 19c, designated for restoring the database from backups.
Implementation:
Oracle provides the mv2bucket utility as an RPM package, which can be configured either on the database server or on a separate server to reduce the load on the database server. However, configuring it on a separate server requires meeting additional prerequisites.
Pre-Requisites:
- OCI CLI
- Cloud Backup Module
- Oracle Home/SQLCL (if configuring on a compute node)
- Staging Location: This can be a local disk or an Oracle Managed Bucket (OMB) mounted as an NFS disk to avoid the cost of additional storage. Mounting OMB as NFS requires the s3fs-fuse utility.
How to Set Up mv2bucket:
Instructions:
- Create or Identify Service Account: Set up a new service account or identify an existing one to enable backup replication.
- Provision Object Storage Bucket: Create an Object Storage bucket in the Phoenix region for storing replicated backups.
- Define Policies: Develop and apply policies to grant the necessary privileges for replication to the service account.
- Install and Configure OCI CLI Tools: Use the recommended manual installation method to avoid conflicts with RPMs on the database server, which could cause issues during future operating system updates.
- Install s3fs-fuse Utility (Optional): If the Oracle/Customer-Managed bucket needs to be mounted as local storage for replication to avoid additional cost, install the s3fs-fuse utility.
- Install and Configure Backup Module: Set up the backup module to facilitate integration with Oracle backup solutions
- Install mv2bucket Utility:
- Download the latest version of mv2bucket (e.g., mv2bucket-2.0.1-11.el7.x86_64.rpm) from the Attachments section of Doc ID 2723911.1.
- Install the downloaded RPM.
- Set Up Oracle Home or SQLCL: Install Oracle Home or SQLCL, especially if the configuration is performed on a compute node where the database is not running.
- Validate RMAN Backup Access: Confirm that RMAN backup pieces are accessible from the Automatic Backups using mv2bucket tool
- Prepare Staging Directory:
- Create a staging directory to download Automatic Backups from the Oracle-Managed bucket to local storage.
- Alternatively, mount the Customer-Managed bucket to ensure files are automatically accessible in the target phoenix region bucket
- Copy Backup Files to Remote Bucket: Transfer the contents of the staging area to the target bucket created in Step 2.
- Note 1: Backup replication can be executed using a two-step process with GET and LOAD options, or a single-step process with the COPY option, which performs both operations.
- Note 2: The mv2bucket utility copies all existing files in the bucket, including full, incremental, archive, and control file backups. Use the –incremental option to copy only missing files to the target bucket.
- Note 3: To replicate backup files with specific RMAN tags, use the –filter option, which supports wildcards.
- Validate Backup Replication: Confirm the successful replication of backups to the Phoenix region by either restoring the database in the target region or executing the RESTORE DATABASE VALIDATE command to verify without performing an actual restoration.
Operations Performed with mv2bucket:
- GET: Downloads backups from the Oracle Managed Bucket to a local disk or staging folder.
- LOAD: Uploads backups from the local disk or staging folder to the target customer-managed bucket.
- COPY: Performs both GET and LOAD operations in sequence.
- PURGE: Deletes data from the customer-managed bucket that is no longer present in the Oracle Managed Bucket due to the retention period.
- CLEANUP: Cleans up data/files from the staging folder and the customer-managed bucket.
- LIST: Lists the contents of a bucket.
- SIZE: Fetches a list of files and their sizes from the Oracle/Customer Managed Buckets and the staging folder.
- REPORT: Displays a metadata-based report of the contents in the Oracle/Customer Managed Bucket or the staging area.
- OPCINFO: Displays OPC file and wallet information.
- File Storage Service Snapshots Life-Cycle Management: Includes operations like makesnap (create snapshot), listsnap (list snapshots), and deletesnap (delete snapshot).
Limitations:
- Oracle rotates the wallet every three days or after each full backup. If the backup download process occurs during this rotation, it will fail with authentication errors.
- Consider disabling backups or ensuring that mv2bucket does not run while a backup is in progress, as mv2bucket cannot guarantee a consistent backup copy during this time.
- Sufficient space must be available in the staging area to store the contents of the Oracle Managed Bucket.
- mv2bucket does not interpret the content of RMAN files; it simply copies everything from the Oracle Managed Bucket.
- mv2bucket cannot guarantee the consistency of the backup. After copying, you must validate the backup by restoring it on another database.
At Apps Associates, we understand the critical importance of reliable and efficient backup solutions for your Oracle environments. As a trusted Oracle partner, we are uniquely positioned to help you determine the best approach for your backup needs, whether automated or manual, and to leverage tools like mv2bucket for seamless, secure data management. If you have any questions or would like expert guidance, don’t hesitate to reach out to our team. We’re here to ensure your success every step of the way.