diff --git a/shared/adb-slack-msteams/get-started/get-started.md b/shared/adb-slack-msteams/get-started/get-started.md new file mode 100644 index 00000000..9979f16a --- /dev/null +++ b/shared/adb-slack-msteams/get-started/get-started.md @@ -0,0 +1,2 @@ + +[](include:cloud-login.md) \ No newline at end of file diff --git a/shared/adb-slack-msteams/get-started/images/adb-configure.png b/shared/adb-slack-msteams/get-started/images/adb-configure.png new file mode 100644 index 00000000..2e144583 Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/adb-configure.png differ diff --git a/shared/adb-slack-msteams/get-started/images/adb-deployment-type.png b/shared/adb-slack-msteams/get-started/images/adb-deployment-type.png new file mode 100644 index 00000000..f37e01e6 Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/adb-deployment-type.png differ diff --git a/shared/adb-slack-msteams/get-started/images/adb-provisioned.png b/shared/adb-slack-msteams/get-started/images/adb-provisioned.png new file mode 100644 index 00000000..4b80140e Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/adb-provisioned.png differ diff --git a/shared/adb-slack-msteams/get-started/images/adb-provisioning.png b/shared/adb-slack-msteams/get-started/images/adb-provisioning.png new file mode 100644 index 00000000..51df7562 Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/adb-provisioning.png differ diff --git a/shared/adb-slack-msteams/get-started/images/adb-workload-type.png b/shared/adb-slack-msteams/get-started/images/adb-workload-type.png new file mode 100644 index 00000000..0af6958f Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/adb-workload-type.png differ diff --git a/shared/adb-slack-msteams/get-started/images/admin-credential.png b/shared/adb-slack-msteams/get-started/images/admin-credential.png new file mode 100644 index 00000000..beab436e Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/admin-credential.png differ diff --git a/shared/adb-slack-msteams/get-started/images/choose-network-access.png b/shared/adb-slack-msteams/get-started/images/choose-network-access.png new file mode 100644 index 00000000..ce2ee87a Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/choose-network-access.png differ diff --git a/shared/adb-slack-msteams/get-started/images/cloud-service-dashboard.png b/shared/adb-slack-msteams/get-started/images/cloud-service-dashboard.png new file mode 100644 index 00000000..925dc01e Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/cloud-service-dashboard.png differ diff --git a/shared/adb-slack-msteams/get-started/images/contact-email-field.png b/shared/adb-slack-msteams/get-started/images/contact-email-field.png new file mode 100644 index 00000000..4bfdcaba Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/contact-email-field.png differ diff --git a/shared/adb-slack-msteams/get-started/images/create-adb-button.png b/shared/adb-slack-msteams/get-started/images/create-adb-button.png new file mode 100644 index 00000000..7894ea33 Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/create-adb-button.png differ diff --git a/shared/adb-slack-msteams/get-started/images/create-adb-screen-freetier-default.png b/shared/adb-slack-msteams/get-started/images/create-adb-screen-freetier-default.png new file mode 100644 index 00000000..56722341 Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/create-adb-screen-freetier-default.png differ diff --git a/shared/adb-slack-msteams/get-started/images/create-adb-screen-freetier.png b/shared/adb-slack-msteams/get-started/images/create-adb-screen-freetier.png new file mode 100644 index 00000000..d61a7e20 Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/create-adb-screen-freetier.png differ diff --git a/shared/adb-slack-msteams/get-started/images/license.png b/shared/adb-slack-msteams/get-started/images/license.png new file mode 100644 index 00000000..055dd97e Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/license.png differ diff --git a/shared/adb-slack-msteams/get-started/images/livelabs-adwconfig.png b/shared/adb-slack-msteams/get-started/images/livelabs-adwconfig.png new file mode 100644 index 00000000..397954a1 Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/livelabs-adwconfig.png differ diff --git a/shared/adb-slack-msteams/get-started/images/livelabs-adwname.png b/shared/adb-slack-msteams/get-started/images/livelabs-adwname.png new file mode 100644 index 00000000..93f4ea7c Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/livelabs-adwname.png differ diff --git a/shared/adb-slack-msteams/get-started/images/livelabs-byol.png b/shared/adb-slack-msteams/get-started/images/livelabs-byol.png new file mode 100644 index 00000000..9c3975b8 Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/livelabs-byol.png differ diff --git a/shared/adb-slack-msteams/get-started/images/navigation.png b/shared/adb-slack-msteams/get-started/images/navigation.png new file mode 100644 index 00000000..48258e12 Binary files /dev/null and b/shared/adb-slack-msteams/get-started/images/navigation.png differ diff --git a/shared/adb-slack-msteams/introduction/intro.md b/shared/adb-slack-msteams/introduction/intro.md new file mode 100644 index 00000000..1931c5f7 --- /dev/null +++ b/shared/adb-slack-msteams/introduction/intro.md @@ -0,0 +1,61 @@ +# Introduction + +## About this Workshop + +The labs in this workshop walk you through all the steps to send Slack and Microsoft Teams notifications from **Oracle Autonomous Database** (ADB) . You will create Slack and Microsoft Teams apps and configure them so that you can send messages, alerts, or the output of a query from Oracle Autonomous Database. You will review and confirm the receipt of the messages in both Slack channel and Microsoft Teams channels. + +Estimated Workshop Time: 1 hour + +### About Slack and Microsoft Teams + +**Slack** is a business messaging platform that connects teams with the apps, services, and resources you need. It offers real-time messaging, file sharing, and application integrations, making it easy for teams to communicate and collaborate efficiently. See [Getting started](https://slack.com/help/articles/360059928654-How-to-use-Slack--your-quick-start-guide) with Slack for more information. + +**Microsoft Teams** is a collaboration platform that combines chat, video meetings, and file sharing. It integrates with Microsoft 365 apps, supports third-party integrations, and offers robust security. With dedicated channels and mobile access, Teams enhances productivity in remote and hybrid work environments. See [Get Started](https://support.microsoft.com/en-us/office/get-started-with-microsoft-teams-b98d533f-118e-4bae-bf44-3df2470c2b12) with Microsoft Teams for more information. + +Oracle Autonomous Database offers robust integration with Slack and Microsoft Teams, enabling you to enhance your communication, and productivity workflows in your organization. This integration facilitates the seamless transmission of messages, alerts, and query results directly to Slack and Teams channels, addressing several key use cases for modern teams. + +### Objectives + +- Create a Slack account, workspace, app, and channel +- Create a Microsoft Teams account, app, and channel +- Provision and configure an Autonomous Database +- Send a message and a query output to the Slack channel +- Confirm the receipt of the messages in Slack channel +- Send a message and a query output to Microsoft Teams +- Confirm the receipt of the messages in Microsoft Teams + +### Prerequisites + +- An Oracle Cloud account - You may use your own cloud account, a cloud account that you obtained through a trial, a Free Tier account, or a training account whose details were given to you by an Oracle instructor. +- Experience with Oracle Autonomous Database +- Familiarity with Slack and Microsoft Teams +- Familiarity with Oracle Cloud Infrastructure is helpful, but not required. + +**Let's begin! Please click Get Started in the Contents menu on the left.** + +## Learn More + +- [Oracle Autonomous Data Warehouse Documentation](https://docs.oracle.com/en/cloud/paas/autonomous-data-warehouse-cloud/index.html) +- [Additional Autonomous Data Warehouse Tutorials](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/tutorials.html) +- [Autonomous Database Workshops](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/livelabs-workshop-cards?clear=100&session=103864463501116) +- [Slack](https://slack.com/) +- [Microsoft Teams](https://www.microsoft.com/en-us/microsoft-teams/group-chat-software) + +## Acknowledgements + ++ **Author:** Yonca Aksit, User Assistance Developer Intern + ++ **Contributors:** + + + Lauran K. Serhal, Consulting User Assistance Developer + + Marty Gubar, Director of Product Management, Autonomous Database + ++ **Last Updated By/Date:** Yonca Aksit, October 2024 + +Copyright (C) 2024 Oracle Corporation. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 +or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled [GNU Free Documentation License](files/gnu-free-documentation-license.txt) diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_app.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_app.png new file mode 100644 index 00000000..808d01fa Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_app.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_app_to_channel.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_app_to_channel.png new file mode 100644 index 00000000..88f4521e Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_app_to_channel.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_bot_to_team.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_bot_to_team.png new file mode 100644 index 00000000..fdc51dba Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_bot_to_team.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_permis_channel.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_permis_channel.png new file mode 100644 index 00000000..13207d62 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_permis_channel.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_permis_readwrite.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_permis_readwrite.png new file mode 100644 index 00000000..cff4d10b Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_permis_readwrite.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_scope_permission.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_scope_permission.png new file mode 100644 index 00000000..02fb8c5d Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_scope_permission.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_secret.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_secret.png new file mode 100644 index 00000000..6b81f7ce Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/add_secret.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/app-created.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/app-created.png new file mode 100644 index 00000000..55c97066 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/app-created.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/app_registry.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/app_registry.png new file mode 100644 index 00000000..a8542e8b Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/app_registry.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/basic-info-example.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/basic-info-example.png new file mode 100644 index 00000000..747b7825 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/basic-info-example.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/basic-info-sized.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/basic-info-sized.png new file mode 100644 index 00000000..25613baf Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/basic-info-sized.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/bot_management.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/bot_management.png new file mode 100644 index 00000000..c703e007 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/bot_management.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/check_popup_msg.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/check_popup_msg.png new file mode 100644 index 00000000..def9cad4 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/check_popup_msg.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/check_sub_status.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/check_sub_status.png new file mode 100644 index 00000000..0ab8b9e4 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/check_sub_status.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click-lines.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click-lines.png new file mode 100644 index 00000000..de3c4804 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click-lines.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_add_permis.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_add_permis.png new file mode 100644 index 00000000..77a7f066 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_add_permis.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_bot_name.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_bot_name.png new file mode 100644 index 00000000..c509b3e2 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_bot_name.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_consent_permis.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_consent_permis.png new file mode 100644 index 00000000..b33334c7 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_consent_permis.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_create_channel.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_create_channel.png new file mode 100644 index 00000000..373da7d4 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_create_channel.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_ok_msg.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_ok_msg.png new file mode 100644 index 00000000..2e72fd7d Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_ok_msg.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_three_dots.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_three_dots.png new file mode 100644 index 00000000..436df446 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/click_three_dots.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/config_permis.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/config_permis.png new file mode 100644 index 00000000..70555c4f Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/config_permis.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_channel_id.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_channel_id.png new file mode 100644 index 00000000..3bfcb509 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_channel_id.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_ids.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_ids.png new file mode 100644 index 00000000..d0207722 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_ids.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_team_id.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_team_id.png new file mode 100644 index 00000000..1d43812f Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_team_id.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_tenant_id.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_tenant_id.png new file mode 100644 index 00000000..1d19978b Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_tenant_id.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_the_link.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_the_link.png new file mode 100644 index 00000000..69109c80 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/copy_the_link.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/create_new_app.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/create_new_app.png new file mode 100644 index 00000000..94fdf502 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/create_new_app.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/create_secret_key.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/create_secret_key.png new file mode 100644 index 00000000..49cf497d Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/create_secret_key.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/create_teams_channel.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/create_teams_channel.png new file mode 100644 index 00000000..f263089c Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/create_teams_channel.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/created-new-chnl.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/created-new-chnl.png new file mode 100644 index 00000000..6ce6b348 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/created-new-chnl.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/created_bot.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/created_bot.png new file mode 100644 index 00000000..f0a45afe Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/created_bot.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/created_client_secret.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/created_client_secret.png new file mode 100644 index 00000000..b96a233c Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/created_client_secret.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/delete-app.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/delete-app.png new file mode 100644 index 00000000..a7340b0a Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/delete-app.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/enter-botname-field.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/enter-botname-field.png new file mode 100644 index 00000000..efc65728 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/enter-botname-field.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/enter-confirm-to-delete.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/enter-confirm-to-delete.png new file mode 100644 index 00000000..47379c74 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/enter-confirm-to-delete.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/enter_bot_name.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/enter_bot_name.png new file mode 100644 index 00000000..a666160b Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/enter_bot_name.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/fill-out-basicinfo.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/fill-out-basicinfo.png new file mode 100644 index 00000000..37656159 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/fill-out-basicinfo.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/get_link_channel.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/get_link_channel.png new file mode 100644 index 00000000..4a70b424 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/get_link_channel.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/grant_permis.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/grant_permis.png new file mode 100644 index 00000000..1f7f22dd Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/grant_permis.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/publish-button.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/publish-button.png new file mode 100644 index 00000000..bcd35735 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/publish-button.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/publish-to-org.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/publish-to-org.png new file mode 100644 index 00000000..1fd3719d Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/publish-to-org.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/receive-popup-msg.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/receive-popup-msg.png new file mode 100644 index 00000000..3a0edb25 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/receive-popup-msg.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/register_app.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/register_app.png new file mode 100644 index 00000000..ab57c397 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/register_app.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/search_team.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/search_team.png new file mode 100644 index 00000000..9ccec4de Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/search_team.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-add-team.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-add-team.png new file mode 100644 index 00000000..167ba86f Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-add-team.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-applications-arrow.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-applications-arrow.png new file mode 100644 index 00000000..29f4ea3b Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-applications-arrow.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-appname.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-appname.png new file mode 100644 index 00000000..d3465a1d Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-appname.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-apps.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-apps.png new file mode 100644 index 00000000..2933c88f Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-apps.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-ateam.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-ateam.png new file mode 100644 index 00000000..78696c13 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-ateam.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-basic-info.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-basic-info.png new file mode 100644 index 00000000..9a415782 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-basic-info.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-identity.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-identity.png new file mode 100644 index 00000000..b40071eb Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-identity.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-teams.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-teams.png new file mode 100644 index 00000000..0b855031 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select-teams.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_api_perms.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_api_perms.png new file mode 100644 index 00000000..4c3fe2a6 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_api_perms.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_app_features.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_app_features.png new file mode 100644 index 00000000..3d6ce018 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_app_features.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_app_name.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_app_name.png new file mode 100644 index 00000000..b713e2ae Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_app_name.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_app_permis.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_app_permis.png new file mode 100644 index 00000000..fdb856a3 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_app_permis.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_appfeatures_bot.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_appfeatures_bot.png new file mode 100644 index 00000000..e069a3f6 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_appfeatures_bot.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_apps.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_apps.png new file mode 100644 index 00000000..3a79f1d4 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_apps.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_bot.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_bot.png new file mode 100644 index 00000000..c7960ae2 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_bot.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_bot_name.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_bot_name.png new file mode 100644 index 00000000..cc71d3eb Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_bot_name.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_client_secrets.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_client_secrets.png new file mode 100644 index 00000000..a8f545ed Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_client_secrets.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_graphapi.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_graphapi.png new file mode 100644 index 00000000..cbc6736a Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_graphapi.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_newbot.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_newbot.png new file mode 100644 index 00000000..2f097abd Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_newbot.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_pub_toorg.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_pub_toorg.png new file mode 100644 index 00000000..5dc59b6d Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_pub_toorg.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_publish_app.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_publish_app.png new file mode 100644 index 00000000..4bf59501 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/select_publish_app.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/images/status-published.png b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/status-published.png new file mode 100644 index 00000000..b2e3cea5 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-config/images/status-published.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-config/prepare-adb-msteams-config.md b/shared/adb-slack-msteams/prepare-adb-msteams-config/prepare-adb-msteams-config.md new file mode 100644 index 00000000..fe56c933 --- /dev/null +++ b/shared/adb-slack-msteams/prepare-adb-msteams-config/prepare-adb-msteams-config.md @@ -0,0 +1,317 @@ +# Configure the Microsoft Teams Application + +**Important:** This lab uses features which are not available on the Oracle LiveLabs Sandbox hosted environments (the Green button), and requires Microsoft Teams admin permissions. + +## Introduction + +Microsoft Teams serves as a comprehensive collaboration platform within the Microsoft 365 ecosystem, facilitating instant messaging, audio and video calls, and online meetings. With its seamless integration with other applications, Teams enhances productivity by streamlining communication and project management. Microsoft Teams supports a wide range of integrations with external apps and services. + +This lab walks you through the steps to create your Microsoft Teams application and channel to receive messages, alerts and output of a query from Autonomous Database. + +Estimated Time: 15 minutes + +### Objectives + +In this lab, you will: + ++ Create your Microsoft Teams application ++ Create and configure a bot for your Microsoft Teams application ++ Publish your Microsoft Teams application ++ Configure your Microsoft Teams application using Azure Portal ++ Create your Microsoft Teams channel + +### Prerequisites + ++ Completion of the lab **Get Started** from the **Contents** menu on the left. ++ Microsoft Teams account and workspace ++ Microsoft Teams app and channel ++ Microsoft 365 Developer Account + +> **Note:** The Microsoft 365 Developer Program offers a powerful sandbox environment through its Microsoft 365 E5 developer subscription. This subscription provides developers with a dedicated space to build and test solutions without impacting production systems. For more information, see [Set up a developer subscription](https://learn.microsoft.com/en-us/office/developer-program/microsoft-365-developer-program-get-started). + +## Task 1: Create your Microsoft Teams application + +1. To create a Microsoft Teams application, click [this link](https://dev.teams.microsoft.com/home) to access **Developer Portal for Teams**, and then select **Apps** from the navigation menu that is located on the left side panel. + + ![Open ADB](./images/select-apps.png "") + + > **Note:** Please bookmark the [apps](https://dev.teams.microsoft.com/apps) link as you will need it for future tasks. + +2. Click the plus sign next to **New app** to create a new application. + + ![Open ADB](./images/create_new_app.png "") + +3. Enter a name for your app in the **Name** field, and then click **Add**. + + ![Open ADB](./images/add_app.png "") + +4. Ensure that your app has been successfully created as shown in the screen capture. + + ![Open ADB](./images/app-created.png "") + +5. If you want to delete your application, click the **3 dots** sign on the row for your app, and then click **Delete**. + + ![Open ADB](./images/delete-app.png "") + +6. Enter your application **name** in the field, and then click **Confirm**. + + ![Open ADB](./images/enter-confirm-to-delete.png "") + +7. If successful, you will receive a message as shown in the screen capture. + + ![Open ADB](./images/receive-popup-msg.png "") + +## Task 2: Create and configure a bot for your Microsoft Teams application + +For this task, you will create and configure a bot for your Microsoft Team application. A bot is the application designed to interact through conversation and it is also referred to as a chatbot or conversational bot. It's an app that runs simple and repetitive tasks by users such as customer service or support staff. Everyday use of bots include, bots that provide information about the weather, make dinner reservations, or provide travel information. Interactions with bots can be quick questions and answers or complex conversations. For more information, see [Build bots for Teams](https://learn.microsoft.com/en-us/microsoftteams/platform/bots/what-are-bots). + +1. Click the **Navigation menu** that is located on the left side panel. + + ![Open ADB](./images/click-lines.png "") + +2. Click **Tools** in the Navigation menu, and then click **Bot management** in the **Tools** section. + + ![Open ADB](./images/bot_management.png "") + +3. Click the plus sign next to **New Bot** to create your bot. + + ![Open ADB](./images/select_newbot.png "") + +4. Enter your bot name in the **Bot name** field, and then click **Add**. + + ![Open ADB](./images/enter_bot_name.png "") + +5. Ensure you receive a pop-up message confirming that your bot has been successfully added. + + ![Open ADB](./images/created_bot.png "") + +6. To create a secret key for your bot, click the **Bot Name**. + + ![Open ADB](./images/click_bot_name.png "") + +7. Select the **Client secrets**, and then click **Add a secret** to create a client secret for your bot. + + ![Open ADB](./images/add_secret.png "") + +8. After you create the client secret, click the **Copy** icon next to the code to copy the secret which you will need in later steps. This is the only time the generated secret will be displayed. Next, click **OK** close it. + + ![Open ADB](./images/create_secret_key.png "") + +9. Select **Apps** from the Navigation menu, and then click your application **Name**. + + ![Open ADB](./images/select-appname.png "") + +10. Scroll down to the **Configure** section, and then click **App features**. + + ![Open ADB](./images/select_app_features.png "") + +11. In the **App features** section, click **Bot** to set up required scope and permission for your application. + + ![Open ADB](./images/select_appfeatures_bot.png "") + + > **Note:** Bots are conversational apps that carry out a predetermined set of tasks. Bots interact with people, answering their inquiries and informing them in advance of changes and other happenings. For more information, see [Build bots for Teams](https://learn.microsoft.com/en-us/microsoftteams/platform/bots/what-are-bots?referrer=developerportal). + +12. Specify the following parameters that are shown in the screen capture to set up your bot's scope, and then click **Save**. + + - Identify your bot: Click **Select an existing bot** + - What can your bot do: Click **Only send notifications** + - Select the scopes where people can use your bot: Click **Team** + + ![Open ADB](./images/add_scope_permission.png "") + + > **Note:** Selecting the "team" scope provides the bot functionalities such as accessing to team channels, ability to interact with multiple users in a team, and retrieving team-specific data. Fore more information, see [App scope](https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/design/understand-use-cases?referrer=developerportal#app-scope). + +## Task 3: Publish your Microsoft Teams application + +After creating your application successfully, the next crucial step is to publish it to your organization. This process ensures that your application becomes accessible to all users within your organization. + +1. Go to your [Apps](https://dev.teams.microsoft.com/apps), click your application **Name**. + + ![Open ADB](./images/select-appname.png "") + +2. Scroll down to the **Configure** section, and then select **Basic information**. + + ![Open ADB](./images/select-basic-info.png "") + +3. On the **Basic Information** page, fill out the basic information about your application, and then click **Save**. + + ![Open ADB](./images/basic-info-sized.png "") + + > **Note:** If you do not enter the information on your app details page, you will not be able to publish your app to org (MSFT). For more information, see [Create your Teams Store listing details](https://learn.microsoft.com/en-us/microsoftteams/platform/concepts/deploy-and-publish/appsource/prepare/submission-checklist?referrer=developerportal&tabs=desktop). + +4. After completing the basic information, scroll down to the **Publish** section, and then click **Publish to org** to submit your app. + + ![Open ADB](./images/publish-button.png "") + +5. Verify that the submission **Status** shows **Submitted**. + + ![Open ADB](./images/check_sub_status.png "") + +6. Once your Microsoft Teams admin approves your app, the **Status** will change to **Published** as shown in the screen capture. + + ![Open ADB](./images/status-published.png "") + +## Task 4: Configure your Microsoft Teams application using Microsoft Entra ID + +1. After publishing your app, ensure your Microsoft Teams admin approves your app from the [Teams admin center](https://admin.teams.microsoft.com/policies/manage-apps) page. + + > **Note:** If your application is not approved by Microsoft Team admin, you will not be able to proceed to the next tasks. + +2. Go to [Microsoft Entra admin center](https://entra.microsoft.com/#home), and then click the arrow down next to **Identity**. + + ![Open ADB](./images/select-identity.png "") + +3. Scroll down to the **Applications** section, and then click the arrow down next to **Applications** section. + + ![Open ADB](./images/select-applications-arrow.png "") + +4. From the drop-down list, click **App registrations**. + + ![Open ADB](./images/register_app.png "") + +5. Select **Owned applications**, which will automatically populate your bot with the **Application(client) ID**. + + ![Open ADB](./images/app_registry.png "") + + > **Note:** Please copy your **Application (client) ID**. It is unique identifier for an app and also known as the client ID for an app. + +6. You can also enter your bot **name** in the **Search** field as shown in the screen capture. + + ![Open ADB](./images/enter-botname-field.png "") + +7. Click **Display name** to see information about your application. + + ![Open ADB](./images/select_bot_name.png "") + +8. Scroll down to **Manage** section, an then select **API permissions**. + + ![Open ADB](./images/select_api_perms.png "") + +9. For your application, these following permissions are required: + + + **`Files.ReadWrite.All`** + + This permission will enable you to read, create, update and delete all files. For more information, see [Microsoft Graph permissions reference](https://learn.microsoft.com/en-us/graph/permissions-reference). + + + **`ChannelSettings.Read.All`** + + This permission will enable you to read all channel names, channel descriptions, and channel settings. For more information, see [Microsoft Graph permissions reference](https://learn.microsoft.com/en-us/graph/permissions-reference). + +10. To request required permissions for your app, click **Add a permission**. + + ![Open ADB](./images/click_add_permis.png "") + +11. On the Request API permissions page, set the following parameters, and then click **Add permissions**. + + + Microsoft APIs: Select **Microsoft Graph** + + Type of permissions: Select **Application permissions** + + Select permissions: Enter **ChannelSettings.Read.All** in the **search** field + + Channel Settings: Click the **ChannelSettings.Read.All** box + + ![Open ADB](./images/add_permis_channel.png "") + + > **Note:** Microsoft Graph API for Teams offers powerful capabilities to enhance your applications. It provides access to crucial data about teams, channels, users, and messages, enabling the creation of rich features. Additionally, the notification APIs simplify sending alerts from your app directly to the Teams activity feed. For more information, see [Use the Microsoft Graph API to work with Microsoft Teams](https://learn.microsoft.com/en-us/graph/api/resources/teams-api-overview?view=graph-rest-1.0). + +12. Repeat the step 11 to add **`Files.ReadWrite.All`** permission as well. + +13. After adding permissions, ensure your admin approve requested permissions from **Microsoft Entra admin center**. + + ![Open ADB](./images/grant_permis.png "") + +## Task 5: Create your Microsoft Teams Channel + +1. Log into your [Microsoft Teams](https://www.microsoft.com/en-us/microsoft-teams/log-in), click **Teams** , click **+** sign next to **Teams**. + + ![Open ADB](./images/select-teams.png "") + +2. Select **Create channel** from the drop-down list. + + ![Open ADB](./images/create_teams_channel.png "") + +3. To create a channel, specify the following parameters as shown in the screen capture and click **Create**. + + + Add the channel to a team: Select your preferred **team**, and click **Done** as shown in the screen capture. + + Channel name: Enter your preferred **Channel name** in the name field. + + Description: Enter your preferred **Description**. + + Channel type: Choose a **channel type** as **Standard** so people on your team has access. + + ![Open ADB](./images/select-ateam.png "") + + ![Open ADB](./images/click_create_channel.png "") + +4. If successful, you will see your channel, which was created under your preferred team. + + ![Open ADB](./images/created-new-chnl.png "") + +5. Select **Apps** from navigation menu, enter your **application name** in the search field, and then click **Add** to add your app to your channel. + + ![Open ADB](./images/add_app_to_channel.png "") + +6. Select **Add to a team**. + + ![Open ADB](./images/select-add-team.png "") + +7. Enter your channel name in the name field or click the **search** icon to find your channel, and then select your **team or your channel** from the dropdown. + + ![Open ADB](./images/search_team.png "") + +8. Click **Set up a bot** to proceed. + + ![Open ADB](./images/add_bot_to_team.png "") + +9. In the **About this bot** message box, click **OK** . + + ![Open ADB](./images/click_ok_msg.png "") + + > **Note:** To send a query result to a Microsoft Teams channel, you need to obtain your **team ID**, and **tenant ID**. The tenant ID is a globally unique identifier (GUID) that differs from your organization’s name or domain. + +10. Click on the **three dots(...)** next to your channel name, and then click **Get link to channel**. + + ![Open ADB](./images/click_three_dots.png "") + + ![Open ADB](./images/get_link_channel.png "") + +11. Click **Copy** to copy the link as shown in the screen capture. + + ![Open ADB](./images/copy_the_link.png "") + + > **Note:** Please save the URL to be able to proceed to next tasks. + +12. Paste the URL into the text editor to copy your **tenant ID**, which is located at the end of the URL. + + ![Open ADB](./images/copy_tenant_id.png "") + + > **Note:** For more information, see [Find your Microsoft 365 tenant ID](https://learn.microsoft.com/en-us/sharepoint/find-your-office-365-tenant-id). + +13. Copy your **team ID** from the URL as shown in the screen capture. + + ![Open ADB](./images/copy_team_id.png "") + +14. Copy the **channel ID** from the URL as shown in the screen capture. + + ![Open ADB](./images/copy_channel_id.png "") + +## Summary + +You learned how to create a Microsoft Teams application and a channel to receive messages and query results form Autonomous Database. Autonomous Database supports sending alerts,messages and query results directly to your channels to enhance productivity. Next, let's see how to provision and configure a new Autonomous Database. + +You may now **proceed to the next lab**. + +## Acknowledgements + ++ **Author:** Yonca Aksit, User Assistance Developer Intern + ++ **Contributors:** + + + Lauran K. Serhal, Consulting User Assistance Developer + + Marty Gubar, Director of Product Management, Autonomous Database + ++ **Last Updated By/Date:** Yonca Aksit, October 2024 + +Copyright (C) 2024 Oracle Corporation. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 +or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled [GNU Free Documentation License](files/gnu-free-documentation-license.txt) diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/check-to-see-msg.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/check-to-see-msg.png new file mode 100644 index 00000000..d39614e8 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/check-to-see-msg.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/click-adb-name.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/click-adb-name.png new file mode 100644 index 00000000..50d91527 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/click-adb-name.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/click-adb.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/click-adb.png new file mode 100644 index 00000000..d44492e8 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/click-adb.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/click-open-link.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/click-open-link.png new file mode 100644 index 00000000..79adf265 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/click-open-link.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/confirm-query-json.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/confirm-query-json.png new file mode 100644 index 00000000..df7c2fb0 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/confirm-query-json.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/confirm-sql-output.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/confirm-sql-output.png new file mode 100644 index 00000000..aac8cbce Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/confirm-sql-output.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/confirm_msg.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/confirm_msg.png new file mode 100644 index 00000000..c1b49399 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/confirm_msg.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/confirm_query_result.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/confirm_query_result.png new file mode 100644 index 00000000..c2651f40 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/confirm_query_result.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/copy-channel-id.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/copy-channel-id.png new file mode 100644 index 00000000..e6900723 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/copy-channel-id.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/csv-result.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/csv-result.png new file mode 100644 index 00000000..3d7bcb9e Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/csv-result.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/insert-data.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/insert-data.png new file mode 100644 index 00000000..e26446f8 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/insert-data.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/json-result.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/json-result.png new file mode 100644 index 00000000..e165d52b Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/json-result.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/open-file-json.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/open-file-json.png new file mode 100644 index 00000000..59e4db8d Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/open-file-json.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/open-link-json.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/open-link-json.png new file mode 100644 index 00000000..25fcf158 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/open-link-json.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/receipt-query-json.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/receipt-query-json.png new file mode 100644 index 00000000..8cd40bb7 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/receipt-query-json.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/run_send_notif_pkg.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/run_send_notif_pkg.png new file mode 100644 index 00000000..c70ce99b Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/run_send_notif_pkg.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/select-database-actions.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/select-database-actions.png new file mode 100644 index 00000000..f080fadd Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/select-database-actions.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send-a-msg.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send-a-msg.png new file mode 100644 index 00000000..87fa36f7 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send-a-msg.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send-query-result-json.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send-query-result-json.png new file mode 100644 index 00000000..8f8d648c Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send-query-result-json.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send-results-json.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send-results-json.png new file mode 100644 index 00000000..cc3e234d Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send-results-json.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send-sqlquery.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send-sqlquery.png new file mode 100644 index 00000000..6c52f679 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send-sqlquery.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send_results_query.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send_results_query.png new file mode 100644 index 00000000..fbf09963 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/send_results_query.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/table-created.png b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/table-created.png new file mode 100644 index 00000000..2c712a09 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/images/table-created.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/prepare-adb-sendmsg.md b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/prepare-adb-sendmsg.md new file mode 100644 index 00000000..2de1c099 --- /dev/null +++ b/shared/adb-slack-msteams/prepare-adb-msteams-slack-sendmsg/prepare-adb-sendmsg.md @@ -0,0 +1,340 @@ +# Send Notifications from Autonomous Database to Slack and Microsoft Teams + +**Important:** This lab uses features which are not available on the Oracle LiveLabs Sandbox hosted environments (the Green button), and requires Microsoft Teams admin permissions. + +## Introduction + +This lab walks you through the steps to send messages, alerts and output of a query from Autonomous Database to Slack and Microsoft Teams. Also, you will learn the procedures to send notifications to Microsoft Teams and Slack channels. + +Estimated Time: 10 minutes + +### Objectives + +In this lab, you will: + ++ Send messages to a Slack channel ++ Send query results to a Slack Channel ++ Send messages to a Microsoft Teams channel ++ Send query results to a Microsoft Teams channel + +### Prerequisites + ++ Completion of the lab **Get Started**, **Lab 1**, **Lab 2**, and **Lab 3** from the **Contents** menu on the left. ++ Slack account and workspace ++ Slack app ++ Slack channel ++ Microsoft Teams account and workspace ++ Microsoft Teams app and channel ++ Microsoft 365 Developer Account + +## Task 1: Create a Luxury Car Dealership Story + +Let's assume you work at a luxury car dealership that prides itself on providing exceptional customer service. The dealership offers a special **white glove** treatment for customers who purchase cars valued at over $40,000. + +You will create the customers table based on few parameters, and then will notify the customer service who qualify for the treatment from Autonomous Database to Slack and Microsoft Teams channels. + ++ name: Customer name ++ email: Customer email ++ product: Car type ++ amount: Price of the car + +1. In the Oracle Cloud console, open the **Navigation menu**, navigate to **Oracle Database**, and then select **Autonomous Data Warehouse**. + + ![Open ADB](./images/click-adb.png "") + +2. Select your **Autonomous Database instance**. + + ![Open ADB](./images/click-adb-name.png "") + +3. Click **Database actions**, and then select **SQL** . + + ![Open ADB](./images/select-database-actions.png "") + +4. To create the generated **customers** table using the script, copy and paste the following code into your SQL Worksheet, and then click the **Run Script (F5)** icon in the Worksheet toolbar. + + ``` + + CREATE TABLE customers + ( + name varchar2(100), + email varchar2(100), + product varchar2(100), + amount number + ); + + + ``` + + ![Open ADB](./images/table-created.png "") + +5. This example is using the sample customers data. To insert sample data into the **customers** table, copy and paste the following code into your SQL Worksheet, and then click the **Run Script (F5)** icon in the Worksheet toolbar. + + ``` + + + Insert into CUSTOMERS (NAME,EMAIL,PRODUCT,AMOUNT) values ('John Doe','john.doe@example.com','Zypher A1',15000); + Insert into CUSTOMERS (NAME,EMAIL,PRODUCT,AMOUNT) values ('Jane Smith','jane.smith@example.com','Zypher A2',18000); + Insert into CUSTOMERS (NAME,EMAIL,PRODUCT,AMOUNT) values ('Emily Johnson','emily.j@example.com','Zypher A3',22000); + Insert into CUSTOMERS (NAME,EMAIL,PRODUCT,AMOUNT) values ('Michael Brown','michael.b@example.com','Zypher B1',30000); + Insert into CUSTOMERS (NAME,EMAIL,PRODUCT,AMOUNT) values ('Jessica Davis','jessica.d@example.com','Zypher B2',35000); + Insert into CUSTOMERS (NAME,EMAIL,PRODUCT,AMOUNT) values ('David Wilson','david.w@example.com','Zypher B3',40000); + Insert into CUSTOMERS (NAME,EMAIL,PRODUCT,AMOUNT) values ('Sarah Miller','sarah.m@example.com','Zypher C1',50000); + Insert into CUSTOMERS (NAME,EMAIL,PRODUCT,AMOUNT) values ('James Anderson','james.a@example.com','Zypher C2',55000); + Insert into CUSTOMERS (NAME,EMAIL,PRODUCT,AMOUNT) values ('Laura Thomas','laura.t@example.com','Zypher C3',60000); + Insert into CUSTOMERS (NAME,EMAIL,PRODUCT,AMOUNT) values ('Robert Jackson','robert.j@example.com','Zypher D1',70000); + commit; + + + ``` + + ![Open ADB](./images/insert-data.png "") + + That's it. Now, you can notify customer service about the customers who qualify for the white glove treatment, which are customers who spent more than $40,000. Let's start! + +## Task 2: Send messages to a Slack channel + + For this task, you will use the **`DBMS_CLOUD_NOTIFICATION.SEND_MESSAGE`** procedure to send a message to your Slack channel. For more information, see [SEND_MESSAGE Procedure](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/autonomous-dbms-cloud-notification.html#GUID-8A557984-BEC3-4F82-909E-4451E86F66E0). + +1. In the source database SQL window, specify the following parameters that are used in the following code example. + + + provider: Enter **slack** + + credential_name: Enter your credential name such as **`SLACK_CRED`** + + message: Enter your preferred message such as **`Alert from Autonomous Database...`** + + params: Substitute the **`C0....08`** place holder with your own Slack **channel ID** + +2. Click the drop-down list next to your channel's name, scroll down to the bottom section, and then copy the **Channel ID**. + + ![Open ADB](./images/copy-channel-id.png "") + +3. Copy and paste the following code into your SQL Worksheet, enter your **Channel ID**, and then click the **Run Script (F5)**. + + ``` + + BEGIN + DBMS_CLOUD_NOTIFICATION.SEND_MESSAGE( + provider => 'slack', + credential_name => 'SLACK_CRED', + message => 'Please provide white glove treatment to the following customer.', + params => json_object('channel' value 'C0....08')); + END; + + + ``` + + ![Open ADB](./images/send-a-msg.png "") + + > **Note:** Use the **params** parameter to specify the Slack channel. The Channel ID is unique ID for a channel and is different from the channel name. You can find your channel ID at the bottom of the channel page as shown in the previous screen capture. + +4. Open your Slack channel, and confirm the receipt of the message. + + ![Open ADB](./images/check-to-see-msg.png "") + +## Task 3: Send query results to a Slack Channel + +For this task, you will use the **`DBMS_CLOUD_NOTIFICATION.SEND_DATA`** procedure to send the output of a query to your Slack channel. For more information, see [`SEND_DATA Procedure`](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/autonomous-dbms-cloud-notification.html#GUID-B3375A5B-79B1-43A5-B043-A7FA646FBF54). + +1. Copy your **Channel ID** from Task 2 (step 2). + +2. Send query results in `json` format using the following script. In the source database SQL window, specify the following parameters that are used in the following script. + + + provider: Enter **slack** + + credential_name: Enter your credential name such as **`SLACK_CRED`** + + query: Enter your preferred query such as **`SELECT username, account_status, expiry_date FROM USER_USERS WHERE rownum < 3`** + + channel: Substitute the **`C0....08`** place holder with your own Slack **channel ID** + + type: Enter your preferred format such as **csv** + + Copy and paste the following code into your SQL Worksheet, and then click the **Run Script (F5)**. + + ``` + + BEGIN + DBMS_CLOUD_NOTIFICATION.SEND_DATA( + provider => 'slack', + credential_name => 'SLACK_CRED', + query => 'select * from CUSTOMERS where amount >= 40000', + params => json_object('channel' value 'C0....08', + 'type' value 'csv')); + END; + + ``` + + ![Open ADB](./images/send-sqlquery.png "") + + > **Note:** To specify the output type, use **params** section. Valid output types include `csv` and `json`. + +3. Open your Slack channel, and confirm the receipt of query result. + + ![Open ADB](./images/confirm-sql-output.png "") + +4. Send the results of query in `json` format using the following script. In the source database SQL window, specify the following parameters that are used in the following script. + + + provider: Enter **slack** + + credential_name: Enter your credential name such as **`SLACK_CRED`** + + query: Enter your preferred query such as **`SELECT username, account_status, expiry_date FROM USER_USERS WHERE rownum < 3`** + + channel: Substitute the **`C0....08`** place holder with your own Slack **channel ID** + + type: Enter your preferred format such as **`json`** + + Copy and paste the following code into your SQL Worksheet, and then click the **Run Script (F5)**. + + ``` + + BEGIN + DBMS_CLOUD_NOTIFICATION.SEND_DATA( + provider => 'slack', + credential_name => 'SLACK_CRED', + query => 'select * from CUSTOMERS where amount >= 40000', + params => json_object('channel' value 'C0....08', + 'type' value 'json')); + END; + + ``` + + ![Open ADB](./images/send-query-result-json.png "") + +5. Open your Slack channel, and confirm the receipt of query result. + + ![Open ADB](./images/receipt-query-json.png "") + +## Task 4: Send messages to a Microsoft Teams Channel + +For this task, you will use the **`DBMS_CLOUD_NOTIFICATION.SEND_MESSAGE`** procedure to send a message to your Microsoft Teams channel. For more information, see [SEND_MESSAGE Procedure](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/autonomous-dbms-cloud-notification.html#GUID-8A557984-BEC3-4F82-909E-4451E86F66E0). + +1. In the source database SQL window, specify the following parameters that are used in the following script. + + + provider: Enter **msteams** + + credential_name: Enter your credential name such as **`TEAMS_CRED`** + + message: Enter your preferred message such as **`text from new teams api`** + + params: Substitute the channel ID placeholder with your own **channel ID** + + > **Note:** You will not be able to run the code without having your **channel ID**. + Please see task 5, step 13 in **Lab 2** to obtain your **channel ID**. + + Copy and paste the following code into your SQL Worksheet, and then click the **Run Script (F5)**. + + ``` + + BEGIN + DBMS_CLOUD_NOTIFICATION.SEND_MESSAGE( + provider => 'msteams', + credential_name => 'TEAMS_CRED', + message => 'Please provide white glove treatment to the following customer.', + params => json_object('channel' value 'channel ID')); + END; + + ``` + + ![Open ADB](./images/run_send_notif_pkg.png "") + +2. Open your Teams channel, and confirm the receipt of the message. + + ![Open ADB](./images/confirm_msg.png "") + +## Task 5: Send query results to a Microsoft Teams Channel + +For this task, you will use the **`DBMS_CLOUD_NOTIFICATION.SEND_DATA`** procedure to send the output of a query to your Microsoft Teams Channel. For more information, see [`SEND_DATA Procedure`](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/autonomous-dbms-cloud-notification.html#GUID-B3375A5B-79B1-43A5-B043-A7FA646FBF54). + +1. Send query results to a Microsoft Teams Channel using the following the script. Specify the following parameters that are used in the following script. + + + provider: Enter **msteams** + + credential_name: Enter your credential name such as **`TEAMS_CRED`** + + query: Enter your preferred query such as **`SELECT tablespace_name FROM dba_tablespaces`** + + tenant: Substitute the **`5b743bc******c0286`** placeholder with your **tenant ID** + + team: Substitute the **`0ae401*********5d2bd`** placeholder with your **team ID** + + channel: Substitute the **`19%3a94be023*****%40thread.tacv2`** placeholder with your **channel ID** + + title: Substitute **`today`** placeholder with your preferred **title** + + type: Enter your preferred output format as **`csv` or `json`** + + Copy and paste the following code into your SQL Worksheet, and then click the **Run Script (F5)**. + + ``` + + BEGIN + DBMS_CLOUD_NOTIFICATION.SEND_DATA( + provider => 'msteams', + credential_name => 'TEAMS_CRED', + query => 'select * from CUSTOMERS where amount >= 40000', + params => json_object( + 'tenant'value '5b743bc******c0286', + 'team'value '0ae401*********5d2bd', + 'channel'value '19%3a94be023*****%40thread.tacv2', + 'title'value 'today', + 'type'value 'csv')); + END; + + ``` + + ![Open ADB](./images/send_results_query.png "") + + > **Note:** The maximum file size supported when using `DBMS_CLOUD_NOTIFICATION.SEND_DATA` for Microsoft Teams is `4MB`. For more information, see ['SEND_DATA Procedure'](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/autonomous-dbms-cloud-notification.html#GUID-B3375A5B-79B1-43A5-B043-A7FA646FBF54) + +2. Go to your Teams channel, and confirm the receipt of the query result. + + ![Open ADB](./images/confirm_query_result.png "") + +3. Click the **Open link** to see query results in csv format. + + ![Open ADB](./images/click-open-link.png "") + +4. After you open the link, you will see your query results as shown in the screen capture. + + ![Open ADB](./images/csv-result.png "") + +5. To get your query results in **`json`** format, substitute specified parameters in step 1. Copy and paste the following code into your SQL Worksheet,and then click the **Run Script (F5)**. + + ``` + + BEGIN + DBMS_CLOUD_NOTIFICATION.SEND_DATA( + provider => 'msteams', + credential_name => 'TEAMS_CRED', + query => 'select * from CUSTOMERS where amount >= 40000', + params => json_object( + 'tenant'value '5b743bc******c0286', + 'team'value '0ae401*********5d2bd', + 'channel'value '19%3a94be023*****%40thread.tacv2', + 'title'value 'today', + 'type'value 'json')); + END; + + ``` + + ![Open ADB](./images/send-results-json.png "") + +6. Go to your Teams channel, and confirm the receipt of the query result. + + ![Open ADB](./images/confirm-query-json.png "") + +7. Click the **Open link** to download the file to your local device. + + ![Open ADB](./images/open-link-json.png "") + +8. Click **Open file** from your downloads folder as shown in the screen capture. + + ![Open ADB](./images/open-file-json.png "") + +9. After you open the file, you will see your query results in **`json`** format as shown in the screen capture. + + ![Open ADB](./images/json-result.png "") + +## Summary + +You learned how to send messages and query results to your Slack and Microsoft Teams channel to from an Autonomous Database. Autonomous Database supports sending alerts,messages and query results directly to your channels to enhance productivity. + +## Acknowledgements + ++ **Author:** Yonca Aksit, User Assistance Developer Intern + ++ **Contributors:** + + + Lauran K. Serhal, Consulting User Assistance Developer + + Marty Gubar, Director of Product Management, Autonomous Database + ++ **Last Updated By/Date:** Yonca Aksit, October 2024 + +Copyright (C) 2024 Oracle Corporation. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 +or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled [GNU Free Documentation License](files/gnu-free-documentation-license.txt) diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/add-an-app.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/add-an-app.png new file mode 100644 index 00000000..0b400139 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/add-an-app.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/add-people-to-ch.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/add-people-to-ch.png new file mode 100644 index 00000000..8be8573b Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/add-people-to-ch.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/added-scope.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/added-scope.png new file mode 100644 index 00000000..ca6cf3f8 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/added-scope.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/added-scopes.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/added-scopes.png new file mode 100644 index 00000000..2ad01f0d Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/added-scopes.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/app-added-channel.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/app-added-channel.png new file mode 100644 index 00000000..7769ec5e Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/app-added-channel.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-add-scope.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-add-scope.png new file mode 100644 index 00000000..946ecc6d Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-add-scope.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-app-name.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-app-name.png new file mode 100644 index 00000000..0a0ee3fa Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-app-name.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-channel-name.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-channel-name.png new file mode 100644 index 00000000..c139f5bb Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-channel-name.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-next.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-next.png new file mode 100644 index 00000000..2c240b56 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-next.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-next2.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-next2.png new file mode 100644 index 00000000..ce108bc1 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-next2.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-oa-permissions.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-oa-permissions.png new file mode 100644 index 00000000..c06037a6 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/click-oa-permissions.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/copy-channel-id.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/copy-channel-id.png new file mode 100644 index 00000000..e6900723 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/copy-channel-id.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/create-a-new-app.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/create-a-new-app.png new file mode 100644 index 00000000..2b5385ab Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/create-a-new-app.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/create-channel.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/create-channel.png new file mode 100644 index 00000000..4fb1c2cc Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/create-channel.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/create-new-channel.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/create-new-channel.png new file mode 100644 index 00000000..4c28e088 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/create-new-channel.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/delete-slack-app.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/delete-slack-app.png new file mode 100644 index 00000000..2bce5d5a Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/delete-slack-app.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/enter-channels-read.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/enter-channels-read.png new file mode 100644 index 00000000..d37d1137 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/enter-channels-read.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/oauth-tokens.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/oauth-tokens.png new file mode 100644 index 00000000..27b66532 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/oauth-tokens.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/overview-channel.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/overview-channel.png new file mode 100644 index 00000000..19a1ca09 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/overview-channel.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/request-info-install.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/request-info-install.png new file mode 100644 index 00000000..a5de4891 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/request-info-install.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/request-to-install.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/request-to-install.png new file mode 100644 index 00000000..4e0b0546 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/request-to-install.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/review-scopesto-add.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/review-scopesto-add.png new file mode 100644 index 00000000..38772ac3 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/review-scopesto-add.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/see-basic-information.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/see-basic-information.png new file mode 100644 index 00000000..e7f07146 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/see-basic-information.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/select-add.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/select-add.png new file mode 100644 index 00000000..7e6777d4 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/select-add.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/select-appname.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/select-appname.png new file mode 100644 index 00000000..071d2c9b Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/select-appname.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/select-from-scratch.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/select-from-scratch.png new file mode 100644 index 00000000..c090e1b6 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/select-from-scratch.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/images/select-integrations.png b/shared/adb-slack-msteams/prepare-adb-slack-config/images/select-integrations.png new file mode 100644 index 00000000..60590db9 Binary files /dev/null and b/shared/adb-slack-msteams/prepare-adb-slack-config/images/select-integrations.png differ diff --git a/shared/adb-slack-msteams/prepare-adb-slack-config/prepare-adb-slack-config.md b/shared/adb-slack-msteams/prepare-adb-slack-config/prepare-adb-slack-config.md new file mode 100644 index 00000000..e3ca8e46 --- /dev/null +++ b/shared/adb-slack-msteams/prepare-adb-slack-config/prepare-adb-slack-config.md @@ -0,0 +1,185 @@ +# Configure the Slack Application + +**Important:** This lab uses features which are not available on the Oracle LiveLabs Sandbox hosted environments (the Green button), and requires Slack admin permissions. + +## Introduction + +Slack, a leading collaboration tool, enables teams with the ability to have seamless communication and efficient data management. Slack has cool integrations with external apps and sources. + +This lab walks you through the steps to create your Slack application and channel to receive messages, alerts, and the output of a query from an Autonomous Database. + +Estimated Time: 15 minutes + +### Objectives + +In this lab, you will: + ++ Create your Slack application ++ Configure your Slack application ++ Create your Slack channel + +### Prerequisites + ++ Completion of the lab **Get Started** from the **Contents** menu on the left. ++ Slack account and workspace ++ Slack app ++ Slack channel + +> **Note:** A Slack workspace is made up of channels, where team members can communicate and work together. To join a workspace, you can [create a Slack account](https://slack.com/get-started#/createnew) using your email address. + +## Task 1: Create Your Slack application + +1. To create a Slack application, click [this link](https://api.slack.com/apps) to access the **Your Apps** page, and select **Create an App**. + + ![Open ADB](./images/create-a-new-app.png "") + + > **Note:** Please bookmark the [Your Apps](https://api.slack.com/apps) link as you will need it for future tasks. + +2. Select **From scratch**. + + ![Open ADB](./images/select-from-scratch.png "") + +3. Enter your **App Name**, select your **Workspace**, and then click **Create App**. + + ![Open ADB](./images/select-appname.png "") + + > **Note:** To create a Slack app successfully, you must select your preferred workspace as shown in the previous screen capture. After creating your app, you need to have your Slack admin approve your application. + +4. Under the **Settings** section, you will see the **Basic Information** page after creating your Slack app. You can update your information, and then click **Save Changes** or you can click **Discard Changes** not to apply changes. + + ![Open ADB](./images/see-basic-information.png "") + +5. At the bottom of the **Basic Information** page, you will see **Delete App** section. If you want to delete your Slack app, you can click **Delete App**. + + ![Open ADB](./images/delete-slack-app.png "") + +## Task 2: Configure your Slack application + +After creating your application, you must request scopes which will grant your application permissions to perform actions such as viewing basic information, posting messages, and uploading files in your selected workspace. + +These following scopes are required: + ++ **channels:read** + + This permission scope will enable you to view basic information about public channels in your workspace. For more information, see [channels:read](https://api.slack.com/scopes/channels:read). ++ **chat:write** + + This permission scope will enable you to post messages in approved channels and conversations. For more information, see [chat:write](https://api.slack.com/scopes/chat:write). ++ **files:write** + + This permission scope will enable you to upload, edit, and delete files from your Slack app. For more information, see [files:write](https://api.slack.com/scopes/files:write). + +1. Go to [Your Apps](https://api.slack.com/apps), and then click your **App Name**. + + ![Open ADB](./images/click-app-name.png "") + +2. Scroll down to the **Features** section, and click **OAuth & Permissions**. + + ![Open ADB](./images/click-oa-permissions.png "") + +3. Scroll down to the **Scopes** section, and then click **Add an OAuth Scope**. + + ![Open ADB](./images/click-add-scope.png "") + +4. For OAuth Scope, enter **channels:read**, and then select **channels:read** from dropdown. This scope allows your app to access public Slack channels. + + ![Open ADB](./images/enter-channels-read.png "") + +5. If successful, you will see the recently added **OAuth Scope** with the **Description**. + + ![Open ADB](./images/added-scope.png "") + +6. Repeat step 4, to add the scopes **chat:write** and **files:write** to your application as well. + + ![Open ADB](./images/added-scopes.png "") + +7. After adding scopes, scroll up to the **OAuth Tokens** section, and then click **Request to Install**. + + ![Open ADB](./images/request-to-install.png "") + +8. To request to install your application, add an **optional message** for your Slack admin, and then click **Submit Request**. + + ![Open ADB](./images/request-info-install.png "") + +9. After submitting request, you will see the following message as shown in the screen capture. + + ![Open ADB](./images/oauth-tokens.png "") + + > **Note:** Have your Slack admin grant you access to install your Slack application in your workspace to proceed with the following tasks in this lab. + +## Task 3: Create a Slack channel + +For this task, you will use **`DBMS_CLOUD_NOTIFICATION`** package which enables you to send messages, and the output of query to the supported providers. For more information, see [`DBMS_CLOUD_NOTIFICATION`](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/autonomous-dbms-cloud-notification.html#GUID-F3347243-2C65-4E9A-84AA-5FA93200058F) package. + +You will learn how to add your Slack app to your channel so that you can send message through the **Integrations** in the channel by using the **`DBMS_CLOUD_NOTIFICATION`** procedure. + +1. Open the Slack app, click the plus icon next to **Add channels**, and then select **Create a new channel**. + + ![Open ADB](./images/create-new-channel.png "") + +2. Select your workspace, and click **Next**. + + ![Open ADB](./images/click-next.png "") + +3. Enter a **Name** for your channel, and then click **Next**. + + ![Open ADB](./images/click-next2.png "") + +4. Select the **Visibility** of your channel based on your preference, and then click **Create**. + + ![Open ADB](./images/create-channel.png "") + +5. If you can want to add people to your new channel, enter the **username or email** address, and then click **Add**. Click **Skip for now**. + + ![Open ADB](./images/add-people-to-ch.png "") + +6. If successful, you will see your channel in your workspace. Click the arrow icon next to your **Channel name**. + + ![Open ADB](./images/overview-channel.png "") + +7. Select **Integrations**. + + ![Open ADB](./images/select-integrations.png "") + +8. Click **Add an App** to integrate the application into your channel. + + ![Open ADB](./images/add-an-app.png "") + +9. Enter your Slack app name in the **Search** field. Select your workspace from the drop-down list. Click your desired application from the **In your workspace** section, and then click **Add**. + + ![Open ADB](./images/select-add.png "") + + > **Note:** Have your Slack admin grant you access to install your Slack application in your workspace to proceed with the following tasks in this lab. + + **ADBS Notifications** is an internal Slack app developed for sending notifications from Autonomous Database to Slack channels. Due to restrictions, the Slack app (Slack-ADB) created in Task 2, Step 3, cannot be installed in the workspace. Therefore, an existing app is being used to test in this workshop. + + The Slack app uses the Slack Web API to communicate with an Autonomous Database. The Slack Web API is an interface for making changes and retrieving information from a Slack workplace. For more information, see [Using the Slack Web API](https://api.slack.com/web). + +10. If successful, you will receive a message as shown in the screen capture below. + + ![Open ADB](./images/app-added-channel.png "") + +## Summary + +You learned how to create a Slack app and a Slack channel to receive messages and query results from Autonomous Database. Autonomous Database supports sending alerts,messages and query results directly to your channels to enhance productivity. Next, let's see how to create Microsoft Teams application and channel. + +You may now **proceed to the next lab**. + +## Acknowledgements + ++ **Author:** Yonca Aksit, User Assistance Developer Intern + ++ **Contributors:** + + * Lauran K. Serhal, Consulting User Assistance Developer + * Marty Gubar, Director of Product Management, Autonomous Database + ++ **Last Updated By/Date:** Yonca Aksit, October 2024 + +Copyright (C) 2024 Oracle Corporation. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 +or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled [GNU Free Documentation License](files/gnu-free-documentation-license.txt) diff --git a/shared/adb-slack-msteams/provision-database-config/images/click-adb-name.png b/shared/adb-slack-msteams/provision-database-config/images/click-adb-name.png new file mode 100644 index 00000000..50d91527 Binary files /dev/null and b/shared/adb-slack-msteams/provision-database-config/images/click-adb-name.png differ diff --git a/shared/adb-slack-msteams/provision-database-config/images/click-adb.png b/shared/adb-slack-msteams/provision-database-config/images/click-adb.png new file mode 100644 index 00000000..d44492e8 Binary files /dev/null and b/shared/adb-slack-msteams/provision-database-config/images/click-adb.png differ diff --git a/shared/adb-slack-msteams/provision-database-config/images/copy-bot-token.png b/shared/adb-slack-msteams/provision-database-config/images/copy-bot-token.png new file mode 100644 index 00000000..cd6049bb Binary files /dev/null and b/shared/adb-slack-msteams/provision-database-config/images/copy-bot-token.png differ diff --git a/shared/adb-slack-msteams/provision-database-config/images/create-credential.png b/shared/adb-slack-msteams/provision-database-config/images/create-credential.png new file mode 100644 index 00000000..fdbfd552 Binary files /dev/null and b/shared/adb-slack-msteams/provision-database-config/images/create-credential.png differ diff --git a/shared/adb-slack-msteams/provision-database-config/images/create_credential.png b/shared/adb-slack-msteams/provision-database-config/images/create_credential.png new file mode 100644 index 00000000..4c096c14 Binary files /dev/null and b/shared/adb-slack-msteams/provision-database-config/images/create_credential.png differ diff --git a/shared/adb-slack-msteams/provision-database-config/images/run-acl.png b/shared/adb-slack-msteams/provision-database-config/images/run-acl.png new file mode 100644 index 00000000..cc48b7d8 Binary files /dev/null and b/shared/adb-slack-msteams/provision-database-config/images/run-acl.png differ diff --git a/shared/adb-slack-msteams/provision-database-config/images/select-database-actions.png b/shared/adb-slack-msteams/provision-database-config/images/select-database-actions.png new file mode 100644 index 00000000..f080fadd Binary files /dev/null and b/shared/adb-slack-msteams/provision-database-config/images/select-database-actions.png differ diff --git a/shared/adb-slack-msteams/provision-database-config/provision-database-configure.md b/shared/adb-slack-msteams/provision-database-config/provision-database-configure.md new file mode 100644 index 00000000..8f0599b1 --- /dev/null +++ b/shared/adb-slack-msteams/provision-database-config/provision-database-configure.md @@ -0,0 +1,190 @@ + +# Provision and Configure an Autonomous Database + +## Introduction + +In this lab, you will learn the steps to get started using the Oracle Autonomous Database (Autonomous Data Warehouse). We will show you how to deploy a complete data warehousing platform that can scale to your requirements. + +Also, you will learn how to configure your Slack and Microsoft Teams application and channel to receive messages, alerts, and output of a query from an Autonomous Database. + +Estimated Time: 15 minutes + +### Objectives + +In this lab, you will: + +- Provision a new Autonomous Database +- Create a credential object to access the Slack application from Autonomous Database +- Configure access control to allow user access to external network services +- Create a credential object to access Microsoft Teams application from Autonomous Database +- Configure access control to allow user access to external network services + +### Prerequisites + +- This lab requires completion of the **Get Started**, **Lab 1**, and **Lab 2** sections in the Contents menu on the left. + +## Task 1: Choose Autonomous Database from the OCI Services Menu + +[](include:adb-goto-service-body.md) + +## Task 2: Create the Autonomous Database Instance + +[](include:adb-provision-body.md) + +## Task 3: Create a credential object to access the Slack application from Autonomous Database + +For this task, you will use **`DBMS_CLOUD.CREATE_CREDENTIAL`** procedure which enables you to access the cloud service for data loading, and querying external data in the cloud. For more information, see [`CREATE_CREDENTIAL procedure`](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/dbms-cloud-subprograms.html#GUID-742FC365-AA09-48A8-922C-1987795CF36A). + +1. In the Oracle Cloud console, open the **Navigation menu**, navigate to **Oracle Database**, and then select **Autonomous Data Warehouse**. + + ![Open ADB](./images/click-adb.png "") + +2. Select your **Autonomous Database instance**. + + ![Open ADB](./images/click-adb-name.png "") + +3. Click **Database actions**, and then select **SQL** . + + ![Open ADB](./images/select-database-actions.png "") + +4. To create credential object to access the Slack app from Autonomous Database, you need to obtain your **Bot User OAuth Token**. + + > **Note:** Bot tokens are authentication tokens, enabling your bot to interact with the workspace's API to send and receive messages. For more information, see [Bot tokens](https://api.slack.com/concepts/token-types#bot). + +5. Access the [Your Apps](https://api.slack.com/apps) page, and then click **Your Apps**. + +6. Scroll down to the **Features** section, click **OAuth & Permissions**, and then copy your **Bot User OAuth Token** + + ![Open ADB](./images/copy-bot-token.png "") + + > **Note:** Once adding your application is approved by your Slack admin, **OAuth Token** will be generated. If the approval is not granted, you will not see the **OAuth Tokens for Your Workspace** section shown in the previous screen capture. + +7. Create a credential object to access the Slack app from Autonomous Database using the following script. Specify the following parameters that are used in the script. + + - credential_name: Enter your preferred name such as **`SLACK_CRED`** + - username: Enter **`SLACK_TOKEN`** as a username + - password: Enter your **Bot User OAuth Token** + + > **Note:** If adding your application is not approved by you Slack admin, you will not be able to run the code without having the **Bot User OAuth Token**. + + Copy and paste the following code into your SQL Worksheet, and then click the **Run Script (F5)** icon in the Worksheet toolbar. + + ``` + + BEGIN + DBMS_CLOUD.CREATE_CREDENTIAL( + credential_name => 'SLACK_CRED', + username => 'SLACK_TOKEN', + password => 'xoxb-34....96-34....52-zW....cy'); + END; + + ``` + + ![Open ADB](./images/create-credential.png "") + + > **Note:**If you can not run the `CREATE_CREDENTIAL` procedure successfully, you can consult the ADMIN user to grant execute access on `DBMS_CLOUD` packages. For more information, see [`DBMS_CLOUD`](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/dbms-cloud-subprograms.html#GUID-3D0A5361-672C-467D-AA90-656B1B4D4E37). + + You can leave the SQL window open and continue with the next task. + +## Task 4: Configure access control to allow user access to external network services + +For this task, you will use **`DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE`** procedure to grant the access control privileges to a user. For more information, see [Configuring Access Control for External Network Services](https://docs.oracle.com/en/database/oracle/oracle-database/19/dbseg/managing-fine-grained-access-in-pl-sql-packages-and-types.html#DBSEG-GUID-3D5B66BC-0277-4887-9CD1-97DB44EB5213). + +1. In the source database SQL window, specify the following parameters that are used in the following script. + + - principal_name: Substitute the `enter_db_user_name_or_role` place holder with your database user name such as **`ADMIN`**. + - principal_type: Enter **`xs_acl.ptype_db`** for a database user or role. + + Copy and paste the following code into your SQL Worksheet, and then click the **Run Script (F5)** icon in the Worksheet toolbar. + + ``` + + BEGIN + DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE ( + host => 'slack.com', + lower_port => 443, + upper_port => 443, + ace => xs$ace_type( + privilege_list => xs$name_list('http'), + principal_name => enter_db_user_name_or_role, + principal_type => xs_acl.ptype_db)); + END; + + ``` + + ![Open ADB](./images/run-acl.png "") + + You can leave the SQL window open and continue with the next task. + +## Task 5: Create a credential object to access Microsoft Teams application from Autonomous Database + +For this task, you will use **`DBMS_CLOUD.CREATE_CREDENTIAL`** procedure which enables you to access the cloud service for data loading, and querying external data in the cloud. For more information, see [`CREATE_CREDENTIAL procedure`](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/dbms-cloud-subprograms.html#GUID-742FC365-AA09-48A8-922C-1987795CF36A). + +1. In the Oracle Cloud console, open the **Navigation menu**, navigate to **Oracle Database**, and then select **Autonomous Data Warehouse**. + + ![Open ADB](./images/click-adb.png "") + +2. Select your **Autonomous Database instance**. + + ![Open ADB](./images/click-adb-name.png "") + +3. Click **Database actions** dropdown, and then select **SQL** . + + ![Open ADB](./images/select-database-actions.png "") + +4. Create a credential object to access the Microsoft Teams app from Autonomous Database using the following script. Specify the following parameters that are used in the script. + + - credential_name: Enter your preferred name such as **`TEAMS_CRED`** + - username: Substitute **bot_id** with your **Application (client) ID** + - password: Substitute **bot_secret** with your **client secret** + + Copy and paste the following code into your SQL Worksheet, and then click the **Run Script (F5)** icon in the Worksheet toolbar. + + ``` + + BEGIN + DBMS_CLOUD.CREATE_CREDENTIAL( + credential_name => 'TEAMS_CRED', + username => 'bot_id', + password => 'bot_secret'); + END; + + ``` + + ![Open ADB](./images/create_credential.png "") + + > **Note:** You will not be able to run the code without having your **Application (client) ID** and **client secret**. Please see task 2, step 8 in **Lab 2** for the **client secret** and task 4, step 5 in **Lab 2** for the **Application (client) ID**. + + > **Note:** To use Microsoft Teams app with **`DBMS_CLOUD_NOTIFICATION`** procedure, you need to run the procedure successfully. If you can not run the **`CREATE_CREDENTIAL`** procedure successfully, you can consult the ADMIN user to grant execute access on **`DBMS_CLOUD`** packages. For more information, see [`DBMS_CLOUD`](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/dbms-cloud-subprograms.html#GUID-3D0A5361-672C-467D-AA90-656B1B4D4E37). + +## Summary + +You learned how to create provisions and configure an Autonomous Database. Next, let's see how to send notifications from an Autonomous Database to your Slack and Microsoft Teams channels. + +You may now **proceed to the next lab**. + +## Want to Learn More? + +* [Using Oracle Autonomous Database Serverless](https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/index.html#Oracle%C2%AE-Cloud) + +## Acknowledgements + ++ **Author:** + + * Lauran K. Serhal, Consulting User Assistance Developer + * Yonca Aksit, User Assistance Developer Intern + ++ **Contributors:** + + * Lauran K. Serhal, Consulting User Assistance Developer + * Marty Gubar, Director of Product Management, Autonomous Database + ++ **Last Updated By/Date:** Yonca Aksit, October 2024 + +Copyright (C) 2024 Oracle Corporation. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 +or any later version published by the Free Software Foundation; +with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the section entitled [GNU Free Documentation License](files/gnu-free-documentation-license.txt) diff --git a/shared/adb-slack-msteams/workshops/sandbox/index.html b/shared/adb-slack-msteams/workshops/sandbox/index.html new file mode 100644 index 00000000..e6d1c3e4 --- /dev/null +++ b/shared/adb-slack-msteams/workshops/sandbox/index.html @@ -0,0 +1,82 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/shared/adb-slack-msteams/workshops/sandbox/manifest.json b/shared/adb-slack-msteams/workshops/sandbox/manifest.json new file mode 100644 index 00000000..33ec6d3a --- /dev/null +++ b/shared/adb-slack-msteams/workshops/sandbox/manifest.json @@ -0,0 +1,54 @@ +{ + "workshoptitle": "Send Notifications from Autonomous Database to Slack and Microsoft Teams", + "help": "livelabs-help-db_us@oracle.com", + "include": { + "adb-goto-service-body.md":"/common/building-blocks/tasks/adb/goto-service-body.md", + "adb-provision-body.md":"/common/building-blocks/tasks/adb/provision-body.md", + "cloud-login.md":"/common/labs/cloud-login/cloud-login.md" + }, + "variables": ["./variables.json"], + "tutorials": [ + { + "title": "Introduction", + "description": "Introduction to Sending Slack and Microsoft Teams notifications from Autonomous Database", + "filename": "../../introduction/intro.md" + }, + { + "title": "Get Started", + "description": "Set up the environment", + "filename": "https://oracle-livelabs.github.io/common//labs/cloud-login/cloud-login.md" + + }, + { + "title": "Lab 1: Configure the Slack application", + "description": "You will use configure Slack and Microsoft Teams to send notifications and query result from an Autonomous Database", + "type": "livelabs", + "filename": "../../prepare-adb-slack-config/prepare-adb-slack-config.md" + }, + { + "title": "Lab 2: Configure the Microsoft Teams application", + "description": "You will learn how to configure MS Teams to send notifications and query result from an Autonomous Database", + "type": "livelabs", + "filename": "../../prepare-adb-msteams-config/prepare-adb-msteams-config.md" + }, + { + "title": "Lab 3: Provision and Configure an Autonomous Database", + "description": "You will create a ADB instance", + "type": "livelabs", + "filename": "../../provision-database-config/provision-database-configure.md" + }, + { + "title": "Lab 4: Send Notifications from Autonomous Database to Slack and Microsoft Teams", + "description": "You will use ADB to send notifications and query result to a Slack channel", + "type": "livelabs", + "filename": "../../prepare-adb-msteams-slack-sendmsg/prepare-adb-sendmsg.md" + }, + + { + "title": "Need Help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "filename":"https://oracle-livelabs.github.io/common/labs/need-help/need-help-freetier.md" + } + + ] +} diff --git a/shared/adb-slack-msteams/workshops/sandbox/variables.json b/shared/adb-slack-msteams/workshops/sandbox/variables.json new file mode 100644 index 00000000..d9e0239b --- /dev/null +++ b/shared/adb-slack-msteams/workshops/sandbox/variables.json @@ -0,0 +1,10 @@ +{ + "db_name": "MYQUICKSTART", + "db_display_name":"MyQuickStart", + "db_ocpu": "2 ECPUs", + "db_storage": "1 TB", + "db_name_livelabs": "MOVIE+your user id", + "db_name_livelabs_example": "MOVIE81481", + "db_workload_type":"Autonomous Data Warehouse", + "oac_instance_name": "WORKSHOPADWOAC" + } diff --git a/shared/adb-slack-msteams/workshops/tenancy/index.html b/shared/adb-slack-msteams/workshops/tenancy/index.html new file mode 100644 index 00000000..e6d1c3e4 --- /dev/null +++ b/shared/adb-slack-msteams/workshops/tenancy/index.html @@ -0,0 +1,82 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/shared/adb-slack-msteams/workshops/tenancy/manifest.json b/shared/adb-slack-msteams/workshops/tenancy/manifest.json new file mode 100644 index 00000000..e9060fef --- /dev/null +++ b/shared/adb-slack-msteams/workshops/tenancy/manifest.json @@ -0,0 +1,53 @@ +{ + "workshoptitle": "Send Notifications from Autonomous Database to Slack and Microsoft Teams", + "help": "livelabs-help-db_us@oracle.com", + "include": { + "adb-goto-service-body.md":"/common/building-blocks/tasks/adb/goto-service-body.md", + "adb-provision-body.md":"/common/building-blocks/tasks/adb/provision-body.md", + "cloud-login.md":"/common/labs/cloud-login/cloud-login.md" + }, + "variables": ["./variables.json"], + "tutorials": [ + { + "title": "Introduction", + "description": "Introduction to Sending Slack and Microsoft Teams notifications from Autonomous Database", + "filename": "../../introduction/intro.md" + }, + { + "title": "Get Started", + "description": "Set up the environment", + "filename": "https://oracle-livelabs.github.io/common//labs/cloud-login/cloud-login.md" + + }, + { + "title": "Lab 1: Configure the Slack application", + "description": "You will use configure Slack and Microsoft Teams to send notifications and query result from an Autonomous Database", + "type": "freetier", + "filename": "../../prepare-adb-slack-config/prepare-adb-slack-config.md" + }, + { + "title": "Lab 2: Configure the Microsoft Teams application", + "description": "You will learn how to configure MS Teams to send notifications and query result from an Autonomous Database", + "type": "freetier", + "filename": "../../prepare-adb-msteams-config/prepare-adb-msteams-config.md" + }, + { + "title": "Lab 3: Provision and Configure an Autonomous Database", + "description": "You will create a ADB instance", + "type": "freetier", + "filename": "../../provision-database-config/provision-database-configure.md" + }, + { + "title": "Lab 4: Send Notifications from Autonomous Database to Slack and Microsoft Teams", + "description": "You will use ADB to send notifications and query result to a Slack channel", + "type": "freetier", + "filename": "../../prepare-adb-msteams-slack-sendmsg/prepare-adb-sendmsg.md" + }, + { + "title": "Need Help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "filename":"https://oracle-livelabs.github.io/common/labs/need-help/need-help-freetier.md" + } + + ] +} diff --git a/shared/adb-slack-msteams/workshops/tenancy/variables.json b/shared/adb-slack-msteams/workshops/tenancy/variables.json new file mode 100644 index 00000000..788b6477 --- /dev/null +++ b/shared/adb-slack-msteams/workshops/tenancy/variables.json @@ -0,0 +1,10 @@ +{ + "db_name": "MYQUICKSTART", + "db_display_name":"MyQuickStart", + "db_ocpu": "2 ECPUs", + "db_storage": "1 TB", + "db_name_livelabs": "MOVIE+your user id", + "db_name_livelabs_example": "MOVIE2252", + "db_workload_type":"Autonomous Data Warehouse", + "oac_instance_name": "WORKSHOPADWOAC" + } diff --git a/shared/adb-speaks-human/integrate-genai/images/create-llama.png b/shared/adb-speaks-human/integrate-genai/images/create-llama.png index 1ec896b7..3b9d0ef6 100644 Binary files a/shared/adb-speaks-human/integrate-genai/images/create-llama.png and b/shared/adb-speaks-human/integrate-genai/images/create-llama.png differ diff --git a/shared/adb-speaks-human/integrate-genai/images/genai-output.png b/shared/adb-speaks-human/integrate-genai/images/genai-output.png new file mode 100644 index 00000000..2e761ad4 Binary files /dev/null and b/shared/adb-speaks-human/integrate-genai/images/genai-output.png differ diff --git a/shared/adb-speaks-human/integrate-genai/integrate-genai.md b/shared/adb-speaks-human/integrate-genai/integrate-genai.md index 657d5586..b3dc1e33 100644 --- a/shared/adb-speaks-human/integrate-genai/integrate-genai.md +++ b/shared/adb-speaks-human/integrate-genai/integrate-genai.md @@ -80,71 +80,49 @@ You can create as many profiles as you need, which is useful when comparing the For a complete list of the Select AI profile attributes, see the [DBMS\_CLOUD\_AI\_Package] (https://docs.oracle.com/en/cloud/paas/autonomous-database/serverless/adbsb/dbms-cloud-ai-package.html#GUID-D51B04DE-233B-48A2-BBFA-3AAB18D8C35C) in the Using Oracle Autonomous Database Serverless documentation. ->**Note:** The deployment script created a Select AI profile using the code below: +>**Note:** The deployment script that you ran in **Lab 1 > Task 1 > Step 1** created a `Select AI` profile named **genai** using the code shown in this task; however, you'll practice dropping the file and then recreating it. For the **region** parameter, specify the region name where the OCI GenAI service is running and to which your tenancy is subscribed. In our example, we used **us-chicago-1** (the default). If you are subscribed to **Frankfurt**, then use `eu-frankfurt-1` as the value for the **region** parameter. If you are subscribed to **London**, then use `uk-london-1` as the value for the **region** parameter. + +1. Sign into the SQL worksheet as the **`MOVIESTREAM`** user with the password **`watchS0meMovies#`**. On the **Database Actions Launchpad** page, click the **Development** tab, and then click the **SQL** tab. The SQL Worksheet is displayed. + + >**Note:** the **`MOVIESTREAM`** user was created as part of the setup and tables that were created in that schema. You can find the Moviestream password by navigating to **Developer Services** from the Navigation menu. Next, click **Resource Manager** > **Stacks** > Select the stack we created, **Deploy-ChatDB-Autonomous-Database...** > Select the job we created, **ormjob2024117214431** (use your own stack number)> Select **Outputs** under **Resources**. + + ![Moviestream password](./images/moviestream-output-pswd.png "") + +2. Create an AI profile for the **Meta Llama 3** model. Copy and paste the following code into your SQL Worksheet, and then click the **Run Script** icon. ``` -begin + +BEGIN + -- drops the profile if it already exists + DBMS_CLOUD_AI.drop_profile( + profile_name => 'genai', + force => true + ); - -- Create an AI profile that uses the default LLAMA model on OCI - dbms_cloud_ai.create_profile( + -- Meta Llama 3 (this is the default model, so you could skip the model attribute if you like) + DBMS_CLOUD_AI.create_profile ( profile_name => 'genai', - attributes => - '{"provider": "oci", + attributes => + '{"provider": "oci", "credential_name": "OCI$RESOURCE_PRINCIPAL", - "comments":"true", "object_list": [ - {"owner": "MOVIESTREAM", "name": "GENRE"}, - {"owner": "MOVIESTREAM", "name": "CUSTOMER"}, - {"owner": "MOVIESTREAM", "name": "PIZZA_SHOP"}, - {"owner": "MOVIESTREAM", "name": "STREAMS"}, - {"owner": "MOVIESTREAM", "name": "MOVIES"}, - {"owner": "MOVIESTREAM", "name": "ACTORS"} - ] - }' - ); - -end; -/ + {"owner": "moviestream", "name": "GENRE"}, + {"owner": "moviestream", "name": "CUSTOMER"}, + {"owner": "moviestream", "name": "PIZZA_SHOP"}, + {"owner": "moviestream", "name": "STREAMS"}, + {"owner": "moviestream", "name": "MOVIES"}, + {"owner": "moviestream", "name": "ACTORS"} + ], + "region": "us-chicago-1" + }'); +END; +/ + ``` -1. Sign into the SQL worksheet as the **`MOVIESTREAM`** user with the password **`watchS0meMovies#`**. On the **Database Actions Launchpad** page, click the **Development** tab, and then click the **SQL** tab. The SQL Worksheet is displayed. - - >**Note:** the **`MOVIESTREAM`** user was created as part of the setup and tables that were created in that schema. You can find the Moviestream password by navigating to **Developer Services** from the Navigation menu. Next, click **Resource Manager** > **Stacks** > Select the stack we created, **Deploy-ChatDB-Autonomous-Database...** > Select the job we created, **ormjob2024117214431** (use your own stack number)> Select **Outputs** under **Resources**. +![Create AI profile](./images/create-llama.png "") - ![Moviestream password](./images/moviestream-output-pswd.png "") - -2. Create an AI profile for the **Meta Llama 3 model**. Copy and paste the following code into your SQL Worksheet, and then click the **Run Script** icon. - - ``` - - BEGIN - -- drops the profile if it already exists - DBMS_CLOUD_AI.drop_profile( - profile_name => 'ociai_llama', - force => true - ); - - -- Meta Llama 3 (this is the default model, so you could skip the model attribute if you like) - DBMS_CLOUD_AI.create_profile ( - profile_name => 'ociai_llama', - attributes => - '{"provider": "oci", - "credential_name": "OCI$RESOURCE_PRINCIPAL", - "object_list": [ - {"owner": "moviestream", "name": "GENRE"}, - {"owner": "moviestream", "name": "CUSTOMER"}, - {"owner": "moviestream", "name": "PIZZA_SHOP"}, - {"owner": "moviestream", "name": "STREAMS"}, - {"owner": "moviestream", "name": "MOVIES"}, - {"owner": "moviestream", "name": "ACTORS"} - ], - "model": "meta.llama-3-70b-instruct" - }'); - END; - / - - ``` - ![Create AI profile](./images/create-llama.png "") + ## Task 3: Test the AI profile -We will use the PL/SQL API to generate a response from the Cohere model. This example is using the **chat** action. It is not using any private data coming from your database. +We will use the PL/SQL API to generate a response from the **Meta Llama 3** model. This example is using the **chat** action. It is not using any private data coming from your database. -1. Test the LLM and learn about Autonomous Database as the MOVIESTREAM user using the **Cohere model**. Copy and paste the following code into your SQL Worksheet, and then click the **Run Script** icon. +1. Test the LLM and learn about Autonomous Database as the MOVIESTREAM user using the **genai** model. Copy and paste the following code into your SQL Worksheet, and then click the **Run Script** icon. ``` SELECT DBMS_CLOUD_AI.GENERATE( prompt => 'what is oracle autonomous database', - profile_name => 'OCIAI_COHERE', + profile_name => 'genai', action => 'chat') FROM dual; ``` - ![Test the LLM](./images/cohere-output.png "") + ![Test the LLM](./images/genai-output.png "") -2. Compare the Cohere model to the **Llama model**. Copy and paste the following code into your SQL Worksheet, and then click the **Run Script** icon. + ## Summary You learned how to integrate Autonomous Database with OCI Generative AI. And, you chatted with different models hosted on OCI Generative AI. Next, let's see how to use our private data with LLMs. @@ -211,16 +192,17 @@ You may now proceed to the next lab. ## Acknowledgements - * **Author:** Lauran K. Serhal, Consulting User Assistance Developer - * **Contributors:** + * **Authors:** + * Lauran K. Serhal, Consulting User Assistance Developer * Marty Gubar, Product Management + * **Contributors:** * Stephen Stuart, Cloud Engineer * Nicholas Cusato, Cloud Engineer * Olivia Maxwell, Cloud Engineer * Taylor Rees, Cloud Engineer * Joanna Espinosa, Cloud Engineer -* **Last Updated By/Date:** Lauran K. Serhal, July 2024 +* **Last Updated By/Date:** Lauran K. Serhal, October 2024 Data about movies in this workshop were sourced from **Wikipedia**. diff --git a/shared/adb-speaks-human/introduction/introduction.md b/shared/adb-speaks-human/introduction/introduction.md index dc563eee..15b94d0c 100644 --- a/shared/adb-speaks-human/introduction/introduction.md +++ b/shared/adb-speaks-human/introduction/introduction.md @@ -4,8 +4,7 @@ In this workshop, you will learn how to use **Autonomous Database Select AI (Select AI)** to query your data using natural language; you don't need prior knowledge of the data structure or how that data is accessed. Next, you'll use those capabilities in a voice-enabled APEX app that enables you to get answers to your questions from your desktop or mobile device. -> **NOTE:** Your tenancy must be subscribed to the **US Midwest (Chicago)** region in order to run this workshop. See the [OCI documentation](https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/managingregions.htm) for more details. - +> **NOTE:** At the time this workshop was last updated, your tenancy must be subscribed to the **US Midwest (Chicago)**, **Germany Central (Frankfurt)**, or **UK South (London)** regions in order to run this workshop. See the [OCI documentation](https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/managingregions.htm) for more details. ### What is Natural Language Processing? @@ -36,8 +35,9 @@ You may now proceed to the next lab. * [Additional Autonomous Database Tutorials](https://docs.oracle.com/en/cloud/paas/autonomous-data-warehouse-cloud/tutorials.html) ## Acknowledgements -* **Author:** Lauran K. Serhal, Consulting User Assistance Developer -* **Contributor:** Marty Gubar, Product Manager +* **Authors:** + * Lauran K. Serhal, Consulting User Assistance Developer + * Marty Gubar, Product Manager * **Last Updated By/Date:** Lauran K. Serhal, October 2024 Data about movies in this workshop were sourced from **Wikipedia**. diff --git a/shared/adb-speaks-human/notebook/adb-speaks-human-notebook-july-2024.dsnb b/shared/adb-speaks-human/notebook/adb-speaks-human-notebook-july-2024.dsnb new file mode 100644 index 00000000..0d86d02a --- /dev/null +++ b/shared/adb-speaks-human/notebook/adb-speaks-human-notebook-july-2024.dsnb @@ -0,0 +1,1709 @@ +[ + { + "name" : "adb-speaks-human-notebook", + "description" : null, + "tags" : null, + "version" : "6", + "layout" : "zeppelin", + "type" : "low", + "readOnly" : false, + "snapshot" : false, + "template" : "dsrgmn3y", + "templateConfig" : "{\"visualization\":{\"filters\":[{\"_id\":1583324064459,\"type\":\"styling\",\"enabled\":true,\"conditions\":{\"operator\":\"and\",\"conditions\":[{\"property\":\"hiddenConnection\",\"operator\":\"*\",\"value\":\"\"}]},\"component\":\"edge\",\"target\":\"edge\",\"properties\":{\"colors\":[\"rgba(0, 0, 0, 0.1)\"],\"style\":[\"dashed\"],\"legendTitle\":[\"Hidden Connection\"]}},{\"_id\":1590499315755,\"type\":\"aggregation\",\"enabled\":true,\"conditions\":{\"operator\":\"and\",\"conditions\":[]},\"component\":\"vertex\",\"target\":\"vertex\",\"properties\":{},\"aggregation\":[{\"source\":\"\",\"type\":\"average\"}]}],\"version\":4}}", + "paragraphs" : [ + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 12, + "title" : null, + "hasTitle" : false, + "message" : [ + "%md", + "# Use natural language to query your data", + "", + "Autonomous Database makes it simple to query your data using natural language. The person asking the question doesn't need to know where the data is stored, its structure or how to combine it with other data to get results. All of these tasks are handled by a large language model and Autonomous Database.", + "", + "The following paragraphs will show you how to:", + "1. Create a credential", + "2. Create an AI profile ", + "3. Have general AI chat conversations", + "4. Query data using natural language", + "5. Show the SQL generated for a query", + "", + "## Use an Autonomous Database resource principal to access OCI Generative AI", + "A credential is used to sign LLM API requests. This workshop uses an Autonomous Database resource principal to access OCI Generative AI model; your database has been granted privileges to access OCI GenAI. This code has already been run by the setup script; you don't need to run it. It is typically run by the ADMIN user:", + "", + " begin", + " dbms_cloud_admin.enable_resource_principal (", + " username => 'MOVIESTREAM'", + " );", + " end;" + ], + "selectedVisualization" : "html", + "visualizationConfig" : null, + "hideCode" : true, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : true, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1721687755875, + "endTime" : 1721687755961, + "interpreter" : "md.low", + "taskStatus" : "SUCCESS", + "status" : "SUCCESS", + "results" : [ + { + "message" : "

Use natural language to query your data

\n

Autonomous Database makes it simple to query your data using natural language. The person asking the question doesn't need to know where the data is stored, its structure or how to combine it with other data to get results. All of these tasks are handled by a large language model and Autonomous Database.

\n

The following paragraphs will show you how to:

\n
    \n
  1. Create a credential
  2. \n
  3. Create an AI profile
  4. \n
  5. Have general AI chat conversations
  6. \n
  7. Query data using natural language
  8. \n
  9. Show the SQL generated for a query
  10. \n
\n

Use an Autonomous Database resource principal to access OCI Generative AI

\n

A credential is used to sign LLM API requests. This workshop uses an Autonomous Database resource principal to access OCI Generative AI model; your database has been granted privileges to access OCI GenAI. This code has already been run by the setup script; you don't need to run it. It is typically run by the ADMIN user:

\n
begin\n    dbms_cloud_admin.enable_resource_principal (\n        username  => 'MOVIESTREAM'\n    );\nend;\n
\n", + "type" : "HTML" + } + ], + "forms" : "[]" + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : null, + "hasTitle" : false, + "message" : [ + "%md", + "## Use AI profiles to access your LLM", + "Profiles capture the properties of your LLM provider plus the tables and views you want to enable for natural language queries. You can create multiple profiles (e.g. for different providers), although only one is active for a given session.", + "### Create an AI profile", + "To get started: you'll need to: ", + "* Create a profile that describes your LLM provider and the metadata (schemas, tables, views, etc.) that can be used for natural language queries. You can have multiple profiles - each pointing to different models.", + "* Set the profile for your session. Because we're accessing a single LLM, create a LOGON trigger that sets the profile for your session." + ], + "selectedVisualization" : "html", + "visualizationConfig" : null, + "hideCode" : true, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719332899047, + "endTime" : 1719332899239, + "interpreter" : "md.low", + "taskStatus" : "SUCCESS", + "status" : "SUCCESS", + "results" : [ + { + "message" : "

Use AI profiles to access your LLM

\n

Profiles capture the properties of your LLM provider plus the tables and views you want to enable for natural language queries. You can create multiple profiles (e.g. for different providers), although only one is active for a given session.

\n

Create an AI profile

\n

To get started: you'll need to:

\n\n", + "type" : "HTML" + } + ], + "forms" : "[]" + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 12, + "title" : "Create AI profile", + "hasTitle" : true, + "message" : [ + "%script", + "", + "begin", + " -- ~~~~~~~~~~~~~~", + " -- drop the AI profile just in case it already exists", + " -- ~~~~~~~~~~~~~~", + " dbms_cloud_ai.drop_profile(", + " profile_name => 'genai',", + " force => true", + " );", + " -- ~~~~~~~~~~~~~~", + " -- Specify the LLM provider, your credential", + " -- and the tables/views that will be used for queries", + " -- You can specify specific tables. Or, omit the table from the object list to", + " -- include all objects in the schema", + " -- ~~~~~~~~~~~~~~", + " dbms_cloud_ai.create_profile(", + " profile_name => 'genai',", + " attributes =>", + " '{\"provider\": \"oci\",", + " \"credential_name\": \"OCI$RESOURCE_PRINCIPAL\", ", + " \"object_list\": [{\"owner\": \"MOVIESTREAM\", \"name\": \"movies\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"streams\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"customer_extension\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"pizza_shop\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"actors\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"genre\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"customer_segment\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"customer_contact\"}", + " ]", + " }'", + " );", + " -- ~~~~~~~~~~~~~~", + " -- set the AI profile for this session", + " -- ~~~~~~~~~~~~~~", + " dbms_cloud_ai.set_profile(", + " profile_name => 'genai'", + " );", + "end;" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331865111, + "endTime" : 1719331869205, + "interpreter" : "script.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 12, + "title" : null, + "hasTitle" : false, + "message" : [ + "%md", + "## Ask natural language questions!", + "", + "You can now ask questions using `SELECT AI`. **AI** is a special keyword in the select statement that tells Autonomous Database that the subsequent text will be either or an action or the natural language question.", + "", + "Here are the actions:", + "1. chat - general AI chat", + "2. runsql - [default] ask a question and get a structured result", + "3. narrate - ask a question and get a conversational result", + "4. showsql - SQL used to produce the result", + "", + "Enough explaining. Just give it a try!", + "", + "Start by asking a general question that is not going to be answered by our data. But, the answer may lead to questions that we want to ask of our data:" + ], + "selectedVisualization" : "html", + "visualizationConfig" : null, + "hideCode" : true, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719332910363, + "endTime" : 1719332910467, + "interpreter" : "md.low", + "taskStatus" : "SUCCESS", + "status" : "SUCCESS", + "results" : [ + { + "message" : "

Ask natural language questions!

\n

You can now ask questions using SELECT AI. AI is a special keyword in the select statement that tells Autonomous Database that the subsequent text will be either or an action or the natural language question.

\n

Here are the actions:

\n
    \n
  1. chat - general AI chat
  2. \n
  3. runsql - [default] ask a question and get a structured result
  4. \n
  5. narrate - ask a question and get a conversational result
  6. \n
  7. showsql - SQL used to produce the result
  8. \n
\n

Enough explaining. Just give it a try!

\n

Start by asking a general question that is not going to be answered by our data. But, the answer may lead to questions that we want to ask of our data:

\n", + "type" : "HTML" + } + ], + "forms" : "[]" + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 12, + "title" : "Ask a general question", + "hasTitle" : true, + "message" : [ + "%script", + "select ai chat what are considered the best movies produced in the past 20 years" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : "[{\"raw\":{\"layout\":\"beautify\",\"lastColumns\":[],\"version\":1},\"table\":{\"version\":1}}]", + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331869566, + "endTime" : 1719331873585, + "interpreter" : "script.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 12, + "title" : null, + "hasTitle" : false, + "message" : [ + "%md", + "#### Take a quick look at some tables", + "Numerous tables were included as part of the AI profile:", + "* movies", + "* streams", + "* customer_extension", + "* customer_contact", + "* customer_segment", + "* pizza_shop", + "* genre", + "* actors", + "", + "", + "These are the only tables that will be accessed by natural language queries. Let's take a look at a few of the tables:" + ], + "selectedVisualization" : "html", + "visualizationConfig" : null, + "hideCode" : true, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : true, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719332917173, + "endTime" : 1719332917246, + "interpreter" : "md.low", + "taskStatus" : "SUCCESS", + "status" : "SUCCESS", + "results" : [ + { + "message" : "

Take a quick look at some tables

\n

Numerous tables were included as part of the AI profile:

\n\n

These are the only tables that will be accessed by natural language queries. Let's take a look at a few of the tables:

\n", + "type" : "HTML" + } + ], + "forms" : "[]" + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 4, + "title" : "Customer movie streams", + "hasTitle" : true, + "message" : [ + "%sql ", + "", + "", + "-- transactions - who is watching what movies", + "--~~~~~~~~~~~~~~~~~~~", + "", + "select * from streams where rownum <= 10;" + ], + "selectedVisualization" : "table", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331873955, + "endTime" : 1719331874177, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 4, + "title" : "Movies", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "", + "-- movies and their attributes", + "--~~~~~~~~~~~~~~~~~~~", + "", + "select * from movies where title like '%Godfather%';" + ], + "selectedVisualization" : "table", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331874307, + "endTime" : 1719331874431, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 4, + "title" : "Customer", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "", + "-- customer info", + "--~~~~~~~~~~~~~~~~~~~", + "select * from customer_extension where rownum <= 10" + ], + "selectedVisualization" : "table", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331874728, + "endTime" : 1719331874957, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 12, + "title" : null, + "hasTitle" : false, + "message" : [ + "%md", + "#### See the different types of actions for a simple natural language query", + "We described the different actions above: runsql, narrate, showsql, explainsql and chat. Whereas chat is just a general question, narrate and runsql are questions about our data. Take a look at the results from the different actions:" + ], + "selectedVisualization" : "html", + "visualizationConfig" : null, + "hideCode" : true, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : true, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719332943860, + "endTime" : 1719332943934, + "interpreter" : "md.low", + "taskStatus" : "SUCCESS", + "status" : "SUCCESS", + "results" : [ + { + "message" : "

See the different types of actions for a simple natural language query

\n

We described the different actions above: runsql, narrate, showsql, explainsql and chat. Whereas chat is just a general question, narrate and runsql are questions about our data. Take a look at the results from the different actions:

\n", + "type" : "HTML" + } + ], + "forms" : "[]" + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 4, + "title" : "Action: runsql", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "", + "select ai runsql what are our total sales" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : true, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331875278, + "endTime" : 1719331877418, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 4, + "title" : "Action: narrate", + "hasTitle" : true, + "message" : [ + "%script", + "", + "", + "select ai narrate what are our total sales" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : true, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331877547, + "endTime" : 1719331880521, + "interpreter" : "script.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 4, + "title" : "Action: showsql", + "hasTitle" : true, + "message" : [ + "%script", + "", + "", + "select ai showsql what are our total sales" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331880670, + "endTime" : 1719331882093, + "interpreter" : "script.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 4, + "title" : "Action: explainsql", + "hasTitle" : true, + "message" : [ + "%script", + "", + "", + "select ai explainsql what are our total sales" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : "[{\"raw\":{\"layout\":\"beautify\",\"lastColumns\":[],\"version\":1}}]", + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331882214, + "endTime" : 1719331886814, + "interpreter" : "script.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 12, + "title" : null, + "hasTitle" : false, + "message" : [ + "%md", + "#### Ask tougher questions", + "That first question was pretty easy. These will be a bit harder. Some things to notice when you check out the generated SQL:", + "* Finds tables to join", + "* Determines columns to query - even when the columns aren't mentioned in the query" + ], + "selectedVisualization" : "html", + "visualizationConfig" : null, + "hideCode" : true, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : true, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719332949674, + "endTime" : 1719332949754, + "interpreter" : "md.low", + "taskStatus" : "SUCCESS", + "status" : "SUCCESS", + "results" : [ + { + "message" : "

Ask tougher questions

\n

That first question was pretty easy. These will be a bit harder. Some things to notice when you check out the generated SQL:

\n\n", + "type" : "HTML" + } + ], + "forms" : "[]" + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 6, + "title" : "Sales by movie", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "", + "select ai what are our total sales by movie with best movies first;" + ], + "selectedVisualization" : "table", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331887130, + "endTime" : 1719331889433, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 6, + "title" : "Joins sales_sample and movie tables", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "", + "select ai showsql what are our total sales by movie with best movies first;" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331889579, + "endTime" : 1719331891693, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 6, + "title" : "Top movies for latest month", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "", + "select ai what are our top 5 selling movies for the latest month;" + ], + "selectedVisualization" : "table", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331891834, + "endTime" : 1719331895244, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 6, + "title" : "Understand dates", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "", + "select ai showsql what are our top 5 selling movies for the latest month;" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331895372, + "endTime" : 1719331897989, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 6, + "title" : "Harrison Ford movies", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "", + "select ai what are our sales for movies starring Harrison Ford broken out by movie;" + ], + "selectedVisualization" : "table", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331898126, + "endTime" : 1719331900841, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 6, + "title" : "Model maps starring to ACTOR column", + "hasTitle" : true, + "message" : [ + "%script", + "", + "", + "select ai showsql select ai what are our sales for movies starring Harrison Ford broken out by movie;" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331901011, + "endTime" : 1719331903336, + "interpreter" : "script.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 6, + "title" : "How people watch Action/Adventure movies", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "", + "select ai runsql what are the most popular devices when watching Action and Adventure movies;" + ], + "selectedVisualization" : "table", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331903491, + "endTime" : 1719331906506, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 6, + "title" : "Model knows A&A are genres", + "hasTitle" : true, + "message" : [ + "%script", + " ", + "", + "select ai showsql what are the most popular devices when watching Action and Adventure movies;" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331906663, + "endTime" : 1719331909069, + "interpreter" : "script.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 12, + "title" : null, + "hasTitle" : false, + "message" : [ + "%md", + "#### Challenge with tables and similar content. Need to create a view.", + "", + "", + "The next question fails. The challenge is when you have multiple tables with similar content - like `CUSTOMER_CONTACT` and `CUSTOMER_EXTENSION`. The model fails to find the right tables.", + "", + "After the failed query, you will solve the problem by: ", + "* creating a view to join `CUSTOMER_CONTACT`, `CUSTOMER_SEGMENT` and `CUSTOMER_SEGMENT`", + "* updating the AI profile to include this new view", + "", + "Then, ask the question again" + ], + "selectedVisualization" : "html", + "visualizationConfig" : null, + "hideCode" : true, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : true, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1721927831011, + "endTime" : 1721927831120, + "interpreter" : "md.low", + "taskStatus" : "SUCCESS", + "status" : "SUCCESS", + "results" : [ + { + "message" : "

Challenge with tables and similar content. Need to create a view.

\n

The next question fails. The challenge is when you have multiple tables with similar content - like CUSTOMER_CONTACT and CUSTOMER_EXTENSION. The model fails to find the right tables.

\n

After the failed query, you will solve the problem by:

\n\n

Then, ask the question again

\n", + "type" : "HTML" + } + ], + "forms" : "[]" + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 12, + "title" : "This question fails", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "", + "select ai What are sales by customer segment" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : "[{\"raw\":{\"layout\":\"beautify\",\"lastColumns\":[],\"version\":1}}]", + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331909413, + "endTime" : 1719331911827, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 6, + "title" : "Create a view to simplify the content", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "CREATE OR REPLACE VIEW v_customer AS", + "SELECT", + " cc.cust_id,", + " cc.last_name,", + " cc.first_name,", + " cc.email,", + " cc.street_address,", + " cc.postal_code,", + " cc.city,", + " cc.state_province,", + " cc.country,", + " cc.country_code,", + " cc.continent,", + " cc.yrs_customer,", + " ce.age,", + " ce.commute_distance,", + " ce.credit_balance,", + " ce.education,", + " ce.full_time,", + " ce.gender,", + " ce.household_size, ", + " ce.income_level,", + " ce.job_type,", + " ce.marital_status,", + " ce.num_cars,", + " ce.pet,", + " ce.rent_own,", + " ce.segment_id,", + " ce.work_experience,", + " ce.yrs_current_employer,", + " ce.yrs_residence,", + " cs.short_name as segment_name", + "FROM", + " customer_extension ce, customer_contact cc, customer_segment cs", + "WHERE ", + " ce.cust_id = cc.cust_id", + "AND ce.segment_id = cs.segment_id; " + ], + "selectedVisualization" : "html", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331911953, + "endTime" : 1719331912057, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 6, + "title" : "Segment name is part of the view", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "select cust_id, last_name, segment_name", + "from v_customer", + "where rownum < 10;" + ], + "selectedVisualization" : "table", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331912229, + "endTime" : 1719331912359, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : "Recreate the profile using the view", + "hasTitle" : true, + "message" : [ + "%script", + "", + "begin", + "", + " -- ~~~~~~~~~~~~~~", + " -- drop the current AI profile ", + " -- ~~~~~~~~~~~~~~", + " dbms_cloud_ai.drop_profile(", + " profile_name => 'genai',", + " force => true", + " );", + "", + " -- ~~~~~~~~~~~~~~", + " -- change CUSTOMER to the V_CUSTOMER view", + " -- ~~~~~~~~~~~~~~", + " ", + " dbms_cloud_ai.create_profile(", + " profile_name => 'genai',", + " attributes => ", + " '{\"provider\": \"oci\", ", + " \"credential_name\": \"OCI$RESOURCE_PRINCIPAL\",", + " \"object_list\": [{\"owner\": \"MOVIESTREAM\", \"name\": \"movies\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"streams\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"v_customer\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"pizza_shop\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"genre\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"actors\"}", + " ]", + " }'", + " );", + "", + " -- ~~~~~~~~~~~~~~", + " -- set the AI profile for this session", + " -- ~~~~~~~~~~~~~~", + " dbms_cloud_ai.set_profile(", + " profile_name => 'genai'", + " ); ", + " ", + "", + "end;" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331912481, + "endTime" : 1719331913987, + "interpreter" : "script.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : "Success! Sales by customer segment", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "", + "select ai runsql What are sales by customer segment" + ], + "selectedVisualization" : "bar", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331914120, + "endTime" : 1719331916366, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : null, + "hasTitle" : false, + "message" : [ + "%md", + "#### Use a PLSQL API to access the LLM", + "You can use a PLSQL API to access the LLM. This is useful for tools that are unable to use the SQL interface. Here's a couple examples that use `DBMS_CLOUD_AI.GENERATE` that to translate natural lange to SQL.", + "", + "This approach is used by the **Ask Autonomous** APEX app." + ], + "selectedVisualization" : "html", + "visualizationConfig" : null, + "hideCode" : true, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : true, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719332969164, + "endTime" : 1719332969232, + "interpreter" : "md.low", + "taskStatus" : "SUCCESS", + "status" : "SUCCESS", + "results" : [ + { + "message" : "

Use a PLSQL API to access the LLM

\n

You can use a PLSQL API to access the LLM. This is useful for tools that are unable to use the SQL interface. Here's a couple examples that use DBMS_CLOUD_AI.GENERATE that to translate natural lange to SQL.

\n

This approach is used by the Ask Autonomous APEX app.

\n", + "type" : "HTML" + } + ], + "forms" : "[]" + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : "Chat using the PLSQL API", + "hasTitle" : true, + "message" : [ + "%script", + "", + "declare", + " l_prompt varchar2(4000) := 'Who is Tom Hanks?';", + " l_response clob;", + " l_profile_name varchar2(100) := 'genai';", + "begin", + " l_response := dbms_cloud_ai.generate(", + " prompt => l_prompt,", + " profile_name => l_profile_name,", + " action => 'chat' ", + " );", + " dbms_output.put_line(l_response);", + "end; " + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331916938, + "endTime" : 1719331919244, + "interpreter" : "script.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : "SHOWSQL using the PLSQL API", + "hasTitle" : true, + "message" : [ + "%script", + "", + "", + "declare", + " l_prompt varchar2(4000) := 'What are our total views by genre?';", + " l_response clob;", + " l_profile_name varchar2(100) := 'genai';", + "begin", + " l_response := dbms_cloud_ai.generate(", + " prompt => l_prompt,", + " profile_name => l_profile_name,", + " action => 'showsql' ", + " );", + " dbms_output.put_line(l_response);", + "end; " + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331919377, + "endTime" : 1719331921250, + "interpreter" : "script.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : null, + "hasTitle" : false, + "message" : [ + "%md", + "#### What to do when my table and column names are difficult to understand?", + "It's convenient that our movie data is contained in tables that use clear names. Unfortunately, that's oftentimes not the case! ", + "", + "Use **COMMENTS** on tables and columns to help the model understand their meaning.", + "", + "We'll create views with meaningless names and then try a natural language query. Then, we'll apply comments to see how they help." + ], + "selectedVisualization" : "html", + "visualizationConfig" : null, + "hideCode" : true, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1721927728815, + "endTime" : 1721927728972, + "interpreter" : "md.low", + "taskStatus" : "SUCCESS", + "status" : "SUCCESS", + "results" : [ + { + "message" : "

What to do when my table and column names are difficult to understand?

\n

It's convenient that our movie data is contained in tables that use clear names. Unfortunately, that's oftentimes not the case!

\n

Use COMMENTS on tables and columns to help the model understand their meaning.

\n

We'll create views with meaningless names and then try a natural language query. Then, we'll apply comments to see how they help.

\n", + "type" : "HTML" + } + ], + "forms" : "[]" + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : "Create views with generic names", + "hasTitle" : true, + "message" : [ + "%script", + "", + "-- movies", + "CREATE or REPLACE VIEW view1", + "AS SELECT ", + " movie_id as c1,", + " title as c2,", + " year as c3", + "FROM movies;", + "", + "-- streams", + "CREATE OR REPLACE VIEW view2 as", + "SELECT DAY_ID as c1,", + " GENRE_ID as c2,", + " MOVIE_ID as c3,", + " CUST_ID as c4,", + " DEVICE as c5,", + " SALES as c6,", + " VIEWS as c7", + "FROM STREAMS;", + "", + "-- genres", + "create or replace view view3 as", + "SELECT ", + " GENRE_ID as c1,", + " NAME as c2", + "FROM GENRE;" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331921603, + "endTime" : 1719331921731, + "interpreter" : "script.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : "Query VIEW3", + "hasTitle" : true, + "message" : [ + "%sql", + "SELECT * FROM view3;" + ], + "selectedVisualization" : "table", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331921874, + "endTime" : 1719331921956, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : null, + "hasTitle" : false, + "message" : [ + "%md ", + "#### Create a new AI profile that uses COMMENTS", + "", + "We'll create a new AI profile called `USING_COMMENTS`. Notice that the profile has an attribute `\"comments\":\"true\"`. This tells Select AI to send comments with the LLM request.", + "", + "We still haven't added comments to our objects - that will come next!" + ], + "selectedVisualization" : "html", + "visualizationConfig" : null, + "hideCode" : true, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1721927753546, + "endTime" : 1721927753724, + "interpreter" : "md.low", + "taskStatus" : "SUCCESS", + "status" : "SUCCESS", + "results" : [ + { + "message" : "

Create a new AI profile that uses COMMENTS

\n

We'll create a new AI profile called USING_COMMENTS. Notice that the profile has an attribute "comments":"true". This tells Select AI to send comments with the LLM request.

\n

We still haven't added comments to our objects - that will come next!

\n", + "type" : "HTML" + } + ], + "forms" : "[]" + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : "Create the new profile", + "hasTitle" : true, + "message" : [ + "%script", + "", + "begin", + " dbms_cloud_ai.drop_profile(", + " profile_name => 'USING_COMMENTS',", + " force => true", + " );", + "", + " dbms_cloud_ai.create_profile(", + " profile_name => 'USING_COMMENTS',", + " attributes => ", + " '{\"provider\": \"oci\",", + " \"credential_name\": \"OCI$RESOURCE_PRINCIPAL\",", + " \"comments\":\"true\", ", + " \"object_list\": [", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"view1\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"view2\"},", + " {\"owner\": \"MOVIESTREAM\", \"name\": \"view3\"} ", + " ] ", + " }'", + " );", + " ", + " dbms_cloud_ai.set_profile(", + " profile_name => 'USING_COMMENTS'", + " );", + "end;" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331922279, + "endTime" : 1719331923886, + "interpreter" : "script.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : "No comments, no luck!", + "hasTitle" : true, + "message" : [ + "%sql", + "", + "select ai runsql What are our total views by genre" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331924019, + "endTime" : 1719331928132, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : null, + "hasTitle" : false, + "message" : [ + "%md", + "##### Add comments to the views", + "Apply comments to the views that describe their meaning. This is really helpful - not just in this case where it's absolutely needed - but in most every case. It helps the LLM find the right information." + ], + "selectedVisualization" : "html", + "visualizationConfig" : null, + "hideCode" : true, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719332983742, + "endTime" : 1719332983905, + "interpreter" : "md.low", + "taskStatus" : "SUCCESS", + "status" : "SUCCESS", + "results" : [ + { + "message" : "
Add comments to the views
\n

Apply comments to the views that describe their meaning. This is really helpful - not just in this case where it's absolutely needed - but in most every case. It helps the LLM find the right information.

\n", + "type" : "HTML" + } + ], + "forms" : "[]" + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : null, + "hasTitle" : false, + "message" : [ + "%script", + "", + "-- Movies", + "COMMENT ON TABLE view1 IS 'Contains movies, movie titles and the year it was released';", + "COMMENT ON COLUMN view1.c1 IS 'movie ids. Use this column to join to other views';", + "COMMENT ON COLUMN view1.c2 IS 'movie titles';", + "COMMENT ON COLUMN view1.c3 IS 'year the movie was released';", + "", + "-- Streams", + "COMMENT ON TABLE view2 IS 'transactions for movie views - also known as streams';", + "COMMENT ON COLUMN view2.c1 IS 'day the movie was streamed';", + "COMMENT ON COLUMN view2.c2 IS 'genre ids. Use this column to join to other views';", + "COMMENT ON COLUMN view2.c3 IS 'movie ids. Use this column to join to other views';", + "COMMENT ON COLUMN view2.c4 IS 'customer ids. Use this column to join to other views';", + "COMMENT ON COLUMN view2.c5 IS 'device used to stream, watch or view the movie';", + "COMMENT ON COLUMN view2.c6 IS 'sales from the movie';", + "COMMENT ON COLUMN view2.c7 IS 'number of views, watched, streamed';", + "", + "-- Genres", + "COMMENT ON TABLE view3 IS 'Contains the genres';", + "COMMENT ON COLUMN view3.c1 IS 'genre id. use this column to join to other views';", + "COMMENT ON COLUMN view3.c2 IS 'name of the genre';" + ], + "selectedVisualization" : "raw", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331928462, + "endTime" : 1719331928618, + "interpreter" : "script.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + }, + { + "row" : 0, + "col" : 0, + "sizeX" : 0, + "width" : 0, + "title" : null, + "hasTitle" : false, + "message" : [ + "%sql", + "", + "select ai runsql what are our top 10 most viewed movies" + ], + "selectedVisualization" : "table", + "visualizationConfig" : null, + "hideCode" : false, + "hideResult" : false, + "hideGutter" : true, + "hideVizConfig" : false, + "hideInIFrame" : false, + "enabled" : true, + "forms" : "[]", + "result" : { + "startTime" : 1719331928756, + "endTime" : 1719331931858, + "interpreter" : "sql.low", + "taskStatus" : null, + "status" : null, + "results" : null, + "forms" : null + }, + "relations" : [ ], + "dynamicFormParams" : null + } + ] + } +] \ No newline at end of file diff --git a/shared/adb-speaks-human/notebook/adb-speaks-human-notebook.dsnb b/shared/adb-speaks-human/notebook/adb-speaks-human-notebook.dsnb index 0d86d02a..31518139 100644 --- a/shared/adb-speaks-human/notebook/adb-speaks-human-notebook.dsnb +++ b/shared/adb-speaks-human/notebook/adb-speaks-human-notebook.dsnb @@ -50,8 +50,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1721687755875, - "endTime" : 1721687755961, + "startTime" : 1730132675976, + "endTime" : 1730132676037, "interpreter" : "md.low", "taskStatus" : "SUCCESS", "status" : "SUCCESS", @@ -64,7 +64,7 @@ "forms" : "[]" }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -87,13 +87,13 @@ "hideCode" : true, "hideResult" : false, "hideGutter" : true, - "hideVizConfig" : false, + "hideVizConfig" : true, "hideInIFrame" : false, "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719332899047, - "endTime" : 1719332899239, + "startTime" : 1730132687461, + "endTime" : 1730132687795, "interpreter" : "md.low", "taskStatus" : "SUCCESS", "status" : "SUCCESS", @@ -106,7 +106,7 @@ "forms" : "[]" }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -145,7 +145,8 @@ " {\"owner\": \"MOVIESTREAM\", \"name\": \"genre\"},", " {\"owner\": \"MOVIESTREAM\", \"name\": \"customer_segment\"},", " {\"owner\": \"MOVIESTREAM\", \"name\": \"customer_contact\"}", - " ]", + " ],", + " \"region\": \"us-chicago-1\"", " }'", " );", " -- ~~~~~~~~~~~~~~", @@ -158,7 +159,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -166,8 +167,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331865111, - "endTime" : 1719331869205, + "startTime" : 1730132656159, + "endTime" : 1730132658355, "interpreter" : "script.low", "taskStatus" : null, "status" : null, @@ -175,7 +176,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -210,8 +211,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719332910363, - "endTime" : 1719332910467, + "startTime" : 1730133536764, + "endTime" : 1730133536839, "interpreter" : "md.low", "taskStatus" : "SUCCESS", "status" : "SUCCESS", @@ -224,7 +225,7 @@ "forms" : "[]" }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -239,7 +240,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : "[{\"raw\":{\"layout\":\"beautify\",\"lastColumns\":[],\"version\":1},\"table\":{\"version\":1}}]", - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -247,8 +248,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331869566, - "endTime" : 1719331873585, + "startTime" : 1730132431224, + "endTime" : 1730132457649, "interpreter" : "script.low", "taskStatus" : null, "status" : null, @@ -256,7 +257,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -291,8 +292,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719332917173, - "endTime" : 1719332917246, + "startTime" : 1730133559446, + "endTime" : 1730133559518, "interpreter" : "md.low", "taskStatus" : "SUCCESS", "status" : "SUCCESS", @@ -305,7 +306,7 @@ "forms" : "[]" }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -325,7 +326,7 @@ ], "selectedVisualization" : "table", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -333,8 +334,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331873955, - "endTime" : 1719331874177, + "startTime" : 1730132457887, + "endTime" : 1730132457964, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -342,7 +343,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -362,7 +363,7 @@ ], "selectedVisualization" : "table", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -370,8 +371,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331874307, - "endTime" : 1719331874431, + "startTime" : 1730132458038, + "endTime" : 1730132458184, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -379,7 +380,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -398,7 +399,7 @@ ], "selectedVisualization" : "table", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -406,8 +407,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331874728, - "endTime" : 1719331874957, + "startTime" : 1730132458264, + "endTime" : 1730132458333, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -415,7 +416,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -439,8 +440,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719332943860, - "endTime" : 1719332943934, + "startTime" : 1730133575627, + "endTime" : 1730133575699, "interpreter" : "md.low", "taskStatus" : "SUCCESS", "status" : "SUCCESS", @@ -453,7 +454,7 @@ "forms" : "[]" }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -470,7 +471,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : true, @@ -478,8 +479,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331875278, - "endTime" : 1719331877418, + "startTime" : 1730132458547, + "endTime" : 1730132460944, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -487,7 +488,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -504,7 +505,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : true, @@ -512,8 +513,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331877547, - "endTime" : 1719331880521, + "startTime" : 1730132461019, + "endTime" : 1730132463615, "interpreter" : "script.low", "taskStatus" : null, "status" : null, @@ -521,7 +522,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -538,7 +539,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -546,8 +547,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331880670, - "endTime" : 1719331882093, + "startTime" : 1730132463686, + "endTime" : 1730132465178, "interpreter" : "script.low", "taskStatus" : null, "status" : null, @@ -555,7 +556,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -572,7 +573,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : "[{\"raw\":{\"layout\":\"beautify\",\"lastColumns\":[],\"version\":1}}]", - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -580,8 +581,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331882214, - "endTime" : 1719331886814, + "startTime" : 1730132465250, + "endTime" : 1730132473847, "interpreter" : "script.low", "taskStatus" : null, "status" : null, @@ -589,7 +590,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -615,8 +616,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719332949674, - "endTime" : 1719332949754, + "startTime" : 1730133472238, + "endTime" : 1730133472385, "interpreter" : "md.low", "taskStatus" : "SUCCESS", "status" : "SUCCESS", @@ -629,7 +630,7 @@ "forms" : "[]" }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -642,11 +643,11 @@ "%sql", "", "", - "select ai what are our total sales by movie with best movies first;" + "select ai what are our total sales by movie with best movies first" ], "selectedVisualization" : "table", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -654,8 +655,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331887130, - "endTime" : 1719331889433, + "startTime" : 1730132474047, + "endTime" : 1730132478057, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -663,7 +664,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -680,7 +681,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -688,8 +689,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331889579, - "endTime" : 1719331891693, + "startTime" : 1730132478349, + "endTime" : 1730132481347, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -697,7 +698,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -714,7 +715,7 @@ ], "selectedVisualization" : "table", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -722,8 +723,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331891834, - "endTime" : 1719331895244, + "startTime" : 1730132481418, + "endTime" : 1730132486615, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -731,7 +732,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -748,7 +749,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -756,8 +757,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331895372, - "endTime" : 1719331897989, + "startTime" : 1730132486689, + "endTime" : 1730132490888, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -765,7 +766,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -782,7 +783,7 @@ ], "selectedVisualization" : "table", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -790,8 +791,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331898126, - "endTime" : 1719331900841, + "startTime" : 1730132490958, + "endTime" : 1730132495856, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -799,7 +800,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -816,75 +817,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, - "hideResult" : false, - "hideGutter" : true, - "hideVizConfig" : false, - "hideInIFrame" : false, - "enabled" : true, - "forms" : "[]", - "result" : { - "startTime" : 1719331901011, - "endTime" : 1719331903336, - "interpreter" : "script.low", - "taskStatus" : null, - "status" : null, - "results" : null, - "forms" : null - }, - "relations" : [ ], - "dynamicFormParams" : null - }, - { - "row" : 0, - "col" : 0, - "sizeX" : 0, - "width" : 6, - "title" : "How people watch Action/Adventure movies", - "hasTitle" : true, - "message" : [ - "%sql", - "", - "", - "select ai runsql what are the most popular devices when watching Action and Adventure movies;" - ], - "selectedVisualization" : "table", - "visualizationConfig" : null, - "hideCode" : false, - "hideResult" : false, - "hideGutter" : true, - "hideVizConfig" : false, - "hideInIFrame" : false, - "enabled" : true, - "forms" : "[]", - "result" : { - "startTime" : 1719331903491, - "endTime" : 1719331906506, - "interpreter" : "sql.low", - "taskStatus" : null, - "status" : null, - "results" : null, - "forms" : null - }, - "relations" : [ ], - "dynamicFormParams" : null - }, - { - "row" : 0, - "col" : 0, - "sizeX" : 0, - "width" : 6, - "title" : "Model knows A&A are genres", - "hasTitle" : true, - "message" : [ - "%script", - " ", - "", - "select ai showsql what are the most popular devices when watching Action and Adventure movies;" - ], - "selectedVisualization" : "raw", - "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -892,8 +825,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331906663, - "endTime" : 1719331909069, + "startTime" : 1730132495924, + "endTime" : 1730132500920, "interpreter" : "script.low", "taskStatus" : null, "status" : null, @@ -901,7 +834,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -912,16 +845,13 @@ "hasTitle" : false, "message" : [ "%md", - "#### Challenge with tables and similar content. Need to create a view.", - "", + "#### Simplify sources for the model using a view.", "", - "The next question fails. The challenge is when you have multiple tables with similar content - like `CUSTOMER_CONTACT` and `CUSTOMER_EXTENSION`. The model fails to find the right tables.", + "It's good to simplify your sources to make the model more effective. For example, you may have tables with overlapping content - creating a view that includes the correct columns will make SQL generation more reliable. Let's create a view to disambiguate customer information.", "", - "After the failed query, you will solve the problem by: ", - "* creating a view to join `CUSTOMER_CONTACT`, `CUSTOMER_SEGMENT` and `CUSTOMER_SEGMENT`", - "* updating the AI profile to include this new view", "", - "Then, ask the question again" + "* Create a view to join `CUSTOMER_CONTACT`, `CUSTOMER_SEGMENT` and `CUSTOMER_SEGMENT`", + "* Update the AI profile to include this new view" ], "selectedVisualization" : "html", "visualizationConfig" : null, @@ -933,55 +863,21 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1721927831011, - "endTime" : 1721927831120, + "startTime" : 1730133632678, + "endTime" : 1730133632751, "interpreter" : "md.low", "taskStatus" : "SUCCESS", "status" : "SUCCESS", "results" : [ { - "message" : "

Challenge with tables and similar content. Need to create a view.

\n

The next question fails. The challenge is when you have multiple tables with similar content - like CUSTOMER_CONTACT and CUSTOMER_EXTENSION. The model fails to find the right tables.

\n

After the failed query, you will solve the problem by:

\n\n

Then, ask the question again

\n", + "message" : "

Simplify sources for the model using a view.

\n

It's good to simplify your sources to make the model more effective. For example, you may have tables with overlapping content - creating a view that includes the correct columns will make SQL generation more reliable. Let's create a view to disambiguate customer information.

\n\n", "type" : "HTML" } ], "forms" : "[]" }, "relations" : [ ], - "dynamicFormParams" : null - }, - { - "row" : 0, - "col" : 0, - "sizeX" : 0, - "width" : 12, - "title" : "This question fails", - "hasTitle" : true, - "message" : [ - "%sql", - "", - "", - "select ai What are sales by customer segment" - ], - "selectedVisualization" : "raw", - "visualizationConfig" : "[{\"raw\":{\"layout\":\"beautify\",\"lastColumns\":[],\"version\":1}}]", - "hideCode" : false, - "hideResult" : false, - "hideGutter" : true, - "hideVizConfig" : false, - "hideInIFrame" : false, - "enabled" : true, - "forms" : "[]", - "result" : { - "startTime" : 1719331909413, - "endTime" : 1719331911827, - "interpreter" : "sql.low", - "taskStatus" : null, - "status" : null, - "results" : null, - "forms" : null - }, - "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1033,7 +929,7 @@ ], "selectedVisualization" : "html", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -1041,8 +937,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331911953, - "endTime" : 1719331912057, + "startTime" : 1730132501118, + "endTime" : 1730132501186, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -1050,7 +946,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1068,7 +964,7 @@ ], "selectedVisualization" : "table", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -1076,8 +972,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331912229, - "endTime" : 1719331912359, + "startTime" : 1730132501254, + "endTime" : 1730132501325, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -1085,7 +981,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1122,7 +1018,8 @@ " {\"owner\": \"MOVIESTREAM\", \"name\": \"pizza_shop\"},", " {\"owner\": \"MOVIESTREAM\", \"name\": \"genre\"},", " {\"owner\": \"MOVIESTREAM\", \"name\": \"actors\"}", - " ]", + " ],", + " \"region\": \"us-chicago-1\"", " }'", " );", "", @@ -1138,7 +1035,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -1146,8 +1043,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331912481, - "endTime" : 1719331913987, + "startTime" : 1730132501396, + "endTime" : 1730132503691, "interpreter" : "script.low", "taskStatus" : null, "status" : null, @@ -1155,7 +1052,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1172,7 +1069,7 @@ ], "selectedVisualization" : "bar", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -1180,8 +1077,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331914120, - "endTime" : 1719331916366, + "startTime" : 1730132503765, + "endTime" : 1730132507060, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -1189,7 +1086,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1215,21 +1112,21 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719332969164, - "endTime" : 1719332969232, + "startTime" : 1730133659853, + "endTime" : 1730133659928, "interpreter" : "md.low", "taskStatus" : "SUCCESS", "status" : "SUCCESS", "results" : [ { - "message" : "

Use a PLSQL API to access the LLM

\n

You can use a PLSQL API to access the LLM. This is useful for tools that are unable to use the SQL interface. Here's a couple examples that use DBMS_CLOUD_AI.GENERATE that to translate natural lange to SQL.

\n

This approach is used by the Ask Autonomous APEX app.

\n", + "message" : "

Use a PLSQL API to access the LLM

\n

You can use a PLSQL API to access the LLM. This is useful for tools that are unable to use the SQL interface. Here's a couple examples that use DBMS_CLOUD_AI.GENERATE that to translate natural lange to SQL.

\n

This approach is used by the Ask Autonomous APEX app.

\n", "type" : "HTML" } ], "forms" : "[]" }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1256,7 +1153,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -1264,8 +1161,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331916938, - "endTime" : 1719331919244, + "startTime" : 1730132507269, + "endTime" : 1730132521074, "interpreter" : "script.low", "taskStatus" : null, "status" : null, @@ -1273,7 +1170,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1287,7 +1184,7 @@ "", "", "declare", - " l_prompt varchar2(4000) := 'What are our total views by genre?';", + " l_prompt varchar2(4000) := 'What are our total streams by customer segment';", " l_response clob;", " l_profile_name varchar2(100) := 'genai';", "begin", @@ -1301,7 +1198,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -1309,8 +1206,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331919377, - "endTime" : 1719331921250, + "startTime" : 1730132521145, + "endTime" : 1730132524340, "interpreter" : "script.low", "taskStatus" : null, "status" : null, @@ -1318,7 +1215,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1346,8 +1243,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1721927728815, - "endTime" : 1721927728972, + "startTime" : 1730133678742, + "endTime" : 1730133678821, "interpreter" : "md.low", "taskStatus" : "SUCCESS", "status" : "SUCCESS", @@ -1360,7 +1257,7 @@ "forms" : "[]" }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1400,7 +1297,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -1408,8 +1305,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331921603, - "endTime" : 1719331921731, + "startTime" : 1730132524540, + "endTime" : 1730132524633, "interpreter" : "script.low", "taskStatus" : null, "status" : null, @@ -1417,7 +1314,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1432,7 +1329,7 @@ ], "selectedVisualization" : "table", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -1440,8 +1337,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331921874, - "endTime" : 1719331921956, + "startTime" : 1730132524702, + "endTime" : 1730132524774, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -1449,7 +1346,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1476,8 +1373,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1721927753546, - "endTime" : 1721927753724, + "startTime" : 1730133703712, + "endTime" : 1730133703805, "interpreter" : "md.low", "taskStatus" : "SUCCESS", "status" : "SUCCESS", @@ -1490,7 +1387,7 @@ "forms" : "[]" }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1529,7 +1426,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -1537,8 +1434,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331922279, - "endTime" : 1719331923886, + "startTime" : 1730132524978, + "endTime" : 1730132527172, "interpreter" : "script.low", "taskStatus" : null, "status" : null, @@ -1546,7 +1443,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1562,7 +1459,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -1570,8 +1467,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331924019, - "endTime" : 1719331928132, + "startTime" : 1730132527250, + "endTime" : 1730132531148, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -1579,7 +1476,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1603,8 +1500,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719332983742, - "endTime" : 1719332983905, + "startTime" : 1730133732741, + "endTime" : 1730133732800, "interpreter" : "md.low", "taskStatus" : "SUCCESS", "status" : "SUCCESS", @@ -1617,7 +1514,7 @@ "forms" : "[]" }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1652,7 +1549,7 @@ ], "selectedVisualization" : "raw", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -1660,8 +1557,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331928462, - "endTime" : 1719331928618, + "startTime" : 1730132531356, + "endTime" : 1730132531505, "interpreter" : "script.low", "taskStatus" : null, "status" : null, @@ -1669,7 +1566,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" }, { "row" : 0, @@ -1681,11 +1578,11 @@ "message" : [ "%sql", "", - "select ai runsql what are our top 10 most viewed movies" + "select ai runsql what are our top 10 most viewed moviesx" ], "selectedVisualization" : "table", "visualizationConfig" : null, - "hideCode" : false, + "hideCode" : true, "hideResult" : false, "hideGutter" : true, "hideVizConfig" : false, @@ -1693,8 +1590,8 @@ "enabled" : true, "forms" : "[]", "result" : { - "startTime" : 1719331928756, - "endTime" : 1719331931858, + "startTime" : 1730132531574, + "endTime" : 1730132534466, "interpreter" : "sql.low", "taskStatus" : null, "status" : null, @@ -1702,7 +1599,7 @@ "forms" : null }, "relations" : [ ], - "dynamicFormParams" : null + "dynamicFormParams" : "{}" } ] } diff --git a/shared/adb-speaks-human/query-using-select-ai/images/import-successful.png b/shared/adb-speaks-human/query-using-select-ai/images/import-successful.png index 64610452..67119c8b 100644 Binary files a/shared/adb-speaks-human/query-using-select-ai/images/import-successful.png and b/shared/adb-speaks-human/query-using-select-ai/images/import-successful.png differ diff --git a/shared/adb-speaks-human/query-using-select-ai/images/oml-home-page-new.png b/shared/adb-speaks-human/query-using-select-ai/images/oml-home-page-new.png new file mode 100644 index 00000000..48f12d01 Binary files /dev/null and b/shared/adb-speaks-human/query-using-select-ai/images/oml-home-page-new.png differ diff --git a/shared/adb-speaks-human/query-using-select-ai/images/run-all-paragraph.png b/shared/adb-speaks-human/query-using-select-ai/images/run-all-paragraph.png index ab2fd2e5..b4a72ba5 100644 Binary files a/shared/adb-speaks-human/query-using-select-ai/images/run-all-paragraph.png and b/shared/adb-speaks-human/query-using-select-ai/images/run-all-paragraph.png differ diff --git a/shared/adb-speaks-human/query-using-select-ai/query-using-select-ai.md b/shared/adb-speaks-human/query-using-select-ai/query-using-select-ai.md index 63f4220b..cf602e84 100644 --- a/shared/adb-speaks-human/query-using-select-ai/query-using-select-ai.md +++ b/shared/adb-speaks-human/query-using-select-ai/query-using-select-ai.md @@ -187,15 +187,15 @@ If you are no longer logged in to your Cloud account, start with **step 1** belo ![Click the Oracle Machine Learning card](./images/oml-tab.png " ") -7. On the **SIGN IN** page, enter **`moviestream`** in the **Username** field, the **`adb_user_password`** that you saved in **Lab 1 > Task 2 Step 6** in the **Password** field, and then click **Sign In**. +7. On the **SIGN IN** page, enter **`moviestream`** in the **Username** field, the **`adb_user_password`** that you saved in **Lab 1 > Task 2 > Step 6** in the **Password** field, and then click **Sign In**. ![Enter credentials on the Sign In page](./images/oml-sign-in.png " ") The **Oracle Machine Learning** Home page is displayed. You can use this landing page to access tutorials, model creation, notebooks, and much more. - ![Oracle Machine Learning Home page is displayed.](./images/oml-home-page.png " ") + ![Oracle Machine Learning Home page is displayed.](./images/oml-home-page-new.png " ") -8. In the **Quick Actions** section, click the **Notebooks** button. The **Notebooks** page is displayed. +8. In the **Quick Actions** section, click the **Notebooks** icon. The **Notebooks** page is displayed. ![The Notebooks page is displayed](./images/notebooks-page-displayed.png " ") @@ -211,7 +211,7 @@ You can import a notebook from a local disk or from a remote location if you pro ![The Open dialog box is displayed](./images/open-imported-notebook.png " ") - If the import is successful, a notification is displayed and the **`ADB Speaks Human`** notebook is displayed in the list of available notebooks. + If the import is successful, a notification is displayed and the **`adb-speaks-human-notebook`** notebook is displayed in the list of available notebooks. ![The newly imported notebook is displayed.](./images/import-successful.png " ") @@ -219,15 +219,11 @@ You can import a notebook from a local disk or from a remote location if you pro >**Note:** If a **User Action Required** message is displayed when you open the notebook, click **Allow Run**. - ![The notebook and the paragraphs it contains is displayed in the Notebook Editor.](./images/notebook-displayed.png " ") - ## Task 4: Review and Run the Imported Notebook A notebook is comprised of paragraphs that use different languages: SQL, PL/SQL, Python, R, markdown and more. The **ADB Speaks Human** notebook is well-documented using markdown code. Examine the paragraphs in the notebook and then execute the code. Feel free to run different types of queries! -1. Display the code sections of all paragraphs in the notebook. On the notebook banner, the **Show Code** icon. This is a toggle icon that you can use to show or hide the code in all paragraphs. - - >**Note:** By default, the code sections of all markdown paragraphs in this notebook are hidden. +1. In this notebook, the code sections of all paragraphs in the notebook are hidden. Only the results (outputs) of all markdown paragraphs are displayed. To show or hide the code sections in all the paragraphs, on the notebook's banner, click the **Show Code** icon. This is a toggle icon that you can use to show or hide the code in all paragraphs. Click the **Show Code** icon. ![Select Show Code from the Actions drop-down menu](./images/show-code.png =75%x*) @@ -237,7 +233,7 @@ A notebook is comprised of paragraphs that use different languages: SQL, PL/SQL, In this notebook, the **`%md`** (Markdown) paragraphs provide useful information about the paragraphs. The **`%md`** Markdown interpreter generates static html from plain Markdown text. In this lab, you will review the code in each paragraph one at a time, run that paragraph, and review the results as desired. It is a good idea to hide the code of any .md paragraph. -2. Display the result (output) sections of all paragraphs in the notebook. On the notebook banner, click the **Show Result/Hide Result** icon to show the output sections of the paragraphs where the output section is not shown by default. +2. By default, when you imported the notebook, the results (output) sections of the .md paragraphs were displayed. On the notebook banner, click the **Show Result/Hide Result** icon to show the output sections of the paragraphs where the output section is not shown by default. ![The Show/hide the output icon on the notebook toolbar is shown as clicked.](./images/show-result.png " ") @@ -275,7 +271,7 @@ You may now proceed to the next lab. * **Author:** Lauran K. Serhal, Consulting User Assistance Developer * **Contributor:** Marty Gubar, Product Manager -* **Last Updated By/Date:** Lauran K. Serhal, July 2024 +* **Last Updated By/Date:** Lauran K. Serhal, October 2024 Data about movies in this workshop were sourced from **Wikipedia**.