Skip to content

Commit

Permalink
cleanup readme links
Browse files Browse the repository at this point in the history
  • Loading branch information
martygubar committed Nov 15, 2024
1 parent 7dea290 commit 164175a
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 233 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ Oracle Database@Azure brings Oracle's best databases - Exadata and Autonomous Da
* Deploy a new Oracle Autonomous Database
* [Using the Azure Portal](https://youtu.be/QOCvRr5CfeQ)
* [Using Terraform scripts](https://github.com/oci-landing-zones/terraform-oci-multicloud-azure/tree/main)
* [Using the Azure CLI](azure-cli/create-adb.md)
* [Using the Azure CLI](azure-cli/README.md)
* Connect to your Autonomous Database
* [Learn about connectivity options](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/connect-preparing.html)
* Use these great VS Code extensions that help you develop and debug your database apps
* SQL Developer for VS Code ([Learn More](https://www.oracle.com/database/sqldeveloper/vscode/) | [Marketplace](https://marketplace.visualstudio.com/items?itemName=Oracle.sql-developer))
* 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))
* [Sample SQL code](./sql/sql-scripts.md)
* [Sample SQL code](./sql/README.md)
* Create a database user and add sample data
* Work with data in Azure Storage
* Get started with Select AI
Expand Down
93 changes: 63 additions & 30 deletions azure-cli/README.md
Original file line number Diff line number Diff line change
@@ -1,51 +1,84 @@
# Oracle Database@Azure: Create an Autonomous Database
The steps below show how to create an Autonomous Database using the Azure CLI. You will need to [install the Azure CLI](https://learn.microsoft.com/en-us/cli/azure/) prior to running thru this example.
The steps below show how to create an Autonomous Database using the Azure CLI.

Run the examples below at a command prompt.

> [!NOTE]
> See the [details for onboarding Autonomous Database](https://learn.microsoft.com/en-us/azure/oracle/oracle-db/onboard-oracle-database)
Prerequisites:
* [Install the Azure CLI](https://learn.microsoft.com/en-us/cli/azure/)
* [Subscribe to Oracle Database@Azure](https://www.youtube.com/watch?v=MEB8kB_TI2I)
* Ensure you have the appropriate user groups and privileges. See [details for onboarding Autonomous Database](https://learn.microsoft.com/en-us/azure/oracle/oracle-db/onboard-oracle-database)

## Deploy your Autonomous Database
Start by logging into Azure:
```bash
az login
```
Use the following scripts to deploy your infrastructure and Autonomous Database. You can run the scripts independently or run `create-all-resources.sh`. Simply update the [`config`](#configuration-file) prior to running the scripts:

|Script|Description|
|----|---|
|[create-resource-group.sh](create-resource-group.sh)|Create a resource group|
|[create-network.sh](create-network.sh)|Create virtual cloud network. <br><br>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-adb.sh)|Create an Autonomous Database|
|[create-compute-vm.sh](create-compute-vm.sh)|Create a VM in that VCN|
|[create-all-resources.sh](create-all-resources.sh)|Creates your resource group, network, ADB and VM|
|[create-data-lake-storage.sh](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](delete-all-resources.sh)|Deletes your resource group, network, ADB and VM|

Edit the [config file](./config) based on your deployment. These variables will be used by the Azure CLI.
### Configuration file
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:
```bash
LOCATION="eastus"
RESOURCE_GROUP="resource-group-name-goes-here"
VNET_ID="vnet-resource-name-goes-here"
SUBNET_ID="subnet-resource-name-goes-here"
ADB_NAME="adb-name-goes-here"
chmod 600 config
```
The VNET and SUBNET IDs must be fully qualified IDs. For example:
* **VNET_ID=**`"/subscriptions/99d4fb0e-ac2.../resourceGroups/your-resource-group/providers/Microsoft.Network/virtualNetworks/your-vnet"`
* **SUBNET_ID=**`"/subscriptions/99d4fb0e-ac2.../resourceGroups/your-resource-group/providers/Microsoft.Network/virtualNetworks/your-vnet/subnets/your-subnet"`

After updating the config file, create a new Autonomous Database by running [`./deploy-adb.sh`](./deploy-adb.sh) from the command line. You can also modify other database properties by editing the deployment script.
|Setting|Description|Example|
|----|----|----|
|LOCATION|Region where resources will be deployed. [See documentation](https://docs.oracle.com/en-us/iaas/Content/database-at-azure/oaa_regions.htm) 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"|

The script will prompte you for the Autonomous Database **ADMIN** user password. Enter a complex password.
### Using the scripts
Log into azure: after updating the config file:

After a few minutes, review your newly created database:
```bash
az oracle-database autonomous-database show \
--autonomousdatabasename $ADB_NAME \
--resource-group $RESOURCE_GROUP
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):

## Delete an Autonomous Database
You can run the following command to an Autonomous Database:
Creating all of the resources will take approximately 15-20 minutes.

```bash
az oracle-database autonomous-database delete \
--autonomousdatabasename $ADB_NAME \
--resource-group $RESOURCE_GROUP \
--no-wait false
./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).

## What's next
Connect to your Autonomous Database!
* [Learn about connectivity options](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/connect-preparing.html)
* Use these great VS Code extensions that help you develop and debug your database apps:
* SQL Developer for VS Code ([Learn More](https://www.oracle.com/database/sqldeveloper/vscode/) | [Marketplace](https://marketplace.visualstudio.com/items?itemName=Oracle.sql-developer))
* 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))

#### 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](images/connect-dialog.png)

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 blade in the Azure Portal and go to **Settings -> Connections**:
![Azure Portal connections](images/connections-portal.png)
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.

<hr>
Copyright (c) 2024 Oracle and/or its affiliates.<br>
Expand Down
85 changes: 0 additions & 85 deletions azure-cli/create-adb.md

This file was deleted.

52 changes: 0 additions & 52 deletions azure-cli/deploy-adb.md

This file was deleted.

6 changes: 3 additions & 3 deletions sql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
Numerous SQL scripts are available to help you get started using Autonomous Database on Oracle Database@Azure

Prerequisites:
* [Create an Autonomous Database](../azure-cli/create-adb.md)
* [Create an Autonomous Database](../azure-cli/README.md)
* A VM deployed on the same VCN as Autonomous Database (or on a network that can access your Autonomous Database)
* Use these great VS Code extensions that help you develop and debug your database apps:
* SQL Developer for VS Code ([Learn More](https://www.oracle.com/database/sqldeveloper/vscode/) | [Marketplace](https://marketplace.visualstudio.com/items?itemName=Oracle.sql-developer))
* 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))

## Connect to Autonomous Database
There are [numerous client tools](../azure-cli/create-adb.md#whats-next) that you can use to start working with Autonomous Database. This includes the built-in SQL Worksheet that's part of the Database Tools (and available from the linked OCI Console) or a tool like VS Code and one an Oracle Database extension.
There are [numerous client tools](../azure-cli/README.md#whats-next) that you can use to start working with Autonomous Database. This includes the built-in SQL Worksheet that's part of the Database Tools (and available from the linked OCI Console) or a tool like VS Code and one an Oracle Database extension.

## Sample scripts
Try out these scripts to learn how to get started using Autonomous Database. Simply update the [`config.sql`](#configuration-file) script prior to running the samples:
Expand Down Expand Up @@ -37,7 +37,7 @@ chmod 600 config.sql

|Setting|Description|Example|
|----|----|----|
|CONN|JDBC Connection. [Go here](../azure-cli/create-adb.md#jdbc-example) to see how to get the connection details.|jdbc:oracle:thin:@(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=your-host.oraclecloud.com))(connect_data=(service_name=my_quickstart_medium.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))
|CONN|JDBC Connection. [Go here](../azure-cli/README.md#jdbc-example) to see how to get the connection details.|jdbc:oracle:thin:@(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=your-host.oraclecloud.com))(connect_data=(service_name=my_quickstart_medium.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))
|USER_NAME|Database user that will contain sample data|'moviestream'|
|USER_PASSWORD|Password for the sample database user|'watchS0meMovies#'
|**Select AI and GenAI**|
Expand Down
Loading

0 comments on commit 164175a

Please sign in to comment.