There are different ways that you can deploy a new Oracle Autonomous Database:
- Using the OCI Console
- Using Terraform scripts
- Using the OCI CLI
The steps below show how to create an Autonomous Database using the OCI CLI.
- Install the OCI CLI
- Subscribe to Autonomous Database for free
- See documentation to ensure you have the appropriate user groups and privileges.
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.
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 |
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" |
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).
Connect to your Autonomous Database!
- Learn about connectivity options
- Use these great VS Code extensions that help you develop and debug your database apps:
- SQL Developer for VS Code (Learn More | Marketplace)
- Oracle Developer Tools for VS Code (Learn More | Marketplace)
- Use the sample scripts to learn how to use different features - like Select AI, data lake integration, JSON, and more.
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:
Notice the jdbc:oracle:thin:@
prefix followed by a connection string. You can find the connection string in different ways.
-
Go to your Autonomous Database instance in the OCI Console and click Database Connections:
-
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/