Note:

Simplify Data Sharing Between Oracle Autonomous Database Serverless on Oracle Database@Google Cloud and Google Cloud Filestore

Introduction

The era of multicloud and hybrid cloud strategies is in full swing, with enterprises seeking the best-of-breed services from different providers to drive innovation and optimize costs. The ground-breaking partnership between Oracle and Google Cloud, delivering Oracle Database@Google Cloud, exemplifies this trend. This offering allows organizations to run Oracle database services, including the highly popular Oracle Autonomous Database Serverless (Autonomous Database Serverless), directly within Google Cloud data centers, providing low-latency access to Google Cloud’s rich ecosystem of services.

A common requirement in such environments is the ability to access shared file systems for various purposes, such as storing application binaries, staging data for Extract, Transform, Load (ETL) processes, sharing large datasets for analytics, or for backup and recovery operations. This is where Google Cloud Filestore, a fully managed, high-performance Network File System (NFS) file storage service, comes into play. Integrating Google Cloud Filestore with your Autonomous Database Serverless on Oracle Database@Google Cloud can unlock significant operational efficiencies and new architectural possibilities.

Accessing Google Cloud Filestore from Oracle Autonomous Database Serverless on Oracle Database@Google Cloud provides a powerful solution for managing and sharing file-based data within your integrated cloud environment. By carefully planning your network architecture, DNS, and database configurations, you can seamlessly bridge these two leading services, enabling more flexible and efficient data operations. This integration underscores the commitment of Oracle and Google Cloud to provide customers with choice and robust capabilities in the multicloud landscape.

Why Connect Autonomous Database Serverless with Google Cloud Filestore?

Combining the power of Autonomous Database Serverless with the flexibility of Google Cloud Filestore offers several advantages:

Architectural Overview

Integrating Autonomous Database Serverless on Oracle Database@Google Cloud with Google Cloud Filestore involves a secure and efficient network setup.

Architecture

Considerations

Objectives

Note: Even though the specific commands might change over time, the overall method like setting up the network configuration, DNS resolution, database Access Control Lists (ACLs), and directory within the Autonomous Database Serverless will generally be the same.

Task 1: Provision a Google Cloud Filestore

  1. Create a Google Cloud Filestore instance in the same Google Cloud region as your Oracle Database@Google Cloud deployment to minimize latency.

  2. Select the appropriate service tier (for example, Basic, Zonal, Enterprise) based on your performance and availability requirements.

  3. Note the Google Cloud Filestore instance private IP address and the NFS share path (for example, 10.85.174.250:/nfsshare).

    Filestore

Task 2: Set up Network Connectivity

Ensure your Google Cloud Virtual Private Cloud (VPC) where the Google Cloud Filestore resides has private network connectivity (for example, VPC Network Peering) to the OCI VCN used by your Oracle Database@Google Cloud autonomous database. This is fundamental for secure and low-latency communication.

Task 3: Configure DNS Resolution (Crucial for Autonomous Database Serverless)

Autonomous Database Serverless uses OCI private DNS for name resolution. By default, OCI private DNS does not integrate with Google Cloud DNS. There are two ways to enable DNS resolution for Autonomous Database Serverless in this setup.

In this tutorial, we will use the second option, create a local private DNS zone in OCI.

Autonomous Database Serverless typically requires Fully Qualified Domain Names (FQDNs) to access network resources rather than IP addresses directly for NFS mounts.

  1. In the Google Cloud Console, click Manage in OCI.

  2. Navigate to your VCN’s DNS resolver.

  3. Create a private DNS zone (for example, nfs.gcp).

    Architecture

  4. Add an A record within this zone that maps a selected FQDN (for example, nfs-server.nfs.gcp) to the private IP address of your Google Cloud Filestore instance.

    Architecture

Task 4: Grant Network ACLs in Autonomous Database Serverless

  1. Connect to your Autonomous Database Serverless as an ADMIN user.

  2. Set the ROUTE_OUTBOUND_CONNECTIONS database property to the value PRIVATE_ENDPOINT to enforce that all outgoing connections to a target host are subject to and limited by the private endpoint’s egress rules.

    ALTER DATABASE PROPERTY SET ROUTE_OUTBOUND_CONNECTIONS = 'PRIVATE_ENDPOINT';
    
  3. Use the DBMS_NETWORK_ACL_ADMIN package to grant the necessary connect and resolve privileges to your database user (or ADMIN user) for the FQDN of the Google Cloud Filestore instance.

    BEGIN
        DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE( host  => 'nfs-server.nfs.gcp', -- Your Filestore FQDN 
                                                ace  => xs$ace_type(
                                                        privilege_list => xs$name_list('connect', 'resolve'),
                                                        principal_name =>'YOUR_DB_USER', -- Or 'ADMIN' 
                                                        principal_type => xs_acl.ptype_db
                                                    )
    ); 
    END; 
    /
    

Task 5: Create a Directory Object in Autonomous Database Serverless

Once ACLs are set, create a directory object in your Autonomous Database Serverless that points to the NFS mount.

CREATE or replace DIRECTORY FSS_DIR AS 'fss'; 

Task 6: Attach NFS to Autonomous Database Serverless

Set the NFS version accordingly in the parameter params => JSON_OBJECT('nfs_version' value <value>).

BEGIN
DBMS_CLOUD_ADMIN.ATTACH_FILE_SYSTEM(
    file_system_name => 'GCPNFS',
    file_system_location => 'nfs-server.nfs.gcp:/nfsshare',
    directory_name => 'FSS_DIR',
    description => 'Attach GCP NFS',
    params => JSON_OBJECT('nfs_version' value 3)
);
END;
/

This procedure effectively creates or links a database directory object (for example, GCPNFS) to the specified NFS path.

Task 7: Access the Files

Run the SQL statement to verify that you can access the files under the directory.

SELECT object_name FROM DBMS_CLOUD.LIST_FILES('FSS_DIR');

Once the directory object is created and associated with the Google Cloud Filestore NFS mount, you can use it in PL/SQL (for example, UTL_FILE), Oracle SQL*Loader, Data Pump, or for creating external tables to read from or write to files on the Google Cloud Filestore share, subject to database user privileges on the directory object.

Acknowledgments

More Learning Resources

Explore other labs on docs.oracle.com/learn or access more free learning content on the Oracle Learning YouTube channel. Additionally, visit education.oracle.com/learning-explorer to become an Oracle Learning Explorer.

For product documentation, visit Oracle Help Center.