Skip to content

Commit

Permalink
Merge branch 'oracle-livelabs:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
davidastart authored Sep 3, 2024
2 parents 816fa6c + 626b0c5 commit 02121df
Show file tree
Hide file tree
Showing 71 changed files with 428 additions and 342 deletions.
Binary file modified 23aifree/json-collections/images/collection-name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/create-movies-constraint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/create-right-type.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/create-wrong-type.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added 23aifree/json-collections/images/dbaction1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/development-json.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/development-sql.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/homepage-dbactions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/homepage-json.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/json-create-collection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/json-doc-created.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/json-object.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/new-json-doc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/popup-json-doc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/popup.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/qbe-dvd-result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/qbe-lte5-dvd-result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/qbe-new-result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/qbe-not-movies-result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/qbe-one-value-result.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/qbe-one-value.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/refresh-collection.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/show-single-json-in-sql.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/sql-constraint-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified 23aifree/json-collections/images/sql-data-dict.png
Binary file modified 23aifree/json-collections/images/sql-shows-schema-error.png
Binary file modified 23aifree/json-collections/images/wrong-type.png
42 changes: 11 additions & 31 deletions 23aifree/json-collections/json-collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ To create a collection all you have to specify is the collection's name. Unlike

Estimated Time: 20 minutes

Watch the video below for a quick walk through of the lab.
[Watch the video](videohub:1_6ajt3iiz)

### Objectives

In this lab, you will:
Expand All @@ -27,47 +24,32 @@ In this lab, you will:

## Task 1: Create Collection

1. Open a browser window to Database Actions.

```
<copy>http://localhost:8080/ords/hol23c/_sdw</copy>
```

![Open Browser](./images/open-browser.png)

2. Sign in with the username and password of the schema with ORDS enabled. If you are using the green button, this user has already been created for you. Replace the `<new_password>` with the one you entered in Lab 1: Setup User.
1. Now that the ATP instance is available, click in the *Database actions* dropdown list and select **View all database actions**

```
username: hol23c
password: <new_password>
```
![DB Actions](images/dbaction1.png)

![User Sign In](./images/ords-sign-in.png)

4. Experience the homepage of Database Actions. Database Actions was formerly known as 'SQL Developer Web' and was focusing meinly on the SQL worksheet functionality, a subset of functionality that is available in SQL Developer Desktop
2. Below you can find the Database Actions homepage.

![Homepage Database Actions](./images/homepage-dbactions.png)

Let's have a quick look into the SQL Worksheet and some of its capabilities to compare and contrast with SQL Developer Desktop. You can walk through the guided tour or return to the main screen of Database Actions.
![Homepage SQL Developer Web](./images/homepage-intro-sdw.png)

5. On the homepage, click the JSON tile under Development. You can ignore the guided tours when they pop up.
3. On the homepage, click the JSON tile under Development.

![Homepage Development JSON](./images/homepage-json.png)

6. To create a collection, click **Create Collection**.
4. To create a collection, click **Create Collection**.
A tour of this section may automatically begin when the page loads. You can click `next` to continue through the tour and return to this page.

![JSON Create Collection](./images/json-create-collection.png)

7. In the field **Collection Name**, provide the name **movies**. Then click **Create**.
5. In the field **Collection Name**, provide the name **movies**. Then click **Create**.

Note that the collection name is case-sensitive. You must enter products in all lower-case, don't use MOVIES or Movies.

![New Collection: movies](./images/collection-name.png)

8. A notification pops up that displays **movies** collections has been created.
6. A notification pops up that displays **movies** collections has been created.

![New collection notification](./images/popup.png)

Expand All @@ -77,11 +59,7 @@ In this lab, you will:

## Task 2: Insert Documents

1. Double click **movies** collection to show the **JSON-movies** worksheet.
![products worksheet](./images/click-movies.png)
2. Click the *New JSON Document* button.
1. Double click **movies** collection to show the **JSON-movies** worksheet. Click the *New JSON Document* button.

![new document button](./images/new-json-doc.png)

Expand Down Expand Up @@ -362,6 +340,8 @@ In the SQL tool, run:
_Click on a table cell then the eye icon to view the full value._
![SQL for data dictionary result](./images/json-schema-result.png)
You may now proceed to the next lab.
## Learn More
Expand All @@ -372,4 +352,4 @@ You may now proceed to the next lab.
* **Author** - William Masdon, Kaylien Phan, Hermann Baer
* **Contributors** - David Start, Ranjan Priyadarshi
* **Last Updated By/Date** - Hermann Baer, Database Product Management, August 2024
* **Last Updated By/Date** - Carmen Berdant, Technical Program Manager, August 2024
44 changes: 32 additions & 12 deletions 23aifree/json-duality-migrator/json-duality-migrator.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,31 @@ In this lab, you will:
### Prerequisites

- Oracle Database 23ai, version 23.4 or above
- MongoDB Compass [can be downloaded for free from here:](https://www.mongodb.com/docs/compass/current/install/)
- MongoDB Compass [can be downloaded for free from here](https://www.mongodb.com/docs/compass/current/install/)


## Task 1: Connect to MongoDB Compass:

## Task 1: Clean up the environment:
1. Open the MongoDB Compass and start the new connection:

![New Connection](images/new_connection_compass.png)

- If you install ORDS in non-autonomous database, then you get the connection string during the installation process. The Oracle API for MongoDB connection string is:

```
<copy>
mongodb://[{user}:{password}@]localhost:27017/{user}?authMechanism=PLAIN&authSource=$external&ssl=true&retryWrites=false&loadBalanced=true
</copy>
```
*Note: Replace the user, password and localhost with yours*
- For ADB, it is given when enabling the MongoDB API.
2. Connect to the database:
![Connect to the database](images/compass_connection.png)
## Task 2: Clean up the environment:
1. Follow these steps to clean up your environment. These steps are only needed in case you're running the workshop more than once. If this is the first time you are using this workshop, you can skip the cleanup.
Expand All @@ -47,7 +67,7 @@ In this lab, you will:
</copy>
```
## Task 2: Create a native JSON collection
## Task 3: Create a native JSON collection
1. Option 1: In SQL Developer run:
Expand All @@ -57,23 +77,23 @@ In this lab, you will:
2. Option 2: Create in MongoDB Compass the collection **CONF\_SCHEDULE**
![Create Collection](images/create_collection.png)
![Create Collection](images/create_collection.png)
## Task 3: Import the document(s) from MongoDB Compass into CONF_SCHEDULE
## Task 4: Import the document(s) from MongoDB Compass into CONF_SCHEDULE
1. Download the [BHRJ_Schedule.json](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/labfiles/BHRJ_Schedule.json) document.
![Add File](images/add_file.png)
![Choose File](images/import_data.png)
![Add File](images/add_file.png)
![Choose File](images/import_data.png)
2. Import the BHRJ_Schedule.json file
![Import File](images/import_schedule.png)
![Show import](images/imported_completed.png)
![Import File](images/import_schedule.png)
![Show import](images/imported_completed.png)
## Task 4: Run the JSON-To-Duality Migrator
## Task 5: Run the JSON-To-Duality Migrator
1. Follow this code to run the JSON-To-Duality Migrator: we will do infer\_schema and generate\_schema together.
Expand Down Expand Up @@ -103,7 +123,7 @@ In this lab, you will:
/
</copy>
```
## Task 5: Validate the newly created objects and check the output from the select statement below
## Task 6: Validate the newly created objects and check the output from the select statement below
1. In SQL Developer run:
Expand All @@ -118,7 +138,7 @@ In this lab, you will:
2. In MongoDB Compass after refreshing the databases, click on the **CONF\_SCHEDULE\_DUALITY** collection under the ADMIN database
![Conf Schedule Duality](images/conf_schedule_duality%20collection.png)
![Conf Schedule Duality](images/conf_schedule_duality%20collection.png)
3. In mongosh, verify the number of documents in the **CONF\_SCHEDULE\_DUALITY** collection:
Expand Down
1 change: 0 additions & 1 deletion 23aifree/json-indexes/json-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ In this lab, you will:
<copy>db.createCollection('SALES');
</copy>
```
*Note: you do not need to explicitly create a collection in Mongo, you can just insert data, and a collection will be created.*
## Task 3: Populate the SALES collections with data
Expand Down
Binary file added 23aifree/json-install-mongo/images/cmd-exe.png
Binary file added 23aifree/json-install-mongo/images/terminal.png
176 changes: 176 additions & 0 deletions 23aifree/json-install-mongo/json-install-mongo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
# Install MongoDB Shell and MongoDB Command Line Database Tools

## Introduction

This lab walks you through the installation of the MongoDB Shell tool and MongoDB Command Line Database Tools on your own machine. Instructions are provided for Mac OS/X and Windows machines. Installation on a Linux machine will be similar to the Mac instructions, but obviously will require a different download file.

**NOTE**: MongoDB Shell tool and MongoDB Command Line Database Tools are tools provided by MongoDB Inc. Oracle is not associated with MongoDB Inc, and has no control over the software. These instructions are provided simply to help you learn about MongoDB Shell and MongoDB Command Line Database Tools. Links may change without notice.

Check the official MongoDB Shell and MongoDB Command Line Database Tools website for latest versions and instructions:

https://www.mongodb.com/try/download/shell

https://www.mongodb.com/try/download/database-tools


Estimated Time: 10 minutes


### Objectives

In this lab, you will:

* Install MongoDB Shell and MongoDB Command Line Database Tools on your local machine
* Set up your PATH to point to the MongoDB Shell and MongoDB Command Line Database Tools executable

### Prerequisites

* A Mac OS/X machine (Intel or Apple hardware) or a Windows PC.
* Access to the command prompt / terminal

## Task 1: (Mac only) Determine the type of hardware

1. If you know already whether your Mac uses Intel or Apple Silicon you can skip this step. Otherwise:

Click on the Apple menu in the top left-hand corner of your screen and go to "About this Mac".

!["about this mac" menu item](./images/about-this-mac.png " ")

That will open a "details" panel. Intel Mac will show a line with *Processor:* and the name of an Intel processor. Apple Silicon Macs will show a line saying *Chip"* and a line such as "Apple M1 Pro".

![processor details](./images/about-mac-details.png " ")

## Task 2: Open a command prompt or terminal window

1. On a Mac:

Open the Launchpad icon in the Dock (or press Command-space) and start typing "terminal" in the search box. Press enter to start terminal.

![open terminal in launchpad](./images/terminal.png " ")

2. On a Windows PC:

Press "Run" (Windows-R) and type "cmd.exe". Press enter or click "OK".

![open command prompt](./images/cmd-exe.png " ")

3. Create and enter a suitable directory. We'll create a directory 'mongosh' under the default home directory, but you can choose to create it elsewhere. For **Mac or Windows**, enter the following commands:

```
<copy>
mkdir mongosh
cd mongosh
</copy>
```
## Task 3: Download and expand the installer files
On both Mac and Windows, you can use the built-in 'curl' command to access a URL and download a file from it. The URL to use will vary according to the machine involved.
**Note:** If you encounter any issues with the download or the version listed here, then please visit https://www.mongodb.com/try/download/shell or https://www.mongodb.com/try/download/database-tools to download the most recent shell for your operating system.
Copy **ONE** of the following *curl* commands and paste it to the command or terminal window:
1. For **Mac with Intel processor**:
Download MongoDB Shell:
```bash
<copy>
curl https://downloads.mongodb.com/compass/mongosh-2.3.0-darwin-x64.zip -o mongosh.zip
</copy>
```
Download Command Line Database Tools:
```bash
<copy>
curl https://fastdl.mongodb.org/tools/db/mongodb-database-tools-macos-x86_64-100.10.0.zip -o mongodbtools.zip
</copy>
```
2. For **Mac with Apple chip**:
Download MongoDB Shell:
```bash
<copy>
curl https://downloads.mongodb.com/compass/mongosh-2.3.0-darwin-arm64.zip -o mongosh.zip
</copy>
```
Download Command Line Database Tools:
```bash
<copy>
curl https://fastdl.mongodb.org/tools/db/mongodb-database-tools-macos-arm64-100.10.0.zip -o mongodbtools.zip
</copy>
```
3. For **Windows**:
Download MongoDB Shell:
```bash
<copy>
curl https://downloads.mongodb.com/compass/mongosh-2.3.0-win32-x64.zip -o mongosh.zip
</copy>
```
Download Command Line Database Tools:
```bash
<copy>
curl https://fastdl.mongodb.org/tools/db/mongodb-database-tools-windows-x86_64-100.10.0.zip -o mongodbtools.zip
</copy>
```
4. The previous step will have downloaded a zip file called mongosh.zip and mongodbtools.zip, which we need to expand.
On **Mac or Windows**, run the following command:
```bash
<copy>
mkdir -p mongosh | tar -xvf mongosh.zip -C mongosh --strip-components=1
</copy>
```
```bash
<copy>
mkdir -p mongodbtools | tar -xvf mongodbtools.zip -C mongosh --strip-components=1
</copy>
```
**Notes**: tar is a built-in command in Windows 11 and recent Windows 10 builds. If for any reason it is not available, you will need to expand the zip file using Windows Explorer. On Mac, you could use the command 'unzip mongosh.zip' to the same effect.
## Task 4: Set the PATH to include the mongosh executable
1. On **Mac** (Intel or Apple silicon) run the following command to set your path variable to include the location of the **mongosh** executable. Y
```bash
<copy>
export PATH=[path to]/mongosh/bin:[path to]/mongodbtools/bin:$PATH
</copy>
```
If that fails, you'll have to set your path manually to include the 'bin' directory from the files you just downloaded. If you close and reopen your terminal window, you will need to re-run this comamnd. Alternatively, you can always navigate to the directory where you have extracted the software and run the shell with the relative path.
2. On **Windows** you can use the following command, assuming you created the 'mongosh' directory in your home directory. If you created it elsewhere, you'll need to edit the path command appropriately.
```
<copy>
set path=%cd%\[path to]\mongosh\bin\:%cd%\[path to]\mongodbtools\bin\:%PATH%
</copy>
```
3. Keep the command or terminal window open for later use. If you close it and need to reopen it, you will need to set the PATH again according to the instructions above.
Mongo Shell is now set up on your PC or Mac.
You may now **proceed to the next lab**.
## Acknowledgements
- **Author** - Roger Ford, Principal Product Manager, Oracle Database
- **Contributors** - Kamryn Vinson, Andres Quintana
- **Last Updated By/Date** - Carmen Berdant, August 2024
Loading

0 comments on commit 02121df

Please sign in to comment.