Continuing testing Oracle Database@Google features, this time I wanted to test provisioning using gcloud CLI on Google and seeing how it works out. Google has documentation on using CLI to provision Autonomous Database (ADB) here: https://cloud.google.com/sdk/gcloud/reference/oracle-database/autonomous-databases/create

Some of the variables are not right away clear, but in addition to the example I wanted to provision DB with a private endpoint, not with public.

When you run gcloud command to create ADB without any parameters, you’ll also get the full list of parameters that can be used, similarly using –help flag gives you details for each parameter.

After some trial and error due to me being new to gcloud CLI, I established that I need to find my project id and path for the network. The path is described in documentation link but I wasn’t fully sure on the actual path so did some digging to find out the correct commands.

Creating ADB

Below I’m setting also my cloud shell to use my project, I don’t think that’s required though as I define the project id in the ADB create command as well.

See the commands from below!

## Set my project for gcloud

simo@cloudshell:~$ gcloud config set project 111572427111
Updated property [core/project].

## Get network path from the selfLink

simo@cloudshell:~$ gcloud compute networks describe vpc-autonomous --project=tfg
autoCreateSubnetworks: false
creationTimestamp: '2024-10-02T09:40:36.069-07:00'
description: For Autonomous DB
id: '1116742841884068111'
kind: compute#network
mtu: 1460
name: vpc-autonomous
networkFirewallPolicyEnforcementOrder: AFTER_CLASSIC_FIREWALL
routingConfig:
  bgpBestPathSelectionMode: LEGACY
  routingMode: REGIONAL
selfLink: https://www.googleapis.com/compute/v1/projects/tfg/global/networks/vpc-autonomous
selfLinkWithId: https://www.googleapis.com/compute/v1/projects/tfg/global/networks/9066742841884068203
subnetworks:
- https://www.googleapis.com/compute/v1/projects/tfg/regions/us-east4/subnetworks/vm-subnet
x_gcloud_bgp_routing_mode: REGIONAL
x_gcloud_subnet_mode: CUSTOM

## Create Autonomous Database with Private Endpoint

simo@cloudshell:~ (111572427111)$ gcloud oracle-database autonomous-databases create gcloudatp  
--location=us-east4  
--display-name=gcloudatp  
--network=projects/tfg/global/networks/vpc-autonomous  
--database=gcloudatp  
--admin-password=My_Only_Password_12
--cidr=10.0.1.0/24  
--properties-compute-count=2  
--properties-db-version=23ai 
--properties-license-type=LICENSE_INCLUDED  
--properties-db-workload=OLTP 
--project=111572427111  
--properties-data-storage-size-gb=200  
--properties-private-endpoint-ip=10.0.1.10
Create request issued for: [gcloudatp]
Waiting for operation [projects/111572427111/locations/us-east4/operations/operation-1748624301002-6365d524e90b4-4718917f-9e18b5f2] to complete...done.                                                                                          
Created autonomousDatabase [gcloudatp].

After few minutes, I do have ADB created in my GCP project with a private endpoint. Not too bad!

Now it’s time to take a peak on the Console what got created.

Mostly interested on the network, I do see it only has private endpoint with the IP I gave and everything else looks according to what I specified.

NOTE: You don’t necessarily need to provide the private IP(thanks Andy!) – if you only specify the CIDR it’ll pick up free IP from the network you specified.

Additional Commands

Couple handy commands that are available with CLI, list and describe. You can get all the ADB details in the region via CLI list command which could be handy for any script you need to do. For details on a single ADB – use describe with: gcloud oracle-database autonomous-databases describe gcloudatp –location=us-east4

Below I’m listing all(my one and only) ADB within us-east4 region.

gcloud oracle-database autonomous-databases list --location=us-east4
---
cidr: 10.0.1.0/24
createTime: '2025-05-30T16:58:22.997294028Z'
database: gcloudatp
displayName: gcloudatp
entitlementId: a5ff3b22-4ea2-4c45-8ea6-3d0497bf7de3
name: projects/991572427707/locations/us-east4/autonomousDatabases/gcloudatp
network: projects/wp-finnishguy/global/networks/vpc-autonomous
properties:
  apexDetails:
    ordsVersion: 25.1.0.100.1652
  backupRetentionPeriodDays: 60
  characterSet: AL32UTF8
  computeCount: 2.0
  connectionStrings:
    allConnectionStrings:
      high: adb.us-ashburn-1.oraclecloud.com:1522/gdbed68d29e37bc_gcloudatp_high.adb.oraclecloud.com
      low: adb.us-ashburn-1.oraclecloud.com:1522/gdbed68d29e37bc_gcloudatp_low.adb.oraclecloud.com
      medium: adb.us-ashburn-1.oraclecloud.com:1522/gdbed68d29e37bc_gcloudatp_medium.adb.oraclecloud.com
    high: adb.us-ashburn-1.oraclecloud.com:1522/gdbed68d29e37bc_gcloudatp_high.adb.oraclecloud.com
    low: adb.us-ashburn-1.oraclecloud.com:1522/gdbed68d29e37bc_gcloudatp_low.adb.oraclecloud.com
    medium: adb.us-ashburn-1.oraclecloud.com:1522/gdbed68d29e37bc_gcloudatp_medium.adb.oraclecloud.com
    profiles:
    - consumerGroup: HIGH
      displayName: gcloudatp_high
      hostFormat: FQDN
      protocol: TCPS
      sessionMode: DIRECT
      syntaxFormat: LONG
      tlsAuthentication: SERVER
      value: (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=x1razcah.adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=gdbed68d29e37bc_gcloudatp_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))
    - consumerGroup: LOW
      displayName: gcloudatp_low
      hostFormat: FQDN
      protocol: TCPS
      sessionMode: DIRECT
      syntaxFormat: LONG
      tlsAuthentication: SERVER
      value: (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=x1razcah.adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=gdbed68d29e37bc_gcloudatp_low.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))
    - consumerGroup: MEDIUM
      displayName: gcloudatp_medium
      hostFormat: FQDN
      protocol: TCPS
      sessionMode: DIRECT
      syntaxFormat: LONG
      tlsAuthentication: SERVER
      value: (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=x1razcah.adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=gdbed68d29e37bc_gcloudatp_medium.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))
    - consumerGroup: TP
      displayName: gcloudatp_tp
      hostFormat: FQDN
      protocol: TCPS
      sessionMode: DIRECT
      syntaxFormat: LONG
      tlsAuthentication: SERVER
      value: (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=x1razcah.adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=gdbed68d29e37bc_gcloudatp_tp.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))
    - consumerGroup: TPURGENT
      displayName: gcloudatp_tpurgent
      hostFormat: FQDN
      protocol: TCPS
      sessionMode: DIRECT
      syntaxFormat: LONG
      tlsAuthentication: SERVER
      value: (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=x1razcah.adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=gdbed68d29e37bc_gcloudatp_tpurgent.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))
    - consumerGroup: HIGH
      displayName: gcloudatp_high
      hostFormat: FQDN
      protocol: TCPS
      sessionMode: DIRECT
      syntaxFormat: LONG
      tlsAuthentication: MUTUAL
      value: (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=x1razcah.adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=gdbed68d29e37bc_gcloudatp_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))
    - consumerGroup: LOW
      displayName: gcloudatp_low
      hostFormat: FQDN
      protocol: TCPS
      sessionMode: DIRECT
      syntaxFormat: LONG
      tlsAuthentication: MUTUAL
      value: (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=x1razcah.adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=gdbed68d29e37bc_gcloudatp_low.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))
    - consumerGroup: MEDIUM
      displayName: gcloudatp_medium
      hostFormat: FQDN
      protocol: TCPS
      sessionMode: DIRECT
      syntaxFormat: LONG
      tlsAuthentication: MUTUAL
      value: (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=x1razcah.adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=gdbed68d29e37bc_gcloudatp_medium.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))
    - consumerGroup: TP
      displayName: gcloudatp_tp
      hostFormat: FQDN
      protocol: TCPS
      sessionMode: DIRECT
      syntaxFormat: LONG
      tlsAuthentication: MUTUAL
      value: (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=x1razcah.adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=gdbed68d29e37bc_gcloudatp_tp.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))
    - consumerGroup: TPURGENT
      displayName: gcloudatp_tpurgent
      hostFormat: FQDN
      protocol: TCPS
      sessionMode: DIRECT
      syntaxFormat: LONG
      tlsAuthentication: MUTUAL
      value: (description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1522)(host=x1razcah.adb.us-ashburn-1.oraclecloud.com))(connect_data=(service_name=gdbed68d29e37bc_gcloudatp_tpurgent.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))
  connectionUrls:
    apexUri: https://x1razcah.adb.us-ashburn-1.oraclecloudapps.com/ords/apex
    databaseTransformsUri: https://x1razcah.adb.us-ashburn-1.oraclecloudapps.com/odi/
    graphStudioUri: https://x1razcah.adb.us-ashburn-1.oraclecloudapps.com/graphstudio/
    machineLearningNotebookUri: https://x1razcah.adb.us-ashburn-1.oraclecloudapps.com/oml/
    machineLearningUserManagementUri: https://x1razcah.adb.us-ashburn-1.oraclecloudapps.com/omlusers/
    ordsUri: https://x1razcah.adb.us-ashburn-1.oraclecloudapps.com/ords/
    sqlDevWebUri: https://x1razcah.adb.us-ashburn-1.oraclecloudapps.com/ords/sql-developer
  dataSafeState: NOT_REGISTERED
  dataStorageSizeGb: 200
  dbVersion: 23ai
  dbWorkload: OLTP
  licenseType: LICENSE_INCLUDED
  localDisasterRecoveryType: BACKUP_BASED
  localStandbyDb:
    state: STANDBY
  maintenanceBeginTime: '2025-06-01T04:00:00Z'
  maintenanceEndTime: '2025-06-01T06:00:00Z'
  maintenanceScheduleType: REGULAR
  nCharacterSet: AL16UTF16
  ocid: ocid1.autonomousdatabase.oc1.iad.anuwcljruc6vv7yaprahzphkjpcoqvwu3wzl5qicbpz4xrgdw2sczzf52oja
  openMode: READ_WRITE
  operationsInsightsState: NOT_ENABLED
  permissionLevel: UNRESTRICTED
  privateEndpoint: x1razcah.adb.us-ashburn-1.oraclecloud.com
  privateEndpointIp: 10.0.1.10
  privateEndpointLabel: x1razcah
  state: AVAILABLE
  supportedCloneRegions:
  - AGA
  - FRA

Deleting ADB via CLI

Final command to remember is delete, which is as simple as:

gcloud oracle-database autonomous-databases delete gcloudatp --location=us-east4
You are about to delete autonomousDatabase [gcloudatp]

Do you want to continue (Y/n)?  y

Delete request issued for: [gcloudatp]                                                                                    
Waiting for operation [projects/111572427111/locations/us-east4/operations/operation-1748628306511-6365e410dc51a-4206b666-f93aadd6] to complete...done.

I can not only check from GCP Console that the database is terminated but OCI Console shows the same as well.

Delete command ran way longer vs just the database termination, I could see DB terminated after minute or two but CLI command ran for 20 minutes.

Summary

Creating Autonomous Database on Google can be done also via CLI (or with Terraform) – if you’re not fully familiar with Google APIs or commands you might have to do some learning on parameters and what is really required.

Next time, I will take a look on how to use Database Tools for Autonomous Database, they work similarly as in OCI but if you end up here on how to use ADB on GCP, it’ll be good learning on how to access and use the tools.

Database Tools is awesome product set that Oracle has with Autonomous Database!

 

Leave a Reply

Your email address will not be published.