Skip to content

Commit 68e8f25

Browse files
committed
getting started
1 parent 7897a7f commit 68e8f25

File tree

8 files changed

+373
-13
lines changed

8 files changed

+373
-13
lines changed

README.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
1-
# oracle-database-azure-samples
1+
# Oracle Database@Azure Samples
22

3-
[![License: UPL](https://img.shields.io/badge/license-UPL-green)](https://img.shields.io/badge/license-UPL-green)<!--[![Quality gate](https://sonarcloud.io/api/project_badges/quality_gate?project=oracle-devrel_oracle-database-azure-samples)](https://sonarcloud.io/dashboard?id=oracle-devrel_oracle-database-azure-samples)-->
4-
5-
## THIS IS A NEW, BLANK REPO THAT IS NOT READY FOR USE YET. PLEASE CHECK BACK SOON!
3+
[![License: UPL](https://img.shields.io/badge/license-UPL-green)](https://img.shields.io/badge/license-UPL-green)
64

75
## Introduction
8-
9-
MISSING
6+
Oracle Database@Azure brings Oracle's best databases - Exadata and Autonomous Database - to Microsoft Azure as a native Azure services. Modernize and deliver powerful new apps that leverage Oracle Database 23ai and Azure services:
7+
* Build new cloud native apps using Azure services, such as Azure Kubernetes and Azure OpenAI, with Oracle Autonomous Database.
8+
* Enhance existing apps with natural language and other generative AI capabilities.
9+
* Quickly react to business demands using one converged, fully automated database that’s optimized for all workloads and data formats.
1010

1111
## Getting Started
12+
* [Install the Azure CLI](https://learn.microsoft.com/en-us/cli/azure/)
13+
* [Deploy a new Oracle Autonomous Database using the Azure CLI](azure-cli/deploy-adb.md)
14+
* Get started with Select AI ([enable access](sql/select-ai-admin-enable.sql) | [samples](sql/select-ai-get-started.sql))
1215

13-
MISSING
16+
<!--
1417
1518
### Prerequisites
16-
1719
MISSING
1820
1921
## Notes/Issues
20-
2122
MISSING
2223
2324
## URLs
24-
2525
* Nothing at this time
2626
27-
## Contributing
27+
-->
2828

29+
## Contributing
2930
<!-- If your project has specific contribution requirements, update the
3031
CONTRIBUTING.md file to ensure those requirements are clearly explained. -->
3132

@@ -38,11 +39,10 @@ Please consult the [security guide](./SECURITY.md) for our responsible security
3839
vulnerability disclosure process.
3940

4041
## License
41-
4242
Copyright (c) 2024 Oracle and/or its affiliates.
4343

4444
Licensed under the Universal Permissive License (UPL), Version 1.0.
4545

4646
See [LICENSE](LICENSE.txt) for more details.
4747

48-
ORACLE AND ITS AFFILIATES DO NOT PROVIDE ANY WARRANTY WHATSOEVER, EXPRESS OR IMPLIED, FOR ANY SOFTWARE, MATERIAL OR CONTENT OF ANY KIND CONTAINED OR PRODUCED WITHIN THIS REPOSITORY, AND IN PARTICULAR SPECIFICALLY DISCLAIM ANY AND ALL IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. FURTHERMORE, ORACLE AND ITS AFFILIATES DO NOT REPRESENT THAT ANY CUSTOMARY SECURITY REVIEW HAS BEEN PERFORMED WITH RESPECT TO ANY SOFTWARE, MATERIAL OR CONTENT CONTAINED OR PRODUCED WITHIN THIS REPOSITORY. IN ADDITION, AND WITHOUT LIMITING THE FOREGOING, THIRD PARTIES MAY HAVE POSTED SOFTWARE, MATERIAL OR CONTENT TO THIS REPOSITORY WITHOUT ANY REVIEW. USE AT YOUR OWN RISK.
48+
ORACLE AND ITS AFFILIATES DO NOT PROVIDE ANY WARRANTY WHATSOEVER, EXPRESS OR IMPLIED, FOR ANY SOFTWARE, MATERIAL OR CONTENT OF ANY KIND CONTAINED OR PRODUCED WITHIN THIS REPOSITORY, AND IN PARTICULAR SPECIFICALLY DISCLAIM ANY AND ALL IMPLIED WARRANTIES OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. FURTHERMORE, ORACLE AND ITS AFFILIATES DO NOT REPRESENT THAT ANY CUSTOMARY SECURITY REVIEW HAS BEEN PERFORMED WITH RESPECT TO ANY SOFTWARE, MATERIAL OR CONTENT CONTAINED OR PRODUCED WITHIN THIS REPOSITORY. IN ADDITION, AND WITHOUT LIMITING THE FOREGOING, THIRD PARTIES MAY HAVE POSTED SOFTWARE, MATERIAL OR CONTENT TO THIS REPOSITORY WITHOUT ANY REVIEW. USE AT YOUR OWN RISK.

azure-cli/config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# update the values below to match your requirements
2+
LOCATION="eastus"
3+
RESOURCE_GROUP="resource-group-name-goes-here"
4+
VNET_ID="vnet-resource-name-goes-here"
5+
SUBNET_ID="subnet-resource-name-goes-here"
6+
ADB_NAME="adb-name-goes-here"

azure-cli/deploy-adb.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/deploy-adb.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# ensure you update the config file to match your deployment prior to running the deployment
2+
3+
source ./config
4+
5+
az oracle-database autonomous-database create \
6+
--location $LOCATION \
7+
--autonomousdatabasename $ADB_NAME \
8+
--resource-group $RESOURCE_GROUP \
9+
--subnet-id $SUBNET_ID \
10+
--display-name $ADB_NAME \
11+
--compute-model ECPU \
12+
--compute-count 2 \
13+
--cpu-auto-scaling true \
14+
--data-storage-size-in-gbs 500 \
15+
--license-model BringYourOwnLicense \
16+
--db-workload OLTP \
17+
--db-version 23ai \
18+
--character-set AL32UTF8 \
19+
--ncharacter-set AL16UTF16 \
20+
--vnet-id $VNET_ID \
21+
--regular \
22+
--admin-password

sql/config.sql

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/*
2+
Enter the configuration information for your Azure OpenAI deployment
3+
*/
4+
5+
-- The endpoint should be the servername only. For example, myopenai.openai.azure.com
6+
define azureOpenAIEndpoint='your-endpoint.openai.azure.com'
7+
define userName='moviestream'
8+
define profileName='gpt4o'
9+
define azureOpenAICredentialName='azure_cred4o'
10+
define azureOpenAIResourceName='your-resource-name'
11+
define azureOpenAIDeploymentName='your-deployment-name'

sql/security-vpd.sql

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
CREATE TABLE "MOVIESTREAM"."VGSALES"
2+
( "NAME" VARCHAR2(4000 BYTE) COLLATE "USING_NLS_COMP",
3+
"PLATFORM" VARCHAR2(4000 BYTE) COLLATE "USING_NLS_COMP",
4+
"YEAR_OF_RELEASE" NUMBER,
5+
"GENRE" VARCHAR2(4000 BYTE) COLLATE "USING_NLS_COMP",
6+
"PUBLISHER" VARCHAR2(4000 BYTE) COLLATE "USING_NLS_COMP",
7+
"NA_SALES" NUMBER,
8+
"EU_SALES" NUMBER,
9+
"JP_SALES" NUMBER,
10+
"OTHER_SALES" NUMBER,
11+
"GLOBAL_SALES" NUMBER,
12+
"CRITIC_SCORE" NUMBER,
13+
"CRITIC_COUNT" NUMBER,
14+
"USER_SCORE" NUMBER,
15+
"USER_COUNT" NUMBER,
16+
"DEVELOPER" VARCHAR2(4000 BYTE) COLLATE "USING_NLS_COMP",
17+
"RATING" VARCHAR2(4000 BYTE) COLLATE "USING_NLS_COMP"
18+
) DEFAULT COLLATION "USING_NLS_COMP" ;
19+
20+
CREATE OR REPLACE FUNCTION hide_eu (
21+
v_schema IN VARCHAR2,
22+
v_objname IN VARCHAR2)
23+
24+
RETURN VARCHAR2 AS
25+
con VARCHAR2 (200);
26+
27+
BEGIN
28+
con := 'Year_of_release=2009';
29+
RETURN (con);
30+
END hide_eu;
31+
32+
BEGIN
33+
dbms_rls.drop_policy(object_schema => 'MOVIESTREAM',object_name=>'VGSALES',policy_name=>'hide_year');
34+
end;
35+
36+
BEGIN
37+
DBMS_RLS.ADD_POLICY(
38+
object_schema => 'MOVIESTREAM',
39+
object_name => 'VGSALES',
40+
policy_name => 'hide_year',
41+
policy_function => 'hide_eu',
42+
sec_relevant_cols =>'eu_sales',
43+
sec_relevant_cols_opt => dbms_rls.ALL_ROWS);
44+
END;

sql/select-ai-admin-enable.sql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* Run this script as the Autonomous Database ADMIN user */
2+
/* You must enable network access to Azure OpenAI for the database user that will be accessing the service */
3+
4+
-- config.sql contains the endpoints, resource groups and other settings required to connect to your Azure OpenAI deployment
5+
@./config.sql
6+
7+
BEGIN
8+
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
9+
host => '&azureOpenAIEndpoint',
10+
ace => xs$ace_type(privilege_list => xs$name_list('http'),
11+
principal_name => '&userName',
12+
principal_type => xs_acl.ptype_db)
13+
);
14+
END;
15+
/

0 commit comments

Comments
 (0)