diff --git a/building-blocks/blocks/adb/cleanup/cleanup.md b/building-blocks/blocks/adb/cleanup/cleanup.md index 5472d37d..22ec57f5 100644 --- a/building-blocks/blocks/adb/cleanup/cleanup.md +++ b/building-blocks/blocks/adb/cleanup/cleanup.md @@ -1,7 +1,9 @@ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/access-control-result.png b/building-blocks/blocks/adb/load-analyze-rest/images/access-control-result.png new file mode 100644 index 00000000..82e3d353 Binary files /dev/null and b/building-blocks/blocks/adb/load-analyze-rest/images/access-control-result.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/adb-query-news-buzz.png b/building-blocks/blocks/adb/load-analyze-rest/images/adb-query-news-buzz.png index d2857f38..5ef0586c 100644 Binary files a/building-blocks/blocks/adb/load-analyze-rest/images/adb-query-news-buzz.png and b/building-blocks/blocks/adb/load-analyze-rest/images/adb-query-news-buzz.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/adb-query-news.png b/building-blocks/blocks/adb/load-analyze-rest/images/adb-query-news.png index 68cf8fe6..a1f2e5b2 100644 Binary files a/building-blocks/blocks/adb/load-analyze-rest/images/adb-query-news.png and b/building-blocks/blocks/adb/load-analyze-rest/images/adb-query-news.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/adb-ranking-by-buzz.png b/building-blocks/blocks/adb/load-analyze-rest/images/adb-ranking-by-buzz.png index 5be7a917..5a5e7725 100644 Binary files a/building-blocks/blocks/adb/load-analyze-rest/images/adb-ranking-by-buzz.png and b/building-blocks/blocks/adb/load-analyze-rest/images/adb-ranking-by-buzz.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/api-key-email.png b/building-blocks/blocks/adb/load-analyze-rest/images/api-key-email.png new file mode 100644 index 00000000..f3d46b56 Binary files /dev/null and b/building-blocks/blocks/adb/load-analyze-rest/images/api-key-email.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/api-registration-complete.png b/building-blocks/blocks/adb/load-analyze-rest/images/api-registration-complete.png new file mode 100644 index 00000000..867f7b9d Binary files /dev/null and b/building-blocks/blocks/adb/load-analyze-rest/images/api-registration-complete.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/create-index.png b/building-blocks/blocks/adb/load-analyze-rest/images/create-index.png new file mode 100644 index 00000000..67370385 Binary files /dev/null and b/building-blocks/blocks/adb/load-analyze-rest/images/create-index.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/function-created.png b/building-blocks/blocks/adb/load-analyze-rest/images/function-created.png new file mode 100644 index 00000000..3d90b05c Binary files /dev/null and b/building-blocks/blocks/adb/load-analyze-rest/images/function-created.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/provide-api-key.png b/building-blocks/blocks/adb/load-analyze-rest/images/provide-api-key.png new file mode 100644 index 00000000..d8588924 Binary files /dev/null and b/building-blocks/blocks/adb/load-analyze-rest/images/provide-api-key.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/query-sentiment.png b/building-blocks/blocks/adb/load-analyze-rest/images/query-sentiment.png new file mode 100644 index 00000000..90f38396 Binary files /dev/null and b/building-blocks/blocks/adb/load-analyze-rest/images/query-sentiment.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/register-api-key.png b/building-blocks/blocks/adb/load-analyze-rest/images/register-api-key.png new file mode 100644 index 00000000..18fbbe3e Binary files /dev/null and b/building-blocks/blocks/adb/load-analyze-rest/images/register-api-key.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/set-lexer.png b/building-blocks/blocks/adb/load-analyze-rest/images/set-lexer.png new file mode 100644 index 00000000..b0947d63 Binary files /dev/null and b/building-blocks/blocks/adb/load-analyze-rest/images/set-lexer.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/sql-worksheet-displayed.png b/building-blocks/blocks/adb/load-analyze-rest/images/sql-worksheet-displayed.png new file mode 100644 index 00000000..e1b6c55d Binary files /dev/null and b/building-blocks/blocks/adb/load-analyze-rest/images/sql-worksheet-displayed.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/table-created.png b/building-blocks/blocks/adb/load-analyze-rest/images/table-created.png new file mode 100644 index 00000000..55afadde Binary files /dev/null and b/building-blocks/blocks/adb/load-analyze-rest/images/table-created.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/images/table-news-buzz-created.png b/building-blocks/blocks/adb/load-analyze-rest/images/table-news-buzz-created.png new file mode 100644 index 00000000..b757a78a Binary files /dev/null and b/building-blocks/blocks/adb/load-analyze-rest/images/table-news-buzz-created.png differ diff --git a/building-blocks/blocks/adb/load-analyze-rest/load-analyze-rest.md b/building-blocks/blocks/adb/load-analyze-rest/load-analyze-rest.md index dcfc7ed3..625d8f1d 100644 --- a/building-blocks/blocks/adb/load-analyze-rest/load-analyze-rest.md +++ b/building-blocks/blocks/adb/load-analyze-rest/load-analyze-rest.md @@ -1,14 +1,32 @@ # Load and Analyze the News from REST Endpoints ## Introduction -There are so many interesting and potentially useful data sets available today via REST: social, financial, science, health, weather - the list goes on and on. Autonomous Database makes it really easy to integrate these sources using SQL queries – eliminating the need for intermediate processing and storage and making that data available to any SQL client. +There are so many interesting and potentially useful data sets available today via REST: social, financial, science, health, weather and so on. Autonomous Database makes it really easy to integrate these sources using SQL queries. This eliminates the need for intermediate processing and storage and making that data available to any SQL client. + +**News API** is a simple HTTP REST API for searching and retrieving live articles from all over the web. It can help you answer questions such as: + +* What top stories is TechCrunch running right now? +* What new articles were published about the next iPhone today? +* Has my company or product been mentioned or reviewed by any blogs recently? + +You can search for articles with any combination of the following criteria: + +* **Keyword or phrase:** For example, find all articles containing the word `Microsoft`. +* **Date published:**. For example, find all articles published yesterday. +* **Source domain name:** For example, find all articles published on https://thenextweb.com. +* **Language:** For example, find all articles written in English. + +You can sort the results in the following order: +* **Date published** +* **Relevancy to search keyword** +* **Popularity of source** In this lab, you will find the latest news about actors and then perform a sentiment analysis of that news. This information can help decide which movies to promote on the MovieStream site - allowing MovieStream to take advantage of "buzz" to drive revenue. @@ -20,44 +38,65 @@ Watch the video below for a quick walk-through of the lab. ### Objectives In this lab, you will: -* Create an account on News API (https://newsapi.org/) and retrieve an API key -* Create a PLSQL function that retrieves the latest news for actors -* Perform a sentiment analysis on the article descriptions -* Identify which actors are generating buzz - both good and bad - +* Create an account on News API (https://newsapi.org/) and retrieve an API key. +* Create a PL/SQL function that retrieves the latest news for actors. +* Perform a sentiment analysis on the article descriptions. +* Identify which actors are generating buzz - both good and bad. ### Prerequisites -- This lab requires: - * a provisioned ADB instance - * movies loaded from object storage +* An ADB instance. +* movies loaded from Oracle object storage. + +## Task 1: Create a News API Account and Key + +You need an API key to use the **News API**. This is a unique key that identifies your requests. They're free while you're in development. -## Task 1: Create an account on News API and retrieve an API key -The News API provides a simple REST API to retrive news from various sources. Get started by creating a News API account: +Create a **News API** account as follows: 1. Register for an API key from the [News API](https://newsapi.org/register). -2. Complete the fields on the registration page, including your name, email and password. Agree to the terms and click **Submit**. -3. You will receive an email from News API that includes your API key. You will need the API key to make REST calls against the service. -4. We will use the [`Everything` News API endpoint (`https://newsapi.org/v2/everything`) ](https://newsapi.org/docs/endpoints/everything) The key parameters for the REST endpoint are: + +2. Complete the fields on the registration page, including your first name, email, and password. Agree to the terms, and then click **Submit**. + + ![Register for an API key.](./images/register-api-key.png " ") + + A **Registration Complete** dialog box is displayed that shows your API key. Save your API key for later use. + + ![API key registration complete.](./images/api-registration-complete.png =50%x*) + +3. You will receive an email from News API that includes your API key. You will need this API key to make REST calls against the service. + + ![Registration complete email.](./images/api-key-email.png " ") + +4. You will use the [`Everything` News API endpoint (`https://newsapi.org/v2/everything`)](https://newsapi.org/docs/endpoints/everything). The key parameters for the REST endpoint are: | Parameter | Description | | --------- | ----------- | - | q | The search term. This will be an actor | - | searchin | We will search news items' titles and descriptions (the full article requires more work) | - | from | The oldest article. We will default to one week ago | - | to | The newest article. We will default to today | - | sortby | We will sort by the published date | + | **`q`** | The search term. This will be an actor in our example| + | **`searchin`** | You will search news items' titles and descriptions (the full article requires more work) | + | **`from`** | The oldest article. You will default to one week ago | + | **`to`** | The newest article. You will default to today | + | **`sortby`** | You will sort by the published date | {: title="News API parameters"} -## Task 2: Create a PLSQL function that retrieves news for an actor -Now that you have the API key, create a PLSQL function that queries the REST endpoint using the parameters above. +## Task 2: Create a PL/SQL Function to Retrieve News for an Actor + +Now that you have the API key, create a PL/SQL function that queries the REST endpoint using the parameters above. + +1. Log in to the **Oracle Cloud Console**, if you are not already logged as the Cloud Administrator. + +2. Open the **Navigation** menu and click **Oracle Database**. Under **Oracle Database**, click **Autonomous Database**. + +3. On the **Autonomous Databases** page, click your ADB instance. -1. Navigate to the Database Actions' SQL Worksheet +4. On the **Autonomous Database details** page, click the **Database actions** drop-down list, and then click **SQL**. + +5. The SQL Worksheet is displayed. + + ![The SQL worksheet is displayed.](./images/sql-worksheet-displayed.png " ") - Go to **Database Actions -> SQL** from the Autonomous Database OCI console: - ![Go to DB Actions](/common/building-blocks/tasks/adb/images/adb-dbactions-goto-sql.png "Go to DB Actions") +6. Ensure that the public REST endpoint is accessible by our PL/SQL function. Copy and paste the following API call code into your SQL Worksheet to update the access control list, and then click the **Run Script (F5)** icon in the Worksheet toolbar. This will allow the **ADMIN** user to call out to any public host. -2. Ensure that the public REST endpoint is accessible by our PL/SQL function. Copy and paste the following API call into SQL Worksheet to update the access control list. Click **Run Script**. This will allow the ADMIN user to call out to any public host. ``` begin @@ -72,73 +111,85 @@ Now that you have the API key, create a PLSQL function that queries the REST end / ``` -3. Create the function that queries the News API REST endpoint. Copy and paste the function below into the SQL worksheet. Replace **``** with the API key that the News API sent to you. After replacing the API key, click **Run Script**. - ``` - - -- turn off prompting for parameter values - set define off; + The output is displayed in the **Script Output** tab. - create or replace function get_news ( - news_search in varchar2 default '+"Tom Hanks"', - from_date in varchar2 default to_char(sysdate-7, 'YYYY-MM-DD'), - end_date in varchar2 default to_char(sysdate, 'YYYY-MM-DD') - ) - return clob is + ![The result of running the script is displayed.](./images/access-control-result.png " ") - result_row clob; +7. Create the function that queries the **News API REST endpoint**. Copy and paste the code in the next step into your SQL Worksheet. _Replace the **`enter-your-api-key`** place holder in the variables declaration section (labeled -- REST management) with your own **API key** that you received from News API when you created your account_. - -- REST management - req varchar2(1000); - resp dbms_cloud_types.resp; - params varchar2(1000); - apikey varchar2(100) := ''; - endpoint varchar2(100) := 'https://newsapi.org/v2/everything'; + ![Provide your api key.](./images/provide-api-key.png " ") +8. Click the **Run Script (F5)** icon in the Worksheet toolbar. - begin - -- Create the URL based on the parameters, API Key and rest endpoint - params := '?q=' || news_search - || '&apikey=' ||apikey - || '&from=' || from_date - || '&to=' || end_date - || '&sortBy=publishedAt&language=en&searchIn=title,description'; + ``` + + -- turn off prompting for parameter values - req := utl_url.escape(endpoint || params); + set define off; - -- send the request and process the result - resp := dbms_cloud.send_request( - credential_name => null, - -- headers => reqheader, - uri => req, - method => DBMS_CLOUD.METHOD_GET, - cache => true - ); + create or replace function get_news ( + news_search in varchar2 default '+"Tom Hanks"', + from_date in varchar2 default to_char(sysdate-7, 'YYYY-MM-DD'), + end_date in varchar2 default to_char(sysdate, 'YYYY-MM-DD') + ) + return clob is - -- Get the response. This is in JSON format - result_row := dbms_cloud.get_response_text(resp); + result_row clob; - -- Return the result - return result_row; + -- REST management + req varchar2(1000); + resp dbms_cloud_types.resp; + params varchar2(1000); + apikey varchar2(100) := 'enter-your-api-key'; + endpoint varchar2(100) := 'https://newsapi.org/v2/everything'; - end; + begin + -- Create the URL based on the parameters, API Key and rest endpoint + params := '?q=' || news_search + || '&apikey=' ||apikey + || '&from=' || from_date + || '&to=' || end_date + || '&sortBy=publishedAt&language=en&searchIn=title,description'; + + + req := utl_url.escape(endpoint || params); + + -- send the request and process the result + resp := dbms_cloud.send_request( + credential_name => null, + -- headers => reqheader, + uri => req, + method => DBMS_CLOUD.METHOD_GET, + cache => true + ); + + -- Get the response. This is in JSON format + result_row := dbms_cloud.get_response_text(resp); + + -- Return the result + return result_row; + end; / ``` - **`DBMS_CLOUD.SEND_REQUEST`** is the key function; it queries the endpoint and returns a response object. This response object is then passed to **`DBMS_CLOUD.GET_RESPONSE_TEXT`** to retrieve the news articles in JSON format. -4. Query the News API for the top 20 actors. The result of the query is saved into a table. + The **`DBMS_CLOUD.SEND_REQUEST`** is the key function; it queries the endpoint and returns a response object. This response object is then passed to **`BMS_CLOUD.GET_RESPONSE_TEXT`** to retrieve the news articles in JSON format. + + ![The function is created.](./images/function-created.png " ") + +9. Query the News API for the top 20 actors. The result of the query is saved into a table. Copy and paste the following code into your SQL Worksheet, and then click the **Run Script (F5)** icon in the Worksheet toolbar. ``` create table news as with top_actors as ( - select + select jt.actor, sum(gross) from movie m, - json_table(m.cast,'$[*]' columns (actor path '$')) jt + json_table(m.cast,'$[*]' columns (actor path '$')) jt where actor != 'novalue' group by jt.actor order by 2 desc nulls last @@ -156,61 +207,70 @@ Now that you have the API key, create a PLSQL function that queries the REST end - A subquery - select the top 20 actors based on box office revenue. - For each of those top actors, get the latest news by calling the `get_news` function. - 5. Let's see the news for Johnny Depp. Note, because this is querying a live news feed, your results will definitely be different!! - ``` - - select - actor, - json_query(json_document, '$' returning clob pretty) as news_articles - from news - where actor = 'Johnny Depp'; - - ``` - Lots of news - 251 articles across publications. Unfortunately, the news is not all good. + ![The table is created.](./images/table-created.png " ") - ![News results](images/adb-query-news.png) +10. Let's see the news for **Johnny Depp**. Copy and paste the following code into your SQL Worksheet, and then click the **Run Script (F5)** icon in the Worksheet toolbar. - 6. Finally, let's clean up the JSON and make it more structured and easier to analyze. Use the **`JSON_TABLE`** function to turn the nested arrays into rows. Again, we'll create a table with a row for each article: + >**Note:** Since you are querying a live news feed, your results will definitely be different our results. - ``` - - create table news_buzz as - select - actor, - json_value(json_document, '$.totalResults' returning number) as buzz, - author, - source, - title, - description - from news n, - json_table(n.json_document, '$.articles[*]' - columns ( - source varchar2(100) path '$.source.name', - author varchar2(100) path '$.author', - title varchar2(200) path '$.title', - description varchar2(1000) path '$.description' - - ) - ) jt; - - ``` - - 7. Let's review the results: - ``` - - select * - from news_buzz; - - ``` - - It's now easy to see each article that refers to an actor, including its title and description. - - ![Query news buzz](images/adb-query-news-buzz.png) - -## Task 3: Analyze the sentiment of each article description -Now that we have the latest news for each actor, let's derive the sentiment of those articles. Oracle Database has powerful text functions for tokenizing the text and then analyzing it. In our case, we'll use the defaults; however, you can perform much more sophisticated models using training methods. - -1. Specify the type of lexer to use. We will use the "automatic" version, which will be fine for our use case. Copy and paste the following into the SQL Worksheet and click **Run Statement**: + ``` + + select + actor, + json_query(json_document, '$' returning clob pretty) as news_articles + from news + where actor = 'Johnny Depp'; + + ``` + + There are **14** articles across publications about Johnny Depp. Unfortunately, not all the news is good. + + ![News results](images/adb-query-news.png) + +11. Finally, let's clean up the JSON and make it more structured and easier to analyze. Use the **`JSON_TABLE`** function to turn the nested arrays into rows. Again, we'll create a table with a row for each article. Copy and paste the following code into your SQL Worksheet, and then click the **Run Script (F5)** icon in the Worksheet toolbar. + + ``` + + create table news_buzz as + select + actor, + json_value(json_document, '$.totalResults' returning number) as buzz, + author, + source, + title, + description + from news n, + json_table(n.json_document, '$.articles[*]' + columns ( + source varchar2(100) path '$.source.name', + author varchar2(100) path '$.author', + title varchar2(200) path '$.title', + description varchar2(1000) path '$.description' + ) + ) jt; + + ``` + + ![Table news_buzz is created.](./images/table-news-buzz-created.png " ") + +12. Let's review the results. Copy and paste the following code into your SQL Worksheet, and then click the **Run Statement** icon in the Worksheet toolbar. + + ``` + + select * + from news_buzz; + + ``` + + It's now easy to see each article that refers to an actor, including its title and description. + + ![Query news buzz](images/adb-query-news-buzz.png) + +## Task 3: Analyze the Sentiment of Each Article's Description + +Now that you have the latest news for each actor, you will derive the sentiment of those articles. Oracle Database has powerful text functions for tokenizing the text and then analyzing it. In this example, you will use the defaults; however, you can perform much more sophisticated models using training methods. + +1. Specify the type of lexer to use. We will use the **`automatic`** version, which will be sufficient for this example. Copy and paste the following code into the SQL Worksheet, and then click **Run Script (F5)** in the Worksheet toolbar. ``` @@ -218,7 +278,10 @@ Now that we have the latest news for each actor, let's derive the sentiment of t ``` -2. Create the sentiment index: + ![Use automatic lexer](images/set-lexer.png) + +2. Create the sentiment index. The index creation analyzes each article, derives the sentiment, and stores it in the index. Copy and paste the following code into the SQL Worksheet, and then click **Run Script (F5)** in the Worksheet toolbar. + ``` create index news_sentiment_idx @@ -227,26 +290,30 @@ Now that we have the latest news for each actor, let's derive the sentiment of t parameters ('lexer newsautolexer stoplist ctxsys.default_stoplist'); ``` - The index creation analyzes each article, deriving the sentiment and storing it in the index. -3. Let's look at the sentiment of some of Johnny Depp's news: + ![Create index](images/create-index.png) + +3. Let's look at the sentiment of some of Johnny Depp's news. Copy and paste the following code into the SQL Worksheet, and then click **Run Statement** in the Worksheet toolbar. + ``` select actor, ctx_doc.sentiment_aggregate('news_sentiment_idx', rowid) as sentiment, - description + description from news_buzz where actor = 'Johnny Depp' order by sentiment ; ``` - As to be expected, the computed sentiment isn't great. However, it's not all bad; as you scroll through the results, there are some positive articles. Also, the description field is fairly small. A richer text field would likely produce even better results. - ![Run a sentiment analysis](images/adb-sentiment-analysis.png) + ![Query sentiment](images/query-sentiment.png) + + The Total Results is 54 in our example; however, your results might be different. Scroll to the right to view the complete results. The description field is fairly small. A richer text field would likely produce even better results. + +4. MovieStream needs to decide which movies to promote on their site. Actors that are generating more buzz and the type of news will likely have some influence on their recommendations. Query the ranking for the actors. Copy and paste the following code into the SQL Worksheet, and then click **Run Statement** in the Worksheet toolbar. -4. MovieStream will want to consider which movies to promote on the site. Actors that are generating buzz and the type of news will likely have some influence on their recommendations. Below are the rankings for our actors: ``` select @@ -263,7 +330,19 @@ Now that we have the latest news for each actor, let's derive the sentiment of t This completes this lab. You now know how to integrate and analyze data coming from REST endpoints in Autonomous Database. +You may now proceed to the next lab. + +## Learn more + +* [SQL Language Reference](https://docs.oracle.com/en/database/oracle/oracle-database/19/sqlrf/index.html) +* [DBMS_CLOUD Subprograms and REST APIs](https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/dbms-cloud-subprograms.html#GUID-3D0A5361-672C-467D-AA90-656B1B4D4E37) +* [Oracle Text](https://docs.oracle.com/en/database/oracle/oracle-database/19/ccref/index.html) +* [Oracle Cloud Infrastructure Documentation](https://docs.cloud.oracle.com/en-us/iaas/Content/GSG/Concepts/baremetalintro.htm) +* [Using Oracle Autonomous Database Serverless](https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/index.html) + ## Acknowledgements -* **Author** - Marty Gubar, Autonomous Database Product Management -* **Last Updated By/Date:** Marty Gubar, July 2022 +* **Authors:** + * Marty Gubar, Autonomous Database Product Management + * Lauran K. Serhal, Consulting User Assistance Developer +* **Last Updated By/Date:** Lauran K. Serhal, March 2024 diff --git a/building-blocks/blocks/oac/provision/images/adb-instances.png b/building-blocks/blocks/oac/provision/images/adb-instances.png new file mode 100644 index 00000000..a48cba7b Binary files /dev/null and b/building-blocks/blocks/oac/provision/images/adb-instances.png differ diff --git a/building-blocks/blocks/oac/provision/images/analytics-cloud.png b/building-blocks/blocks/oac/provision/images/analytics-cloud.png new file mode 100644 index 00000000..a4dd6bc3 Binary files /dev/null and b/building-blocks/blocks/oac/provision/images/analytics-cloud.png differ diff --git a/building-blocks/blocks/oac/provision/images/create-analytics-instance.png b/building-blocks/blocks/oac/provision/images/create-analytics-instance.png new file mode 100644 index 00000000..b36ba79e Binary files /dev/null and b/building-blocks/blocks/oac/provision/images/create-analytics-instance.png differ diff --git a/building-blocks/blocks/oac/provision/images/create-instance.png b/building-blocks/blocks/oac/provision/images/create-instance.png new file mode 100644 index 00000000..22cf0b89 Binary files /dev/null and b/building-blocks/blocks/oac/provision/images/create-instance.png differ diff --git a/building-blocks/blocks/oac/provision/images/federated-user.png b/building-blocks/blocks/oac/provision/images/federated-user.png index af48cf4a..940d5080 100644 Binary files a/building-blocks/blocks/oac/provision/images/federated-user.png and b/building-blocks/blocks/oac/provision/images/federated-user.png differ diff --git a/building-blocks/blocks/oac/provision/images/oac-created.png b/building-blocks/blocks/oac/provision/images/oac-created.png new file mode 100644 index 00000000..da9343b2 Binary files /dev/null and b/building-blocks/blocks/oac/provision/images/oac-created.png differ diff --git a/building-blocks/blocks/oac/provision/images/oac-creating.png b/building-blocks/blocks/oac/provision/images/oac-creating.png index 719d2f34..9d01df02 100644 Binary files a/building-blocks/blocks/oac/provision/images/oac-creating.png and b/building-blocks/blocks/oac/provision/images/oac-creating.png differ diff --git a/building-blocks/blocks/oac/provision/oac-provision.md b/building-blocks/blocks/oac/provision/oac-provision.md index c54ba9f0..00a5c8fe 100644 --- a/building-blocks/blocks/oac/provision/oac-provision.md +++ b/building-blocks/blocks/oac/provision/oac-provision.md @@ -8,13 +8,15 @@ ## Introduction -In this lab, you provision an **Oracle Analytics Cloud (OAC)** instance on Oracle Cloud Infrastructure, which you will use in the final lab to analyze your data. +> **Important:** _Oracle Analytics Cloud (OAC) is not available with Oracle Cloud Free Tier (Always Free), nor is it supported in Oracle LiveLabs Sandbox hosted environments (the Green button). If you run this workshop using an Always Free database or a LiveLabs Sandbox environment, you can review **Lab 1** and **Lab 5** **without provisioning and using OAC**, and later practice the two labs on **Oracle Autonomous Database** and **OAC** in your organization’s own tenancy._ + +In this lab, you provision an **Oracle Analytics Cloud (OAC)** instance on Oracle Cloud Infrastructure, which you will use to analyze your data in the **Develop Self-Service Analytics Cloud Dashboards** lab in this workshop. You will provision your OAC instance with your Oracle Cloud paid or Free Tier **credits**; Oracle Analytics Cloud is not part of the **Always Free** cloud services. -Provisioning an Oracle Analytics Cloud instance can take over **40 minutes**. We position this lab first, so that the OAC instance can provision while you proceed with the following labs. You will later use your OAC instance in the final lab of this workshop, "Develop Self-Service Analytics Cloud Dashboards." +Provisioning an Oracle Analytics Cloud instance can take over **20+ minutes**. We position this lab first, so that the OAC instance can provision while you proceed with the following labs. -> **Note**: Oracle Analytics Cloud (OAC) is not available with Oracle Cloud Free Tier (Always Free), nor is it supported in Oracle LiveLabs Sandbox hosted environments. If you run this workshop using an Always Free database or LiveLabs Sandbox environment, you can view Labs 1 and 5 on provisioning and using OAC, and later practice these steps on Oracle Autonomous Databases in your organization's tenancy. +> **Note:** Oracle Analytics Cloud (OAC) is not available with Oracle Cloud Free Tier (Always Free), nor is it supported in Oracle LiveLabs Sandbox hosted environments (the Green button). If you run this workshop using an Always Free database or a LiveLabs Sandbox environment, you can view **Lab 1** and **Lab 5** _without provisioning and using OAC_, and later practice the two labs on **Oracle Autonomous Database** and **OAC** in your organization’s own tenancy. Also... @@ -22,88 +24,77 @@ Also... Watch our short video that explains how to provision your Oracle Analytics Cloud instance: -> Note: Please disregard the video's reference to "Lab 2." +> Note: Please disregard the video's reference to **Lab 2**. [](youtube:ZAqXlhivQCg) -Estimated Time: 40+ minutes. +Estimated Time: 20+ minutes. ### Objectives - Create an Oracle Analytics Cloud Instance ## Task 1: Create an Oracle Analytics Cloud (OAC) Instance -Access the Oracle Cloud Infrastructure Console from the **Oracle Home Page** (www.oracle.com) and sign in to your cloud account. Click **View Account** and **Sign in to Cloud**. +1. Log in to the Oracle Cloud Console as the Cloud Administrator using the instructions in the **Get Started** lab in the **Contents** menu on the left. -![Oracle Console SignIn](./images/cloud-signin.png) +2. Click the **Profile** icon in the top right side of the banner. -1. Click the menu icon on the left. Verify that you are signed in as a **Single Sign On** (Federated user) by selecting the **Profile** icon in the top right side of your screen. If your username is shown as: + If your username is shown in the following format, then you are **connected** as a **Single Sign On** user. - oracleidentitycloudservice/<your username> - Then you are **connected** as a **Single Sign On** user. - - ![Federated User](./images/federated-user.png) - - If your username is shown as: - - - <your username> + ![Federated User](./images/federated-user.png) - Then you are **signed in** as an **Oracle Cloud Infrastructure** user. + If your username is shown in the following format, then you are **signed in** as an **Oracle Cloud Infrastructure** user. - ![OCI User](./images/oci-user.png) + - <your username> - If your user does not contain the identity provider (**oracleidentitycloudprovider**), please log out and select to authenticate - using **Single Sign On**. - > To enable using **Oracle Analytics Cloud**, we need to sign on as a **Single Sign-On** (SSO) user. + >**Note:** If your user does not contain the identity provider (**oracleidentitycloudprovider**), please log out and select to authenticate + using **Single Sign On**. To enable using **Oracle Analytics Cloud**, we need to sign on as a **Single Sign-On** (SSO) user. For more information about federated users, see the [User Provisioning for Federated Users](https://docs.cloud.oracle.com/en-us/iaas/Content/Identity/Tasks/usingscim.htm) documentation. - ![Oracle Console SignIn](./images/console-signin.png) +3. Return to the **Console** Home page. Open the Navigation menu and click **Analytics & AI**. Under **Analytics**, click **Analytics Cloud**. - For more information about federated users, see [User Provisioning for Federated Users](https://docs.cloud.oracle.com/en-us/iaas/Content/Identity/Tasks/usingscim.htm). - -2. Return to the **Home Console Page** and navigate to the **Analytics & AI** section and then **Analytics Cloud**. - - ![Oracle Analytics Console](https://oracle-livelabs.github.io/common/images/console/analytics-oac.png " ") + ![Navigate to Analytics Cloud.](./images/analytics-cloud.png) > **Note**: You must be connected as a **Single Sign On** (**Federated user**) user to a tenancy, which has available cloud credits to see this menu item. Local OCI users are not able to do this. -3. Select **Create Instance**. - - Complete the form using the following information: - - - **Compartment**: Select a valid compartment in your tenancy +4. On the **Analytics Instances** page, select your compartment from the **Compartment** drop-down list in the **List Scope** section. Next, click **Create Instance**. - - **Instance Name**: [](var:oac_instance_name) + ![Click create instance.](./images/create-instance.png) - - **Description**: `Analytics Instance for the cloud` +5. On the **Create Analytics Instance** panel, specify the following: + * **Compartment:** Select your compartment. + * **Instance Name:** [](var:oac_instance_name). + * **Description:** Analytics Instance for the cloud. + * **Capacity Type:** OCPU. + * **OCPU Count:** 1 (Non Production). + * **License Type:** License Included. + * **License Edition:** Enterprise Edition. - - **Feature Set**: Enterprise Analytics (important) + ![OAC Instance Creation](./images/create-analytics-instance.png) - - **Capacity**: 1 - Non Production - - - **License Type**: "Subscribe to a new Analytics Cloud software > license and the Analytics Cloud." (You will use this service as part of the free Oracle Cloud trial that you requested for this workshop). - -4. Select **Create**. - - ![OAC Instance Creation](./images/oac-creation-details-new.png) - -5. On the **Confirmation** screen, select **Create**. - - The Analytics instance page will be displayed with a status of **CREATING**. +6. Click **Create**. The Analytics instance page will be displayed with a status of **CREATING**. ![OAC Instance Creating](./images/oac-creating.png) ***Reminder***: Provisioning an Oracle Analytics Cloud instance can take over **40 minutes**. -6. The Analytics instance page will be displayed with a status of **ACTIVE**. +6. When provisioning is complete, the status of your Analytics instance changes to **ACTIVE**. - ![OAC Instance Active](./images/oac-active.png) + ![OAC Instance Active](./images/oac-created.png) -Please proceed to the next lab. +You may now proceed to the next lab. ## **Acknowledgements** -- **Author** - Priscila Iruela - Technology Product Strategy Director, Juan Antonio Martin Pedro - Analytics Business Development -- **Contributors** - Victor Martin, Melanie Ashworth-March, Andrea Zengin -- **Updated By/Date** - Priscila Iruela, June 2022 -- **Last Updated By/Date** - Rick Green, Principal Developer, Database User Assistance, July 2022 +- **Authors:** + * Priscila Iruela - Technology Product Strategy Director + * Juan Antonio Martin Pedro - Analytics Business Development + * Lauran K. Serhal, Consulting User Assistance Developer + +- **Contributors:** + * Victor Martin + * Melanie Ashworth-March + * Andrea Zengin + +- **Last Updated By/Date:** Lauran K. Serhal, March 2024 diff --git a/building-blocks/how-to-author-with-blocks/all-blocks-tasks.md b/building-blocks/how-to-author-with-blocks/all-blocks-tasks.md index 8859a559..5ad3b86c 100644 --- a/building-blocks/how-to-author-with-blocks/all-blocks-tasks.md +++ b/building-blocks/how-to-author-with-blocks/all-blocks-tasks.md @@ -8,14 +8,14 @@ Building Blocks are exposed to customers. You can use these same blocks in your | Cloud Service | Block | File | Description | |---------------| ---- | ---- |------------ | | setup | [Add Workshop Utilities](/common/building-blocks/workshop/freetier/index.html?lab=add-workshop-utilities) | /common/building-blocks /setup/add-workshop-utilities.md| Utilities for adding data sets and users | -| adb | [Delete your workshop resources](/common/building-blocks/workshop/freetier/index.html?lab=cleanup.md) | /common/building-blocks/blocks/adb/cleanup/cleanup.md | Delete some or all of the resources that you created in the workshop | -| adb | [Connect with SQL Worksheet](/common/building-blocks/workshop/freetier/index.html?lab=connect-sql-worksheet.md) | /common/building-blocks/blocks/adb/connect/connect-sql-worksheet.md | Connect to Autonomous Database using the SQL Worksheet in Database Actions | -| adb | [Load and Analyze Data from REST Services](/common/building-blocks/workshop/freetier/index.html?lab=load-analyze-rest.md) | /common/building-blocks/blocks/adb/load-analyze-rest/load-analyze-rest.md | Analyze data sourced from REST services. Using the News API as an example.
  • Create an Account on newsapi.org
  • Create a PLSQL function that retrieves news for actors
  • Perform a sentiment analysis on the article descriptions
  • Find which actors are generating buzz - both good and bad
| -| adb | [Use Database Actions Data Loading for Object Store data](/common/building-blocks/workshop/freetier/index.html?lab=load-data-tools.md) | /common/building-blocks/blocks/adb/load-data/load-data-tools.md | Use the Database Actions tooling to easily load data from object storage. | -| adb | [Provision ADB using Python API](/common/building-blocks/workshop/freetier/index.html?lab=provision-python-api.md) | /common/building-blocks/blocks/adb/provision-python-api/provision-python-api.md | OCI provides a rich set of APIs to interact with its services. Use the python API to provision an autonomous database. | -| adb | [Create an Oracle Autonomous Database](/common/building-blocks/workshop/freetier/index.html?lab=provision-console.md) | /common/building-blocks/blocks/adb/provision/provision-console.md | Learn how to provision Autonomous Database using the OCI console. | -| adb | [Access and Load Partitioned Object Storage Data](/common/building-blocks/workshop/freetier/index.html?lab=use-partitioned-external-table.md) | /common/building-blocks/blocks/adb/use-partitioned-external-table/use-partitioned-external-table.md | Show value of partitioned external tables to improve performance | -| oac | [Provision Your Oracle Analytics Cloud (OAC) Instance](/common/building-blocks/workshop/freetier/index.html?lab=oac-provision.md) | /common/building-blocks/blocks/oac/provision/oac-provision.md | Show how to create a new OAC instance | +| adb\cleanup\cleanup.m | [Delete your workshop resources](/common/building-blocks/workshop/freetier/index.html?lab=blocks\adb\cleanup\cleanup.md) | d | Delete some or all of the resources that you created in the workshop | +| adb\connect\connect-sql-worksheet.m | [Connect with SQL Worksheet](/common/building-blocks/workshop/freetier/index.html?lab=blocks\adb\connect\connect-sql-worksheet.md) | d | Connect to Autonomous Database using the SQL Worksheet in Database Actions | +| adb\load-analyze-rest\load-analyze-rest.m | [Load and Analyze Data from REST Services](/common/building-blocks/workshop/freetier/index.html?lab=blocks\adb\load-analyze-rest\load-analyze-rest.md) | d | Analyze data sourced from REST services. Using the News API as an example.
  • Create an Account on newsapi.org
  • Create a PLSQL function that retrieves news for actors
  • Perform a sentiment analysis on the article descriptions
  • Find which actors are generating buzz - both good and bad
| +| adb\load-data\load-data-tools.m | [Use Database Actions Data Loading for Object Store data](/common/building-blocks/workshop/freetier/index.html?lab=blocks\adb\load-data\load-data-tools.md) | d | Use the Database Actions tooling to easily load data from object storage. | +| adb\provision-python-api\provision-python-api.m | [Provision ADB using Python API](/common/building-blocks/workshop/freetier/index.html?lab=blocks\adb\provision-python-api\provision-python-api.md) | d | OCI provides a rich set of APIs to interact with its services. Use the python API to provision an autonomous database. | +| adb\provision\provision-console.m | [Create an Oracle Autonomous Database](/common/building-blocks/workshop/freetier/index.html?lab=blocks\adb\provision\provision-console.md) | d | Learn how to provision Autonomous Database using the OCI console. | +| adb\use-partitioned-external-table\use-partitioned-external-table.m | [Access and Load Partitioned Object Storage Data](/common/building-blocks/workshop/freetier/index.html?lab=blocks\adb\use-partitioned-external-table\use-partitioned-external-table.md) | d | Show value of partitioned external tables to improve performance | +| oac\provision\oac-provision.m | [Provision Your Oracle Analytics Cloud (OAC) Instance](/common/building-blocks/workshop/freetier/index.html?lab=blocks\oac\provision\oac-provision.md) | d | Show how to create a new OAC instance | [Go here for the customer view of Building Blocks](/building-blocks/workshop/freetier/index.html) ## List of Tasks @@ -23,27 +23,27 @@ Building Blocks are exposed to customers. You can use these same blocks in your Listed below are the tasks that you can incorporate into your markdown. You can also use the navigation tree on the left to view the tasks. Again, contribute to the list of tasks! | Cloud Service | Task | File | Description | |---------------| ---- | ---- |------------ | -| adb | [Delete your workshop resources](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#Deleteyourworkshopresources) | /common/building-blocks/tasks/adb/cleanup.md | Delete some or all of the resources that you created in the workshop | -| adb | [Connect with SQL Worksheet](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#ConnectwithSQLWorksheet) | /common/building-blocks/tasks/adb/connect-with-sql-worksheet-body.md | Connect to Autonomous Database using the SQL Worksheet in Database Actions | -| adb | [Connect with SQL Worksheet as non-admin user](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#ConnectwithSQLWorksheetasnonadminuser) | /common/building-blocks/tasks/adb/connect-with-sql-worksheet-non-admin.md | Connect to Autonomous Database using the SQL Worksheet in Database Actions. Non-admin user. | -| adb | [Create Graph](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#CreateGraph) | /common/building-blocks/tasks/adb/create-graph.md | Create a bipartite Graph for MOVIESTREAM watched movies. | -| adb | [Create and load JSON Collection from object storage](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#CreateandloadJSONCollectionfromobjectstorage) | /common/building-blocks/tasks/adb/create-load-json-collection.md |
  • Loads data using DBMS_CLOUD.COPY_COLLECTION
  • Introduces JSON_SERIALIZE, JSON_VALUE and JSON_QUERY (minimal)
  • Creates a view over JSON data
  • Performs basic JSON queries
| -| adb | [Create ADB User using Database Actions](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#CreateADBUserusingDatabaseActions) | /common/building-blocks/tasks/adb/create-user.md | Creates an ADB user using the new user database action | -| adb | [Generate an RSA key pair](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#GenerateanRSAkeypair) | /common/building-blocks/tasks/adb/generate-rsa-key-pair.md | Generate an RSA key pair and get the key's values and fingerprint | -| adb | [Go to Data Load Utility Database Action](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#GotoDataLoadUtilityDatabaseAction) | /common/building-blocks/tasks/adb/goto-data-load-utility.md | Navigate to data loader. AUTHORS: For expediency, this task uses the ADMIN user/password to open Database Actions. In your workshop, you might want to substitute a different user/password to open Database Actions. | -| adb | [Go to Graph Studio](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#GotoGraphStudio) | /common/building-blocks/tasks/adb/goto-graph-studio.md | Login to Graph Studio from the Autonomous Database OCI console | -| adb | [Go to Autonomous Database Service](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#GotoAutonomousDatabaseService) | /common/building-blocks/tasks/adb/goto-service-body.md | Navigate to ADB using the OCI menu. AUTHORS: For expediency, this task uses the ADMIN user/password to open Database Actions. In your workshop, you might want to substitute a different user/password to open Database Actions. | -| adb | [Go to SQL Worksheet in Database Actions](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#GotoSQLWorksheetinDatabaseActions) | /common/building-blocks/tasks/adb/goto-sql-worksheet.md | Navigate to SQL Worksheet from the OCI service console. | -| adb | [Load data from public buckets using Database Actions](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#LoaddatafrompublicbucketsusingDatabaseActions) | /common/building-blocks/tasks/adb/load-public-db-actions-15-min-quickstart.md | Uses Database Actions to load data from public object storage buckets. It loads the following two tables:
  • customer
  • sales_sample
| -| adb | [Load data from public buckets using Database Actions. Sales data not included.](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#LoaddatafrompublicbucketsusingDatabaseActionsSalesdatanotincluded) | /common/building-blocks/tasks/adb/load-public-db-actions-no-sales.md | Uses Database Actions to load data from public object storage buckets. It loads the following tables:
  • customer_contact
  • genre
  • pizza location

To load sales_sample, use task **Load data from public buckets using Database Actions** | -| adb | [Load data from public buckets using Database Actions](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#LoaddatafrompublicbucketsusingDatabaseActions) | /common/building-blocks/tasks/adb/load-public-db-actions.md | Uses Database Actions to load data from public object storage buckets. It loads the following tables:

  • customer_contact
  • sales_sample
  • genre
  • pizza location
| -| adb | [Provision Autonomous Database](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#ProvisionAutonomousDatabase) | /common/building-blocks/tasks/adb/provision-body.md | Provision an ADB. Use the `variables.json` file to update provisioning parameters, including database name, ECPUs, storage and more. | -| adb | [Query JSON arrays](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#QueryJSONarrays) | /common/building-blocks/tasks/adb/query-json-arrays.md | Use JSON_TABLE to convert arrays into rows. | -| adb | [Query simple JSON attributes](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#QuerysimpleJSONattributes) | /common/building-blocks/tasks/adb/query-json-simple.md | Use dot notation and JSON_VALUE to query JSON documents. Creates a view to simplify subsequent access. | -| adb | [Query Object Storage contents with SQL](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#QueryObjectStoragecontentswithSQL) | /common/building-blocks/tasks/adb/query-object-store-contents-with-sql.md | Use SQL to see listing of object storage files and folders. | -| adb | [Analyze Spatial Data with SQL](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#AnalyzeSpatialDatawithSQL) | /common/building-blocks/tasks/adb/query-spatial.md | Oracle provides rich support for querying and analyzing spatial data. Run queries to find pizza shops closest to customers. | -| adb | [Using Partitoned External Tables](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb#UsingPartitonedExternalTables) | /common/building-blocks/tasks/adb/use-partitioned-external-table-body.md | Create partitioned external tables over object storage data using a single, simple API call. Then, load that data. Compare performance of external tables and partitioned external tables. | -| iam | [Create an OCI Compartment](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=iam#CreateanOCICompartment) | /common/building-blocks/tasks/iam/compartment-create-body.md | Create a new compartment using the OCI service console | +| adb\cleanup.m | [Delete your workshop resources](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\cleanup.m#Deleteyourworkshopresources) | d | Delete some or all of the resources that you created in the workshop | +| adb\connect-with-sql-worksheet-body.m | [Connect with SQL Worksheet](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\connect-with-sql-worksheet-body.m#ConnectwithSQLWorksheet) | d | Connect to Autonomous Database using the SQL Worksheet in Database Actions | +| adb\connect-with-sql-worksheet-non-admin.m | [Connect with SQL Worksheet as non-admin user](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\connect-with-sql-worksheet-non-admin.m#ConnectwithSQLWorksheetasnonadminuser) | d | Connect to Autonomous Database using the SQL Worksheet in Database Actions. Non-admin user. | +| adb\create-graph.m | [Create Graph](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\create-graph.m#CreateGraph) | d | Create a bipartite Graph for MOVIESTREAM watched movies. | +| adb\create-load-json-collection.m | [Create and load JSON Collection from object storage](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\create-load-json-collection.m#CreateandloadJSONCollectionfromobjectstorage) | d |
  • Loads data using DBMS_CLOUD.COPY_COLLECTION
  • Introduces JSON_SERIALIZE, JSON_VALUE and JSON_QUERY (minimal)
  • Creates a view over JSON data
  • Performs basic JSON queries
| +| adb\create-user.m | [Create ADB User using Database Actions](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\create-user.m#CreateADBUserusingDatabaseActions) | d | Creates an ADB user using the new user database action | +| adb\generate-rsa-key-pair.m | [Generate an RSA key pair](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\generate-rsa-key-pair.m#GenerateanRSAkeypair) | d | Generate an RSA key pair and get the key's values and fingerprint | +| adb\goto-data-load-utility.m | [Go to Data Load Utility Database Action](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\goto-data-load-utility.m#GotoDataLoadUtilityDatabaseAction) | d | Navigate to data loader. AUTHORS: For expediency, this task uses the ADMIN user/password to open Database Actions. In your workshop, you might want to substitute a different user/password to open Database Actions. | +| adb\goto-graph-studio.m | [Go to Graph Studio](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\goto-graph-studio.m#GotoGraphStudio) | d | Login to Graph Studio from the Autonomous Database OCI console | +| adb\goto-service-body.m | [Go to Autonomous Database Service](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\goto-service-body.m#GotoAutonomousDatabaseService) | d | Navigate to ADB using the OCI menu. AUTHORS: For expediency, this task uses the ADMIN user/password to open Database Actions. In your workshop, you might want to substitute a different user/password to open Database Actions. | +| adb\goto-sql-worksheet.m | [Go to SQL Worksheet in Database Actions](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\goto-sql-worksheet.m#GotoSQLWorksheetinDatabaseActions) | d | Navigate to SQL Worksheet from the OCI service console. | +| adb\load-public-db-actions-15-min-quickstart.m | [Load data from public buckets using Database Actions](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\load-public-db-actions-15-min-quickstart.m#LoaddatafrompublicbucketsusingDatabaseActions) | d | Uses Database Actions to load data from public object storage buckets. It loads the following two tables:
  • customer
  • sales_sample
| +| adb\load-public-db-actions-no-sales.m | [Load data from public buckets using Database Actions. Sales data not included.](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\load-public-db-actions-no-sales.m#LoaddatafrompublicbucketsusingDatabaseActionsSalesdatanotincluded) | d | Uses Database Actions to load data from public object storage buckets. It loads the following tables:
  • customer_contact
  • genre
  • pizza location

To load sales_sample, use task **Load data from public buckets using Database Actions** | +| adb\load-public-db-actions.m | [Load data from public buckets using Database Actions](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\load-public-db-actions.m#LoaddatafrompublicbucketsusingDatabaseActions) | d | Uses Database Actions to load data from public object storage buckets. It loads the following tables:

  • customer_contact
  • sales_sample
  • genre
  • pizza location
| +| adb\provision-body.m | [Provision Autonomous Database](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\provision-body.m#ProvisionAutonomousDatabase) | d | Provision an ADB. Use the `variables.json` file to update provisioning parameters, including database name, ECPUs, storage and more. | +| adb\query-json-arrays.m | [Query JSON arrays](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\query-json-arrays.m#QueryJSONarrays) | d | Use JSON_TABLE to convert arrays into rows. | +| adb\query-json-simple.m | [Query simple JSON attributes](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\query-json-simple.m#QuerysimpleJSONattributes) | d | Use dot notation and JSON_VALUE to query JSON documents. Creates a view to simplify subsequent access. | +| adb\query-object-store-contents-with-sql.m | [Query Object Storage contents with SQL](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\query-object-store-contents-with-sql.m#QueryObjectStoragecontentswithSQL) | d | Use SQL to see listing of object storage files and folders. | +| adb\query-spatial.m | [Analyze Spatial Data with SQL](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\query-spatial.m#AnalyzeSpatialDatawithSQL) | d | Oracle provides rich support for querying and analyzing spatial data. Run queries to find pizza shops closest to customers. | +| adb\use-partitioned-external-table-body.m | [Using Partitoned External Tables](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=adb\use-partitioned-external-table-body.m#UsingPartitonedExternalTables) | d | Create partitioned external tables over object storage data using a single, simple API call. Then, load that data. Compare performance of external tables and partitioned external tables. | +| iam\compartment-create-body.m | [Create an OCI Compartment](/common/building-blocks/how-to-author-with-blocks/workshop/index.html?lab=iam\compartment-create-body.m#CreateanOCICompartment) | d | Create a new compartment using the OCI service console | ## Variable Defaults You can use the default variables or copy the default file to your project and override the settings. See the **Authoring using Blocks and Tasks** topic for details. @@ -61,27 +61,27 @@ The template assumes you copied the default **variables.json** to the same direc { "workshoptitle":"LiveLabs Workshop Template", "include": { - "adb-cleanup.md":"/common/building-blocks/tasks/adb/cleanup.md", - "adb-connect-with-sql-worksheet-body.md":"/common/building-blocks/tasks/adb/connect-with-sql-worksheet-body.md", - "adb-connect-with-sql-worksheet-non-admin.md":"/common/building-blocks/tasks/adb/connect-with-sql-worksheet-non-admin.md", - "adb-create-graph.md":"/common/building-blocks/tasks/adb/create-graph.md", - "adb-create-load-json-collection.md":"/common/building-blocks/tasks/adb/create-load-json-collection.md", - "adb-create-user.md":"/common/building-blocks/tasks/adb/create-user.md", - "adb-generate-rsa-key-pair.md":"/common/building-blocks/tasks/adb/generate-rsa-key-pair.md", - "adb-goto-data-load-utility.md":"/common/building-blocks/tasks/adb/goto-data-load-utility.md", - "adb-goto-graph-studio.md":"/common/building-blocks/tasks/adb/goto-graph-studio.md", - "adb-goto-service-body.md":"/common/building-blocks/tasks/adb/goto-service-body.md", - "adb-goto-sql-worksheet.md":"/common/building-blocks/tasks/adb/goto-sql-worksheet.md", - "adb-load-public-db-actions-15-min-quickstart.md":"/common/building-blocks/tasks/adb/load-public-db-actions-15-min-quickstart.md", - "adb-load-public-db-actions-no-sales.md":"/common/building-blocks/tasks/adb/load-public-db-actions-no-sales.md", - "adb-load-public-db-actions.md":"/common/building-blocks/tasks/adb/load-public-db-actions.md", - "adb-provision-body.md":"/common/building-blocks/tasks/adb/provision-body.md", - "adb-query-json-arrays.md":"/common/building-blocks/tasks/adb/query-json-arrays.md", - "adb-query-json-simple.md":"/common/building-blocks/tasks/adb/query-json-simple.md", - "adb-query-object-store-contents-with-sql.md":"/common/building-blocks/tasks/adb/query-object-store-contents-with-sql.md", - "adb-query-spatial.md":"/common/building-blocks/tasks/adb/query-spatial.md", - "adb-use-partitioned-external-table-body.md":"/common/building-blocks/tasks/adb/use-partitioned-external-table-body.md", - "iam-compartment-create-body.md":"/common/building-blocks/tasks/iam/compartment-create-body.md" + "adb\cleanup.m-tasks\adb\cleanup.md":"d", + "adb\connect-with-sql-worksheet-body.m-tasks\adb\connect-with-sql-worksheet-body.md":"d", + "adb\connect-with-sql-worksheet-non-admin.m-tasks\adb\connect-with-sql-worksheet-non-admin.md":"d", + "adb\create-graph.m-tasks\adb\create-graph.md":"d", + "adb\create-load-json-collection.m-tasks\adb\create-load-json-collection.md":"d", + "adb\create-user.m-tasks\adb\create-user.md":"d", + "adb\generate-rsa-key-pair.m-tasks\adb\generate-rsa-key-pair.md":"d", + "adb\goto-data-load-utility.m-tasks\adb\goto-data-load-utility.md":"d", + "adb\goto-graph-studio.m-tasks\adb\goto-graph-studio.md":"d", + "adb\goto-service-body.m-tasks\adb\goto-service-body.md":"d", + "adb\goto-sql-worksheet.m-tasks\adb\goto-sql-worksheet.md":"d", + "adb\load-public-db-actions-15-min-quickstart.m-tasks\adb\load-public-db-actions-15-min-quickstart.md":"d", + "adb\load-public-db-actions-no-sales.m-tasks\adb\load-public-db-actions-no-sales.md":"d", + "adb\load-public-db-actions.m-tasks\adb\load-public-db-actions.md":"d", + "adb\provision-body.m-tasks\adb\provision-body.md":"d", + "adb\query-json-arrays.m-tasks\adb\query-json-arrays.md":"d", + "adb\query-json-simple.m-tasks\adb\query-json-simple.md":"d", + "adb\query-object-store-contents-with-sql.m-tasks\adb\query-object-store-contents-with-sql.md":"d", + "adb\query-spatial.m-tasks\adb\query-spatial.md":"d", + "adb\use-partitioned-external-table-body.m-tasks\adb\use-partitioned-external-table-body.md":"d", + "iam\compartment-create-body.m-tasks\iam\compartment-create-body.md":"d" }, "help": "livelabs-help-db_us@oracle.com", "variables": ["./variables.json"], diff --git a/building-blocks/how-to-author-with-blocks/how-to-author-with-blocks.md b/building-blocks/how-to-author-with-blocks/how-to-author-with-blocks.md index a7baf196..64c1f333 100644 --- a/building-blocks/how-to-author-with-blocks/how-to-author-with-blocks.md +++ b/building-blocks/how-to-author-with-blocks/how-to-author-with-blocks.md @@ -1,4 +1,4 @@ -# Building Blocks +# Authoring LiveLabs Workshops with Building Blocks and Tasks ## Introduction LiveLabs is a great environment for publishing workshops. There are a few things that we are addressing to satisfy the following requirements: @@ -8,16 +8,45 @@ LiveLabs is a great environment for publishing workshops. There are a few things * Improve on-going maintenance of workshops * Promote consistency across workshops -Building Blocks are a way to enhance both the workshop development and customer experience. This page focuses on how authors can use Building Blocks and Tasks to accelerate workshop development. +Building Blocks are a way to enhance both the workshop development and customer experience. This workshop provides the details on how authors can use Building Blocks and Tasks to accelerate workshop development. -## Building Blocks and Tasks -As an author, there are two types of components you may want to take advantage of: a Building Block and/or a Task. Let's examine these two concepts and how they map to your workshop development: +## Introduction to Building Blocks and Tasks +As a LiveLabs workshop author, there are two types of components you may want to take advantage of: + +* Building **Block** (common block), and/or +* Building **Task** (common task) + +>**Note:** Both Building **Blocks** and **Tasks** are located in the **`common`** repository; therefore, in this workshop we will refer to Building Blocks and Tasks as **`common`** **blocks** and **tasks** interchangeably. + +Let's look at the folder structure for the Building Blocks and Tasks. + +![Building Blocks and Tasks structure](images/common-blocks-tasks-structure.png " ") + +Let's examine the above folders structure: + +* **`livelabs-clones`:** +This is the root folder that contains all of your repositories that you use in your workshops. The name of this folder is up to you. In our example, this folder contains the **`adb`**, **`common`**, **`oci`**, and **`sprints`** repositories. Having a root or parent folder that contains all of your cloned repos is a +pre-requisite; _otherwise, you'll have issues implementing and running common blocks and tasks_. + +* **`common` repository:** +This is the the repo that contains the Building Blocks and Tasks among other things. + +* **`building-blocks`:** +This is the root folder that contains all common blocks and tasks. + +* + +### Pre-requisite 1 to Using Building Blocks and Tasks + + + +Let's examine these two concepts and how they map to your workshop development: ![Blocks and Tasks](images/lab-to-block.png " ") Just as a lab is comprised of multiple tasks, a Block is comprised of multiple Tasks. -For example: ADB provisioning has two tasks: +For example: ADB provisioning has two tasks: * Selecting the ADB Service from the OCI menu * Creating the ADB instance diff --git a/building-blocks/how-to-author-with-blocks/images/common-blocks-tasks-structure.png b/building-blocks/how-to-author-with-blocks/images/common-blocks-tasks-structure.png new file mode 100644 index 00000000..e257f89f Binary files /dev/null and b/building-blocks/how-to-author-with-blocks/images/common-blocks-tasks-structure.png differ diff --git a/building-blocks/how-to-author-with-blocks/workshop/manifest.json b/building-blocks/how-to-author-with-blocks/workshop/manifest.json index fb83cd7a..dd452f8e 100644 --- a/building-blocks/how-to-author-with-blocks/workshop/manifest.json +++ b/building-blocks/how-to-author-with-blocks/workshop/manifest.json @@ -1,27 +1,27 @@ { "workshoptitle":"LiveLabs Building Blocks", "include": { - "adb-cleanup.md":"/common/building-blocks/tasks/adb/cleanup.md", - "adb-connect-with-sql-worksheet-body.md":"/common/building-blocks/tasks/adb/connect-with-sql-worksheet-body.md", - "adb-connect-with-sql-worksheet-non-admin.md":"/common/building-blocks/tasks/adb/connect-with-sql-worksheet-non-admin.md", - "adb-create-graph.md":"/common/building-blocks/tasks/adb/create-graph.md", - "adb-create-load-json-collection.md":"/common/building-blocks/tasks/adb/create-load-json-collection.md", - "adb-create-user.md":"/common/building-blocks/tasks/adb/create-user.md", - "adb-generate-rsa-key-pair.md":"/common/building-blocks/tasks/adb/generate-rsa-key-pair.md", - "adb-goto-data-load-utility.md":"/common/building-blocks/tasks/adb/goto-data-load-utility.md", - "adb-goto-graph-studio.md":"/common/building-blocks/tasks/adb/goto-graph-studio.md", - "adb-goto-service-body.md":"/common/building-blocks/tasks/adb/goto-service-body.md", - "adb-goto-sql-worksheet.md":"/common/building-blocks/tasks/adb/goto-sql-worksheet.md", - "adb-load-public-db-actions-15-min-quickstart.md":"/common/building-blocks/tasks/adb/load-public-db-actions-15-min-quickstart.md", - "adb-load-public-db-actions-no-sales.md":"/common/building-blocks/tasks/adb/load-public-db-actions-no-sales.md", - "adb-load-public-db-actions.md":"/common/building-blocks/tasks/adb/load-public-db-actions.md", - "adb-provision-body.md":"/common/building-blocks/tasks/adb/provision-body.md", - "adb-query-json-arrays.md":"/common/building-blocks/tasks/adb/query-json-arrays.md", - "adb-query-json-simple.md":"/common/building-blocks/tasks/adb/query-json-simple.md", - "adb-query-object-store-contents-with-sql.md":"/common/building-blocks/tasks/adb/query-object-store-contents-with-sql.md", - "adb-query-spatial.md":"/common/building-blocks/tasks/adb/query-spatial.md", - "adb-use-partitioned-external-table-body.md":"/common/building-blocks/tasks/adb/use-partitioned-external-table-body.md", - "iam-compartment-create-body.md":"/common/building-blocks/tasks/iam/compartment-create-body.md" + "adb\cleanup.m-tasks\adb\cleanup.md":"d", + "adb\connect-with-sql-worksheet-body.m-tasks\adb\connect-with-sql-worksheet-body.md":"d", + "adb\connect-with-sql-worksheet-non-admin.m-tasks\adb\connect-with-sql-worksheet-non-admin.md":"d", + "adb\create-graph.m-tasks\adb\create-graph.md":"d", + "adb\create-load-json-collection.m-tasks\adb\create-load-json-collection.md":"d", + "adb\create-user.m-tasks\adb\create-user.md":"d", + "adb\generate-rsa-key-pair.m-tasks\adb\generate-rsa-key-pair.md":"d", + "adb\goto-data-load-utility.m-tasks\adb\goto-data-load-utility.md":"d", + "adb\goto-graph-studio.m-tasks\adb\goto-graph-studio.md":"d", + "adb\goto-service-body.m-tasks\adb\goto-service-body.md":"d", + "adb\goto-sql-worksheet.m-tasks\adb\goto-sql-worksheet.md":"d", + "adb\load-public-db-actions-15-min-quickstart.m-tasks\adb\load-public-db-actions-15-min-quickstart.md":"d", + "adb\load-public-db-actions-no-sales.m-tasks\adb\load-public-db-actions-no-sales.md":"d", + "adb\load-public-db-actions.m-tasks\adb\load-public-db-actions.md":"d", + "adb\provision-body.m-tasks\adb\provision-body.md":"d", + "adb\query-json-arrays.m-tasks\adb\query-json-arrays.md":"d", + "adb\query-json-simple.m-tasks\adb\query-json-simple.md":"d", + "adb\query-object-store-contents-with-sql.m-tasks\adb\query-object-store-contents-with-sql.md":"d", + "adb\query-spatial.m-tasks\adb\query-spatial.md":"d", + "adb\use-partitioned-external-table-body.m-tasks\adb\use-partitioned-external-table-body.md":"d", + "iam\compartment-create-body.m-tasks\iam\compartment-create-body.md":"d" }, "help": "livelabs-help-db_us@oracle.com", "variables": ["/common/building-blocks/variables/variables.json"], @@ -48,14 +48,109 @@ "filename": "/common/building-blocks/how-to-author-with-blocks/all-blocks-tasks.md" }, { - "title": "ADB Tasks", + "title": "ADB\CLEANUP.M Tasks", "type": "freetier", - "filename": "/common/building-blocks/how-to-author-with-blocks/adb.md" + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\cleanup.m.md" }, { - "title": "IAM Tasks", + "title": "ADB\CONNECT-WITH-SQL-WORKSHEET-BODY.M Tasks", "type": "freetier", - "filename": "/common/building-blocks/how-to-author-with-blocks/iam.md" + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\connect-with-sql-worksheet-body.m.md" + }, + { + "title": "ADB\CONNECT-WITH-SQL-WORKSHEET-NON-ADMIN.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\connect-with-sql-worksheet-non-admin.m.md" + }, + { + "title": "ADB\CREATE-GRAPH.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\create-graph.m.md" + }, + { + "title": "ADB\CREATE-LOAD-JSON-COLLECTION.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\create-load-json-collection.m.md" + }, + { + "title": "ADB\CREATE-USER.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\create-user.m.md" + }, + { + "title": "ADB\GENERATE-RSA-KEY-PAIR.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\generate-rsa-key-pair.m.md" + }, + { + "title": "ADB\GOTO-DATA-LOAD-UTILITY.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\goto-data-load-utility.m.md" + }, + { + "title": "ADB\GOTO-GRAPH-STUDIO.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\goto-graph-studio.m.md" + }, + { + "title": "ADB\GOTO-SERVICE-BODY.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\goto-service-body.m.md" + }, + { + "title": "ADB\GOTO-SQL-WORKSHEET.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\goto-sql-worksheet.m.md" + }, + { + "title": "ADB\LOAD-PUBLIC-DB-ACTIONS-15-MIN-QUICKSTART.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\load-public-db-actions-15-min-quickstart.m.md" + }, + { + "title": "ADB\LOAD-PUBLIC-DB-ACTIONS-NO-SALES.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\load-public-db-actions-no-sales.m.md" + }, + { + "title": "ADB\LOAD-PUBLIC-DB-ACTIONS.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\load-public-db-actions.m.md" + }, + { + "title": "ADB\PROVISION-BODY.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\provision-body.m.md" + }, + { + "title": "ADB\QUERY-JSON-ARRAYS.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\query-json-arrays.m.md" + }, + { + "title": "ADB\QUERY-JSON-SIMPLE.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\query-json-simple.m.md" + }, + { + "title": "ADB\QUERY-OBJECT-STORE-CONTENTS-WITH-SQL.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\query-object-store-contents-with-sql.m.md" + }, + { + "title": "ADB\QUERY-SPATIAL.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\query-spatial.m.md" + }, + { + "title": "ADB\USE-PARTITIONED-EXTERNAL-TABLE-BODY.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/adb\use-partitioned-external-table-body.m.md" + }, + { + "title": "IAM\COMPARTMENT-CREATE-BODY.M Tasks", + "type": "freetier", + "filename": "/common/building-blocks/how-to-author-with-blocks/iam\compartment-create-body.m.md" } ] } \ No newline at end of file diff --git a/building-blocks/tasks/adb/cleanup.md b/building-blocks/tasks/adb/cleanup.md index 5472d37d..ad38be28 100644 --- a/building-blocks/tasks/adb/cleanup.md +++ b/building-blocks/tasks/adb/cleanup.md @@ -1,7 +1,7 @@ diff --git a/building-blocks/tasks/adb/create-load-json-collection.md b/building-blocks/tasks/adb/create-load-json-collection.md index 6cd36e5b..84920f5e 100644 --- a/building-blocks/tasks/adb/create-load-json-collection.md +++ b/building-blocks/tasks/adb/create-load-json-collection.md @@ -5,26 +5,37 @@ } ---> ### What is JSON? -JSON provides a language independent, flexible and powerful data model. It was derived from JavaScript, but many modern programming languages include code to generate and parse JSON-format data. For more information see here: [https://en.wikipedia.org/wiki/JSON](https://en.wikipedia.org/wiki/JSON). No wonder that it is such a popular storage format for developers. +JSON provides a language independent, flexible, and powerful data model. It was derived from JavaScript, but many modern programming languages include code to generate and parse JSON-format data. For more information see [https://en.wikipedia.org/wiki/JSON](https://en.wikipedia.org/wiki/JSON). No wonder that it is such a popular storage format for developers. Oracle SQL allows you to analyze JSON data - including complex data types like arrays - in combination with structured tabular data. -### Movie JSON data -Our movie data set has a series of columns that contain different types of details about movies. Each movie has a **crew** associated with it and that crew is comprised of **jobs**, such as "producer," "director," "writer," along with the names of the individuals. Each movie also has a list of award nominations and wins. An example of how this information is organized is shown below: +### Movie JSON Data +Our movie data set has a series of columns that contain different types of details about movies. Each movie has a **crew** associated with it and that crew is comprised of **jobs**, such as **producer**, **director**,**writer**, along with the names of the individuals. Each movie also has a list of award nominations and wins. An example of how this information is organized is shown below: ![JSON example](images/adb-json-movie.png " ") -You can see that JSON data is organized very differently than typical warehouse data. There is a single entry for "producer" but the corresponding key "names" actually has multiple values. This is referred to as an **array** - specifically a JSON array. +JSON data is organized very differently than typical warehouse data. There is a single entry for **producer** but the corresponding key **names** actually has multiple values. This is referred to as an **array** - specifically a JSON array. -1. Navigate to the Database Actions' SQL Worksheet: - - Go to **Database Actions -> SQL** from the Autonomous Database OCI console: - ![Go to DB Actions](images/adb-dbactions-goto-sql.png "Go to DB Actions") +>**Note:** +If you already have the **Oracle Database Actions** browser tab open from the previous lab, click the **Database Actions | Launchpad** banner to display the **Database Actions | Launchpad** Home page. In the **Development** section, click the **SQL** card to display the SQL Worksheet. Next, skip to **step 6**; otherwise, start with **step 1** below. -2. Use the Autonomous Database ``DBMS_CLOUD.COPY_COLLECTION`` procedure to create and load the movie collection from object storage. Copy and paste the following PL/SQL into the SQL worksheet and click run: +![Click the banner.](./images/click-banner.png " ") + +1. Log in to the **Oracle Cloud Console**, if you are not already logged as the Cloud Administrator. + +2. Open the **Navigation** menu and click **Oracle Database**. Under **Oracle Database**, click **Autonomous Database**. On the **Autonomous Databases** page, click your ADB instance name. + +3. On the **Autonomous Database details** page, click the **Database actions** drop-down list, and then click **SQL**. + +4. The SQL Worksheet is displayed. + + ![The SQL worksheet is displayed.](./images/sql-worksheet-displayed.png " ") + +5. Use the Autonomous Database ``DBMS_CLOUD.COPY_COLLECTION`` procedure to create and load the movie collection from object storage. Copy and paste the following script into your SQL Worksheet, and then click the **Run Script (F5)** icon in the Worksheet toolbar. ``` -- create and load movie json collection from a public bucket on object storage + begin dbms_cloud.copy_collection ( collection_name => 'MOVIE_COLLECTION', @@ -38,17 +49,17 @@ You can see that JSON data is organized very differently than typical warehouse ![Create JSON movie collection](images/adb-create-json-collection.png) - This single step creates a table called `MOVIE_COLLECTION` and populates it with JSON documents. You can access this table thru SQL, Oracle Database API for MongoDB, SODA REST and more. + This single step creates a table called **`MOVIE_COLLECTION`** and populates it with JSON documents. You can access this table thru SQL, Oracle Database API for MongoDB, SODA REST, and more. + + > **Note:** There is extra metadata captured for SODA collections that is not removed by dropping the table directly using SQL ``drop table``. To properly drop a collection, use PL/SQL function [`DMBS_SODA.DROP_COLLECTION`](https://docs.oracle.com/en/database/oracle/oracle-database/18/adsdp/using-soda-pl-sql.html#GUID-D29C4FFF-D093-4C1B-889A-5C29B63756C6). -> **Note:** There is extra metadata captured for SODA collections that is not removed by dropping the table directly using SQL ``drop table``. To properly drop a collection, use PL/SQL function [`DMBS_SODA.DROP_COLLECTION`](https://docs.oracle.com/en/database/oracle/oracle-database/18/adsdp/using-soda-pl-sql.html#GUID-D29C4FFF-D093-4C1B-889A-5C29B63756C6). +6. Let's take a look at the documents. The documents are stored in a highly optimized binary format. Use the `JSON_SERIALIZE` function to view the JSON text. Copy and paste the following SQL code into the worksheet, and then click the **Run Statement** icon in the Worksheet toolbar. -3. Let's take a look at the documents. The documents are stored in a highly optimized binary format. Use the `JSON_SERIALIZE` function to view the JSON text. Copy and paste the following SQL into the worksheet and click **Run**: ``` select json_serialize(json_document) as json from movie_collection - where rownum < 10 - ; + where rownum < 10; ``` diff --git a/building-blocks/tasks/adb/goto-data-load-utility.md b/building-blocks/tasks/adb/goto-data-load-utility.md index db7415c7..b7a60ab0 100644 --- a/building-blocks/tasks/adb/goto-data-load-utility.md +++ b/building-blocks/tasks/adb/goto-data-load-utility.md @@ -5,16 +5,16 @@ } --> -Navigate to the Data Load utility of Database Actions. +1. Navigate to the **Autonomous Database details** page of the Autonomous Database instance that you provisioned earlier. Click the **Database actions** drop-down list, and then select **View all database actions**. -1. Go to the Details page of the Autonomous Database you provisioned. Click **Database Actions** and select **View all database actions** to go to the suite of Autonomous Database tools. + ![Click view all database actions.](./images/click-all-database-actions.png =70%x*) - ![Details page of your Autonomous Database](images/service-details.png " ") +2. The **Database Actions | Launchpad** Home page is displayed in a _**new tab**_ in your browser. In the **Data Studio** section, click the **DATA LOAD** card. -2. Logging into Database Actions from the OCI service console expects you to be the ADMIN user. Log in as ADMIN if you are not automatically logged into Database Actions. Enter the administrator **Password** you specified when creating the database. Click **Sign in**. + ![Click the Data Load card.](./images/click-data-load.png " ") - ![Enter the admin password.](./images/admin-username-and-password.png " ") + The **Data Load** page is displayed. -3. On the Database Actions Launchpad page, under **Data Studio**, click **DATA LOAD**. + >**Note:** Logging into **Database Actions** from the OCI Service Console expects you to be the `ADMIN` user. Log in as `ADMIN` if you are not automatically logged into **Database Actions**. Enter the administrator **Password** that you specified when you created the database, and then click **Sign in**. - ![Click DATA LOAD](images/dataload.png) + ![Enter the admin password.](./images/admin-username-and-password.png " ") \ No newline at end of file diff --git a/building-blocks/tasks/adb/goto-service-body.md b/building-blocks/tasks/adb/goto-service-body.md index 74644cce..b49cfe4c 100644 --- a/building-blocks/tasks/adb/goto-service-body.md +++ b/building-blocks/tasks/adb/goto-service-body.md @@ -4,11 +4,11 @@ "description":"Navigate to ADB using the OCI menu. AUTHORS: For expediency, this task uses the ADMIN user/password to open Database Actions. In your workshop, you might want to substitute a different user/password to open Database Actions." } --> -1. In the Oracle Cloud console, open the **navigation menu**, navigate to **Oracle Database**, and then select **Autonomous Data Warehouse**. +1. Open the **Navigation** menu. Under **Oracle Database**, click **Autonomous Data Warehouse**. ![Click Autonomous Database (ATP or ADW).](images/oci-navigation-adb.png " ") -2. You can use the List Scope fields on the left to control the list of Autonomous Databases that are displayed. This is useful when you are managing many Autonomous Databases: +2. You can use the **List scope** and **Filters** sections on the left to control the list of Autonomous Databases that are displayed. This is useful when you are managing many Autonomous Databases. ![Database list.](images/oci-adb-list.png " ") @@ -18,7 +18,7 @@ - > **Note:** Avoid the use of the `ManagedCompartmentforPaaS` compartment as this is an Oracle default used for Oracle Platform Services. + > **Note:** Avoid the use of the `ManagedCompartmentforPaaS` compartment as this is an Oracle default used for Oracle Platform Services. diff --git a/building-blocks/tasks/adb/goto-sql-worksheet.md b/building-blocks/tasks/adb/goto-sql-worksheet.md index 33b5d5e2..24602ea7 100644 --- a/building-blocks/tasks/adb/goto-sql-worksheet.md +++ b/building-blocks/tasks/adb/goto-sql-worksheet.md @@ -4,10 +4,25 @@ "description":"Navigate to SQL Worksheet from the OCI service console. " } --> -1. Navigate to the SQL worksheet. From the Autonomous Database service console, select **Database Actions -> SQL**: - ![Go to Database Actions](images/adb-dbactions-goto-sql.png) +Although you can connect to your Oracle Autonomous Database using desktop tools such as Oracle SQL Developer, you can conveniently access the browser-based SQL Worksheet directly from your Autonomous Database Console. -2. You will be presented with the SQL worksheet tour the first time the current database user accesses the worksheet. Dismiss the tour by clicking the X button: +1. Log in to the **Oracle Cloud Console**, if you are not already logged as the Cloud Administrator, **`ADMIN`**. - ![SQL worksheet tour](images/adb-sql-worksheet-opening-tour.png) \ No newline at end of file +2. Open the **Navigation** menu and click **Oracle Database**. Under **Oracle Database**, click **Autonomous Database**. + +3. On the **Autonomous Databases** page, select your own compartment and region, and then click your ADB instance name, **`MyQuickStart`** in our example. + + ![The Autonomous Database is displayed and highlighted.](./images/adb-instances.png " ") + +4. On the **Autonomous Database details** page, click the **Database actions** drop-down list, and then click **SQL**. + + ![From the Database Actions drop-down list, click SQL.](./images/click-db-actions-sql.png " ") + + The SQL Worksheet is displayed. A **Logged in as ADMIN user** warning box is displayed, close this box. The first time you access the SQL Worksheet, a series of pop-up informational boxes may appear, providing you a tour that introduces the main features. If not, click the Tour button (labeled with binoculars symbol) in the upper right corner. Click **Next** to take a tour through the informational boxes. + + ![An information box is displayed.](./images/information-box.png " ") + + In this example, close the **Data Loading** box. + + ![The SQL Worksheet is displayed.](./images/sql-worksheet.png " ") \ No newline at end of file diff --git a/building-blocks/tasks/adb/images/adb-click-create-adb.png b/building-blocks/tasks/adb/images/adb-click-create-adb.png index c38d384f..8ca93819 100644 Binary files a/building-blocks/tasks/adb/images/adb-click-create-adb.png and b/building-blocks/tasks/adb/images/adb-click-create-adb.png differ diff --git a/building-blocks/tasks/adb/images/adb-create-complete-message.png b/building-blocks/tasks/adb/images/adb-create-complete-message.png index 32072e84..6153cc29 100644 Binary files a/building-blocks/tasks/adb/images/adb-create-complete-message.png and b/building-blocks/tasks/adb/images/adb-create-complete-message.png differ diff --git a/building-blocks/tasks/adb/images/adb-create-json-collection.png b/building-blocks/tasks/adb/images/adb-create-json-collection.png index 02e25931..bae2ce10 100644 Binary files a/building-blocks/tasks/adb/images/adb-create-json-collection.png and b/building-blocks/tasks/adb/images/adb-create-json-collection.png differ diff --git a/building-blocks/tasks/adb/images/adb-create-provisioning-message.png b/building-blocks/tasks/adb/images/adb-create-provisioning-message.png index 4759cac8..11739525 100644 Binary files a/building-blocks/tasks/adb/images/adb-create-provisioning-message.png and b/building-blocks/tasks/adb/images/adb-create-provisioning-message.png differ diff --git a/building-blocks/tasks/adb/images/adb-create-screen-choose-network.png b/building-blocks/tasks/adb/images/adb-create-screen-choose-network.png index 70c7a09f..9850f6ca 100644 Binary files a/building-blocks/tasks/adb/images/adb-create-screen-choose-network.png and b/building-blocks/tasks/adb/images/adb-create-screen-choose-network.png differ diff --git a/building-blocks/tasks/adb/images/adb-create-screen-configure-db.png b/building-blocks/tasks/adb/images/adb-create-screen-configure-db.png index b18d9fb0..d6a56a5b 100644 Binary files a/building-blocks/tasks/adb/images/adb-create-screen-configure-db.png and b/building-blocks/tasks/adb/images/adb-create-screen-configure-db.png differ diff --git a/building-blocks/tasks/adb/images/adb-create-screen-contact-email.png b/building-blocks/tasks/adb/images/adb-create-screen-contact-email.png index 4bfdcaba..9b3b600d 100644 Binary files a/building-blocks/tasks/adb/images/adb-create-screen-contact-email.png and b/building-blocks/tasks/adb/images/adb-create-screen-contact-email.png differ diff --git a/building-blocks/tasks/adb/images/adb-create-screen-deployment-type.png b/building-blocks/tasks/adb/images/adb-create-screen-deployment-type.png index 396e5f08..2fd99dd5 100644 Binary files a/building-blocks/tasks/adb/images/adb-create-screen-deployment-type.png and b/building-blocks/tasks/adb/images/adb-create-screen-deployment-type.png differ diff --git a/building-blocks/tasks/adb/images/adb-create-screen-names.png b/building-blocks/tasks/adb/images/adb-create-screen-names.png index 6cc62c91..f0c8ba68 100644 Binary files a/building-blocks/tasks/adb/images/adb-create-screen-names.png and b/building-blocks/tasks/adb/images/adb-create-screen-names.png differ diff --git a/building-blocks/tasks/adb/images/adb-create-screen-password.png b/building-blocks/tasks/adb/images/adb-create-screen-password.png index d0507f21..5934d6a0 100644 Binary files a/building-blocks/tasks/adb/images/adb-create-screen-password.png and b/building-blocks/tasks/adb/images/adb-create-screen-password.png differ diff --git a/building-blocks/tasks/adb/images/adb-create-screen-workload.png b/building-blocks/tasks/adb/images/adb-create-screen-workload.png index c62ce7c7..9a6f1fb1 100644 Binary files a/building-blocks/tasks/adb/images/adb-create-screen-workload.png and b/building-blocks/tasks/adb/images/adb-create-screen-workload.png differ diff --git a/building-blocks/tasks/adb/images/adb-instance-displayed.png b/building-blocks/tasks/adb/images/adb-instance-displayed.png new file mode 100644 index 00000000..2f0174c3 Binary files /dev/null and b/building-blocks/tasks/adb/images/adb-instance-displayed.png differ diff --git a/building-blocks/tasks/adb/images/adb-instances.png b/building-blocks/tasks/adb/images/adb-instances.png new file mode 100644 index 00000000..9979d4f1 Binary files /dev/null and b/building-blocks/tasks/adb/images/adb-instances.png differ diff --git a/building-blocks/tasks/adb/images/adb-json-cast-member-array.png b/building-blocks/tasks/adb/images/adb-json-cast-member-array.png index 42da3a36..2e134726 100644 Binary files a/building-blocks/tasks/adb/images/adb-json-cast-member-array.png and b/building-blocks/tasks/adb/images/adb-json-cast-member-array.png differ diff --git a/building-blocks/tasks/adb/images/adb-json-top-actors.png b/building-blocks/tasks/adb/images/adb-json-top-actors.png index 0649c40a..ee4db029 100644 Binary files a/building-blocks/tasks/adb/images/adb-json-top-actors.png and b/building-blocks/tasks/adb/images/adb-json-top-actors.png differ diff --git a/building-blocks/tasks/adb/images/adb-query-json-meryl-streep.png b/building-blocks/tasks/adb/images/adb-query-json-meryl-streep.png index e0c89092..56e61e10 100644 Binary files a/building-blocks/tasks/adb/images/adb-query-json-meryl-streep.png and b/building-blocks/tasks/adb/images/adb-query-json-meryl-streep.png differ diff --git a/building-blocks/tasks/adb/images/adb-query-json-table-cast.png b/building-blocks/tasks/adb/images/adb-query-json-table-cast.png index 11152012..808f45f7 100644 Binary files a/building-blocks/tasks/adb/images/adb-query-json-table-cast.png and b/building-blocks/tasks/adb/images/adb-query-json-table-cast.png differ diff --git a/building-blocks/tasks/adb/images/adb-query-top-grossing-movies.png b/building-blocks/tasks/adb/images/adb-query-top-grossing-movies.png index 7a06b439..7f6c30a4 100644 Binary files a/building-blocks/tasks/adb/images/adb-query-top-grossing-movies.png and b/building-blocks/tasks/adb/images/adb-query-top-grossing-movies.png differ diff --git a/building-blocks/tasks/adb/images/adb-simple-query-json.png b/building-blocks/tasks/adb/images/adb-simple-query-json.png index 05dbc090..a8dc3d4f 100644 Binary files a/building-blocks/tasks/adb/images/adb-simple-query-json.png and b/building-blocks/tasks/adb/images/adb-simple-query-json.png differ diff --git a/building-blocks/tasks/adb/images/bucket-details.png b/building-blocks/tasks/adb/images/bucket-details.png new file mode 100644 index 00000000..4a04b711 Binary files /dev/null and b/building-blocks/tasks/adb/images/bucket-details.png differ diff --git a/building-blocks/tasks/adb/images/bucket-folders-displayed.png b/building-blocks/tasks/adb/images/bucket-folders-displayed.png new file mode 100644 index 00000000..9e96075a Binary files /dev/null and b/building-blocks/tasks/adb/images/bucket-folders-displayed.png differ diff --git a/building-blocks/tasks/adb/images/change-target-table-name.png b/building-blocks/tasks/adb/images/change-target-table-name.png new file mode 100644 index 00000000..747b1f79 Binary files /dev/null and b/building-blocks/tasks/adb/images/change-target-table-name.png differ diff --git a/building-blocks/tasks/adb/images/choose-backup-retention.png b/building-blocks/tasks/adb/images/choose-backup-retention.png new file mode 100644 index 00000000..a58da7bc Binary files /dev/null and b/building-blocks/tasks/adb/images/choose-backup-retention.png differ diff --git a/building-blocks/tasks/adb/images/choose-license.png b/building-blocks/tasks/adb/images/choose-license.png new file mode 100644 index 00000000..fdfde085 Binary files /dev/null and b/building-blocks/tasks/adb/images/choose-license.png differ diff --git a/building-blocks/tasks/adb/images/click-all-database-actions.png b/building-blocks/tasks/adb/images/click-all-database-actions.png new file mode 100644 index 00000000..19a6135e Binary files /dev/null and b/building-blocks/tasks/adb/images/click-all-database-actions.png differ diff --git a/building-blocks/tasks/adb/images/click-banner.png b/building-blocks/tasks/adb/images/click-banner.png new file mode 100644 index 00000000..cce03a2d Binary files /dev/null and b/building-blocks/tasks/adb/images/click-banner.png differ diff --git a/building-blocks/tasks/adb/images/click-create-adb.png b/building-blocks/tasks/adb/images/click-create-adb.png new file mode 100644 index 00000000..5c8fa816 Binary files /dev/null and b/building-blocks/tasks/adb/images/click-create-adb.png differ diff --git a/building-blocks/tasks/adb/images/click-customer-contact-settings.png b/building-blocks/tasks/adb/images/click-customer-contact-settings.png new file mode 100644 index 00000000..d53d8534 Binary files /dev/null and b/building-blocks/tasks/adb/images/click-customer-contact-settings.png differ diff --git a/building-blocks/tasks/adb/images/click-data-load.png b/building-blocks/tasks/adb/images/click-data-load.png new file mode 100644 index 00000000..6e3f96e2 Binary files /dev/null and b/building-blocks/tasks/adb/images/click-data-load.png differ diff --git a/building-blocks/tasks/adb/images/click-db-actions-sql.png b/building-blocks/tasks/adb/images/click-db-actions-sql.png new file mode 100644 index 00000000..18f2dfe0 Binary files /dev/null and b/building-blocks/tasks/adb/images/click-db-actions-sql.png differ diff --git a/building-blocks/tasks/adb/images/click-db-actions.png b/building-blocks/tasks/adb/images/click-db-actions.png new file mode 100644 index 00000000..320bd509 Binary files /dev/null and b/building-blocks/tasks/adb/images/click-db-actions.png differ diff --git a/building-blocks/tasks/adb/images/click-load-data.png b/building-blocks/tasks/adb/images/click-load-data.png new file mode 100644 index 00000000..0bd99212 Binary files /dev/null and b/building-blocks/tasks/adb/images/click-load-data.png differ diff --git a/building-blocks/tasks/adb/images/create-json-view.png b/building-blocks/tasks/adb/images/create-json-view.png new file mode 100644 index 00000000..cbf7b514 Binary files /dev/null and b/building-blocks/tasks/adb/images/create-json-view.png differ diff --git a/building-blocks/tasks/adb/images/customer-contact-settings.png b/building-blocks/tasks/adb/images/customer-contact-settings.png new file mode 100644 index 00000000..658bdfa5 Binary files /dev/null and b/building-blocks/tasks/adb/images/customer-contact-settings.png differ diff --git a/building-blocks/tasks/adb/images/customer_contact-target-table.png b/building-blocks/tasks/adb/images/customer_contact-target-table.png new file mode 100644 index 00000000..37250018 Binary files /dev/null and b/building-blocks/tasks/adb/images/customer_contact-target-table.png differ diff --git a/building-blocks/tasks/adb/images/data-load-page-redisplayed.png b/building-blocks/tasks/adb/images/data-load-page-redisplayed.png new file mode 100644 index 00000000..60a9f22a Binary files /dev/null and b/building-blocks/tasks/adb/images/data-load-page-redisplayed.png differ diff --git a/building-blocks/tasks/adb/images/data-load-page.png b/building-blocks/tasks/adb/images/data-load-page.png new file mode 100644 index 00000000..64867cad Binary files /dev/null and b/building-blocks/tasks/adb/images/data-load-page.png differ diff --git a/building-blocks/tasks/adb/images/drag-drop-3-folders.png b/building-blocks/tasks/adb/images/drag-drop-3-folders.png new file mode 100644 index 00000000..a062a417 Binary files /dev/null and b/building-blocks/tasks/adb/images/drag-drop-3-folders.png differ diff --git a/building-blocks/tasks/adb/images/drag-drop-customer-contact.png b/building-blocks/tasks/adb/images/drag-drop-customer-contact.png new file mode 100644 index 00000000..279db45e Binary files /dev/null and b/building-blocks/tasks/adb/images/drag-drop-customer-contact.png differ diff --git a/building-blocks/tasks/adb/images/execute-script-in-sql-worksheet-to-create-view.png b/building-blocks/tasks/adb/images/execute-script-in-sql-worksheet-to-create-view.png new file mode 100644 index 00000000..f150f29b Binary files /dev/null and b/building-blocks/tasks/adb/images/execute-script-in-sql-worksheet-to-create-view.png differ diff --git a/building-blocks/tasks/adb/images/genre-cast.png b/building-blocks/tasks/adb/images/genre-cast.png new file mode 100644 index 00000000..87091c59 Binary files /dev/null and b/building-blocks/tasks/adb/images/genre-cast.png differ diff --git a/building-blocks/tasks/adb/images/information-box.png b/building-blocks/tasks/adb/images/information-box.png new file mode 100644 index 00000000..6650d019 Binary files /dev/null and b/building-blocks/tasks/adb/images/information-box.png differ diff --git a/building-blocks/tasks/adb/images/load-completed.png b/building-blocks/tasks/adb/images/load-completed.png new file mode 100644 index 00000000..46216c1c Binary files /dev/null and b/building-blocks/tasks/adb/images/load-completed.png differ diff --git a/building-blocks/tasks/adb/images/load-data-page.png b/building-blocks/tasks/adb/images/load-data-page.png new file mode 100644 index 00000000..b776e4ae Binary files /dev/null and b/building-blocks/tasks/adb/images/load-data-page.png differ diff --git a/building-blocks/tasks/adb/images/load-to-single-table.png b/building-blocks/tasks/adb/images/load-to-single-table.png new file mode 100644 index 00000000..7b6df19b Binary files /dev/null and b/building-blocks/tasks/adb/images/load-to-single-table.png differ diff --git a/building-blocks/tasks/adb/images/oci-adb-list.png b/building-blocks/tasks/adb/images/oci-adb-list.png index b9968135..e7b2809a 100644 Binary files a/building-blocks/tasks/adb/images/oci-adb-list.png and b/building-blocks/tasks/adb/images/oci-adb-list.png differ diff --git a/building-blocks/tasks/adb/images/oci-navigation-adb.png b/building-blocks/tasks/adb/images/oci-navigation-adb.png index 590d6303..2c78ba40 100644 Binary files a/building-blocks/tasks/adb/images/oci-navigation-adb.png and b/building-blocks/tasks/adb/images/oci-navigation-adb.png differ diff --git a/building-blocks/tasks/adb/images/oci-region-list.png b/building-blocks/tasks/adb/images/oci-region-list.png index b462e8a2..48f2e35f 100644 Binary files a/building-blocks/tasks/adb/images/oci-region-list.png and b/building-blocks/tasks/adb/images/oci-region-list.png differ diff --git a/building-blocks/tasks/adb/images/preview-genre-table.png b/building-blocks/tasks/adb/images/preview-genre-table.png new file mode 100644 index 00000000..56f4d580 Binary files /dev/null and b/building-blocks/tasks/adb/images/preview-genre-table.png differ diff --git a/building-blocks/tasks/adb/images/public-bucket-url.png b/building-blocks/tasks/adb/images/public-bucket-url.png new file mode 100644 index 00000000..fd846285 Binary files /dev/null and b/building-blocks/tasks/adb/images/public-bucket-url.png differ diff --git a/building-blocks/tasks/adb/images/query-view.png b/building-blocks/tasks/adb/images/query-view.png new file mode 100644 index 00000000..0d4a1054 Binary files /dev/null and b/building-blocks/tasks/adb/images/query-view.png differ diff --git a/building-blocks/tasks/adb/images/run-data-link.png b/building-blocks/tasks/adb/images/run-data-link.png new file mode 100644 index 00000000..5ecc2ef7 Binary files /dev/null and b/building-blocks/tasks/adb/images/run-data-link.png differ diff --git a/building-blocks/tasks/adb/images/sales-sample-preview.png b/building-blocks/tasks/adb/images/sales-sample-preview.png new file mode 100644 index 00000000..a268b8d7 Binary files /dev/null and b/building-blocks/tasks/adb/images/sales-sample-preview.png differ diff --git a/building-blocks/tasks/adb/images/sql-worksheet-displayed.png b/building-blocks/tasks/adb/images/sql-worksheet-displayed.png new file mode 100644 index 00000000..e1b6c55d Binary files /dev/null and b/building-blocks/tasks/adb/images/sql-worksheet-displayed.png differ diff --git a/building-blocks/tasks/adb/images/sql-worksheet.png b/building-blocks/tasks/adb/images/sql-worksheet.png new file mode 100644 index 00000000..22937580 Binary files /dev/null and b/building-blocks/tasks/adb/images/sql-worksheet.png differ diff --git a/building-blocks/tasks/adb/load-public-db-actions.md b/building-blocks/tasks/adb/load-public-db-actions.md index d8d61ae4..e7d25077 100644 --- a/building-blocks/tasks/adb/load-public-db-actions.md +++ b/building-blocks/tasks/adb/load-public-db-actions.md @@ -4,11 +4,16 @@ "description":"Uses Database Actions to load data from public object storage buckets. It loads the following tables:
  • customer_contact
  • sales_sample
  • genre
  • pizza location
" } --> -1. Under **What do you want to do with your data?** select **LOAD DATA**, and under **Where is your data?** select **CLOUD STORE**, then click **Next** - ![Select Load Data, then Cloud Store](images/select-load-data-from-cloud-store.png) +1. On the **Data Load** page, click the **LOAD DATA** card. -2. The **Load Data from Cloud Store** page appears. Copy the following object storage URL for the source data to the empty text field: + ![Click Link Data.](images/click-load-data.png) + +2. On the **Load Data** page, click the **Cloud Store** tab. + + ![Select Link Data and Cloud Store.](images/load-data-page.png) + +3. Copy the following object storage URL and paste it in the **Select Cloud Store Location or enter public URL** field. The **moviestream\_landing** Oracle Object Storage bucket that contains the data is located in a different tenancy than yours, **c4u04**; therefore, you will use the following URL. ``` @@ -16,45 +21,66 @@ ``` - ![Enter URL](images/cloud-location-url.png) + ![Enter public bucket URL.](images/public-bucket-url.png) + +4. A list of the folders in the selected Object Storage bucket is displayed on left side section of the page. You can drag and drop the desired folders from this public bucket from this section to the data loading job section on the right. + + ![The Load Cloud Object page appears](images/bucket-folders-displayed.png) + +5. Drag the **customer\_contact** folder and drop it onto the data loading job section. + + ![Drag the customer_contact folder](images/drag-drop-customer-contact.png) + +6. A **Load to Single Target Table** dialog box is displayed to prompt you whether or not you want to link all objects in this folder matching **.csv** to a single target table. This folder contains a single file, `customer-contact.csv`. In general, data lake folders contain many files of the same type, as you will see with sales data. Click **Yes**. + + ![Click yes to load objects to a single table.](images/load-to-single-table.png) + + The **customer\_contact** target table to be created for the selected `.csv` file is displayed in the data loading job section. + + ![The customer_contact target table is displayed.](images/customer_contact-target-table.png) + +7. Drag and drop the **genre**, **sales\_sample**, and **pizza\_location** folders onto the data linking job section. Click **Yes** when prompted for each target table. + + ![Drag and drop three more folders.](images/drag-drop-3-folders.png) - Click ENTER on your keyboard. This will take you to the data loading tool. You will see a list of folders on the left side from which you can drag and drop to the data loading job. +8. Click the **Settings** icon (pencil) for the **customer\_contact** link task to view its settings. - ![The Load Cloud Object page appears](images/load-cloud-object-page-appears.png) + ![Click the pencil icon to open settings viewer for customer_contact load task](images/click-customer-contact-settings.png) -3. You will select multiple folders. First, drag the **customer\_contact** folder over to the right hand pane. Note that a dialog box appears asking if you want to load all the files in this folder to a single target table. In this case, the folder has only a single file, `customer-contact.csv`. Frequently, data lake folders contain many files of the same type, as you will see with sales data. Click **Yes**. + The **Load Data from Cloud Store Location customer_contact** settings panel is displayed. - ![Drag the customer_contact folder](images/drag-customer-contact-folder.png) +9. The **Database Actions** link job will create a **CUSTOMER_CONTACT** table with the listed columns and data types that are based on the selected *.csv file. Review the information and the loading options. In the **Mapping** section, notice that you can change the target column names, data types, and length/precision. Click **Close** to close the settings viewer panel. -4. Perform the same drag and drop steps for **genre**, **sales\_sample** and **pizza\_location**. + ![View the settings for customer_contact load task](images/customer-contact-settings.png) +10. Click the **Settings** icon (pencil) for the **sales\_sample** load task to view its settings. -5. Click the 3-dot ellipsis menu for the **customer\_contact** load task. In the pop-up menu, click **Settings** to view the settings for this task. + ![View the sales-sample load task settings.](images/sales-sample-preview.png) - ![Click the pencil icon to open settings viewer for customer_contact load task](images/cc-viewsettings.png) +11. The Load tool makes intelligent choices for the target table name and properties. Since this is an initial load, accept the default option of **Create Table**, which conveniently creates the target table in the Autonomous Database instance, without the need to predefine the table in SQL. Change the name of the target table to be created from **SALES_SAMPLE** to **CUSTSALES**. Next, click **Close**. -6. In the settings viewer, you can see that Database Actions will create a **CUSTOMER_CONTACT** table with the list of columns and data types that will be created from the csv file. Take a moment to examine the preview information and loading options. In the Mapping section, notice that you can change the target column names and data types. They all look correct, so click **Close** to close the settings viewer. + ![Update table name](images/change-target-table-name.png) - ![View the settings for customer_contact load task](images/settings-viewer-for-customer-contact.png) +12. Click **Start** to run the data link job. In the **Start Link From Cloud Store** dialog box, click **Run**. -7. New view the settings for **sales\_sample** task to view its settings. Note that the tool makes intelligent choices for target table name and properties. Since this is an initial load, accept the default option of **Create Table**, which conveniently creates the target table in the Autonomous Database, without the need to predefine the table in SQL. In this case, update the name of the table to be created, to **CUSTSALES**. + ![Run the data load job](images/run-data-link.png) - ![Update table name](images/adb-load-data-table-name.png) + > **Note:** The load job can take about 2 minutes to complete. - Click **Close** +13. After the load job is completed, make sure that all of the data load cards have green check marks next to them. This indicates that your data load tasks have completed successfully. -8. Now click the **Start** button to run the data load job. In the **Run Data Load Job** dialog box, click **Run**. + ![Load job tasks completed. View the genre load task settings.](images/load-completed.png) - ![Run the data load job](images/rundataload.png) +14. Click the **Settings** icon (pencil) for the **genre** load task to view its settings. - The job should take about 2 minutes to run. +15. Review some of the linked data. Click the **Table** tab to view the **genre** data. -9. Check that all of the data load cards have green tick marks in them, indicating that the data load tasks have completed successfully. Click the 3-dot ellipsis menu and **Settings** button for the **genre** task: + ![View genre data](images/preview-genre-table.png) - ![Check the job is completed](images/loadcompleted.png) +16. Click **Close** to exit the **genre** task preview. -10. Let's do a quick review of the loaded data. Click the **Table** tab to view the **genre** data: + ![Click Done.](images/data-load-page.png) - ![View genre data](images/adb-dataload-genre-table.png) +17. Click **Done** to exit the **Link Data** page and return to the **Data Load** page. - The data looks good! Click **Close** to exit the **genre** task and then click **Done** to exit the DATA LOAD tool and return to the Database Actions Launchpad. + ![Data Load page.](images/data-load-page-redisplayed.png) \ No newline at end of file diff --git a/building-blocks/tasks/adb/provision-body.md b/building-blocks/tasks/adb/provision-body.md index e25aab8f..1d257ca4 100644 --- a/building-blocks/tasks/adb/provision-body.md +++ b/building-blocks/tasks/adb/provision-body.md @@ -4,97 +4,110 @@ "description":"Provision an ADB. Use the `variables.json` file to update provisioning parameters, including database name, ECPUs, storage and more." } --> -1. Click **Create Autonomous Database** to start the instance creation process. +1. Click **Create Autonomous Database** to start the instance creation process. The **Create Autonomous Database** page is displayed. - ![Click Create Autonomous Database.](images/adb-click-create-adb.png "Create ADB") + ![Click Create Autonomous Database.](images/adb-click-create-adb.png " ") -2. This brings up the **Create Autonomous Database** screen. Provide basic information for the Autonomous Database: +2. In the **Provide basic information for the Autonomous Database** section, specify the following: - - **Choose a compartment** - Select the compartment you just created. - - **Display Name** - Enter a memorable name for the database for display purposes. For this lab, use **[](var:db_display_name)**. - - **Database Name** - Use letters and numbers only, starting with a letter. Maximum length is 14 characters. (Underscores not supported.) For this lab, use **[](var:db_name)**. + - **Compartment**: Select the compartment you just created. + - **Display name**: Enter a memorable name for the database for display purposes. For this lab, use **[](var:db_display_name)**. + - **Database Name**: Use letters and numbers only, starting with a letter. Maximum length is 14 characters. (Underscores not supported.) For this lab, use **[](var:db_name)**. - ![Enter the required details.](./images/adb-create-screen-names.png " ") + ![Enter the required details.](./images/adb-create-screen-names.png =70%x*) -> **Note:** Ensure you use suggested database names as instructed, and not those shown in screenshots. + >**Note:** Ensure that you use the suggested database names as instructed in this step, and not those shown in the screenshots. - - **Choose a compartment** - Use the default compartment created for you. + - **Compartment** - Use the default compartment created for you. - **Display Name** - Enter a memorable name for the database for display purposes. For this lab, use **[](var:db_display_name)**. - **Database Name** - Use letters and numbers only, starting with a letter. Maximum length is 14 characters. (Underscores not supported.) For this lab, use **[](var:db_name_livelabs)**, for example, **[](var:db_name_livelabs_example)**. ![Enter the required details.](./images/adb-create-screen-names.png " ") -> **Note:** Ensure you use suggested database names as instructed, and not those shown in screenshots. +> **Note:** Ensure that you use the suggested database names as instructed in this step, and not those shown in the screenshots. -3. Choose a workload type. Select the workload type for your database from the choices: - - - **Data Warehouse** - designed to support all standard SQL and business intelligence (BI) tools, and provides all of the performance of the market-leading Oracle Database in an environment that is tuned and optimized for data warehouse workloads - - **Transaction Processing** - provides all of the performance of the market-leading Oracle Database in an environment that is tuned and optimized to meet the demands of a variety of applications, including: mission-critical transaction processing, mixed transactions and analytics, IoT, and JSON document store - - **JSON Database** - is Oracle Autonomous Transaction Processing, but designed for developing NoSQL-style applications that use JavaScript Object Notation (JSON) documents. You can store up to 20 GB of data other than JSON document collections. There is no storage limit for JSON collections. - - **APEX** - is a low cost, Oracle Cloud service offering convenient access to the Oracle APEX platform for rapidly building and deploying low-code applications +3. In the **Choose a workload type** section, choose a workload type. Select the workload type for your database from the following choices: - For this workshop, choose **Data Warehouse**. + - **Data Warehouse**: Designed to support all standard SQL and business intelligence (BI) tools, and provides all of the performance of the market-leading Oracle Database in an environment that is tuned and optimized for data warehouse workloads + - **Transaction Processing**: Provides all of the performance of the market-leading Oracle Database in an environment that is tuned and optimized to meet the demands of a variety of applications, including: mission-critical transaction processing, mixed transactions and analytics, IoT, and JSON document store + - **JSON Database**: It is Oracle Autonomous Transaction Processing, but designed for developing NoSQL-style applications that use JavaScript Object Notation (JSON) documents. You can store up to 20 GB of data other than JSON document collections. There is no storage limit for JSON collections. + - **APEX**: It is a low cost, Oracle Cloud service offering convenient access to the Oracle APEX platform for rapidly building and deploying low-code applications - ![Choose a workload type.](images/adb-create-screen-workload.png "Workload type") + For this workshop, accept the **Data Warehouse** default selection. -4. Choose a deployment type. Select the deployment type for your database from the choices: + ![Choose a workload type.](images/adb-create-screen-workload.png =70%x*) - - **Serverless** - For this lab, choose **Serverless** as the deployment type. - - **Dedicated Infrastructure** +4. In the **Choose a deployment type** section, accept the **Serverless** default selection. - ![Choose a deployment type.](images/adb-create-screen-deployment-type.png "Deployment type") + ![Choose a deployment type.](images/adb-create-screen-deployment-type.png =70%x*) -5. Configure the database: +5. In the **Configure the database** section, accept the default selections as follows: - **Always Free** - An Always Free database is especially useful for development and trying new features. You can deploy an Always Free instance in an Always Free account or paid account. The only option you specify in an Always Free database is the database version. For this lab, we recommend you leave **Always Free** unchecked unless you are in an Always Free account. - **Choose database version** - Select **19c** as the database version. - **ECPU count** - Number of ECPUs for your service. For this lab, specify **[](var:db_ocpu)**. If you choose an Always Free database, you do not need to specify this option. - **Storage (TB)** - Select your storage capacity in terabytes. For this lab, specify **[](var:db_storage)** of storage. Or, if you choose an Always Free database, it comes with 20 GB of storage. - - **Compute auto scaling** - For this lab, keep auto scaling enabled, to enable the system to automatically use up to three times more compute and IO resources to meet workload demand. + - **Compute auto scaling** - For this lab, keep auto scaling enabled, to enable the system to automatically use up to three times more compute and IO resources to meet workload demand. - **Storage auto scaling** - For this lab, there is no need to enable storage auto scaling, which would allow the system to expand up to three times the reserved storage. - - **Backup retention** - Your data is always backed up. Specify the backup retention period in days. - > **Note:** You cannot scale up/down an Always Free autonomous database. + > **Note:** You cannot scale up/down an Always Free autonomous database. + + ![Choose the remaining parameters.](./images/adb-create-screen-configure-db.png =65%x*) + +6. In the **Backup retention** section, you can either accept the default value or specify your own preferred backup retention days value. Accept the default 60 days default value. + + ![Choose backup retention.](./images/choose-backup-retention.png =70%x*) - ![Choose the remaining parameters.](./images/adb-create-screen-configure-db.png "Configuration") +7. In the **Create administrator** credentials section, specify the following: -6. Create administrator credentials: + - **Username:** This read-only field displays the default administrator username, **`ADMIN`**. _**Important:** Make a note of this **username** as you will need it to perform later tasks._ + - **Password:** Enter a password for the **`ADMIN`** user of the service instance choice such as **`Training4ADW`**. _**Important:** Make a note of this **password** as you will need it to perform later tasks._ + - **Confirm password:** Confirm your password. - - **Password and Confirm Password** - Specify the password for ADMIN user of the service instance. The password must meet the following requirements: - - The password must be between 12 and 30 characters long and must include at least one uppercase letter, one lowercase letter, and one numeric character. - - The password cannot contain the username. - - The password cannot contain the double quote (") character. - - The password must be different from the last 4 passwords used. - - The password must not be the same password that you set less than 24 hours ago. - - Re-enter the password to confirm it. Make a note of this password. + > **Note:** The password must meet the following requirements: + - Must be between 12 and 30 characters long and must include at least one uppercase letter, one lowercase letter, and one numeric character. + - Cannot contain the username. + - Cannot contain the double quote (") character. + - Must be different from the last 4 passwords used. + - Must not be the same password that you set less than 24 hours ago. - ![Enter password and confirm password.](./images/adb-create-screen-password.png "Admin password") + ![Enter password and confirm password.](./images/adb-create-screen-password.png =70%x*) -7. Choose network access: +8. In the **Choose network access** section, select one of the following options: - For this lab, accept the default, **Secure access from everywhere**. - If you want to allow traffic only from the IP addresses and VCNs you specify - where access to the database from all public IPs or VCNs is blocked, select **Secure access from allowed IPs and VCNs only** in the Choose network access area. - If you want to restrict access to a private endpoint within an OCI VCN, select **Private endpoint access only** in the Choose network access area. - If the **Require mutual TLS (mTLS) authentication** option is selected, mTLS will be required to authenticate connections to your Autonomous Database. TLS connections allow you to connect to your Autonomous Database without a wallet, if you use a JDBC thin driver with JDK8 or above. See the [documentation for network options](https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/support-tls-mtls-authentication.html#GUID-3F3F1FA4-DD7D-4211-A1D3-A74ED35C0AF5) for options to allow TLS, or to require only mutual TLS (mTLS) authentication. - ![Choose the network access.](./images/adb-create-screen-choose-network.png "Networking options") + ![Choose the network access.](./images/adb-create-screen-choose-network.png =70%x*) -8. Choose a license type. For this lab, accept the default **License Included**. The two license types are: - - **Bring Your Own License (BYOL)** - Select this type when your organization has existing database licenses. - - **License Included** - Select this type when you want to subscribe to new database software licenses and the database cloud service. +9. In the **Choose a license and Oracle Database edition** section, accept the default selection, **This Database is provisioned with License included license type**. + + >**Note:** Select the **Bring Your Own License (BYOL)** type when your organization has existing database licenses. -9. For this lab, do not provide a contact email address. The "Contact Email" field allows you to list contacts to receive operational notices and announcements as well as unplanned maintenance notifications. + ![Choose a license.](./images/choose-license.png =70%x*) + +10. For this lab, do not provide a contact email address. The "Contact Email" field allows you to list contacts to receive operational notices and announcements as well as unplanned maintenance notifications. ![Do not provide a contact email address.](images/adb-create-screen-contact-email.png "email") -10. Click **Create Autonomous Database**. +11. Click **Create Autonomous Database**. + + ![Click Create Autonomous Database.](./images/click-create-adb.png =70%x*) + +12. The **Autonomous Database details** page is displayed. The status of your ADB instance is **PROVISIONING**. + + ![Database Provisioning message.](./images/adb-create-provisioning-message.png " ") + + A **Check database lifecycle state** informational box is displayed. You can navigate through this tour or choose to skip it. Click **Skip tour**. A **Skip guided tour** dialog box is displayed. Click **Skip**. -11. Your instance will begin provisioning. + In a few minutes, the instance status changes to **AVAILABLE**. At this point, your Autonomous Data Warehouse database instance is ready to use! Review your instance's details including its name, database version, ECPU count, and storage size. - ![Database Provisioning message.](./images/adb-create-provisioning-message.png "Provisioning") + ![Database complete message.](./images/adb-create-complete-message.png " ") - In a few minutes, the state will turn from Provisioning to Available. At this point, your Autonomous Database instance is ready to use! Have a look at your instance's details - including its name, database version, ECPU count, and storage size. +13. Click the **Autonomous Database** link in the breadcrumbs. The **Autonomous Database** page is displayed. The new Autonomous Database instance is displayed. In the following screen capture, the instance display name is **MyQuickStart**. - ![Database complete message.](./images/adb-create-complete-message.png "Complete") + ![Database instance displayed.](./images/adb-instance-displayed.png " ") \ No newline at end of file diff --git a/building-blocks/tasks/adb/query-json-arrays.md b/building-blocks/tasks/adb/query-json-arrays.md index 37ba5e5b..45bb7357 100644 --- a/building-blocks/tasks/adb/query-json-arrays.md +++ b/building-blocks/tasks/adb/query-json-arrays.md @@ -4,14 +4,14 @@ "description":"Use JSON_TABLE to convert arrays into rows." } --> -### Query JSON arrays -An array of cast members is stored for each movie. Here, you can see that Tom Hanks, Elizabeth Perkins, Robert Loggia were all a part of the cast for the movie "Big": +### Query JSON Arrays +An array of cast members is stored for each movie. Here, you can see that Tom Hanks, Elizabeth Perkins, Robert Loggia were all a part of the cast for the movie **Big**. ![Cast member array](images/adb-json-cast-member-array.png) -In order to find the top grossing actors across movies, the arrays for each movie need to be expanded into rows - one row for each movie -> cast member combination. The `JSON_TABLE` function is designed for this purpose. The following will illustrate how to use the function ([see the documenation for more details](https://docs.oracle.com/en/database/oracle/oracle-database/19/adjsn/function-JSON_TABLE.html#GUID-0172660F-CE29-4765-BF2C-C405BDE8369A)): +In order to find the top grossing actors across movies, the arrays for each movie need to be expanded into rows: _One row for each **movie**-**cast** members combination_. The `JSON_TABLE` function is designed for this purpose. The following will illustrate how to use the function. See [SQL/JSON Function JSON_TABLE](https://docs.oracle.com/en/database/oracle/oracle-database/19/adjsn/function-JSON_TABLE.html#GUID-0172660F-CE29-4765-BF2C-C405BDE8369A). -1. Find the top grossing movies. Copy and paste the following SQL into the SQL worksheet and click **Run**: +1. Find the top grossing movies. Copy and paste the following SQL statement into the worksheet, and then click the **Run Statement** icon in the Worksheet. ``` @@ -26,11 +26,12 @@ In order to find the top grossing actors across movies, the arrays for each movi fetch first 10 rows only; ``` - Notice the top movies and the list of actors for each movie. + + The top 10 grossing movies in descending order and the list of actors for each movie are displayed. ![Top grossing movies](images/adb-query-top-grossing-movies.png) -2. Finding the top movies is easy. It's not quite as simple to find the top grossing actors because actors are stored in the cast array. Let's break this down into a couple of steps. First, use `JSON_TABLE` to peform a lateral join; a row will be created for each cast member -> movie combination. Copy and paste the SQL below into the worksheet and click **Run**: +2. Finding the top movies is easy. It's not quite as simple to find the top grossing actors because actors are stored in the cast array. Let's break this down into a couple of steps. First, use `JSON_TABLE` to perform a lateral join; a row will be created for each **cast member-movie combination**. Copy and paste the following SQL statement into the worksheet, and then click the **Run Statement** icon in the Worksheet. ``` @@ -38,9 +39,9 @@ In order to find the top grossing actors across movies, the arrays for each movi title, year, gross, - jt.actor + jt.actor from movie m, - json_table(m.cast,'$[*]' columns (actor path '$')) jt + json_table(m.cast,'$[*]' columns (actor path '$')) jt order by gross desc nulls last; ``` @@ -48,19 +49,19 @@ In order to find the top grossing actors across movies, the arrays for each movi ![Breakout by actor](images/adb-query-json-table-cast.png) - Step one has been completed! JSON table has created a row for each actor and movie combination. + Step one is complete! A JSON table is created with a row for each actor and movie combination. -3. The next step will find the top 10 actors based on box office receipts across all their movies. Copy and paste the SQL into the worksheet and click **Run**: +3. The next step will find the top 10 actors based on box office receipts across all their movies. Copy and paste the following SQL statement into the worksheet, and then click the **Run Statement** icon in the Worksheet. ``` select - actor, + actor, sum(gross) from movie m, - json_table(m.cast,'$[*]' columns (actor path '$')) jt + json_table(m.cast,'$[*]' columns (actor path '$')) jt where actor != 'novalue' -- filter out bad values - group by actor + group by actor order by 2 desc nulls last fetch first 10 rows only; diff --git a/building-blocks/tasks/adb/query-json-simple.md b/building-blocks/tasks/adb/query-json-simple.md index 82731554..a8796039 100644 --- a/building-blocks/tasks/adb/query-json-simple.md +++ b/building-blocks/tasks/adb/query-json-simple.md @@ -4,26 +4,33 @@ "description":"Use dot notation and JSON_VALUE to query JSON documents. Creates a view to simplify subsequent access." } --> -Oracle Database offers a wide range of SQL functions that help you analyze JSON data ([see documentation](https://docs.oracle.com/en/database/oracle/oracle-database/19/adjsn/query-json-data.html#GUID-119E5069-77F2-45DC-B6F0-A1B312945590) for details). The SQL capabilities include simple extraction of JSON attributes using dot notation, array and object manipulation, JSON aggregations and more. + +Oracle Database offers a wide range of SQL functions that help you analyze JSON data ([see Query JSON Data](https://docs.oracle.com/en/database/oracle/oracle-database/19/adjsn/query-json-data.html#GUID-119E5069-77F2-45DC-B6F0-A1B312945590) for details). The SQL capabilities include simple extraction of JSON attributes using dot notation, array and object manipulation, JSON aggregations and more. -1. Use simple dot notation to extract fields in tabular format. +1. Use the simple dot (.) notation to extract fields in a tabular format. + + The movie collection includes **`title`** and **`year`** attributes. Your SQL statements can use the dot notation to navigate through the JSON path. For example, **`m.json_document.title`** refers to table **`m` (`movie_collection`)**, the **`json_document`** column, and the **`title`** JSON attribute. Copy and paste the following SQL statement into the worksheet, and then click the **Run Statement** icon in the Worksheet toolbar to view **Meryl Streep's** movies: - The movie collection includes `title` and `year` attributes. Your SQL can use dot notation to navigate the JSON path. For example, `m.json_document.title` refers to table `m` (`movie_collection`), the `json_document` column, and the `title` JSON attribute. Copy and paste the following SQL into the worksheet and click **Run** to view Meryl Streep's movies: ``` select m.json_document.title, - m.json_document.year + m.json_document.year from movie_collection m - where m.json_document.cast like '%Meryl Streep%' - ; + where m.json_document.cast like '%Meryl Streep%'; ``` - Below are the Meryl Streep movies and the years that they were released: + Meryl Streep movies and the years that they were released are displayed. + ![Meryl Streep movies](images/adb-query-json-meryl-streep.png) -2. Simplify subsequent queries against the movie collection by using a view. The view will allow tools and applications to access JSON data as if it were tabular data. The view definition extracts from the JSON documents both simple fields (using the `JSON_VALUE` function) and complex arrays (using the `JSON_QUERY` function). Copy and paste the following SQL into the worksheet. +2. You can simplify subsequent queries against the movie collection by using a view. The view will allow tools and applications to access JSON data as if it were tabular data. The view definition extracts from the JSON documents both simple fields (using the `JSON_VALUE` function) and complex arrays (using the `JSON_QUERY` function). Copy and paste the following SQL code into the worksheet, and then click the **Run Statement** icon in the Worksheet toolbar. ``` @@ -54,7 +61,9 @@ Oracle Database offers a wide range of SQL functions that help you analyze JSON ``` Each JSON attribute is now exposed as a column - similar to any table column. -3. Query the view by copying and pasting the following SQL into the worksheet: + ![Create movie view.](images/create-json-view.png) + +3. Query the newly created by view. Copy and paste the following SQL code into the worksheet, and then click the **Run Statement** icon in the Worksheet toolbar. ``` @@ -63,6 +72,9 @@ Oracle Database offers a wide range of SQL functions that help you analyze JSON where rownum < 10; ``` - ![Tabular and array-based data](images/adb-create-json-view.png) + + ![Tabular and array-based data](images/query-view.png) Most of the data is in tabular format. However, several of the fields are arrays. For example, there are multiple genres and cast members associated with each movie. + + ![Genre and Cast members.](images/genre-cast.png) \ No newline at end of file diff --git a/building-blocks/tasks/iam/compartment-create-body.md b/building-blocks/tasks/iam/compartment-create-body.md index 4c8dab7d..26a1e6d4 100644 --- a/building-blocks/tasks/iam/compartment-create-body.md +++ b/building-blocks/tasks/iam/compartment-create-body.md @@ -4,21 +4,39 @@ "description":"Create a new compartment using the OCI service console" } --> + A compartment is a collection of cloud assets, like compute instances, load balancers, databases, and so on. By default, a root compartment was created for you when you created your tenancy (for example, when you registered for the trial account). It is possible to create everything in the root compartment, but Oracle recommends that you create sub-compartments to help manage your resources more efficiently. If you are using an Oracle LiveLabs-provided sandbox, you don't have privileges to create a compartment and should skip this first task. Oracle LiveLabs has already created a compartment for you and you should use that one. Even though you can't create a compartment, you can review the steps below to see how it is done. +>_**Note:** This is an optional task. If you already have a compartment that you are using, you don't have to create a new compartment._ + +1. Open the **Navigation** menu and click **Identity & Security**. Under **Identity**, click **Compartments**. + + ![The Navigation menu is clicked. The navigation path to Compartments is displayed.](./images/navigate-compartment.png =80%x*) + + For faster navigation, you can pin items that you use frequently. To pin an item, hover over the menu item and then click pin to the left of the item name. + + ![An example on pinning an item such as Data Lake/Data Catalog for quicker access is shown.](./images/pin-items.png " ") + + The pinned item is displayed in the **Pinned** section of the **Home** tab the next time you use the Navigation menu. + + ![An example that shows the Compartment item pinned.](./images/pinned-item.png " ") + + The **Recently visited** section of the **Home** tab shows recently used navigation items. + + To quickly find navigation menu items, use the **Search** box. -1. Click the three-line menu on the top left of the console. Scroll down to the bottom of the menu, click **Identity & Security -> Compartments**. +2. On the **Compartments** page, click **Create Compartment**. - ![Click Identity & Security then Compartments.](images/oci-navigation-compartments.png " ") + ![The Compartments page is displayed. The Create Compartment button is highlighted.](./images/click-create-compartment.png " ") - Then, click the **Create Compartment** button to create a sub-compartment. +3. In the **Create Compartment** dialog box, enter a name and a description in the **Name** and the **Description** fields respectively. - ![Click the Create Compartment button.](images/compartment-create.png " ") +4. In the **Parent Compartment** drop-down list, select your parent compartment, and then click **Create Compartment**. -2. Give the compartment a name and description. Be sure your root compartment appears as the parent compartment. Press the blue **Create Compartment** button. + ![On the completed Create Compartment dialog box, click Create Compartment.](./images/create-compartment.png " ") - ![Click the Create Compartment button.](images/compartment-click-create.png " ") + The **Compartments** page is re-displayed and the newly created compartment is displayed in the list of available compartments. - The compartment is created and you can use it for your cloud services! + ![The newly created compartment is highlighted with its status as Active.](./images/compartment-created.png " ") diff --git a/building-blocks/tasks/iam/images/click-create-compartment.png b/building-blocks/tasks/iam/images/click-create-compartment.png new file mode 100644 index 00000000..06377bf1 Binary files /dev/null and b/building-blocks/tasks/iam/images/click-create-compartment.png differ diff --git a/building-blocks/tasks/iam/images/compartment-created.png b/building-blocks/tasks/iam/images/compartment-created.png new file mode 100644 index 00000000..16bef5bf Binary files /dev/null and b/building-blocks/tasks/iam/images/compartment-created.png differ diff --git a/building-blocks/tasks/iam/images/create-compartment.png b/building-blocks/tasks/iam/images/create-compartment.png new file mode 100644 index 00000000..f921f5c5 Binary files /dev/null and b/building-blocks/tasks/iam/images/create-compartment.png differ diff --git a/building-blocks/tasks/iam/images/navigate-compartment.png b/building-blocks/tasks/iam/images/navigate-compartment.png new file mode 100644 index 00000000..d2d22619 Binary files /dev/null and b/building-blocks/tasks/iam/images/navigate-compartment.png differ diff --git a/building-blocks/tasks/iam/images/pin-items.png b/building-blocks/tasks/iam/images/pin-items.png new file mode 100644 index 00000000..097223d7 Binary files /dev/null and b/building-blocks/tasks/iam/images/pin-items.png differ diff --git a/building-blocks/tasks/iam/images/pinned-item.png b/building-blocks/tasks/iam/images/pinned-item.png new file mode 100644 index 00000000..c70d2814 Binary files /dev/null and b/building-blocks/tasks/iam/images/pinned-item.png differ