|
| 1 | +# Create an Autonomous Database on OCI |
| 2 | +There are different ways that you can deploy a new Oracle Autonomous Database: |
| 3 | +* [Using the OCI Console](https://youtu.be/5BUXoBewZbQ) |
| 4 | +* [Using Terraform scripts](https://github.com/oci-landing-zones/terraform-oci-multicloud-azure/tree/main) |
| 5 | +* Using the OCI CLI |
| 6 | + |
| 7 | +The steps below show how to create an Autonomous Database using the OCI CLI. |
| 8 | + |
| 9 | +## Prerequisites: |
| 10 | +* [Install the OCI CLI](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm) |
| 11 | +* [Subscribe to Autonomous Database for free](https://www.oracle.com/autonomous-database/free-trial/) |
| 12 | +* See documentation to ensure you have the appropriate user groups and privileges. |
| 13 | + * [Deploy Autonomous Database](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/autonomous-database-iam-policies.html) |
| 14 | + * [Use OCI GenAI](https://docs.oracle.com/en-us/iaas/Content/generative-ai/iam-policies.htm) |
| 15 | + * [Use OCI Object Storage](https://docs.oracle.com/en-us/iaas/Content/Security/Reference/objectstorage_security.htm#iam-policies) |
| 16 | + |
| 17 | +## Deploy your Autonomous Database |
| 18 | +Use the following scripts to deploy your Autonomous Database and sample data. You can run the scripts independently or run `create-all-resources.sh`. Simply update the [`config`](#configuration-file) prior to running the scripts: |
| 19 | + |
| 20 | +|Script|Description| |
| 21 | +|----|---| |
| 22 | +|[create-compartment.sh](create-compartment-group.sh)|Create a compartment for your Autonomous Database| |
| 23 | +|[create-adb.sh](create-adb.sh)|Create an Autonomous Database in the compartment| |
| 24 | +|[create-all-resources.sh](create-all-resources.sh)|Creates your resource group, network, ADB and VM| |
| 25 | +|[create-data-lake-storage.sh](create-data-lake-storage.sh)|Creates an OCI Object Storage bucket and uploads sample data into that bucket| |
| 26 | +|[delete-all-resources.sh](delete-all-resources.sh)|Deletes your compartment, bucket and Autonomous Database| |
| 27 | + |
| 28 | +### Configuration file |
| 29 | +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. |
| 30 | + |
| 31 | +>**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: |
| 32 | +```bash |
| 33 | +chmod 600 config |
| 34 | +``` |
| 35 | + |
| 36 | +|Setting|Description|Example| |
| 37 | +|----|----|----| |
| 38 | +|TENANCY_OCID|The tenancy Oracle Cloud Identifier. [See documentation](https://docs.oracle.com/en-us/iaas/Content/Identity/tenancy/Viewing_the_Tenancy_Details_Page.htm) for finding the OCID. |"ocid1.tenancy.oc1..aaaaaaaa..."| |
| 39 | +|REGION|Region where resources will be deployed. Your tenancy must be subscribed to the region.|"us-ashburn-1"| |
| 40 | +|COMPARTMENT|Target compartment for new resources|"development"| |
| 41 | +|ADB_NAME|Autonomous Database name. This name must be unique within a region location|"quickstart"| |
| 42 | +|BUCKET_NAME|The name of the Object Storage bucket where files will be uploaded|"adb-sample"| |
| 43 | +|USER_PASSWORD|The password for the Autonomous Database admin user|"Welcome1234#abcd"| |
| 44 | + |
| 45 | +### Using the scripts |
| 46 | +Open a command prompt to deploy all the resources. |
| 47 | + |
| 48 | +Creating all of the resources will take approximately 5 minutes. |
| 49 | + |
| 50 | +```bash |
| 51 | +./create-all-resources.sh |
| 52 | +``` |
| 53 | + |
| 54 | +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). |
| 55 | + |
| 56 | +## What's next |
| 57 | +Connect to your Autonomous Database! |
| 58 | +* [Learn about connectivity options](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/connect-preparing.html) |
| 59 | +* Use these great VS Code extensions that help you develop and debug your database apps: |
| 60 | + * SQL Developer for VS Code ([Learn More](https://www.oracle.com/database/sqldeveloper/vscode/) | [Marketplace](https://marketplace.visualstudio.com/items?itemName=Oracle.sql-developer)) |
| 61 | + * Oracle Developer Tools for VS Code ([Learn More](https://docs.oracle.com/en/database/oracle/developer-tools-for-vscode/getting-started/gettingstarted.html) | [Marketplace](https://marketplace.visualstudio.com/items?itemName=Oracle.oracledevtools)) |
| 62 | + |
| 63 | +#### JDBC Example: |
| 64 | +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: |
| 65 | +  |
| 66 | + |
| 67 | +Notice the `jdbc:oracle:thin:@` prefix followed by a connection string. You can find the connection string in different ways. |
| 68 | + |
| 69 | +1. Go to your Autonomous Database blade in the Azure Portal and go to **Settings -> Connections**: |
| 70 | +  |
| 71 | +2. Use the Azure cli script [`show-adb-info.sh`](./show-adb-info.sh). That script will return information about your Autonomous Database, including connection details. |
| 72 | + |
| 73 | +<hr> |
| 74 | +Copyright (c) 2024 Oracle and/or its affiliates.<br> |
| 75 | +Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ |
0 commit comments