Skip to content

Commit 7dea290

Browse files
committed
minor file name changes and config updates
1 parent 6c82566 commit 7dea290

File tree

4 files changed

+118
-5
lines changed

4 files changed

+118
-5
lines changed

azure-cli/README.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Oracle Database@Azure: Create an Autonomous Database
2+
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.
3+
4+
Run the examples below at a command prompt.
5+
6+
> [!NOTE]
7+
> See the [details for onboarding Autonomous Database](https://learn.microsoft.com/en-us/azure/oracle/oracle-db/onboard-oracle-database)
8+
9+
## Deploy your Autonomous Database
10+
Start by logging into Azure:
11+
```bash
12+
az login
13+
```
14+
15+
Edit the [config file](./config) based on your deployment. These variables will be used by the Azure CLI.
16+
```bash
17+
LOCATION="eastus"
18+
RESOURCE_GROUP="resource-group-name-goes-here"
19+
VNET_ID="vnet-resource-name-goes-here"
20+
SUBNET_ID="subnet-resource-name-goes-here"
21+
ADB_NAME="adb-name-goes-here"
22+
```
23+
The VNET and SUBNET IDs must be fully qualified IDs. For example:
24+
* **VNET_ID=**`"/subscriptions/99d4fb0e-ac2.../resourceGroups/your-resource-group/providers/Microsoft.Network/virtualNetworks/your-vnet"`
25+
* **SUBNET_ID=**`"/subscriptions/99d4fb0e-ac2.../resourceGroups/your-resource-group/providers/Microsoft.Network/virtualNetworks/your-vnet/subnets/your-subnet"`
26+
27+
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.
28+
29+
The script will prompte you for the Autonomous Database **ADMIN** user password. Enter a complex password.
30+
31+
After a few minutes, review your newly created database:
32+
```bash
33+
az oracle-database autonomous-database show \
34+
--autonomousdatabasename $ADB_NAME \
35+
--resource-group $RESOURCE_GROUP
36+
```
37+
38+
## Delete an Autonomous Database
39+
You can run the following command to an Autonomous Database:
40+
41+
```bash
42+
az oracle-database autonomous-database delete \
43+
--autonomousdatabasename $ADB_NAME \
44+
--resource-group $RESOURCE_GROUP \
45+
--no-wait false
46+
```
47+
48+
49+
50+
<hr>
51+
Copyright (c) 2024 Oracle and/or its affiliates.<br>
52+
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/

azure-cli/config

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,13 @@ ADB_NAME="quickstart"
99
## NETWORKING
1010
# database
1111
VNET_NAME="dev-vnet"
12-
#VNET_PREFIX="192.168.0.0/16"
1312
VNET_PREFIX="19x.xxx.0.0/16"
1413
# subnet for the database
1514
SUBNET_NAME="dev-sn-db"
16-
#SUBNET_PREFIX="192.168.1.0/24"
1715
SUBNET_PREFIX="19x.xxx.1.0/24"
1816

1917
# client subnet
2018
SUBNET2_NAME="dev-sn-client"
21-
#SUBNET2_PREFIX="192.168.2.0/24"
2219
SUBNET2_PREFIX="19x.xxx.2.0/24"
2320

2421
#network security group
@@ -37,4 +34,5 @@ STORAGE_CONTAINER_NAME="adb-sample"
3734
## IDENTITIES
3835
# This identity will be used for your VM. The password will also be used for the database ADMIN user
3936
USER_NAME="adb"
40-
USER_PASSWORD="your-complex-password"
37+
# The password must be between 12 and 30 characters long and must include at least one uppercase letter, one lowercase letter, and one numeric character.
38+
USER_PASSWORD=""

sql/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Oracle Database@Azure: Sample SQL Scripts
2+
Numerous SQL scripts are available to help you get started using Autonomous Database on Oracle Database@Azure
3+
4+
Prerequisites:
5+
* [Create an Autonomous Database](../azure-cli/create-adb.md)
6+
* A VM deployed on the same VCN as Autonomous Database (or on a network that can access your Autonomous Database)
7+
* Use these great VS Code extensions that help you develop and debug your database apps:
8+
* SQL Developer for VS Code ([Learn More](https://www.oracle.com/database/sqldeveloper/vscode/) | [Marketplace](https://marketplace.visualstudio.com/items?itemName=Oracle.sql-developer))
9+
* 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))
10+
11+
## Connect to Autonomous Database
12+
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.
13+
14+
## Sample scripts
15+
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:
16+
17+
|Script|Description|
18+
|----|---|
19+
|[data-create-sample-schema.sql](data-create-sample-schema.sql)|Create a sample user and install sample data|
20+
|[data-create-synthetic-data.sql](data-create-synthetic-data.sql)|Use AI to generate sample data sets|
21+
|[data-import-from-datalake.sql](data-create-synthetic-data.sql)|Import sample data from Azure Data Lake. Sample data was uploaded using the [`create-all-resources.sh`](../azure-cli/create-all-resources.sh)and [`create-data-lake-storage.sh`](../azure-cli/create-data-lake-storage.sh) scripts. You can run [`show-data-lake-storage-info.sh`](../azure-cli/show-data-lake-storage-info.sh) to get connection information to the storage container.|
22+
|[data-export-to-datalake.sql](data-export-to-datalake.sql)|Export data from a table to your data lake storage|
23+
|[select-ai-admin-enable.sql](select-ai-admin-enable.sql)|Autonomous Database is secure by default. In order to access external services, you will need to enable connectivity. This script enables connectivity to your Azure OpenAI resource.|
24+
|[select-ai-create-profile.sql](select-ai-create-profile.sql)|A Select AI profile is used to connect to your AI provider. It includes information about your provider plus tables and view that you want to be targets for natural language queries|
25+
|[select-ai-nl2sql.sql](select-ai-nl2sql.sql)|Use natural language to query your data|
26+
|[select-ai-sql-function.sql](select-ai-sql-function.sql)|Use Select AI SQL functions to apply AI to your data. These examples summarize a support chat and make product recommendations based on info in your database|
27+
|[select-ai-rag.sql](select-ai-rag.sql)|Select AI makes it easy to create AI vector pipelines and then ask questions using AI and your organization's knowledge base|
28+
29+
30+
### Configuration file
31+
Many of the SQL scripts rely on information found in your [config.sql](config.sql) file. Update the config file prior to running any of the scripts.
32+
33+
>**IMPORTANT:** This file will contain sensitive data that should be protected. Set the file's permissions so that only the file's owner can view its contents:
34+
```bash
35+
chmod 600 config.sql
36+
```
37+
38+
|Setting|Description|Example|
39+
|----|----|----|
40+
|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)))
41+
|USER_NAME|Database user that will contain sample data|'moviestream'|
42+
|USER_PASSWORD|Password for the sample database user|'watchS0meMovies#'
43+
|**Select AI and GenAI**|
44+
|AZURE_OPENAI_RESOURCE_NAME|Name of the Azure OpenAI endpoint|'dev-adb-azure-openai'|
45+
|AZURE_OPENAI_ENDPOINT|Your Azure OpenAI endpoint (server name only)|'my-openai.openai.azure.com'|
46+
|AZURE_OPENAI_DEPLOYMENT_NAME|Your Azure OpenAI deployment name|'gpt-4o'|
47+
|AZURE_OPENAI_KEY|Azure OpenAI secret key|'3Cu9AB...H53'|
48+
|AZURE_OPENAI_PROFILE_NAME|The Select AI profile that will reference your Azure OpenAI deployment|'gpt4o'|
49+
|AZURE_OPENAI_CREDENTIAL_NAME|The database credential that will be used to connect to Azure OpenAI|'azure_cred4o'|
50+
|**Azure Data Lake Storage**|
51+
|STORAGE_ACCOUNT_NAME|Name of your Azure Data Lake Storage Gen 2 account. You can run [`show-data-lake-storage-info.sh`](../azure-cli/show-data-lake-storage-info.sh) to get storage details|'mysamplestorage'|
52+
|STORAGE_URL|Azure data lake storage URL|'https://mysamplestorage.blob.core.windows.net/adb-sample'
53+
|STORAGE_KEY|The secret key used to connecto Azure Data Lake Storage|'dJVNxq1YTT...jp/g=='
54+
55+
You can find the Azure OpenAI settings in the Azure OpenAI Studio:
56+
![Azure OpenAI settings](images/azure-openai.png)
57+
58+
59+
<hr>
60+
Copyright (c) 2024 Oracle and/or its affiliates.<br>
61+
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/

sql/config.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
define CONN='your-database-connection-string'
1010
-- the database user that will own the sample schema
1111
define USER_NAME='moviestream'
12-
define USER_PASSWORD='your-strong-password'
12+
-- Password for the database user
13+
-- The password must be between 12 and 30 characters long and must include at least one uppercase letter, one lowercase letter, and one numeric character.
14+
define USER_PASSWORD=''
1315
--
1416
-- GENAI
1517
--

0 commit comments

Comments
 (0)