Skip to content

Latest commit

 

History

History
89 lines (68 loc) · 5.67 KB

File metadata and controls

89 lines (68 loc) · 5.67 KB

Create an Autonomous Database on OCI

There are different ways that you can deploy a new Oracle Autonomous Database:

The steps below show how to create an Autonomous Database using the OCI CLI.

Prerequisites:

Deploy your Autonomous Database

Autonomous Database will be deployed on a public endpoint - which will simplify the architecture. The OCI CLI will deploy:

  • An Oracle Autonomous Database. It is deployed to a private subnet on that VPC Network. That private subnet is managed by Oracle Database@Google Cloud.
  • An Object Storage bucket with sample data
  • Sample code will use OCI GenAI (or other AI service).
  • Use your computer as a client.

ADB on OCI

You can run the OCI CLI scripts independently or run create-all-resources.sh. Simply update the config prior to running the scripts:

Script Description
create-compartment.sh Create a compartment for your Autonomous Database
create-adb.sh Create an Autonomous Database in the compartment
create-all-resources.sh Creates your resource group, network, ADB and VM
create-data-lake-storage.sh Creates an OCI Object Storage bucket and uploads sample data into that bucket
delete-all-resources.sh Deletes your compartment, bucket and Autonomous Database
show-adb-info.sh Shows information about your ADB - including you JDBC connection details to the HIGH service
show-data-lake-storage-info.sh Shows information about your data lake storage - including the storage endpoint URL

Configuration file

The OCI cli deployment scripts rely on settings found in the config file. These resources will be created by the scripts. Update the config file prior to running any of the scripts.

IMPORTANT: This file will contain a password that is used to connect to Autonomous Database and the virtual machine. Set the file's permissions so that only the file's owner can view its contents:

chmod 600 config
Setting Description Example
TENANCY_OCID The tenancy Oracle Cloud Identifier. See documentation for finding the OCID. "ocid1.tenancy.oc1..aaaaaaaa..."
REGION Region where resources will be deployed. Your tenancy must be subscribed to the region. "us-ashburn-1"
COMPARTMENT Target compartment for new resources "development"
ADB_NAME Autonomous Database name. This name must be unique within a region location "quickstart"
BUCKET_NAME The name of the Object Storage bucket where files will be uploaded "adb-sample"
USER_PASSWORD The password for the Autonomous Database admin user "Welcome1234#abcd"

Using the scripts

Open a command prompt to deploy all the resources.

Creating all of the resources will take approximately 5 minutes.

./create-all-resources.sh

Check for errors after running the script. If there is an issue, simply rerun the script that creates the resource (note: you may need to update the config file).

What's next

Connect to your Autonomous Database!

JDBC Example:

JDBC is a common way to connect to Autonomous Database. For example, you can use the Custom JDBC URL in the VS Code SQL Developer Extension: connection dialog

Notice the jdbc:oracle:thin:@ prefix followed by a connection string. You can find the connection string in different ways.

  1. Go to your Autonomous Database instance in the OCI Console and click Database Connections: connection dialog

  2. Use the OCI cli script show-adb-info.sh. That script will return information about your Autonomous Database, including connection details.


Copyright (c) 2024 Oracle and/or its affiliates.
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/