How to Deploy Oracle Autonomous AI Database@Google on Google Cloud

Oracle AI Database@Google Cloud enables organisations to run Oracle database services on Oracle Cloud infrastructure directly within Google Cloud data centres.

For organisations that already rely on Oracle Database while investing strategically in Google Cloud, the value proposition is straightforward:

  • Modernise without unnecessary re-platforming — retain Oracle database capabilities while moving application development and cloud services closer to Google Cloud.
  • Bring AI closer to enterprise data — combine governed Oracle data with Google Cloud services such as Gemini Enterprise Agent Platform.
  • Reduce multicloud complexity — streamlining procurement process, use the existing Google credits to run the Oracle AI database and procure via Google Marketplace
  • Improve developer productivity — allow developers to build with Python, Java, Node.js, Kubernetes, Streamlit and other Google Cloud services while accessing Oracle Autonomous AI Database.
  • Reduce operational overhead — use Autonomous AI Database capabilities to automate routine database administration, tuning and scaling.
  • Preserve enterprise data governance — keep Oracle Database as the system of record while exposing controlled data and services to cloud-native applications and AI workloads.

High Level Architecture:

 

In this simple demo, I have created an Autonomous AI Database@Google which can only be accessed via private connectivity. 

I have used the public offer model which gives you access to Autonomous AI Database@Google via a PAYG model.

Since it’s a public offer – the linking process will involve provisioning a new OCI cloud account where your Oracle AI database is provisioned.

 

A developer can create a GCP  cloud VM and access the Oracle database through the Google VPC network and the associated ODB Network.

As this is a high level write up, some steps may have been skipped!

Assumption: Account Linking already done!

  1. Provision the Google VPC network on your preferred region (I am using europe-west2 Region. Add an application subnet. 

Subnet rage: 10.1.0.0/24

The important thing to note is that this VPC network will also be associated with your ODB Network. Google describes the ODB Network as the bridge between the Google VPC and the OCI child site hosting the Oracle database services.

2. Create an ODB Network and Subnet

In Google Cloud Console:

Oracle Database@Google Cloud → ODB Networks → Create

Select:

Associated VPC: The VPC Network you created above
Region: europe-west2 (or the region of your VPC)
ODB network: odb-db2-subnet (or your prefered name)

Create a subnet- make sure that the CIDR doesn’t conflict with the existing Google VPC ranges.

Subnet rage: 10.2.0.0/24 

3. Provision the Autonomous AI Database @Google

Instance ID: oracledemo1
Database name: ORACLEDEMO1
Region: europe-west2
Workload: Transaction Processing
ECPU: minimum suitable for demo
Autoscaling: enabled if desired
Storage: minimum suitable for demo
Networking: Private endpoint
ODB Network: <Your ODB Network>
ODB Subnet: <Your ODB Subnet>
Authentication: mTLS

4. Create the Google Compute Engine VM

Create a Google compute vm, place it under the VPC network above using the application subnet you created before. (Allow it to be accessed externally via an external IP.

zone=europe-west2
machine-type=e2-medium
subnet=<app-subnet you created earlier>

Access it using your favorite SSH client. 

(I have done a blog on that here )

5. Download the Autonomous AI Database Wallet and upload it on the compute VM.

In GCP console, go to Autonomous AI Database -> Connections -> Download Wallet

Copy the Zip file to the VM.

Create a dedicated wallet folder:

mkdir -p ~/wallet

Move it:

mv Wallet_ORACLEDEMO1.zip ~/wallet/

Extract it:

cd ~/wallet
unzip Wallet_ORACLEDEMO1.zip

Verify:

ls -lah


For python-oracledb Thin mode, the important files are:

 

tnsnames.ora
ewallet.pem

Oracle specifically documents these two as the required wallet files for Thin mode.

6. Create a Python virtual environment

Run:

python3 -m venv ~/.adb-env

Activate it:

source ~/.adb-env/bin/activate

Upgrade pip:

python -m pip install –upgrade pip

Install Oracle’s driver:

python -m pip install oracledb

7. Create environment variables

export DB_USER='ADMIN'
export DB_PASSWORD='YOUR_DATABASE_PASSWORD'
export WALLET_PASSWORD='YOUR_WALLET_PASSWORD'
export DB_DSN='oracledemo1_high' (from your database naming)
export WALLET_DIR="$HOME/wallet"

Save the above as a file ie. .dbvariables.env -> to run on the VM terminal:

source ~/.dbvariables.env

To verify:

echo "DB_USER=$DB_USER"
echo "DB_DSN=$DB_DSN"
echo "WALLET_DIR=$WALLET_DIR"

[ -n "$DB_PASSWORD" ] && echo "DB_PASSWORD is set"
[ -n "$WALLET_PASSWORD" ] && echo "WALLET_PASSWORD is set"

8.  create a test connection python script (testconnection.py)

import oracledb
import os

WALLET_DIR = "~/wallet"

connection = oracledb.connect(
user=os.environ["DB_USER"],
password=os.environ["DB_PASSWORD"],
dsn=os.environ["DB_DSN"],
config_dir=WALLET_DIR,
wallet_location=WALLET_DIR,
wallet_password=os.environ["WALLET_PASSWORD"],
)

print("Connected!")

cursor = connection.cursor()

cursor.execute("""

SELECT

sys_context('USERENV','DB_NAME'),

sys_context('USERENV','SERVICE_NAME'),

user

FROM dual

""")

db_name, service_name, username = cursor.fetchone()

print(f"Database : {db_name}")

print(f"Service : {service_name}")

print(f"User : {username}")

cursor.execute("""

SELECT

JSON_VALUE(cloud_identity, '$.DATABASE_NAME'),

JSON_VALUE(cloud_identity, '$.PROVIDER_NAME'),

JSON_VALUE(cloud_identity, '$.REGION'),

JSON_VALUE(

JSON_VALUE(cloud_identity, '$.DATABASE_RESOURCE_ID'),

'$.cloud_identifier_string'

)

FROM v$pdbs

WHERE con_id = SYS_CONTEXT('USERENV', 'CON_ID')

""")

display_name, cloud_provider, region, cloud_location = cursor.fetchone()

print(f"Display Name : {display_name}")

print(f"Cloud Provider : {cloud_provider}")

print(f"Region : {region}")

print(f"GCP Cloud Location : {cloud_location}")

cursor.execute("SELECT CURRENT_TIMESTAMP FROM dual")

print("Current Database Time:", cursor.fetchone()[0])

cursor.close()

connection.close()

print("Connection closed successfully...")

9. Run and Test the connection!

A multi cloud strategy in cloud adoption

Cloud computing is the convenient model of computing where users can access from anywhere a shared pool of resources and pay only for what they consume.

It has been largely adopted by majority of the startups , SMEs (Small and Medium-sized Enterprises), and large enterprise businesses. Among the reasons being that it makes the businesses to focus on the core of their business as the cloud provider offers a scalable, reliable and on demand infrastructure, platform or software service.

Multi cloud strategy is the newly adopted trend where businesses are involving more than one cloud vendor to support their business. This should not be confused with hybrid computing.

Hybrid computing refers to when a business runs some of it’s workloads on premise and other on a public or private cloud with a secured connection between the two. Multi cloud on the other hand refers to when a business involves different cloud providers to run it’s workloads.

Some of the benefits of a Multi Cloud Strategy include:

  • Avoiding Vendor lock in – Some enterprises are afraid of being locked into a single vendor- thus with the multi cloud strategy they are not “dependent” on a single cloud provider.
  • Redundancy and Performance – Every enterprise wants to have a continual up time and performance to beat their competition. This makes them approach multi cloud strategy to support their strategy.
  • Data sovereignty /Compliance – Due to different regulations, some enterprises are forced to adopt certain cloud vendors within their regions or within the stipulated regulations regarding data .

However, a multi cloud strategy comes at cost such as you require a large talent pool to handle the various technologies from the various vendors, this can also lead to management complexity.

Some cloud vendors have already adopted the multi cloud model.

Oracle Cloud and Microsoft Azure cloud have a interoperability partnership allowing customers to run mission critical enterprise workloads across both clouds.

Google embraces the mult cloud strategy with Anthos, an open application modernization platform.

As an enterprise, you need to evaluate your current status on the digital transformation journey, where you are today and where you target to be, then choose wisely a cloud strategy that shall offer you a high ROI.

Laban.

Today, the greatest concern on many enterprise IT infrastructures is manageability, reliability , availability, performance, security, scalability just to list a few.

If a multi cloud strategy solves the above challenges for you, then it’s time you take the leap.

References:

Tech Target

ZD Net

Oracle News

Google News