There are different ways that you can deploy a new Oracle Autonomous Database:
- Using the Azure Portal
- Using Terraform scripts
- Using the Azure CLI
The steps below show how to create an Autonomous Database using the Azure CLI.
- Install the Azure CLI
- Subscribe to Oracle Database@Azure
- Ensure you have the appropriate user groups and privileges. See details for onboarding Autonomous Database
Use the following scripts to deploy your infrastructure and Autonomous Database:
Note: Azure OpenAI is used by the samples - but the scripts do not deploy the resource.
f
You can run the scripts independently or run create-all-resources.sh
. Simply update the config
prior to running the scripts:
Script | Description |
---|---|
create-resource-group.sh | Create a resource group |
create-network.sh | Create virtual cloud network. ADB must be deployed to a delegated subnet. In addition, ADB access is thru a private endpoint. This means it must be accessed from either the same VCN or another privileged network. |
create-adb.sh | Create an Autonomous Database |
create-compute-vm.sh | Create a VM in that VCN |
create-all-resources.sh | Creates your resource group, network, ADB and VM |
create-data-lake-storage.sh | Creates an Azure Data Lake Gen 2 storage account, a container and uploads sample data into that container |
delete-all-resources.sh | Deletes your resource group, network, ADB and VM |
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 Azure 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 |
---|---|---|
LOCATION | Region where resources will be deployed. See documentation for regions where Oracle Database 23ai is available | "eastus" |
RESOURCE_GROUP | Target resource group for new resources | "development" |
ADB_NAME | Autonomous Database name. This name must be unique within a region location | "quickstart" |
VNET_NAME | Virtual network | "dev-vnet" |
VNET_PREFIX | CIDR range for the virtual network | "192.168.0.0/16" |
SUBNET_NAME | Delegated subnet where the database will be deployed | "dev-sn-db" |
SUBNET_PREFIX | CIDR range for the delegated subnet | "192.168.1.0/24" |
SUBNET2_NAME | Client subnet. The VM will be deployed to this subnet | "dev-sn-client" |
SUBNET2_PREFIX | CIDR range for the client subnet | "192.168.2.0/24" |
NSG_NAME | Name of the network security group used by the client subnet | $SUBNET2_NAME-nsg |
VM_NAME | Name of the virtual machine | "adb-vm-client" |
VM_PREFERRED_SIZES | A list of VM sizes. Change these values based on region availability. The script will attempt to create a VM based on the order listed | ( "Standard_GS1" "Standard_DC1s_v2" "Standard_DC2s_v2" "Standard_DC2ads_v5" "Standard_L4s" ) |
VM_IMAGE | The image used by the VM | "MicrosoftWindowsDesktop:Windows-11:win11-22h2-pro:latest" |
STORAGE_ACCOUNT_NAME | The name of an Azure Data Lake Storage Gen 2 account. This name must be unique across Azure. Sample data files will be uploaded into this storage account. | "mytenancysamplestorageaccount" |
STORAGE_CONTAINER_NAME | The name of the container where files will be uploaded | "adb-sample" |
USER_NAME | The name of the user for the virtual machine | "adb" |
USER_PASSWORD | The password for both the VM and the Autonomous Database admin user | "Welcome1234#abcd" |
Log into azure: after updating the config file:
az login
Then, run your scripts. The following will deploy a complete environment, but you can also install independent components. Just make sure you install dependencies (e.g. a VCN prior to Autonomous Database):
Creating all of the resources will take approximately 15-20 minutes.
./create-all-resources.sh
Check for errors after running the script. For example, VM availability can impact the success of creating the resource. 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 blade in the Azure Portal and go to Settings -> Connections:
- Use the Azure 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/