top of page

Setting Up Object Storage bucket to receive export backups from an ADW

Setting up an Oracle Cloud Infrastructure (OCI) Object Storage bucket to receive export backups from an Autonomous Data Warehouse (ADW) involves a few crucial steps. I'll guide you through setting up the bucket, creating necessary credentials, and configuring your ADW to export data using Oracle Data Pump. This setup will enable you to securely and efficiently handle database backups.


### Step 1: Create and Configure an OCI Object Storage Bucket


1. **Log in to OCI Console**:

- Access the Oracle Cloud Infrastructure console using your credentials.


2. **Navigate to Object Storage**:

- From the hamburger menu in the upper left corner, go to **Storage** -> **Object Storage**.


3. **Create a New Bucket**:

- Select the correct compartment where you want to create the bucket.

- Click on **Create Bucket**.

- Enter a name for your bucket.

- Choose the storage tier (Standard or Archive depending on your access needs).

- Leave the default settings for encryption (which is to use Oracle-managed keys) or change as per your policy.

- Click **Create**.


### Step 2: Create a Database Credential for Object Storage


To allow your ADW to authenticate with OCI Object Storage, you need to create a database credential using a user's OCI credentials and an auth token.


1. **Generate an Auth Token**:

- Navigate to your user settings in the OCI console.

- Under **Resources**, click on **Auth Tokens**.

- Click **Generate Token**.

- Give it a description, then click **Generate Token**.

- Copy and securely store the token; you will not be able to see it again after you close the window.


2. **Create the Database Credential**:

- Connect to your ADW instance using a tool like SQL Developer, SQLcl, or SQL*Plus.

- Execute the following PL/SQL block to create the credential:

```sql

BEGIN

DBMS_CLOUD.CREATE_CREDENTIAL(

credential_name => 'MY_OCI_CREDENTIAL',

username => 'your_oci_user_email@example.com',

password => 'your_auth_token_copied_earlier'

);

END;

/

```

- Replace `your_oci_user_email@example.com` with your OCI user email and `your_auth_token_copied_earlier` with the auth token you generated.


### Step 3: Configure Data Pump to Use Object Storage


With the bucket and credentials configured, you can now set up Data Pump to export data directly to your Object Storage bucket.


1. **Create a Data Pump Directory**:

- This directory will be a logical directory within your database that points to the Object Storage bucket.

- Execute the following SQL command:

```sql

CREATE OR REPLACE DIRECTORY data_pump_dir AS 'https://objectstorage.{region}.oraclecloud.com/n/{namespaceName}/b/{bucketName}/o/';

```

- Replace `{region}`, `{namespaceName}`, and `{bucketName}` with your specific values.


2. **Perform Data Export**:

- Use the `expdp` command to start the export process, specifying the directory and credential you created:

```sql

expdp admin/password schemas=your_schema_name directory=data_pump_dir credential=MY_OCI_CREDENTIAL dumpfile=expdp_yourschema_%U.dmp logfile=expdp_yourschema.log parallel=4

```

- Adjust the command according to your schema name and parallelism preferences.


### Step 4: Monitoring and Management


- **Monitor the Export**: Check the log file `expdp_yourschema.log` in your Object Storage bucket to monitor the progress and completion of the export.

- **Manage Backups**: Regularly review and manage the backups in your bucket, setting up lifecycle policies if necessary to archive or delete old backups.


This setup ensures your ADW can export data securely to OCI Object Storage, providing a robust backup solution that leverages Oracle's cloud infrastructure.

19 views

Recent Posts

See All

Comentarios


AiTech

©2023 by AiTech

bottom of page