From c76072b41d0cf319d077a8d9d656ed6231d4b46d Mon Sep 17 00:00:00 2001 From: Brianna Ambler <84342965+Brianna-Ambler@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:41:13 -0500 Subject: [PATCH 1/2] LL ID #3950: Reinstating the JSON Duality Views with REST section (#678) * Self-QA Updates Adding workshop changes to further align with the Self-QA checklist. * Update adb-free-container-setup.md * Post-Testing Edits V1 * Update adb-free-container-setup.md * Post-Testing Changes V2 * Updating Screenshots * WMSID# 11693: Adding the initial workshop structure. * Update adb-free-container-setup.md * Update adb-free-container-setup.md * [WMS ID #11029] DB Collective - JSON Duality Search * WMS ID #11029: Minor fix * Update manifest.json * LL ID #4004: Add JSON Duality Intro * LL ID# 4004: Minor Updates * LL ID #4004: Minor updates. * WMS ID #11693: Revising the workshop structure. * WMS ID# 11693 * HOL 46 * DB Collective - JSON Updates * LL ID #4004: DB Collective Changes * OCW & DB Collective Updates * Update new-duality-views-15.md * Update new-duality-views-15.md * Update new-duality-views-15.md * Update new-duality-views-15.md * Update new-duality-views-15.md * Update new-duality-views-15.md * LL ID #3984: Formatting Changes * HOL 46 Technical Fixes * Update inst-auth-container-setup.md * DB Collective + OCW 24 Updates * Update manifest.json * LL ID #3984: Screenshots & Minor Fixes * LL ID #3984 - Minor Updates & Fixes * Last updates. * Update similarity-search.md * Update intro-aivs-adb.md * Updates to All 23ai New Features Workshops * Reinstating the JSON Duality Views with REST section. --------- Co-authored-by: William Masdon Co-authored-by: Hope Fisher <127253314+hope-fisher@users.noreply.github.com> Co-authored-by: Dan Wiliams <127415766+dannymgithub@users.noreply.github.com> --- .../new-duality-views/new-duality-views-15.md | 2 +- .../new-duality-views-updated.md | 85 ++++++++++++++++++- 2 files changed, 83 insertions(+), 4 deletions(-) diff --git a/db-23ai-fundamentals/new-duality-views/new-duality-views-15.md b/db-23ai-fundamentals/new-duality-views/new-duality-views-15.md index 0699f9710..e8f295a64 100644 --- a/db-23ai-fundamentals/new-duality-views/new-duality-views-15.md +++ b/db-23ai-fundamentals/new-duality-views/new-duality-views-15.md @@ -272,4 +272,4 @@ If the eTags do not match, which can occur if another concurrent operation updat ## Acknowledgements * **Author** - Killian Lynch, Oracle Database Product Management, Product Manager * **Contributors** - Dominic Giles, Oracle Database Product Management, Distinguished Product Manager -* **Last Updated By/Date** - Briana Ambler, Oracle Database Product Management, Product Manager, August 2024 +* **Last Updated By/Date** - Brianna Ambler, Oracle Database Product Management, Product Manager, September 2024 diff --git a/db-23ai-fundamentals/new-duality-views/new-duality-views-updated.md b/db-23ai-fundamentals/new-duality-views/new-duality-views-updated.md index ffbcef126..6fe5725aa 100644 --- a/db-23ai-fundamentals/new-duality-views/new-duality-views-updated.md +++ b/db-23ai-fundamentals/new-duality-views/new-duality-views-updated.md @@ -273,12 +273,91 @@ This lab assumes you have: You can now see that the update made to the orders table has propogated to the customer orders duality view, and the same occurs for all other representations of the customers table! -**You've completed the workshop!** - Note that the "etag" value supplied in the content is used for "out-of-the-box" optimistic locking to prevent the well-known "lost update" problem that can occur with concurrent operations. During a replace operation, the database checks that the eTag provided in the replacement document matches the latest eTag of the target Duality View document. If the eTags do not match, which can occur if another concurrent operation updated the same document, an error is thrown. If you get the error, you can reread the updated value (including the updated eTag), and retry the replace operation again, adjusting it (if desired) based on the updated value. +## Task 3: (Optional) JSON Relational Duality Views with REST + +1. We can also use Oracle's SODA (Simple Object Data API) or even the Mongo API to work against the Duality View. + + For a small example, I will show this using a macOS native terminal and execute a basic GET request. + +2. Click on SQL under the Development section. The first thing we want to do is enable REST on our Duality Views. Use the Oracle Database Actions Navigator on the left side of the screen, click the drop-down arrow for the box showing the Table objects, and select Views. Refer to the picture below. + + ![load rest](images/rest1.png " ") + +3. Right-click on the CUSTOMERS_DV, hover the mouse over REST, and click Enable if it isn't already enabled. See the picture below. NOTE: If it is enabled already, it will say Disableā€¦ instead. If you see Disableā€¦ you don't have to do anything. Skip to number 5. + + ![locating rest](images/rest2.png =50%x*) + +4. The REST Enable Object side panel will appear. Select Enable to continue. + + ![pick the rest panel](images/rest3.png " ") + + Alternatively we could have done this in PL/SQL. + +5. Here we will use the SQL Developer Web URL to obtain your ADB instance base URL: + + ``` + ADB_LL_URL = https://xxxxxxxxxx.adb..oraclecloudapps.com + ``` + + ![find the URL](images/r2.png " ") + + For example, mine looks like this: + + ``` + ADB_LL_URL=https://ajs6esm7pafcr84-atp97134.adb.us-ashburn-1.oraclecloudapps.com + ``` + +6. Now, create a variable in your terminal (It shouldn't have / at the end.) + + ``` + + export ADB_LL_URL=https://ajs6esm7pafcr84-atp97134.adb.us-ashburn-1.oraclecloudapps.com + + ``` + +7. Check it was set. + + ``` + + echo $ADB_LL_URL + + ``` + > NOTE: This base url will be unique for each user, verify that you are using the correct URL. + +8. Make a GET request from your laptop terminal command line. + + ``` + + curl -X GET $ADB_LL_URL/ords/admin/customers_dv/ | json_pp + + + ``` + ![pull one doc](images/r1.png " ") + + +9. This lab is only intended to give you a small taste of what Duality Views have to offer. For full, in-depth free workshops, follow the link below: + + [23ai JSON Duality View Workshops](https://livelabs.oracle.com/pls/apex/f?p=133:100:110578183178299::::SEARCH:duality%20views) + + In summary, this lab checks out the power of JSON Relational Duality Views, allowing you to work with data in either JSON Document format or SQL Relational format. Changes made through views are reflected in the corresponding documents and tables. This flexibility enables convenient create, read, update, or delete operations across multiple documents and tables with ease. + +10. We can clean up from the lab by dropping our tables. Navigate back to the SQL editor or go back to task one - step one if you need a reminder where it is. + + ``` + + DROP TABLE orders CASCADE CONSTRAINTS; + DROP TABLE customers CASCADE CONSTRAINTS; + DROP VIEW customer_orders_dv; + DROP VIEW customers_dv; + + + ``` + +**You've completed the workshop!** ## Learn More @@ -288,4 +367,4 @@ If the eTags do not match, which can occur if another concurrent operation updat ## Acknowledgements * **Author** - Killian Lynch, Oracle Database Product Management, Product Manager * **Contributors** - Dominic Giles, Oracle Database Product Management, Distinguished Product Manager -* **Last Updated By/Date** - Briana Ambler, Oracle Database Product Management, Product Manager, August 2024 +* **Last Updated By/Date** - Brianna Ambler, Oracle Database Product Management, Product Manager, September 2024 From 421cd6a4b1097d1a05aae6ed52c72427496c28b5 Mon Sep 17 00:00:00 2001 From: Brianna Ambler <84342965+Brianna-Ambler@users.noreply.github.com> Date: Wed, 25 Sep 2024 11:57:59 -0500 Subject: [PATCH 2/2] LL ID 3950: Task Numbering Fix (#679) --- .../new-duality-views/new-duality-views-updated.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/db-23ai-fundamentals/new-duality-views/new-duality-views-updated.md b/db-23ai-fundamentals/new-duality-views/new-duality-views-updated.md index 6fe5725aa..64c7fd520 100644 --- a/db-23ai-fundamentals/new-duality-views/new-duality-views-updated.md +++ b/db-23ai-fundamentals/new-duality-views/new-duality-views-updated.md @@ -277,7 +277,8 @@ Note that the "etag" value supplied in the content is used for "out-of-the-box" If the eTags do not match, which can occur if another concurrent operation updated the same document, an error is thrown. If you get the error, you can reread the updated value (including the updated eTag), and retry the replace operation again, adjusting it (if desired) based on the updated value. -## Task 3: (Optional) JSON Relational Duality Views with REST + +## Task 5: (Optional) JSON Relational Duality Views with REST 1. We can also use Oracle's SODA (Simple Object Data API) or even the Mongo API to work against the Duality View. @@ -356,7 +357,7 @@ If the eTags do not match, which can occur if another concurrent operation updat ``` - + **You've completed the workshop!** ## Learn More