diff --git a/23aifree/adb-free-container-setup/inst-auth-container-setup.md b/23aifree/adb-free-container-setup/inst-auth-container-setup.md index 7191d3815..1addd428f 100644 --- a/23aifree/adb-free-container-setup/inst-auth-container-setup.md +++ b/23aifree/adb-free-container-setup/inst-auth-container-setup.md @@ -8,7 +8,7 @@ In this lab, you will experience just how easy it is to get started with the Ora ### **Objectives** In this lab, you will: -* Launch the container image. +* Launch the container image using Podman. * Connect to your Autonomous Database. * Access SQL Developer Web & APEX. diff --git a/23aifree/json-collections/json-collections-desktop.md b/23aifree/json-collections/json-collections-desktop.md new file mode 100644 index 000000000..0165d312f --- /dev/null +++ b/23aifree/json-collections/json-collections-desktop.md @@ -0,0 +1,375 @@ +# Work with JSON collections + +## Introduction + +Oracle is a relational database, meaning it typically stores data in rows and columns of tables and JSON can be stored as a column value. For this lab though, we first focus on the Document Store API SODA (Simple Oracle Document Access) which allows us to store JSON data in a so-called collection. A JSON collection stores JSON documents alongside some metadata like the time of creation or update. Collections offer operations like inserts, deletes, index creation or queries. + +To create a collection all you have to specify is the collection's name. Unlike a relational table, you do not have to provide any schema information. So, let's create a collection for the products we want to sell in the store. + +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: + +* Create Collection +* Insert First Document +* Find JSON documents in a collection +* Learn about JSON and Constraints + +### Prerequisites + +- Oracle Database 23ai Free Developer Release +- All previous labs successfully completed + +## Task 1: Create Collection + +1. Open a browser window to Database Actions. + + ``` + http://localhost:8080/ords/hol23c/_sdw + ``` + + ![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 `` with the one you entered in Lab 1: Setup User. + + ``` + username: hol23c + password: + ``` + + ![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 + + ![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. + + ![Homepage Development JSON](./images/homepage-json.png) + +6. 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**. + + 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. + + ![New collection notification](./images/popup.png) + +9. Click the refresh button to verify the **movies** collection has been created. + + ![Refresh button](./images/refresh-collection.png) + +## 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. + + ![new document button](./images/new-json-doc.png) + +3. A **New JSON Document** panel displays. Copy the following JSON object, paste it in the worksheet and click **Create**. + + ``` + + { + "_id": 100, + "type":"movie", + "title": "Coming to America", + "format": "DVD", + "condition": "acceptable", + "price": 5, + "comment": "DVD in excellent condition, cover is blurred", + "starring": ["Eddie Murphy", "Arsenio Hall", "James Earl Jones", "John Amos"], + "year": 1988, + "decade": "80s" + } + + ``` + + ![add new document](./images/json-object.png) + +4. A notification pops up that says A New Document is created and the new document is shown in the bottom section of the JSON workshop. + + ![new document confirmation popup](./images/popup-json-doc.png) + +5. Let's repeat this with the following documents: + + Click the *New JSON Document* button, copy the following JSON objects one by one, paste it into the worksheet and click **Create**. + + ``` + + { + "_id": 101, + "title": "The Thing", + "type": "movie", + "format": "DVD", + "condition": "like new", + "price": 9.50, + "comment": "still sealed", + "starring": [ + "Kurt Russel", + "Wilford Brimley", + "Keith David" + ], + "year": 1982, + "decade": "80s" + } + + ``` + + ``` + + { + "_id": 102, + "title": "Aliens", + "type": "movie", + " format ": "VHS", + "condition": "unknown, cassette looks ok", + "price": 2.50, + "starring": [ + "Sigourney Weaver", + "Michael Bien", + "Carrie Henn" + ], + "year": 1986, + "decade": "80s" + } + + ``` + + +## Task 3: Find JSON documents in a collection + +Documents can be selected based on filter conditions - we call them 'Queries By Example' or 'QBE' for short. A QBE is a JSON document itself and it contains the fields and filter conditions that a JSON document in the collection must satisfy, in order to be selected. QBEs are used with SODA (only); you can use SQL functions as an alternative. + +The simplest form of a QBE just contains a key-value pair. Any selected document in the collection must have the same key with the same value. More complex QBEs can contain multiple filter conditions or operators like 'negation' or 'and', etc. + +The following are examples of QBEs. You can copy them into the corresponding window (see screenshot) and execute them. In a real application, those QBE-expressions would be issued directly from the programming language - the SODA drivers have APIs for common application programming languages: Python, etc. + +Now let's issue some simple queries on the **movies** collection we just created. + +1. Copy and paste the following queries into the worksheet and click the *Run Query* button to run a query. + +2. Lookup by one value: + + Here, it displays the document whose id value is 101. + + ``` + + {"_id":101} + + ``` + ![QBE doc with id 101](./images/qbe-one-value.png) + ![QBE id 101 results](./images/qbe-one-value-result.png) + +3. Find all DVDs: + + Running the query will display two documents with format DVD. + + ``` + + {"format":"DVD"} + + ``` + ![QBE DVD results](./images/qbe-dvd-result.png) + +4. Find all non-movies: + + This query displays the documents that are not of type - movies, which is currently nothing. + + ``` + + {"type":{"$ne":"movie"}} + + ``` + ![QBE for "not movies" result](./images/qbe-not-movies-result.png) + +5. Find documents whose condition value contains "new", which means just document (with id) 101. + + ``` + + {"condition":{"$like":"%new%"}} + + ``` + ![QBE condition is new result](./images/qbe-new-result.png) + +6. Find bargains of all products costing 5 and choose only DVD format documents: + + This query displays the document id 100, as this document has a price less than 5 and is the format DVD. + + ``` + + {"$and":[{"price":{"$lte":5}}, {"format":"DVD"}]} + + ``` + ![QBE price less than 5 and not type = book ](./images/qbe-lte5-dvd-result.png) + +## Task 4: JSON and Constraints + +JSON data is "schema flexible", you can add whatever data you like to a JSON document. But sometimes you will wish to impose some required structure on that data. That can be done through SQL by creating indexes and/or constraints on the JSON collection. + +An index will aid fast access to an item (for example speeding up access via the "title" field), but can also be used to impose uniqueness (a unique index or primary key constraint) or to enforce particular datatypes (by triggering an error if the datatype is not what is expected). + +More generally, constraints can be used to check the data being entered for various aspects. + +1. Let's add a check - or 'constraint' to check our data entry. We will do this using SQL Developer Web. Click the navigation menu on the top left and select **SQL** under Development. + + ![SQL navigation](./images/development-sql.png) + +2. We want to ensure that our JSON data satisfies minimal data quality, so we will create a constraint to enforce a couple of mandatory fields and their data types. **Enforcing a JSON schema is new functionality in Oracle Database 23ai.** + + To quickly recap what the documents look like, let's look at the first JSON document quickly. (Don't worry, we will have a closer look into the SQL world with JSON later): + ``` + + select json_serialize(data pretty) from movies fetch first 1 rows only; + + ``` + ![Single document in SQL](./images/show-single-json-in-sql.png) + + Now copy and paste the query below in the worksheet and click the *Run query* button to run the SQL query to alter the **movie** table and add constraints. + + ``` + alter table movies add constraint movies_json_schema + check (data is json validate '{ "type": "object", + "properties": { + "_id": { "type": "number" }, + "title": { "type": "string"}, + "type": {"type" : "string"}, + "price": {"type" : "number"}, + "starring": { + "type": "array", + "minItems": 0, + "items": { + "type": "string" + } + } + }, + "required": ["_id", "title", "type", "price"] + }' + ); + ``` + ![Create movies constraint in SQL](./images/create-movies-constraint.png) + +3. Add another constraint so that the price cannot be a negative number. + + ``` + + alter table movies add constraint no_negative_price + check ( + JSON_EXISTS(data, '$?(@.price.number() >= 0)') + ); + + ``` + ![add constraint](./images/sql-constraint-2.png) + + JSON_Exists is a SQL/JSON function that checks that a SQL/JSON path expression selects at least one value in the JSON data. The selected value(s) are not extracted – only their existence is checked. Here, *$?(@.price.number() >= 0)* is a standard, SQL/JSON path expressions. You'll learn more about SQJ/JSON functions later in this lab. + +4. Once the **movie** table is altered, navigate back to JSON workshop. Click the navigation menu on the top left and select **JSON** under Development. + + ![JSON navigation](./images/development-json.png) + +5. Validate that the following documents cannot get inserted, since fields are missing or are of wrong type. + + Click the *New JSON Document* icon, copy and paste the following query in the worksheet and click *Create*. + + This throws the error "Unable to add new JSON document" since the following document has missing fields and incorrect data types. + + ``` + + { + "_id": "upc9800432" , + "title": "Love Everywhere", + "summary": "Plucky Brit falls in love with American actress", + "year": 2023, + "genre": "Romance", + "starring": "tbd" + } + + ``` + ![create a not-allowed item](./images/create-wrong-type.png) + ![constraint error message](./images/wrong-type.png) + +6. The following document now satisfies all the constraints: the "id" is a unique number, "starring" is an array, it has all required fields, and the price is a positive number. + + ``` + + { + "_id": 99999 , + "title": "Love Everywhere", + "type": "movie", + "price": 10, + "summary": "Plucky Brit falls in love with American actress", + "year": 2023, + "genre": "Romance", + "starring": ["tbd"] + } + + ``` + ![create allowed item](./images/create-right-type.png) + ![doc successfully created](./images/json-doc-created.png) + +7. Now that was quite cumbersome to figure out the mistakes manually. But there's a better way: you can ask the database for the problems with your payload. Navigating back to the SQL page, you can enter this command to see the errors with your JSON payload. **JSON schema is new functionality in Oracle Database 23ai.** + + ``` + + with x as + ( + SELECT DBMS_JSON_SCHEMA.validate_report( + JSON('{ "_id": "upc9800432" , + "title": "Love Everywhere", + "summary": "Plucky Brit falls in love with American actress", + "year": 2023, + "genre": "Romance", + "starring" :"tbd" }'), json_schema ) + AS REPORT + from user_JSON_SCHEMA_COLUMNS where table_name = 'MOVIES') + select json_serialize(report pretty) from x + / + + ``` + The output shows you all the violations in detail, so that it is easier to address the issues. + + ![SQL to find JSON doc problem](./images/sql-shows-schema-error.png) + +8. You may also check the JSON Schema definition in your data dictionary. **JSON schema is new functionality in Oracle Database 23ai.** +In the SQL tool, run: + + ``` + + select constraint_name, json_serialize(json_schema) from user_JSON_SCHEMA_COLUMNS where table_name = 'MOVIES'; + + ``` + ![SQL for data dictionary](./images/sql-data-dict.png) + + + _Click on a table cell then the eye icon to view the full value._ + +You may now proceed to the next lab. + +## Learn More + +* [Oracle Database API for MongoDB](https://blogs.oracle.com/database/post/mongodb-api) + +## Acknowledgements + +* **Author** - William Masdon, Kaylien Phan, Hermann Baer +* **Contributors** - David Start, Ranjan Priyadarshi +* **Last Updated By/Date** - William Masdon, Database Product Manager, April 2023 \ No newline at end of file diff --git a/23aifree/json-mongo/json-mongo-desktop.md b/23aifree/json-mongo/json-mongo-desktop.md new file mode 100644 index 000000000..dfc416a7a --- /dev/null +++ b/23aifree/json-mongo/json-mongo-desktop.md @@ -0,0 +1,169 @@ +# Use Mongo API to interact with Oracle Database + +## Introduction + +With our JSON Collection created in the Oracle Database, we can use Mongo APIs to interact with the collection as if we were interacting with a Mongo Database. In this lab, we will download Mongo tools and then use a Mongo connection string -- which was configured as a part of the Oracle REST Data Service (ORDS) configuration -- to connect to the Oracle Database using Mongo Shell. From there, we can interact with Mongo tools or SQL Developer Web interchangeably to access our data. + +Estimated Time: 10 minutes + +Watch the video below for a quick walk through of the lab. +[Watch the video](videohub:1_pypv5ivy) + +### Objectives + +In this lab, you will: + +- Install Mongo Shell and Mongo Database Tools +- Load more data through the Database API for MongoDB +- Use Mongo Shell to interact with Oracle Database + +### Prerequisites + +- Oracle Database 23ai Free Developer Release +- All previous labs successfully completed + + +## Task 1: Download Mongo Shell and Mongo Database Tools + +This lab has you download software from the YUM repo at repo.mongodb.org. This software is free. If you agree to their terms of use please continue on with this portion of the lab. + +1. Open your terminal window. + + _If you closed your terminal window from the previous labs, please see steps in Lab 1 to reconnect to the host._ + + Run the following commands to download and install Mongo Shell and Mongo Database Tools. + + ``` + $ echo '65.8.161.52 downloads.mongodb.com' | sudo tee -a /etc/hosts + $ echo '18.65.185.55 repo.mongodb.org' | sudo tee -a /etc/hosts + $ sudo dnf install -y https://repo.mongodb.org/yum/redhat/8/mongodb-org/6.0/x86_64/RPMS/mongodb-mongosh-1.8.0.x86_64.rpm + $ sudo dnf install -y https://repo.mongodb.org/yum/redhat/8/mongodb-org/6.0/x86_64/RPMS/mongodb-database-tools-100.7.0.x86_64.rpm + ``` + Your screen will look similar to this after running the commands. + ![End of mongo install](./images/mongo-install.png) + +## Task 2: Interact with Oracle Database using Mongo API + +1. First, you must set the URI to the Mongo API running in ORDS on your machine. Copy and paste in the username, password, and host for your database and schema user. If you are using the green button, those values will be as follows: hol23c, Welcome123, and localhost. + + ``` + $ export URI='mongodb://:@:27017/?authMechanism=PLAIN&authSource=$external&tls=true&retryWrites=false&loadBalanced=true' + ``` + + ``` + Example: export URI='mongodb://hol23c:Welcome123@localhost:27017/hol23c?authMechanism=PLAIN&authSource=$external&tls=true&retryWrites=false&loadBalanced=true' + ``` + + If you aren't using the green button environment and you have different values for those fields, you may need to escape some characters. Please click [this link](https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/mongo-using-oracle-database-api-mongodb.html#ADBSA-GUID-44088366-81BF-4090-A5CF-09E56BB2ACAB) to learn how to escape characters in the URL. + +2. Before we connect to the Mongo Shell, let's populate our database using the Mongo Tools. You will use a document from Object Storage to seed the data in your **movie** collection. + + ``` + $ curl -s https://objectstorage.us-ashburn-1.oraclecloud.com/n/c4u04/b/moviestream_gold/o/movie/movies.json | mongoimport --collection movies --drop --tlsInsecure --uri $URI + + ``` + ![Populate the database](images/populate-mongo-db.png " ") + +3. Now with the URI set and the Mongo tools installed and the data inserted, we can connect to Mongo Shell. Run the command below to connect. + + ``` + $ mongosh --tlsAllowInvalidCertificates $URI + ``` + ![Connect to the Mongo Shell](images/mongo-shell.png " ") + +4. Within the Mongo Shell, you can begin running commands to interact with the data in your database as if you were using a Mongo Database. To show the **movie** collection we created and the count of documents we imported, run the following commands. + + ``` + hol23c> show collections + hol23c> db.movies.countDocuments() + + ``` + ![Query result for count](images/mongo-count.png " ") + +5. You can also query for specific documents. Run this query to find the document with title "Zootopia." + + ``` + hol23c> db.movies.find( {"title": "Zootopia"} ) + + ``` + ![Query result for Zootopia](images/mongo-zootopia.png " ") + +5. Now query for all movies made after 2020. + + ``` + hol23c> db.movies.find ( { "year": {"$gt": 2020} } ) + + ``` + ![Query result for after 2020](images/mongo-2020.png " ") + + There's only one movie in our library that was released after 2020. + +## Task 3: Interact interchangeably with Mongo API and SQL Developer Web + +Let's take some time to demonstrate the interactivity between the Oracle and Mongo tools we have installed on our machine to see the different APIs working against the same data set. + +1. Use the Mongo Shell to insert 2 documents to our movie collection. + + ``` + hol23c> db.movies.insertMany( [{ + "title": "Love Everywhere", + "summary": "Plucky Brit falls in love with American actress", + "year": 2023, + "genre": "Romance" + } + , + { + "title": "SuperAction Mars", + "summary": "A modern day action thriller", + "year": 2023, + "genre": [ + "Action", + "Sci-Fi" + ], + "cast": [ + "Arnold Schwarzenegger", + "Tom Cruise" + ] + } ]) + + ``` + ![Mongo inserts two docs](images/mongo-insert.png " ") + +2. Now check for movies again that were released after 2020 and you will see these two movies popping up as well: + + ``` + hol23c> db.movies.find ( { "year": {"$gt": 2020} } ) + + ``` + ![New result for after 2020](images/mongo-2020-new.png " ") + +3. Return to the browser window that contains SQL Developer Web. We will query for the same movies using the JSON tool. Navigate to the JSON tool using the menu in the top left corner of the webpage if you are not there already. + ![Homepage Development JSON](./images/development-json.png) + +4. Let's edit the entries in SQL Developer Web and see the changes in Mongo Shell. First, double click on the document referencing the movie "SuperAction Mars," or click the "Edit Document" icon next to it. In the dialog page, change the year to 2025 and then save the document. Seems Tom Cruise is busy and won't have enough time to finish the movie before then. + + ``` + { "title": "SuperAction Mars" } + + ``` + + ![Find SuperAction Mars](./images/find-superaction-mars.png) + ![Edit SuperAction Mars](./images/edit-superaction-mars.png) + +5. Finally, return the to Terminal window and using the Mongo Shell instance running, query for movies released after 2020 again. You will see the updated information for the "SuperAction Mars" movie. + + ``` + hol23c> db.movies.find ( { "year": {"$gt": 2020} } ) + + ``` + ![New result for after 2020 edit](./images/mongo-2020-edited.png) + +## Learn More + +* [Oracle Database API for MongoDB](https://blogs.oracle.com/database/post/mongodb-api) + +## Acknowledgements + +* **Author** - William Masdon, Kaylien Phan, Hermann Baer +* **Contributors** - David Start, Ranjan Priyadarshi +* **Last Updated By/Date** - William Masdon, Database Product Manager, April 2023 \ No newline at end of file diff --git a/23aifree/workshops/desktop-json-enhancements/manifest.json b/23aifree/workshops/desktop-json-enhancements/manifest.json index f0757c753..5af71b99f 100644 --- a/23aifree/workshops/desktop-json-enhancements/manifest.json +++ b/23aifree/workshops/desktop-json-enhancements/manifest.json @@ -21,23 +21,18 @@ { "title": "Lab 2: Work with JSON Collections", "description": "Work with JSON Collections", - "filename": "./../../json-collections/json-collections.md" + "filename": "./../../json-collections/json-collections-desktop.md" }, { "title": "Lab 3: Use Mongo API to interact with Oracle Database", "description": "Use Mongo API to interact with Oracle Database", - "filename": "./../../json-mongo/json-mongo.md" + "filename": "./../../json-mongo/json-mongo-desktop.md" }, { "title": "Lab 4: Use SQL to work with JSON", "description": "Use SQL to work with JSON", "filename": "./../../json-sql/json-sql.md" }, - { - "title": "Lab 5: Work with JSON Search Indexes", - "description": "Work with JSON Search Indexes", - "filename": "./../../json-search/json-search.md" - }, { "title": "Need Help?", "description": "Solutions to Common Problems and Directions for Receiving Live Help", diff --git a/ai-vector-rag/demo/demo.md b/ai-vector-rag/demo/demo.md new file mode 100644 index 000000000..af41c02a9 --- /dev/null +++ b/ai-vector-rag/demo/demo.md @@ -0,0 +1,74 @@ +# Running a RAG Application + +## Introduction + +Watch the following video for a brief walkthrough of the lab: + + [](videohub:1_ldgknjmv) +
+ +**_Estimated Time: 10 Minutes_** + +### **Objectives** + +In this lab, you will run a RAG application interactively using a user-friendly interface. You’ll be able to choose and load several PDF documents and ask your own questions using a prompt. This setup will allow you to easily interact with the RAG system and observe how it processes and generates responses in real time. + +### **Prerequisites** +This lab assumes you have: +- All previous labs successfully completed + +## Task 1: Open the Jupyter Notebook Interface + +1. In the upper-left corner, select **View Login Info**. + + ![View login info.](images/lab1-1-view-login-info.png) + +2. You can now see all reservation details relevant to completing this workshop. Copy the Jupyter Notebook password and open the Jupyter Notebook URL. + + ![Copy the Jupyter Notebook pasword.](images/lab1-2-jupyter-notebook-info.png) + +3. Paste the Jupyter Notebook password into the password field, as shown below. + + ![Enter the password.](images/lab1-3-jupyter-login.png) + +4. After a successfull login, you will see the Jupyter Notebook's landing page. + ![The Jupyter Notebook landing page.](images/lab1-4-landing-page.png) + +## Task 2: Run the RAG Application + +1. In the top navigation bar, open the terminal by clicking **File** >> **New** >> **Terminal**. + ![Open the terminal.](images/lab1-5-open-terminal.png) + +2. In the terminal, copy and paste the code below. + ```` + + cd /home/oracle + /home/oracle/run.sh + + ```` + ![Run the code snippet in the terminal.](images/lab1-6-terminal-commands.png) + +3. The above commands will start a streamlit application running your Chatbot. Three URLs will appear. Click on the last URL to interact with the application from your browser. + ![Launch the app in your browser.](images/lab1-7-app-urls.png) + +4. You should now see the landing page of the application you'll be building shortly. Explore the application by following the instructions on the landing page. Feel free to explore the documents with your own questions and discover how the RAG application can retrieve and provide accurate responses based on the document’s content. + + Once finished you can return to these instructions. + + ![View the application landing page.](images/lab1-8-app-landing-page.png) + +You may now **proceed to the next lab**. + +## Learn More + +- [Oracle Database 23ai Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/index.html) + +- [Oracle AI Vector Search User's Guide](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/whats-new-oracle-ai-vector-search.html) + +- [Oracle AI Vector Search Blog](https://blogs.oracle.com/database/post/oracle-announces-general-availability-of-ai-vector-search-in-oracle-database-23ai) + + +## Acknowledgements +* **Author** - Francis Regalado, Database Product Management; David Start, Database Product Management +* **Contributors** - Brianna Ambler, Kaylien Phan, Database Product Management +* **Last Updated By/Date** - Brianna Ambler, October 2024 diff --git a/ai-vector-rag/demo/images/lab1-1-view-login-info.png b/ai-vector-rag/demo/images/lab1-1-view-login-info.png new file mode 100644 index 000000000..5ef061662 Binary files /dev/null and b/ai-vector-rag/demo/images/lab1-1-view-login-info.png differ diff --git a/ai-vector-rag/demo/images/lab1-2-jupyter-notebook-info.png b/ai-vector-rag/demo/images/lab1-2-jupyter-notebook-info.png new file mode 100644 index 000000000..ced2c27dd Binary files /dev/null and b/ai-vector-rag/demo/images/lab1-2-jupyter-notebook-info.png differ diff --git a/ai-vector-rag/demo/images/lab1-3-jupyter-login.png b/ai-vector-rag/demo/images/lab1-3-jupyter-login.png new file mode 100644 index 000000000..b526b0622 Binary files /dev/null and b/ai-vector-rag/demo/images/lab1-3-jupyter-login.png differ diff --git a/ai-vector-rag/demo/images/lab1-4-landing-page.png b/ai-vector-rag/demo/images/lab1-4-landing-page.png new file mode 100644 index 000000000..482f77f66 Binary files /dev/null and b/ai-vector-rag/demo/images/lab1-4-landing-page.png differ diff --git a/ai-vector-rag/demo/images/lab1-5-open-terminal.png b/ai-vector-rag/demo/images/lab1-5-open-terminal.png new file mode 100644 index 000000000..de8c6cf78 Binary files /dev/null and b/ai-vector-rag/demo/images/lab1-5-open-terminal.png differ diff --git a/ai-vector-rag/demo/images/lab1-6-terminal-commands.png b/ai-vector-rag/demo/images/lab1-6-terminal-commands.png new file mode 100644 index 000000000..c8d8a5ead Binary files /dev/null and b/ai-vector-rag/demo/images/lab1-6-terminal-commands.png differ diff --git a/ai-vector-rag/demo/images/lab1-7-app-urls.png b/ai-vector-rag/demo/images/lab1-7-app-urls.png new file mode 100644 index 000000000..9bea34640 Binary files /dev/null and b/ai-vector-rag/demo/images/lab1-7-app-urls.png differ diff --git a/ai-vector-rag/demo/images/lab1-8-app-landing-page.png b/ai-vector-rag/demo/images/lab1-8-app-landing-page.png new file mode 100644 index 000000000..53131d3d5 Binary files /dev/null and b/ai-vector-rag/demo/images/lab1-8-app-landing-page.png differ diff --git a/ai-vector-rag/introduction/images/rag1.png b/ai-vector-rag/introduction/images/rag1.png new file mode 100644 index 000000000..f6d0ad316 Binary files /dev/null and b/ai-vector-rag/introduction/images/rag1.png differ diff --git a/ai-vector-rag/introduction/introduction.md b/ai-vector-rag/introduction/introduction.md new file mode 100644 index 000000000..a642675e2 --- /dev/null +++ b/ai-vector-rag/introduction/introduction.md @@ -0,0 +1,52 @@ +# AI Vector Search - Rag applications with Oracle AI Vector Search + +### **About this Workshop** + +Generative artificial intelligence (AI) excels at creating text responses based on large language models (LLMs) where the AI is trained on a massive number of data points. The good news is that the generated text is often easy to read and provides detailed responses that are broadly applicable to the questions asked of the software, often called prompts. + +The bad news is that the information used to generate the response is limited to the information used to train the AI, often a generalized LLM. The LLM’s data may be weeks, months, or years out of date and in a corporate AI chatbot may not include specific information about the organization’s products or services. That can lead to incorrect responses that erode confidence in the technology among customers and employees. + +That’s where retrieval-augmented generation (RAG) comes in. RAG provides a way to optimize the output of an LLM with targeted information without modifying the underlying model itself; that targeted information can be more up-to-date than the LLM as well as specific to a particular organization and industry. That means the generative AI system can provide more contextually appropriate answers to prompts as well as base those answers on extremely current data. + +This lab will guide you through the process of building a Retrieval Augmented Generation (RAG) application using Oracle AI Vector Search and a Generative AI model. This application will act as a flexible template that can be adapted to a wide range of use cases. Oracle Database 23AI will function as the vector data, where you'll store important context for the model to use when generating responses. This approach allows you to create a robust system that retrieves relevant data and combines it with the power of generative AI to deliver accurate, up-to-date answers based on your specific business needs. By the end of this lab, you will have: +- Stored, chunked, and vectorized data from a PDF document. +- Used a Large Language Model (LLM) to generate a precise answer to a user’s query based on relevant context stored in Oracle Database 23AI. +- See the diagram below what you will be learning. + + ![rag image](images/rag1.png " ") + +**_Estimated Time: 30 Minutes_** + +## About Oracle AI Vector Search + +Oracle AI Vector Search is a feature of Oracle Database 23ai that enables efficient searching of AI-generated vectors stored in the database. It supports fast search using various indexing strategies and can handle massive amounts of vector data. This makes it possible for Large Language Models (LLMs) to query private business data using a natural language interface, helping them provide more accurate and relevant results. Additionally, AI Vector Search allows developers to easily add semantic search capabilities to both new and existing applications. + +### **Objectives** +The labs in this workshop will guide you through the following tasks: + +- Getting familiar with the new Vector Datatype and PL/SQL packages for managing vector data and performing vector operations. +- Using PL/SQL to develop applications that work with Large Language Models (LLMs). +- Implementing Oracle AI Vector Search to store and search vectors within Oracle Database 23ai. +- Accessing popular LLMs and generating responses based on relevant data. +- Running a complete sample application that integrates all these concepts and showcases how to build a practical RAG solution. + +By the end of the workshop, you’ll have hands-on experience working with Oracle’s AI-powered tools to build a scalable, efficient retrieval augmented generation (RAG) application. + +## Learn More +- [What Is Retrieval-Augmented Generation](https://www.oracle.com/artificial-intelligence/generative-ai/retrieval-augmented-generation-rag/) + +- [Oracle Database 23ai Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/index.html) + +- [Oracle AI Vector Search User's Guide](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/whats-new-oracle-ai-vector-search.html) + +- [Oracle AI Vector Search Blog](https://blogs.oracle.com/database/post/oracle-announces-general-availability-of-ai-vector-search-in-oracle-database-23ai) + +- [Oracle AI Vector Embeddings](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/store-vector-embeddings.html) + +- [Oracle AI Vector Distance](https://docs.oracle.com/en/database/oracle/oracle-database/23/sqlrf/vector_distance.html) + + +## Acknowledgements +* **Author** - Francis Regalado, Database Product Management; David Start, Database Product Management +* **Contributors** - Brianna Ambler, Kaylien Phan, Database Product Management +* **Last Updated By/Date** - Brianna Ambler, October 2024 diff --git a/ai-vector-rag/rag/images/lab1-1-view-login-info.png b/ai-vector-rag/rag/images/lab1-1-view-login-info.png new file mode 100644 index 000000000..5ef061662 Binary files /dev/null and b/ai-vector-rag/rag/images/lab1-1-view-login-info.png differ diff --git a/ai-vector-rag/rag/images/lab1-2-jupyter-notebook-info.png b/ai-vector-rag/rag/images/lab1-2-jupyter-notebook-info.png new file mode 100644 index 000000000..ced2c27dd Binary files /dev/null and b/ai-vector-rag/rag/images/lab1-2-jupyter-notebook-info.png differ diff --git a/ai-vector-rag/rag/images/lab1-3-jupyter-login.png b/ai-vector-rag/rag/images/lab1-3-jupyter-login.png new file mode 100644 index 000000000..b526b0622 Binary files /dev/null and b/ai-vector-rag/rag/images/lab1-3-jupyter-login.png differ diff --git a/ai-vector-rag/rag/images/lab1-4-landing-page.png b/ai-vector-rag/rag/images/lab1-4-landing-page.png new file mode 100644 index 000000000..482f77f66 Binary files /dev/null and b/ai-vector-rag/rag/images/lab1-4-landing-page.png differ diff --git a/ai-vector-rag/rag/images/lab2-5-open-notebook.png b/ai-vector-rag/rag/images/lab2-5-open-notebook.png new file mode 100644 index 000000000..4710b8935 Binary files /dev/null and b/ai-vector-rag/rag/images/lab2-5-open-notebook.png differ diff --git a/ai-vector-rag/rag/images/lab2-6-run-notebook.png b/ai-vector-rag/rag/images/lab2-6-run-notebook.png new file mode 100644 index 000000000..8db2b582a Binary files /dev/null and b/ai-vector-rag/rag/images/lab2-6-run-notebook.png differ diff --git a/ai-vector-rag/rag/rag.md b/ai-vector-rag/rag/rag.md new file mode 100644 index 000000000..841eba853 --- /dev/null +++ b/ai-vector-rag/rag/rag.md @@ -0,0 +1,74 @@ +# Build Your Own RAG App! + +## Introduction + +Watch the following video for a brief walkthrough of the lab: + +[](videohub:1_02twssdb) + +A typical RAG (Retrieval Augmented Generation) application follows 7 key steps and requires a vector store. In this lab, you will learn how to build a RAG application using Oracle AI Vector Search. By the end of the lab, you will have stored, chunked, and vectorized data from a PDF document. You will then use a Large Language Model (LLM) to generate an answer to a user’s query based on the relevant context stored in Oracle Database 23ai. We’ll be working with documents (PDF) as the source data, but the same process can be applied to other data types like audio and video. + +Here are the steps we will cover: + +1. Load your document. +2. Convert the document to text. +3. Break the text into smaller chunks. +4. Use an embedding model to turn those chunks into vectors and store them in Oracle Database 23AI. +5. Ask a question in the prompt, and use the same embedding model to vectorize the question. +6. Perform a similarity search in Oracle Database 23ai using the question. +7. The search results and question are passed to the LLM to generate a final response. + +Each step will be explained in detail, guiding you through the process of interacting with models, embedding vectors, and using advanced search techniques. In the main workshop, additional information and documentation will be provided for further exploration and deeper understanding of the concepts covered. + +Throughout this section we will be leveraging a Jupyter Notebook to explore vectors. If you are unfamiliar with notebooks here are a few tips to get started: +- Instructions and code will be mixed together, each having their own blocks. You can use the run button on the code to see it execute. If you accidently hit run on any instructions it will just move to the next block so don't worry. +- When running a code block it will switch from either a [ ] or a [1] (a number inside) to a [*]. When you see the one with a * that means its running. Wait till it switches to a number before moving on. +- If you see any warnings, don't worry, they are probably just letting you know that things are changing, depreciating and you should look at updating to the latest standards. You don't need to do anything. + +### **Prerequisites** +This lab assumes you have: +- All previous labs successfully completed + +## Task 1: Open Notebook +This task will have you login to the Jupyter environment and run specific notebooks for this lab. + +1. **If you have already logged into the Jupyter environment skip to step 5, otherwise** open "**View Login Info**" section of your workshop. + + ![View login info.](images/lab1-1-view-login-info.png) + +2. Copy the Jupyter Notebook Password and click the Jupyter Notebook URL. + + ![Copy login details.](images/lab1-2-jupyter-notebook-info.png) + +3. Paste the Jupyter Notebook password you copied in the previous step into the password field. + + ![Enter the password.](images/lab1-3-jupyter-login.png) + +4. After a successfull login, you will see the Jupyter Notebook's landing page. + ![The Jupyter Notebook landing page.](images/lab1-4-landing-page.png) + +5. In the left File Explorer panel, open the (**workshop**) and open(**workshop.ipynb**) notebook. + + ![Open the workshop's Jupyter Notebook.](images/lab2-5-open-notebook.png) + +6. Follow the steps in the notebook. A few things to remember: + - there are markdown blocks and code blocks mixed together + - The run button can be used on both code and markdown blocks (markdown just advances you to the next block) + - When you run a code block there are [ ] next to the code block. If it changes to a [*] that means it running. If it has a number like [1] then its done running. + - Passwords and additional information you may need will be found in the "View Login Info" where the Jupyter Notebook link was + + ![How to use the Jupyter Notebook.](images/lab2-6-run-notebook.png) + +## Learn More + +- [Oracle Database 23ai Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/index.html) + +- [Oracle AI Vector Search User's Guide](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/whats-new-oracle-ai-vector-search.html) + +- [Oracle AI Vector Search Blog](https://blogs.oracle.com/database/post/oracle-announces-general-availability-of-ai-vector-search-in-oracle-database-23ai) + + +## Acknowledgements +* **Author** - Francis Regalado, Database Product Management; David Start, Database Product Management +* **Contributors** - Brianna Ambler, Kaylien Phan, Database Product Management +* **Last Updated By/Date** - Brianna Ambler, October 2024 \ No newline at end of file diff --git a/ai-vector-rag/sandbox/workshop/index.html b/ai-vector-rag/sandbox/workshop/index.html new file mode 100644 index 000000000..c5e04122d --- /dev/null +++ b/ai-vector-rag/sandbox/workshop/index.html @@ -0,0 +1,63 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/ai-vector-rag/sandbox/workshop/manifest.json b/ai-vector-rag/sandbox/workshop/manifest.json new file mode 100644 index 000000000..9d4af217e --- /dev/null +++ b/ai-vector-rag/sandbox/workshop/manifest.json @@ -0,0 +1,34 @@ +{ + "workshoptitle": "AI Vector Search - Complete RAG application with Oracle AI Vector Search", + "help": "livelabs-help-db_us@oracle.com", + "tutorials": [ + { + "title": "Introduction", + "description": "This is an introduction to RAG", + "type": "livelabs", + "filename": "../../introduction/introduction.md" + }, + { + "title": "Get Started", + "description": "Prerequisites for LiveLabs (Oracle-owned tenancies). The title of the lab and the Contents Menu title (the title above) match for Prerequisite lab. This lab is always first.", + "filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/cloud-login-23ai.md" + }, + { + "title": "Lab 1: Running a RAG Application", + "description": "Run a RAG application", + "type": "livelabs", + "filename": "../../demo/demo.md" + }, + { + "title": "Lab 2: Build Your Own RAG App", + "description": "Exploring RAG", + "type": "livelabs", + "filename": "../../rag/rag.md" + }, + { + "title": "Need Help?", + "description": "Template to link to Need Help lab at the end of workshop. Change 'CHANGE-ME' in link below to need-help-livelabs.md or need-help-freetier.md", + "filename":"https://raw.githubusercontent.com/oracle-livelabs/common/main/labs/need-help/need-help-freetier.md" + } + ] +} diff --git a/app-continuity-fundamentals/intro/images/RACandAssociated.png b/app-continuity-fundamentals/intro/images/RACandAssociated.png new file mode 100644 index 000000000..326d2a27b Binary files /dev/null and b/app-continuity-fundamentals/intro/images/RACandAssociated.png differ diff --git a/app-continuity-fundamentals/intro/intro.md b/app-continuity-fundamentals/intro/intro.md index 303a383e6..80e7645d8 100644 --- a/app-continuity-fundamentals/intro/intro.md +++ b/app-continuity-fundamentals/intro/intro.md @@ -34,7 +34,7 @@ Estimated Workshop Time: 2 hours Oracle Application Continuity provides: * Continuous availability for applications -![](./images/RACandRACFamily.png " ") +![](./images/racandassociated.png " ") ## Application Continuity and MAA Oracle MAA is a collection of architecture, configuration, and life cycle best practices and blueprints. It provides Oracle’s customers with valuable insights and expert recommendations which have been validated and tested working with enterprise customers. This is also an outcome of ongoing communication, with the community of database architects, software engineers, and database strategists, that helps Oracle develop a deep and complete understanding of various kinds of events that can affect availability or data integrity. Over the years, this led to the development and natural evolution of an array of availability reference architectures. @@ -49,5 +49,5 @@ Application Continuity extends the MAA architecture to the application tier. ## Acknowledgements -- **Authors/Contributors** - Troy Anthony, Ian Cookson -- **Last Updated By/Date** - Troy Anthony, March 2021 +- **Authors/Contributors** - Troy Anthony, Anil Nair +- **Last Updated By/Date** - Anil Nair, Oct 2024 diff --git a/create-tables-nosql-database/create-api-signing-keys/create-api-signing-keys.md b/create-tables-nosql-database/create-api-signing-keys/create-api-signing-keys.md index 7cdc118cb..06e0eff87 100644 --- a/create-tables-nosql-database/create-api-signing-keys/create-api-signing-keys.md +++ b/create-tables-nosql-database/create-api-signing-keys/create-api-signing-keys.md @@ -1,4 +1,4 @@ -# Create an API Signing Key and SDK CLI Configuration File +# Create an API Sign-In Key and SDK CLI Configuration File ## Introduction @@ -45,7 +45,7 @@ Any software client you use to connect to Oracle Cloud Infrastructure must be co ![Copy OCID](images/copy-user-ocid.png) -## Task 2: Generate an API Signing Key +## Task 2: Generate an API Sign-In Key To create a user API key, you will use `openssl` on your local system. If you are using Windows, we recommend the Git Bash Shell. @@ -91,7 +91,7 @@ To create a user API key, you will use `openssl` on your local system. If you ar openssl rsa -pubout -in ~/.oci/oci_api_key_private.pem -out ~/.oci/oci_api_key_public.pem -passin stdin ``` - ![](images/generate-public-key.png) + ![Generate a public key](images/generate-public-key.png) 6. Confirm that the public key file has been created in the directory you specified. @@ -105,7 +105,7 @@ To create a user API key, you will use `openssl` on your local system. If you ar 8. On the API Keys page, click **Add Public Key**. - ![](images/add-public-key.png) + ![Add Public Key](images/add-public-key.png) 9. Click **select one** and navigate to your `~/.oci` directory, and select the `oci_api_key_public.pem` file. Click **Add**. @@ -124,4 +124,4 @@ You may proceed to the next lab. ## Acknowledgements * **Author** - Dave Rubin, Senior Director, NoSQL and Embedded Database Development and Michael Brey, Director, NoSQL Product Development * **Contributors** - Jaden McElvey, Technical Lead - Oracle LiveLabs Intern -* **Last Updated By/Date** - Vandana Rajamani, Database User Assistance, February 2023 +* **Last Updated By/Date** - Ramya Umesh, Database User Assistance, October 2024 diff --git a/create-tables-nosql-database/run-sample-application/images/helloworldtable.png b/create-tables-nosql-database/run-sample-application/images/helloworldtable.png index 0cc692f5d..f6436fe64 100644 Binary files a/create-tables-nosql-database/run-sample-application/images/helloworldtable.png and b/create-tables-nosql-database/run-sample-application/images/helloworldtable.png differ diff --git a/create-tables-nosql-database/run-sample-application/images/nosql-cloud.png b/create-tables-nosql-database/run-sample-application/images/nosql-cloud.png index 57af3872d..babc3378b 100644 Binary files a/create-tables-nosql-database/run-sample-application/images/nosql-cloud.png and b/create-tables-nosql-database/run-sample-application/images/nosql-cloud.png differ diff --git a/create-tables-nosql-database/run-sample-application/images/open-helloworldtable.png b/create-tables-nosql-database/run-sample-application/images/open-helloworldtable.png index d3af4c808..38619d5ea 100644 Binary files a/create-tables-nosql-database/run-sample-application/images/open-helloworldtable.png and b/create-tables-nosql-database/run-sample-application/images/open-helloworldtable.png differ diff --git a/create-tables-nosql-database/run-sample-application/images/run-query.png b/create-tables-nosql-database/run-sample-application/images/run-query.png index 254426590..2a8da6ec9 100644 Binary files a/create-tables-nosql-database/run-sample-application/images/run-query.png and b/create-tables-nosql-database/run-sample-application/images/run-query.png differ diff --git a/create-tables-nosql-database/run-sample-application/run-sample-application.md b/create-tables-nosql-database/run-sample-application/run-sample-application.md index 95ad4303d..4f906960d 100644 --- a/create-tables-nosql-database/run-sample-application/run-sample-application.md +++ b/create-tables-nosql-database/run-sample-application/run-sample-application.md @@ -8,12 +8,12 @@ Estimated Lab Time: 10 Minutes ### About Oracle NoSQL Database Cloud Service -Oracle NoSQL Database Cloud Service is a fully managed database cloud service that handles large amounts of data at high velocity. Developers can start using this service in minutes by following the simple steps outlined in this tutorial. To get started with the service, you create a table. Oracle NoSQL Database supports Java, Python, Node.js , Go and C#. +Oracle NoSQL Database Cloud Service is a fully managed database cloud service that handles large amounts of data at high velocity. Developers can start using this service in minutes by following the simple steps outlined in this tutorial. To get started with the service, you create a table. Oracle NoSQL Database supports Java, Python, Node.js, Go, and C#. ### Prerequisites * An Oracle Free Tier, Always Free, Paid or LiveLabs Cloud Account -* Successful completon of Lab 1 : Create an API Signing Key and SDK CLI Configuration File +* Successful completion of Lab 1 : Create an API Signing Key and SDK CLI Configuration File This workshop contains different language implementation in the form of different tabs. Click the tab corresponding to the language you are interested in. @@ -24,45 +24,45 @@ This workshop contains different language implementation in the form of differen 2. Make sure you have `maven` installed. See [Installing Maven](https://maven.apache.org/install.html) for details. 3. Create a `test` directory. Download [pom.xml](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/data-management-library-files/pom.xml) to configure Oracle NoSQL SDK. This grabs the SDK runtime from Maven Central. -``` - - - 4.0.0 - com.oracle.nosql.example - HelloWorld - 1.0-SNAPSHOT - HelloWorld - http://maven.apache.org - - - - com.oracle.nosql.sdk - nosqldriver - - - - - - - - maven-clean-plugin - 3.1.0 - - - maven-compiler-plugin - 3.8.0 - - - true - - - - - - - -``` + ``` + + + 4.0.0 + com.oracle.nosql.example + HelloWorld + 1.0-SNAPSHOT + HelloWorld + http://maven.apache.org + + + + com.oracle.nosql.sdk + nosqldriver + + + + + + + + maven-clean-plugin + 3.1.0 + + + maven-compiler-plugin + 3.8.0 + + + true + + + + + + + + ``` **Note:** The latest SDK can be found here [Oracle NoSQL Database SDK For Java](https://mvnrepository.com/artifact/com.oracle.nosql.sdk/nosqldriver). Please make sure to replace the placeholder for the version of the Oracle NoSQL Java SDK in the `pom.xml` file with the exact SDK version number. @@ -70,13 +70,15 @@ This workshop contains different language implementation in the form of differen 1. Make sure that python is installed in your system. 2. You can install the Python SDK through the Python Package Index with the command given below. -``` -  pip3 install borneo -``` + + ``` + pip3 install borneo + ``` 3. If you are using the Oracle NoSQL Database cloud service you will also need to install the oci package: -``` -  pip3 install oci -``` + + ``` +   pip3 install oci + ``` @@ -87,40 +89,47 @@ This workshop contains different language implementation in the form of differen *Note: By default, the installer will install Go to Program Files or Program Files (x86). You can change the location as needed. After installing, you will need to close and reopen any open command prompts so that changes to the environment made by the installer are reflected at the command prompt.* - On Linux systems, Extract the archive you downloaded into /usr/local, creating a Go tree in /usr/local/go. Add /usr/local/go/bin to the PATH environment variable. - ``` - tar -C /usr/local -xzf go1.16.5.linux-amd64.tar.gz - export PATH=$PATH:/usr/local/go/bin - - ``` + ``` + tar -C /usr/local -xzf go1.16.5.linux-amd64.tar.gz + export PATH=$PATH:/usr/local/go/bin + + ``` 3. Verify that you've installed Go. In the Command Prompt window that appears, type the following command: ``` - - $ go version - + + $ go version + ``` Confirm that the command prints the installed version of Go. - 1. Open the [Node.js Download](https://nodejs.org/en/) and download Node.js for your operating system. Ensure that Node Package Manager (npm) is installed along with Node.js. - 2. Install the node SDK for Oracle NoSQL Database. + The Node SDK supports both JavaScript and TypeScript applications. + + 1. This lab includes code samples for JavaScript and TypeScript applications. Decide the language that you want to use. - ``` -   - npm install oracle-nosqldb - - ``` + 2. Open the [Node.js Download](https://nodejs.org/en/) link and download Node.js. Follow the prompts to install the Node.js package. The Node Package Manager (npm) is automatically installed. + + With this Node.js package, you can run both JavaScript and TypeScript applications. + + 3. Install the Node SDK for Oracle NoSQL Database. + + ``` + + npm install oracle-nosqldb + + ``` - With the above command, npm will create node_modules directory in the current directory and install it there. + With the above command, npm creates the `node_modules` directory in the current directory. Another option is to install the SDK globally: - ``` - - npm install -g oracle-nosqldb - - ``` -You can do one of the above options depending on the permissions you have. + ``` + + npm install -g oracle-nosqldb + + ``` + You can choose one of the above options depending on the permissions you have. @@ -128,60 +137,62 @@ You can add the SDK NuGet Package as a reference to your project by using .Net C 1. Make sure you have [.NET](https://dotnet.microsoft.com/en-us/download) installed in your system. You can add the SDK NuGet Package as a reference to your project by using .Net CLI: 2. Run the following command to create your project directory. -``` - -dotnet new console -o HelloWorld - -``` + ``` + + dotnet new console -o HelloWorld + + ``` 2. Go to your project directory. Add the SDK package to your project. - ``` - - dotnet add package Oracle.NoSQL.SDK - - ``` + + ``` + + dotnet add package Oracle.NoSQL.SDK + + ``` -## **Step 2:** Download, build and run the sample application +## **Step 2:** Download, build, and run the sample application 1. Download the provided [HelloWorld.java](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/data-management-library-files/HelloWorld.java) file and move it to the `test/src/main/java` directory. 2. Review the sample application. You can access the [JavaAPI Reference Guide](https://docs.oracle.com/en/cloud/paas/nosql-cloud/csnjv/index.html) to reference Java classes, methods, and interfaces included in this sample application. - Oracle NoSQL Database Cloud Service tables are created in a compartment and are scoped to that compartment. When authenticated as a specific user, your tables are managed in the root compartment of your tenancy unless otherwise specified. It is recommended not to create tables in the "root" compartment, but to create them in your own compartment created under "root". Edit the code [HelloWorld.java](https://objectstorage.us-ashburn-1.oraclecloud.com/p/qCpBRv5juyWwIF4dv9h98YWCDD50574Y6OwsIHhEMgI/n/c4u03/b/data-management-library-files/o/HelloWorld.java), replace the placeholder of the compartment in the function ```setDefaultCompartment``` with the OCID of your compartment. Replace the placeholder for region with the name of your region. Save the file and close it. + Oracle NoSQL Database Cloud Service tables are created in a compartment and are scoped to that compartment. It is recommended not to create tables in the "root" compartment, but to create them in your own compartment created under "root". Edit the code [HelloWorld.java](https://objectstorage.us-ashburn-1.oraclecloud.com/p/qCpBRv5juyWwIF4dv9h98YWCDD50574Y6OwsIHhEMgI/n/c4u03/b/data-management-library-files/o/HelloWorld.java), replace the placeholder of the compartment in the function ```setDefaultCompartment``` with the OCID of your compartment. Replace the placeholder for region with the name of your region. Save the file and close it. 3. From your home directory, navigate to ".oci" directory. -``` - -cd ~ -cd .oci - -``` - -Use `vi` or `nano` or any text editor to create a file named `config` in the `.oci` directory. - -``` - -[DEFAULT] -user=USER-OCID -fingerprint=FINGERPRINT-VALUE -tenancy=TENANCY-OCID -key_file= - -``` -Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five) with the value you copied on your note pad, FINGERPRINT-VALUE with your API key fingerprint, TENANCY-OCID with your [tenancy OCID](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five). The [key_file] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#How) is the private key that you generated. You should have noted these values in a text file as you've been working through this workshop. Use the values recorded from Lab 1. -![View config file](images/config-file.png) -When `SignatureProvider` is constructed without any parameters, the default [Configuration File](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/sdkconfig.htm) is located in the `~/.oci/config` directory. + ``` + + cd ~ + cd .oci + + ``` + + Use `vi` or `nano` or any text editor to create a file named `config` in the `.oci` directory. Copy the following content to the `config` file. + + ``` + + [DEFAULT] + user=USER-OCID + fingerprint=FINGERPRINT-VALUE + tenancy=TENANCY-OCID + key_file= + pass_phrase=PASSPHRASE + + ``` + Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five) with the value you copied on your notepad, FINGERPRINT-VALUE with your API key fingerprint, TENANCY-OCID with your [tenancy OCID](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five). The [key_file] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#How) is the private key that you generated. Replace the PASSPHRASE with the passphrase that you entered. You should have noted these values in a text file as you've been working through this workshop. Use the values recorded from Lab 1. + ![View config file](images/config-file.png) + When `SignatureProvider` is constructed without any parameters, the default [Configuration File](https://docs.cloud.oracle.com/iaas/Content/API/Concepts/sdkconfig.htm) is located in the `~/.oci/config` directory. 4. Compile your java code using the command `mvn compile`. 5. Build your maven project using the following command. -``` - -$ mvn exec:java -Dexec.mainClass=HelloWorld - -``` + ``` + + $ mvn exec:java -Dexec.mainClass=HelloWorld + + ``` *Note: In the main method of `HelloWorld.java`, the `dropTable(handle)` is commented out to allow you to see the result of creating the tables in the Oracle Cloud Console.* @@ -192,21 +203,22 @@ $ mvn exec:java -Dexec.mainClass=HelloWorld 2. Review the sample application. You can access the [Python API Reference Guide](https://nosql-python-sdk.readthedocs.io/en/latest/api.html) to reference Python classes and methods included in this sample application. - Oracle NoSQL Database Cloud Service tables are created in a compartment and are scoped to that compartment. When authenticated as a specific user, your tables are managed in the root compartment of your tenancy unless otherwise specified. It is recommended not to create tables in the "root" compartment, but to create them in your own compartment created under "root". Edit the code [HelloWorld.py](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/data-management-library-files/HelloWorld.py), replace the placeholder of the compartment in the function ```set_default_compartment``` with the OCID of your compartment. Replace the placeholder for region with the name of your region. Save the file and close it. + Oracle NoSQL Database Cloud Service tables are created in a compartment and are scoped to that compartment. It is recommended not to create tables in the "root" compartment, but to create them in your own compartment created under "root". Edit the code [HelloWorld.py](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/data-management-library-files/HelloWorld.py), replace the placeholder of the compartment in the function ```set_default_compartment``` with the OCID of your compartment. Replace the placeholder for region with the name of your region. Save the file and close it. -3. From your home directory, navigate to ".oci" directory. Create a file named `config` in the `.oci` directory. Add OCID, tenancy ID, fingerprint & key credentials in the `config` file. +3. From your home directory, navigate to ".oci" directory. Create a file named `config` in the `.oci` directory. Copy the following content to the `config` file. -``` - -[DEFAULT] -user=USER-OCID -fingerprint=FINGERPRINT-VALUE -tenancy=TENANCY-OCID -key_file= - -``` -Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five) with the value you copied on your note pad, FINGERPRINT-VALUE with your API key fingerprint, TENANCY-OCID with your [tenancy OCID](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five). The [key_file] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#How) is the private key that you generated. You should have noted these values in a text file as you've been working through this workshop. Use the values recorded from Lab 1. -![View config file](images/config-file.png) + ``` + + [DEFAULT] + user=USER-OCID + fingerprint=FINGERPRINT-VALUE + tenancy=TENANCY-OCID + key_file= + pass_phrase=PASSPHRASE + + ``` + Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five) with the value you copied on your notepad, FINGERPRINT-VALUE with your API key fingerprint, TENANCY-OCID with your [tenancy OCID](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five). The [key_file] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#How) is the private key that you generated. Replace the PASSPHRASE with the passphrase that you entered. You should have noted these values in a text file as you've been working through this workshop. Use the values recorded from Lab 1. + ![View config file](images/config-file.png) 4. Execute the sample application: Open the Command Prompt, and navigate to the directory where you saved the `HelloWorld.py` program. @@ -238,20 +250,22 @@ Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/api 2. Review the sample application. You can access the [Go API docs](https://pkg.go.dev/github.com/oracle/nosql-go-sdk/nosqldb?utm_source=godoc) to reference Go classes and methods included in this sample application. - Oracle NoSQL Database Cloud Service tables are created in a compartment and are scoped to that compartment. When authenticated as a specific user, your tables are managed in the root compartment of your tenancy unless otherwise specified. It is recommended not to create tables in the "root" compartment, but to create them in your own compartment created under "root". Edit the code [HelloWorld.go](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/data-management-library-files/HelloWorld.go) , replace the placeholder of the compartment in the constructor of ```NewSignatureProviderFromFile``` with the OCID of your compartment. Replace the placeholder for region with the name of your region. Save the file and close it. - -3. From your home directory, navigate to ".oci" directory. Create a file named `config` in the `.oci` directory. Add OCID, tenancy ID, fingerprint & key credentials in the `config` file. -``` - -[DEFAULT] -user=USER-OCID -fingerprint=FINGERPRINT-VALUE -tenancy=TENANCY-OCID -key_file= - -``` -Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five) with the value you copied on your note pad, FINGERPRINT-VALUE with your API key fingerprint, TENANCY-OCID with your [tenancy OCID](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five). The [key_file] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#How) is the private key that you generated. You should have noted these values in a text file as you've been working through this workshop. Use the values recorded from Lab 1. -![View config file](images/config-file.png) + Oracle NoSQL Database Cloud Service tables are created in a compartment and are scoped to that compartment. It is recommended not to create tables in the "root" compartment, but to create them in your own compartment created under "root". Edit the code [HelloWorld.go](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/data-management-library-files/HelloWorld.go) , replace the placeholder of the compartment in the constructor of ```NewSignatureProviderFromFile``` with the OCID of your compartment. Replace the placeholder for region with the name of your region. Save the file and close it. + +3. From your home directory, navigate to ".oci" directory. Create a file named `config` in the `.oci` directory. Copy the following content to the `config` file. + + ``` + + [DEFAULT] + user=USER-OCID + fingerprint=FINGERPRINT-VALUE + tenancy=TENANCY-OCID + key_file= + pass_phrase=PASSPHRASE + + ``` + Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five) with the value you copied on your notepad, FINGERPRINT-VALUE with your API key fingerprint, TENANCY-OCID with your [tenancy OCID](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five). The [key_file] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#How) is the private key that you generated. Replace the PASSPHRASE with the passphrase that you entered. You should have noted these values in a text file as you've been working through this workshop. Use the values recorded from Lab 1. + ![View config file](images/config-file.png) 4. Execute the sample application: Initialize a new module for the example program. @@ -262,6 +276,7 @@ Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/api ``` You see the following output: + ``` go: creating new go.mod: module example.com/HelloWorld @@ -270,6 +285,7 @@ Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/api ``` Run go mod tidy and the various modules are added to the project + ``` go mod tidy @@ -297,97 +313,112 @@ Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/api ``` - *Note: In the main method of `HelloWorld.go`, the code for dropping the table is commented out to allow you to see the result of creating the tables in the Oracle Cloud Console.* +*Note: In the main method of `HelloWorld.go`, the code for dropping the table is commented out to allow you to see the result of creating the tables in the Oracle Cloud Console.* +The given code sample in JavaScript and TypeScript use the [ES6 modules](https://docs.oracle.com/pls/topic/lookup?ctx=en/database/other-databases/nosql-database/24.1/nsdev&id=node_ecma_mod). -1. Download the provided [HelloWorld.js](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/data-management-library-files/HelloWorld.js) file and move it to your home directory. +1. For JavaScript applications, download the [HelloWorld.js](https://objectstorage.us-ashburn-1.oraclecloud.com/p/hP3lO4cVou3C1XqL-oxJi4F3IC3fsqwO6jsoq4b4-j6uhJ3DjFffEJwf6O5M0ABf/n/c4u04/b/livelabsfiles/o/HelloWorld.js) file and move it to your home directory. For TypeScript applications, download the [HelloWorld.ts] (https://objectstorage.us-ashburn-1.oraclecloud.com/p/-_rOKBbY7zRRg6fyYdm3vvRIatks_zGuJ3ZX4QhRDm8UfgAqsotpcDo4phLRuQAL/n/c4u04/b/livelabsfiles/o/HelloWorld.ts) file and move it to your home directory. 2. Review the sample application. You can access the [Node.js API Reference Guide](https://oracle.github.io/nosql-node-sdk/index.html) to reference Node.js classes and methods included in this sample application. - Oracle NoSQL Database Cloud Service tables are created in a compartment and are scoped to that compartment. When authenticated as a specific user, your tables are managed in the root compartment of your tenancy unless otherwise specified. It is recommended not to create tables in the "root" compartment, but to create them in your own compartment created under "root". Edit the code [HelloWorld.js](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/data-management-library-files/HelloWorld.js), replace the placeholder of the compartment in the ```NoSQLClient``` constructor with the OCID of your compartment. Replace the placeholder for region with the name of your region. Save the file and close it. + Oracle NoSQL Database Cloud Service tables are created in a compartment and are scoped to that compartment. It is recommended not to create tables in the "root" compartment, but to create them in your own compartment created under "root". Depending on your application, edit either the JavaScript code [HelloWorld.js](https://objectstorage.us-ashburn-1.oraclecloud.com/p/hP3lO4cVou3C1XqL-oxJi4F3IC3fsqwO6jsoq4b4-j6uhJ3DjFffEJwf6O5M0ABf/n/c4u04/b/livelabsfiles/o/HelloWorld.js) or the TypeScript code [HelloWorld.ts](https://objectstorage.us-ashburn-1.oraclecloud.com/p/-_rOKBbY7zRRg6fyYdm3vvRIatks_zGuJ3ZX4QhRDm8UfgAqsotpcDo4phLRuQAL/n/c4u04/b/livelabsfiles/o/HelloWorld.ts), replace the placeholder of the compartment in the ```NoSQLClient``` constructor with the OCID of your compartment. Replace the placeholder for region with the name of your region. Save the file and close it. -3. From your home directory, navigate to ".oci" directory. Create a file named `config` in the `.oci` directory. Add OCID, tenancy ID, fingerprint & key credentials in the `config` file. +3. From your home directory, navigate to ".oci" directory. Create a file named `config` in the `.oci` directory. Copy the following content to the `config` file. -``` - -[DEFAULT] -user=USER-OCID -fingerprint=FINGERPRINT-VALUE -tenancy=TENANCY-OCID -key_file= - -``` -Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five) with the value you copied on your note pad, FINGERPRINT-VALUE with your API key fingerprint, TENANCY-OCID with your [tenancy OCID](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five). The [key_file] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#How) is the private key that you generated. You should have noted these values in a text file as you've been working through this workshop. Use the values recorded from Lab 1. -![View config file](images/config-file.png) + ``` + + [DEFAULT] + user=USER-OCID + fingerprint=FINGERPRINT-VALUE + tenancy=TENANCY-OCID + key_file= + pass_phrase=PASSPHRASE + + ``` + Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five) with the value you copied on your notepad, FINGERPRINT-VALUE with your API key fingerprint, TENANCY-OCID with your [tenancy OCID](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five). The [key_file] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#How) is the private key that you generated. Replace the PASSPHRASE with the passphrase that you entered. You should have noted these values in a text file as you've been working through this workshop. Use the values recorded from Lab 1. + ![View config file](images/config-file.png) 4. Execute the Sample Application - Open the Command Prompt, and navigate to the directory where you saved the `HelloWorld.js` program. + + For JavaScript Application: + Open the Command Prompt, and navigate to the directory where you saved the `HelloWorld.js` program. + Execute the HelloWorld program. + + ``` +   + node HelloWorld.js + + ``` + For TypeScript Application: + Open the Command Prompt, and navigate to the directory where you saved the `HelloWorld.ts` program. Execute the HelloWorld program. - ``` - - node HelloWorld.js - - ``` - *Note: In the main method of `HelloWorld.js`, the `dropTable(handle)` is commented out to allow you to see the result of creating the tables in the Oracle Cloud Console.* + ``` +   + npx tsx HelloWorld.ts + + ``` +*Note: In the main method of `HelloWorld.js` and `HelloWorld.ts`, the `dropTable(handle)` is commented out to allow you to see the result of creating the tables in the Oracle Cloud Console.* 1. Download the provided [HelloWorld.cs](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/data-management-library-files/HelloWorld.cs) file and move it to your home directory. 2. Review the sample application. You can access the [.NET API Reference Guide](https://oracle.github.io/nosql-dotnet-sdk/index.html) to reference .NET classes and methods included in this sample application. - Oracle NoSQL Database Cloud Service tables are created in a compartment and are scoped to that compartment. When authenticated as a specific user, your tables are managed in the root compartment of your tenancy unless otherwise specified. It is recommended not to create tables in the "root" compartment, but to create them in your own compartment created under "root". Edit the code [HelloWorld.cs](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/data-management-library-files/HelloWorld.cs), replace the placeholder of the compartment in the ```NoSQLClient``` constructor with the OCID of your compartment. Replace the placeholder for region with the name of your region. Save the file and close it. - -3. From your home directory, navigate to ".oci" directory. Create a file named `config` in the `.oci` directory. Add OCID, tenancy ID, fingerprint & key credentials in the `config` file. - -``` - -[DEFAULT] -user=USER-OCID -fingerprint=FINGERPRINT-VALUE -tenancy=TENANCY-OCID -key_file= - -``` -Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five) with the value you copied on your note pad, FINGERPRINT-VALUE with your API key fingerprint, TENANCY-OCID with your [tenancy OCID](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five). The [key_file] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#How) is the private key that you generated. You should have noted these values in a text file as you've been working through this workshop. Use the values recorded from Lab 1. -![View config file](images/config-file.png) - -4. Go to your project directory. you will see the example source code ```Program.cs```. Remove this file . -``` - - rm Program.cs - -``` -Build and run your project as shown below. - -*Note: You have multiple dotnet target frameworks which are supported. Currently the supported frameworks are .NET 7.0 and higher.* - -``` - -dotnet run - -``` - *Note: In the RunBasicExample method of `HelloWorld.cs`, the section to drop table is commented out to allow you to see the result of creating the tables in the Oracle Cloud Console.* + Oracle NoSQL Database Cloud Service tables are created in a compartment and are scoped to that compartment. It is recommended not to create tables in the "root" compartment, but to create them in your own compartment created under "root". Edit the code [HelloWorld.cs](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/data-management-library-files/HelloWorld.cs), replace the placeholder of the compartment in the ```NoSQLClient``` constructor with the OCID of your compartment. Replace the placeholder for region with the name of your region. Save the file and close it. + +3. From your home directory, navigate to ".oci" directory. Create a file named `config` in the `.oci` directory. Copy the following content to the `config` file. + + ``` + + [DEFAULT] + user=USER-OCID + fingerprint=FINGERPRINT-VALUE + tenancy=TENANCY-OCID + key_file= + pass_phrase=PASSPHRASE + + ``` + Replace [USER-OCID] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five) with the value you copied on your notepad, FINGERPRINT-VALUE with your API key fingerprint, TENANCY-OCID with your [tenancy OCID](https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#five). The [key_file] (https://docs.oracle.com/en-us/iaas/Content/API/Concepts/apisigningkey.htm#How) is the private key that you generated. Replace the PASSPHRASE with the passphrase that you entered. You should have noted these values in a text file as you've been working through this workshop. Use the values recorded from Lab 1. + ![View config file](images/config-file.png) + +4. Go to your project directory. You will see the example source code ```Program.cs```. Remove this file. + + ``` + + rm Program.cs + + ``` + Build and run your project as shown below. + + *Note: You have multiple dotnet target frameworks which are supported. Currently the supported frameworks are .NET 7.0 and higher.* + + ``` + + dotnet run + + ``` +*Note: In the RunBasicExample method of `HelloWorld.cs`, the section to drop table is commented out to allow you to see the result of creating the tables in the Oracle Cloud Console.* ## **Step 3:** Explore tables using the Oracle Cloud Infrastructure Console -1. On the left hand menu, click **NoSQL Database**. +1. On the left hand menu, click **Databases**. In the **Databases** window, click **Tables** under **Oracle NoSQL Database**. - ![Click NoSQL Database](images/nosql-cloud.png) + ![Click NoSQL Database Tables](images/nosql-cloud.png) 2. Click **HelloWorldTable** to open the details page. - *If you do not see HelloWorldTable select your correct compartment ( that you mentioned in your code) on the left dropdown.* + *If you do not see HelloWorldTable select your correct compartment (that you mentioned in your code) on the left dropdown.* ![Click HelloWorldTable](images/open-helloworldtable.png) -3. Click **Table Rows** under Resources. +3. Click **Columns** under Resources to view the table columns. - ![Table Rows](images/helloworldtable.png) + ![View table columns](images/helloworldtable.png) -4. Click Run Query to execute the select statement and display the record inserted into the table. +4. Click **Explore data** under Resources and click **Execute** to execute the select statement and display the record inserted into the table. - ![Run Query](images/run-query.png) + ![Click Execute](images/run-query.png) Congratulations! You have completed the workshop. @@ -413,4 +444,4 @@ This application accesses Oracle NoSQL Database Cloud Service, but most likely y ## Acknowledgements * **Author** - Dave Rubin, Senior Director, NoSQL and Embedded Database Development and Michael Brey, Director, NoSQL Product Development * **Contributors** - Jaden McElvey, Technical Lead - Oracle LiveLabs Intern -* **Last Updated By/Date** -Vandana Rajamani, Database User Assistance, January 2024 +* **Last Updated By/Date** -Ramya Umesh, Database User Assistance, October 2024 diff --git a/create-tables-nosql-database/workshops/freetier/manifest.json b/create-tables-nosql-database/workshops/freetier/manifest.json index 9593d7d8b..007ef80f0 100644 --- a/create-tables-nosql-database/workshops/freetier/manifest.json +++ b/create-tables-nosql-database/workshops/freetier/manifest.json @@ -13,7 +13,7 @@ "filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/pre-register-free-tier-account.md" }, { - "title": "Lab 1: Create an API Signing Key and SDK CLI Configuration File", + "title": "Lab 1: Create an API Sign-In Key and SDK CLI Configuration File", "filename":"../../create-api-signing-keys/create-api-signing-keys.md" }, { diff --git a/create-tables-nosql-database/workshops/livelabs/manifest.json b/create-tables-nosql-database/workshops/livelabs/manifest.json index 745dcf8c9..79ddb789f 100644 --- a/create-tables-nosql-database/workshops/livelabs/manifest.json +++ b/create-tables-nosql-database/workshops/livelabs/manifest.json @@ -13,7 +13,7 @@ "filename":"../../introduction/introduction.md" }, { - "title": "Lab 1: Create an API Signing Key and SDK CLI Configuration File", + "title": "Lab 1: Create an API Sign-In Key and SDK CLI Configuration File", "filename":"../../create-api-signing-keys/create-api-signing-keys.md" }, { diff --git a/datapump-xtts-migration/00-introduction/introduction.md b/datapump-xtts-migration/00-introduction/introduction.md index 792029772..730463173 100644 --- a/datapump-xtts-migration/00-introduction/introduction.md +++ b/datapump-xtts-migration/00-introduction/introduction.md @@ -10,7 +10,7 @@ For simplicity, this lab teaches you to migrate a database from Linux to Linux, Estimated Workshop Time: 1 hour -[Next Level Platform](videohub:1_wcdk0nws) +[Next-Level Platform Migration with Cross-Platform Transportable Tablespaces - Introduction](youtube:fgyDy-QcV_o?start=10) ### Objectives diff --git a/datapump-xtts-migration/01-initialize-environment/initialize-environment.md b/datapump-xtts-migration/01-initialize-environment/initialize-environment.md index c98ea55fc..296d7dc98 100644 --- a/datapump-xtts-migration/01-initialize-environment/initialize-environment.md +++ b/datapump-xtts-migration/01-initialize-environment/initialize-environment.md @@ -6,7 +6,7 @@ In this lab, you will review and start-up all components required to run this wo Estimated Time: 5 Minutes -[Next Level Platform](videohub:1_kfvfupd4) +[Next-Level Platform Migration with Cross-Platform Transportable Tablespaces - lab 1](youtube:fgyDy-QcV_o?start=185) ### Objectives diff --git a/datapump-xtts-migration/02-check-source/check-source.md b/datapump-xtts-migration/02-check-source/check-source.md index 49ed015f5..c07af9622 100644 --- a/datapump-xtts-migration/02-check-source/check-source.md +++ b/datapump-xtts-migration/02-check-source/check-source.md @@ -6,7 +6,7 @@ In this lab, you will perform a number of checks on the source database to ensur Estimated Time: 10 Minutes -[Next Level Platform](videohub:1_sxoqy9pd) +[Next-Level Platform Migration with Cross-Platform Transportable Tablespaces - lab 2](youtube:fgyDy-QcV_o?start=275) ### Objectives diff --git a/datapump-xtts-migration/03-create-target/create-target.md b/datapump-xtts-migration/03-create-target/create-target.md index 055785eae..c624ee88a 100644 --- a/datapump-xtts-migration/03-create-target/create-target.md +++ b/datapump-xtts-migration/03-create-target/create-target.md @@ -6,7 +6,7 @@ In this lab, you create a new, empty pluggable database in *CDB23*. The database Estimated Time: 10 Minutes -[Next Level Platform](videohub:1_04gmmrd8) +[Next-Level Platform Migration with Cross-Platform Transportable Tablespaces - lab 3](youtube:fgyDy-QcV_o?start=535) ### Objectives diff --git a/datapump-xtts-migration/04-prepare-m5/prepare-m5.md b/datapump-xtts-migration/04-prepare-m5/prepare-m5.md index 8063379e0..9cf5d88b6 100644 --- a/datapump-xtts-migration/04-prepare-m5/prepare-m5.md +++ b/datapump-xtts-migration/04-prepare-m5/prepare-m5.md @@ -6,7 +6,7 @@ In this lab, you take a first look at the M5 script. The script is available for Estimated Time: 5 Minutes -[Next Level Platform](videohub:1_gnbcgiin) +[Next-Level Platform Migration with Cross-Platform Transportable Tablespaces - lab 4](youtube:fgyDy-QcV_o?start=766) ![Configure M5 script](./images/prepare-m5-overview.png " ") diff --git a/datapump-xtts-migration/05-initial-backup-restore/initial-backup-restore.md b/datapump-xtts-migration/05-initial-backup-restore/initial-backup-restore.md index 64be84f7a..51bed1cec 100644 --- a/datapump-xtts-migration/05-initial-backup-restore/initial-backup-restore.md +++ b/datapump-xtts-migration/05-initial-backup-restore/initial-backup-restore.md @@ -6,7 +6,8 @@ Now, it's time to start the migration. First, you take a level 0 backup that you Estimated Time: 10 Minutes -[Next Level Platform](videohub:1_x11nn7nr) +[Next-Level Platform Migration with Cross-Platform Transportable Tablespaces - lab 5](youtube:fgyDy-QcV_o?start=930) + ![Start the initial level 0 backup/restore](./images/initial-backup-restore-overview.png " ") diff --git a/datapump-xtts-migration/06-incremental-backup-restore/incremental-backup-restore.md b/datapump-xtts-migration/06-incremental-backup-restore/incremental-backup-restore.md index e011ff3cf..6b93e9ca3 100644 --- a/datapump-xtts-migration/06-incremental-backup-restore/incremental-backup-restore.md +++ b/datapump-xtts-migration/06-incremental-backup-restore/incremental-backup-restore.md @@ -6,7 +6,7 @@ The next part of the migration is the incremental backups. They built on top of Estimated Time: 10 Minutes -[Next Level Platform](videohub:1_0l5swhst) +[Next-Level Platform Migration with Cross-Platform Transportable Tablespaces - lab 6](youtube:fgyDy-QcV_o?start=1232) ![Start the incremental level 1 backup/restore](./images/incremental-backup-restore-overview.png " ") diff --git a/datapump-xtts-migration/07-test-migration/test-migration.md b/datapump-xtts-migration/07-test-migration/test-migration.md index 3a0fe2389..9a7563c93 100644 --- a/datapump-xtts-migration/07-test-migration/test-migration.md +++ b/datapump-xtts-migration/07-test-migration/test-migration.md @@ -16,7 +16,7 @@ This is an optional lab. You can skip it and move directly to lab 8. Estimated Time: 20 Minutes -[Next Level Platform](videohub:1_qyy2rxav) +[Next-Level Platform Migration with Cross-Platform Transportable Tablespaces - lab 7](youtube:fgyDy-QcV_o?start=1569) ### Objectives diff --git a/datapump-xtts-migration/08-final-preparations/final-preparations.md b/datapump-xtts-migration/08-final-preparations/final-preparations.md index ce471e2fd..9dc236d62 100644 --- a/datapump-xtts-migration/08-final-preparations/final-preparations.md +++ b/datapump-xtts-migration/08-final-preparations/final-preparations.md @@ -6,7 +6,7 @@ Right before the outage starts, there are a few final preparations. Estimated Time: 5 Minutes -[Next Level Platform](videohub:1_dmmf02vy) +[Next-Level Platform Migration with Cross-Platform Transportable Tablespaces - lab 8](youtube:fgyDy-QcV_o?start=2231) ### Objectives diff --git a/datapump-xtts-migration/09-final-backup-restore/final-backup-restore.md b/datapump-xtts-migration/09-final-backup-restore/final-backup-restore.md index e0b0d4b69..bc7a24a5d 100644 --- a/datapump-xtts-migration/09-final-backup-restore/final-backup-restore.md +++ b/datapump-xtts-migration/09-final-backup-restore/final-backup-restore.md @@ -6,7 +6,7 @@ It's time to complete the migration. You've done all the preparations, but now i Estimated Time: 20 Minutes -[Next Level Platform](videohub:1_3r3ijska) +[Next-Level Platform Migration with Cross-Platform Transportable Tablespaces - lab 9](youtube:fgyDy-QcV_o?start=2363) ![Complete the migration](./images/final-backup-restore-overview.png " ") diff --git a/datapump-xtts-migration/10-post-migration-tasks/post-migration-tasks.md b/datapump-xtts-migration/10-post-migration-tasks/post-migration-tasks.md index effe605c5..a817d864e 100644 --- a/datapump-xtts-migration/10-post-migration-tasks/post-migration-tasks.md +++ b/datapump-xtts-migration/10-post-migration-tasks/post-migration-tasks.md @@ -6,7 +6,7 @@ Now, you have migrated the database. Before going live, there are a few importan Estimated Time: 10 Minutes -[Next Level Platform](videohub:1_qxg5tjfj) +[Next-Level Platform Migration with Cross-Platform Transportable Tablespaces - lab 10](youtube:fgyDy-QcV_o?start=2722) ### Objectives diff --git a/db-23ai-fundamentals/annotations/annotations.md b/db-23ai-fundamentals/annotations/annotations.md index c2df6eb21..3998ddd66 100644 --- a/db-23ai-fundamentals/annotations/annotations.md +++ b/db-23ai-fundamentals/annotations/annotations.md @@ -17,9 +17,15 @@ The objective of this lab is to provide hands-on experience with Schema Annotati ## Task 1: Adding Schema Annotations -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. ![click SQL](images/im1.png =50%x*) + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) + 2. Why Use Schema Annotations? Schema Annotations provide a way to add additional property metadata for database objects, such as tables, columns, views, materialized views, and even domains. Compared to comments, annotations offer more flexibility. They can be used with various types of database elements, not just tables. Also, you can attach multiple annotations to the same object, which isn't possible with comments. Schema Annotations are keys with optional values. You can use them to record any metadata you want about the object in question. This is important because there is no set format for comments. So, which do you use: JSON? XML? Delimited key-value pairs? And on top of this, how do you enforce the format for all future maintainers? diff --git a/db-23ai-fundamentals/annotations/images/simple-db-actions.png b/db-23ai-fundamentals/annotations/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/annotations/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/intro/23ai-intro-15.md b/db-23ai-fundamentals/intro/23ai-intro-15.md index 6af6ea0cb..de390d9fa 100644 --- a/db-23ai-fundamentals/intro/23ai-intro-15.md +++ b/db-23ai-fundamentals/intro/23ai-intro-15.md @@ -2,7 +2,7 @@ Welcome to the Oracle Database 23ai New Features Quick Start Workshop! This workshop covers some of the new features and enhancements in Oracle's long-term support release, version 23ai. Please note, this lab provides a high-level overview of some of Oracle Database 23ai’s new features. This is a small set of the 300+ new features in the database. For a comprehensive workshop, please visit the [23ai New Features](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3950). -[](youtube:HLQW1OkLuaw) +[](youtube:MPOYjrGhvZk) ## About Oracle Database 23ai diff --git a/db-23ai-fundamentals/intro/23ai-intro.md b/db-23ai-fundamentals/intro/23ai-intro.md index 9e6eaad87..b500074ff 100644 --- a/db-23ai-fundamentals/intro/23ai-intro.md +++ b/db-23ai-fundamentals/intro/23ai-intro.md @@ -2,7 +2,7 @@ Welcome to the Oracle Database 23ai New Features Workshop! This workshop covers some of the new features and enhancements in Oracle's long-term support release, version 23ai. While this introduction LiveLab provides an overview of the new features, keep in mind that this is not an exhaustive list, rather just a small sample of some of the new features in the database. If there is a specific database feature that you would like to see in this workshop, tag me on X (twitter) with your suggestion! [@Killianlynchh](https://twitter.com/Killianlynchh) -[](youtube:HLQW1OkLuaw) +[](youtube:MPOYjrGhvZk) ## About Oracle Database 23ai diff --git a/db-23ai-fundamentals/intro/images/dbseclab-archi.png b/db-23ai-fundamentals/intro/images/dbseclab-archi.png new file mode 100644 index 000000000..90d69bd7f Binary files /dev/null and b/db-23ai-fundamentals/intro/images/dbseclab-archi.png differ diff --git a/db-23ai-fundamentals/intro/json-dv-intro-15.md b/db-23ai-fundamentals/intro/json-dv-intro-15.md index 2a74f3e03..0df285e9f 100644 --- a/db-23ai-fundamentals/intro/json-dv-intro-15.md +++ b/db-23ai-fundamentals/intro/json-dv-intro-15.md @@ -4,7 +4,7 @@ This workshop briefly introduces you to the JSON Duality View feature. -### **JSON Duality** +### **JSON Relational Duality** JSON Relational Duality is a landmark capability in Oracle Database 23ai providing game-changing flexibility and simplicity for Oracle Database developers. This breakthrough innovation overcomes the historical challenges developers have faced when building applications, using relational or document models. diff --git a/db-23ai-fundamentals/intro/security-intro-15.md b/db-23ai-fundamentals/intro/security-intro-15.md index 7327594b7..a0c171d3f 100644 --- a/db-23ai-fundamentals/intro/security-intro-15.md +++ b/db-23ai-fundamentals/intro/security-intro-15.md @@ -2,14 +2,25 @@ In this workshop, we introduce you to a newly released feature of Oracle Database 23ai--_Schema-Level Privileges_. Previously, developers had to either give users full-access to the database or manually grant user privileges to each database object in a schema. With Oracle Database 23ai, developers can now grant privileges at the schema-level--making it easier to secure your database. -## About Oracle Database 23ai +## About this Workshop -Building on the strengths of its predecessor, Oracle Database 23ai represents the latest long-term support release, delivering new cutting-edge technology. Just like Oracle Database 19c, version 23ai provides best-in-class support for all data types, including the new Vector data type along with relational, JSON, XML, spatial, graph, and more, coupled with industry-leading performance, scalability, availability, and security for various workloads. +There are additional workshops dedicated to the Oracle Database Security features and functionalities. -Users of Oracle Database 19c and 21c can directly upgrade to Oracle Database 23ai. +Based on an OCI architecture, deployed in a few minutes with a simple internet connection, it allows you to test DB Security use cases in a complete environment already pre-configured by the Oracle Database Security Product Manager Team. -Check out this workshop for free access to two databases and a hands on guide to get some experience with upgrading: -[Hitchhiker's Guide for Upgrading to Oracle Database 19c & Oracle Database 23ai](https://livelabs.oracle.com/pls/apex/dbpm/r/livelabs/view-workshop?wid=3943) +Now, you no longer need important resources on your PC (storage, CPU or memory), nor complex tools to master, making you completely autonomous to discover at your rhythm all new DB Security features. + +### Components +The complete architecture of the **DB Security Hands-On Labs** is as following: + + ![DBSec LiveLabs Archi](./images/dbseclab-archi.png "DBSec LiveLabs Archi") + +It may be composed of as many as five VMs: + - **DBSec-Lab** (mandatory for all workshops: Baseline and Advanced workshops) + - **Audit Vault Server** (for Advanced workshop only) + - **DB Firewall Server** (for Advanced workshop only) + - **Key Vault Server** (for Advanced workshop only) + - **DB23ai** (for SQL Firewall workshop only) You may now proceed to the next section. @@ -24,6 +35,6 @@ You may now proceed to the next section. ## Acknowledgements * **Author** - Killian Lynch, Database Product Management -* **Contributors** - Dom Giles, Brianna Ambler, Database Product Management -* **Last Updated By/Date** - Brianna Ambler, August 2024 +* **Contributors** - Dom Giles, Brianna Ambler, Francis Regalado Database Product Management +* **Last Updated By/Date** - Francis Regalado, Oct 2024 diff --git a/db-23ai-fundamentals/intro/sql-introduction.md b/db-23ai-fundamentals/intro/sql-introduction.md index 761c6217a..db1f10497 100644 --- a/db-23ai-fundamentals/intro/sql-introduction.md +++ b/db-23ai-fundamentals/intro/sql-introduction.md @@ -14,7 +14,7 @@ JSON Relational Duality helps to converge the benefits of both document and rela Key benefits of JSON Relational Duality: - Experience extreme flexibility in building apps using Duality View. Developers can access the same data relationally or as hierarchical documents based on their use case and are not forced into making compromises because of the limitations of the underlying database. Build document-centric apps on relational data or create SQL apps on documents. -- Experience simplicity by retrieving and storing all the data needed for an app in a single database operation. Duality Views provide fully updateable JSON views over data. Apps can read a document, make necessary changes, and write the document back without worrying about underlying data structure, mapping, consistency, or performance tuning. +- Experience simplicity by retrieving and storing all the data needed for an app in a single database operation. Duality Views provide fully updatable JSON views over data. Apps can read a document, make necessary changes, and write the document back without worrying about underlying data structure, mapping, consistency, or performance tuning. - Enable flexibility and simplicity in building multiple apps on same data. Developers can use the power of Duality View to define multiple JSON Views across overlapping groups of tables. This flexible data modeling makes building multiple apps against the same data easy and efficient. - Duality Views eliminate the inherent problem of data duplication and data inconsistency in document databases. Duality Views are fully ACID (atomicity, consistency, isolation, durability) transactions across multiple documents and tables. It eliminates data duplication across documents data, whereas consistency is maintained automatically. - Build apps that support high concurrency access and updates. Traditional locks don’t work well for modern apps. A new lock-free concurrency control provided with Duality View supports high concurrency updates. The new-lock free concurrency control also works efficiently for interactive applications since the data is not locked during human thinking time. diff --git a/db-23ai-fundamentals/new-ai-vector-search/images/simple-db-actions.png b/db-23ai-fundamentals/new-ai-vector-search/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-ai-vector-search/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-ai-vector-search/new-ai-vector-search.md b/db-23ai-fundamentals/new-ai-vector-search/new-ai-vector-search.md index c64d9625a..cf53fb02e 100644 --- a/db-23ai-fundamentals/new-ai-vector-search/new-ai-vector-search.md +++ b/db-23ai-fundamentals/new-ai-vector-search/new-ai-vector-search.md @@ -4,26 +4,30 @@ Welcome to the "Exploring AI Vector Search" workshop. In this workshop, you will learn what vectors are and how they are used in AI applications. We will cover the creation of vector tables, perform basic DDL operations, and dive into similarity search using some of the new SQL functions in Oracle Database 23ai. This lab is meant to be a small introduction to the new AI functionality that Oracle Database 23ai supports. -This lab will focus on AI Vector search at a very high level. If you're looking for an in depth workshop on AI Vector Search, check out the following labs: -* [Complete RAG Application using PL/SQL in Oracle Database 23ai](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3934&clear=RR,180&session=1859311324732) -* [7 Easy Steps to Building a RAG Application using LangChain](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3927&clear=RR,180&session=1859311324732) -* [Using Vector Embedding Models with Python](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3928&clear=RR,180&session=1859311324732) -* [Using Vector Embedding Models with Nodejs](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3926&clear=RR,180&session=1859311324732) +This lab will focus on AI Vector search at a very high level. If you're looking for an in depth workshop on AI Vector Search, check out Learn More section at the bottom of this workshop Estimated Lab Time: 20 minutes ### Objective: -In this lab, you will explore the new vector data type introduced in Oracle Database 23ai. You will create a vector table and perform basic DDL operations on the vectors. You will also learn about similarity search and how it relates to vectors, as well as use some of the new AI focused SQL functions in the database. +In this lab, you will explore the new vector data type and SQL Functions introduced in Oracle Database 23ai. You will create a vector table and perform basic DDL operations on the vectors. You will also learn about similarity search and how it relates to vectors. ### Prerequisites: +- Completed the 'Getting Started with LiveLabs' lab. - Access to Oracle Database 23ai environment. - Basic understanding of SQL and PL/SQL. ## Task 1: Creating a vector table -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. ![click SQL](images/im1.png =50%x*) -2. The first thing we'll do is create a table with the new vector data type. + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) + + +3. The first thing we'll do is create a table with the new vector data type. Paste the following into the SQL Worksheet and click the **Run as Script Button** (shown in the picture below) ``` @@ -34,9 +38,7 @@ In this lab, you will explore the new vector data type introduced in Oracle Data ``` ![Create a table](images/vec1.png =50%x*) - Nothing crazy here. Just the new vector data type in the Oracle Database! - -2. Before we add data, let's understand what vectors are (mathematically) and how they relate to Generative AI. +4. Before we add data, let's understand what vectors are (mathematically) and how they relate to Generative AI. A vector is simply an array of numbers. Mathematically, a vector is an object that has both magnitude and direction (think of an arrow plotted on a graph). In generative AI, vectors represent the semantic meaning of objects, such as pictures, documents, audio files, or other large unstructured objects. @@ -48,13 +50,13 @@ In this lab, you will explore the new vector data type introduced in Oracle Data Okay, so what? - At a high level, vectors are what these large language models use under the covers. Through storing vectors in the Oracle database, you can create countless applications that utilize generative AI capabilities and build the next generation of AI applications. The following diagram shows a VERY high-level overview of how you would create a chatbot application that can use an LLM in combination with private company data to answer questions specific to YOUR data. This process is called Retrieval Augmented Generation, or RAG. + At a high level, vectors are what these large language models use under the covers. Through storing vectors in the Oracle Database, you can create countless applications that utilize LLMs and generative AI capabilities to build the next generation of AI applications. The following diagram shows a VERY high-level overview of how you would create a chatbot application that can use an LLM in combination with private company data to answer questions specific to YOUR data. This process is called Retrieval Augmented Generation, or RAG. ![Vector diagram](images/vectors-diagram-2.png " ") We aren't going to cover RAG in this lab. If you're interested in that, checkout this free sandbox environment and build a [RAG Application](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3934&clear=RR,180&session=1859311324732). -3. In this task we're going to focus on the vector datatype. Let's add some data to our vector table. +5. In this task we're going to focus on the **vector datatype**. A vector in the Oracle Database is nothing more than another data type. For example, let's add some data to our vector table. Clear the SQL Worksheet and paste the following into the SQL Worksheet. Click the **Run as Script Button**. ``` @@ -64,7 +66,7 @@ In this lab, you will explore the new vector data type introduced in Oracle Data ``` -4. We can query our table and see the data we just inserted. +6. We can query our table and see the data we just inserted. ``` @@ -73,7 +75,7 @@ In this lab, you will explore the new vector data type introduced in Oracle Data ``` ![select from the table](images/vec2.png =50%x*) -5. We can use regular DDL against our vectors just as we'd expect. For example, run the following to update one of our vectors. +7. We can use regular DDL against our vectors just as we'd expect. For example, run the following to update one of our vectors. ``` @@ -86,7 +88,7 @@ In this lab, you will explore the new vector data type introduced in Oracle Data ``` ![update the table](images/vec3.png =50%x*) -6. We can also delete rows with vectors. Run the following to remove a vector. +8. We can also delete rows with vectors just as we'd expect. Again, the vectors are just a datatype in the Oracle Database. Run the following to remove a vector. ``` delete from vector_table @@ -98,9 +100,9 @@ In this lab, you will explore the new vector data type introduced in Oracle Data ![delete the table](images/vec4.png =50%x*) ## Task 2. Vector dimensionality and formats -1. In this task, we're going to take a look at what vector dimensionality is, how we format it, and why we care. +1. In this task, we're going to take a look at what vector dimensionality is, how we format it, and why we care. - What is dimensionality? + What is dimensionality? This is going to be a very simple example. Dimensionality is the 'plane' in which something exists. For example, we exist in a world of three dimensions. Everything we interact with has three dimensions: height, length, and width. @@ -115,7 +117,9 @@ In this lab, you will explore the new vector data type introduced in Oracle Data The Oracle Database currently allows you to use up to **64K dimensions** when storing vectors. -2. You can optionally define the number of dimensions when creating a table. You can also define the number format of the vector. Let's check it out. +2. If you take a look at our vector column above, you'll notice we didn't set a dimensionality. You can optionally define the number of dimensions when creating a table. You can also define the number format of the vector. + + For example, vector(3, float32) would mean this vector has 3 dimensions and is of type float32. ``` @@ -123,7 +127,6 @@ In this lab, you will explore the new vector data type introduced in Oracle Data create table if not exists vector_table_2 (id number, v vector(3, float32)); ``` - Here we are saying we want our vectors to have 3 dimensions and to be of the format float32. 3. Let's add some data ``` @@ -164,7 +167,186 @@ In this lab, you will explore the new vector data type introduced in Oracle Data ``` ## Task 3: Vectors and Similarity Search -1. Now that we've looked at vectors and their dimensions, let's learn a bit about similarity search and its role in generative AI. + +1. To give a real world example, let's imagine we work at a company called Oracle MovieStreams. Oracle MovieStreams is similar to other movie streaming company where their customers sign into an application and can access 1000s of movies and tv shows for a monthly subscription. + +2. We'll create three tables. Customers, Movies and Ratings. + + ``` + + CREATE TABLE IF NOT EXISTS movies ( + movie_id NUMBER, + title VARCHAR2(255) NOT NULL + ANNOTATIONS (description 'The title of the movie'), + genre VARCHAR2(100) + ANNOTATIONS (description 'The genre of the movie'), + release_year NUMBER(4) + ANNOTATIONS (description 'The year the movie was released'), + duration_minutes NUMBER(3) + ANNOTATIONS (description 'Duration of the movie in minutes'), + m_description CLOB + ANNOTATIONS (description 'Detailed desciption of the movie'), + questions VECTOR + ANNOTATIONS (description 'Holds the value of the embedded movie descriptions after running them through the embedding model'), + director VARCHAR2(255) + ANNOTATIONS (description 'Director of the movie'), + CONSTRAINT movies PRIMARY KEY (movie_id) + ); + + CREATE TABLE IF NOT EXISTS customers ( + customer_id NUMBER + ANNOTATIONS (description 'Unique ID for each customer'), + first_name VARCHAR2(100) + ANNOTATIONS (description 'First name of the customer'), + last_name VARCHAR2(100) + ANNOTATIONS (description 'Last name of the customer'), + email VARCHAR2(255) UNIQUE NOT NULL + ANNOTATIONS (description 'Email address of the customer'), + signup_date DATE DEFAULT SYSDATE + ANNOTATIONS (description 'The date the customer signed up'), + has_sub BOOLEAN + ANNOTATIONS (description 'Whether the customer has an active subsciption'), + CONSTRAINT customers PRIMARY KEY (customer_id) + + ); + + CREATE TABLE IF NOT EXISTS ratings ( + rating_id NUMBER + ANNOTATIONS (description 'Unique ID for each rating'), + customer_id NUMBER + ANNOTATIONS (description 'ID of the customer who rated'), + movie_id NUMBER + ANNOTATIONS (description 'ID of the movie being rated'), + rating NUMBER(1) CHECK (rating BETWEEN 1 AND 5) + ANNOTATIONS (description 'Rating given to the movie, between 1 and 5'), + rating_date DATE DEFAULT SYSDATE + ANNOTATIONS (description 'Date when the rating was given'), + FOREIGN KEY (customer_id) REFERENCES customers(customer_id), + FOREIGN KEY (movie_id) REFERENCES movies(movie_id), + CONSTRAINT ratings PRIMARY KEY (rating_id) + + ); + + + ``` + +3. Now that we have our tables, we can add data using the NEW Table Value Constructors + + + ``` + + INSERT INTO movies (movie_id, title, genre, release_year, duration_minutes, m_description, questions, director) + VALUES + (1, 'The Grand Budapest Hotel', 'Comedy', 2014, 99, + 'Set in a famous European hotel between the wars, The Grand Budapest Hotel is the story of a legendary concierge, M. Gustave, and his friendship with a young employee named Zero. The film weaves a whimsical narrative full of adventure, comedy, and poignant moments, all within the lush, stylized world characteristic of Wes Andersons work. The plot revolves around the theft of a priceless painting, a family inheritance battle, and the rise of fascism, portrayed with a blend of humor and melancholy. The films visual design is as intricate as its narrative, with meticulous attention to detail in its sets, costumes, and cinematography, making it a feast for the eyes as much as for the mind.', + NULL, 'Wes Anderson'), + + (2, 'Superbad', 'Comedy', 2007, 113, + 'Superbad is a hilarious coming-of-age film that follows two inseparable high school friends, Seth and Evan, during their last days of high school. The duo are invited to a party by a girl they like, and they decide that this party is their last chance to lose their virginity before heading off to college. The movie tracks their chaotic journey to secure alcohol for the party, leading to a series of absurd and comedic misadventures. With a mix of crude humor and heartfelt moments, Superbad captures the anxiety, excitement, and sheer awkwardness of adolescence, backed by strong performances from its young cast.', + NULL, 'Greg Mottola'), + + (3, 'Shaun of the Dead', 'Comedy', 2004, 99, + 'Shaun of the Dead is a British horror-comedy that blends elements of zombie movies with sharp, witty humor. The story follows Shaun, a man stuck in a mundane life, as he attempts to win back his girlfriend, reconcile with his mother, and deal with the sudden outbreak of a zombie apocalypse. The film is known for its clever dialogue, memorable characters, and a perfect balance of horror and comedy. It offers a fresh take on the zombie genre while exploring themes of responsibility, friendship, and personal growth in the most unexpected of circumstances.', + NULL, 'Edgar Wright'), + + (4, 'In Bruges', 'Comedy', 2008, 107, + 'In Bruges is a darkly comedic crime drama set in the picturesque medieval town of Bruges, Belgium. The story follows two hitmen, Ray and Ken, who are sent to Bruges by their ruthless boss after a job goes wrong. As they await further instructions, the two men have very different reactions to the town: Ken enjoys the sights, while Ray finds it unbearable. The film is a mix of humor, tragedy, and moral dilemmas, with sharp dialogue and strong performances, particularly from Colin Farrell as the guilt-ridden Ray. The movie explores themes of redemption, guilt, and the consequences of violence, all set against the backdrop of one of Europes most beautiful cities.', + NULL, 'Martin McDonagh'), + + (5, 'Mean Girls', 'Comedy', 2004, 97, + 'Mean Girls is a teen comedy that satirizes the social hierarchy of high school life. The film follows Cady Heron, a teenager who moves to the United States after being homeschooled in Africa. She soon finds herself navigating the complex social dynamics of her new high school, where she becomes entangled with a popular clique known as The Plastics. The movie is both a hilarious and insightful look at the pressures and pitfalls of adolescence, with memorable characters and sharp, quotable dialogue. Mean Girls has become a cultural touchstone, beloved for its humor and its accurate portrayal of high school life.', + NULL, 'Mark Waters'), + + (6, 'Step Brothers', 'Comedy', 2008, 98, + 'Step Brothers is a raucous comedy about two middle-aged, spoiled men who are forced to live together when their single parents marry. Brennan and Dale, played by Will Ferrell and John C. Reilly, initially despise each other, but eventually bond over their shared immaturity and love of absurd activities. The film is full of outrageous humor, ridiculous situations, and over-the-top performances. It explores themes of family, friendship, and the challenges of growing up—albeit in the most hilarious and unconventional ways. Step Brothers is known for its memorable one-liners and its unique brand of comedy that pushes the boundaries of good taste.', + NULL, 'Adam McKay'), + + (7, 'Anchorman', 'Comedy', 2004, 94, + 'Anchorman: The Legend of Ron Burgundy is a satirical comedy that takes a humorous look at the male-dominated world of 1970s television news. The film follows Ron Burgundy, a charismatic yet chauvinistic anchorman, and his team of equally clueless colleagues as they face off against a new female co-anchor, Veronica Corningstone. The movie is a wild ride of absurd humor, over-the-top characters, and sharp social commentary on gender roles and media culture. With its memorable quotes and hilarious performances, particularly from Will Ferrell as Ron Burgundy, Anchorman has become a cult classic that continues to entertain audiences.', + NULL, 'Adam McKay'), + + (8, 'No Country for Old Men', 'Thriller', 2007, 122, + 'No Country for Old Men is a gripping crime thriller that explores the violent consequences of a drug deal gone wrong in the desolate landscapes of West Texas. The story follows Llewelyn Moss, who stumbles upon a suitcase filled with cash at the scene of a botched drug deal, and soon finds himself pursued by the relentless and cold-blooded hitman Anton Chigurh. The film is a tense and atmospheric exploration of fate, morality, and the changing nature of the American West, with powerful performances and a hauntingly minimalist score. Directed by the Coen Brothers, No Country for Old Men is a modern masterpiece that challenges traditional notions of good and evil.', + NULL, 'Joel Coen, Ethan Coen'), + + (9, 'The Big Lebowski', 'Comedy', 1998, 117, + 'The Big Lebowski is a cult classic comedy that follows Jeff The Dude Lebowski, an easygoing slacker who becomes embroiled in a case of mistaken identity. When two thugs mistake him for a millionaire with the same name, they urinate on his rug, setting off a bizarre chain of events involving kidnapping, ransom, and bowling. The film is a quirky and surreal journey through the eccentric underbelly of Los Angeles, with a memorable cast of characters and endlessly quotable dialogue. Directed by the Coen Brothers, The Big Lebowski is a film that defies genre conventions and remains beloved for its unique blend of humor, oddball characters, and offbeat storytelling.', + NULL, 'Joel Coen'), + + (10, 'Memento', 'Thriller', 2000, 113, + 'Memento is a psychological thriller that tells the story of Leonard Shelby, a man suffering from short-term memory loss who is determined to find his wifes murderer. The film is structured in a unique and innovative way, with scenes presented in reverse chronological order to reflect Leonards fragmented memory. As Leonard pieces together clues about his wifes death, the audience is drawn into his world of confusion and uncertainty, questioning the nature of truth and memory. Directed by Christopher Nolan, Memento is a masterful exploration of the mind, filled with twists and turns that keep viewers on the edge of their seats until the very end.', + NULL, 'Christopher Nolan'); + + INSERT INTO customers (customer_id, first_name, last_name, email, signup_date, has_sub) + VALUES + (1, 'John', 'Doe', 'john.doe@example.com', SYSDATE, TRUE), + (2, 'Jane', 'Smith', 'jane.smith@example.com', SYSDATE, TRUE), + (3, 'Alice', 'Johnson', 'alice.johnson@example.com', SYSDATE, TRUE), + (4, 'Bob', 'Brown', 'bob.brown@example.com', SYSDATE, TRUE), + (5, 'Charlie', 'Davis', 'charlie.davis@example.com', SYSDATE, TRUE); + + INSERT INTO ratings (rating_id, customer_id, movie_id, rating, rating_date) + VALUES + (1, 1, 1, 5, SYSDATE), + (2, 2, 3, 4, SYSDATE), + (3, 3, 5, 4, SYSDATE), + (4, 4, 8, 5, SYSDATE), + (5, 5, 10, 3, SYSDATE); + + + ``` +4. Notice we left the vector column null. Let's update that now. The model used to create these embeddings maps text and paragraphs to a 384 dimension dense vector space. For readability, the vectors are in the collapsible field below. I would suggest clicking the copy button and pasting them into Database Actions to continue for better readability. Alternatively, you can expand the field and see them here. + +
+ Click to see what the vectors look like +
+

+UPDATE movies SET questions = '[-0.03186416, 0.100448914, -0.08820329, 0.05411677, -0.044413082, 0.04332847, 0.0621402, 0.013988524, 0.04205, -0.10710743, 0.009223937, 0.039977495, 0.027808847, 0.05647867, 0.008109424, -0.023528328, 0.059961338, -0.046181977, 0.02585358, -0.011352473, 0.004151645, -0.07381002, 0.048352238, -0.044253614, -0.009961141, -0.022853399, 0.010549535, -0.009179258, 0.006506621, 0.045964774, -0.016583476, 0.08538077, -0.09761192, 0.0019082956, 0.065572396, 0.04915272, 0.009243112, 0.057153206, 0.0077142515, 0.0040078973, -0.021618655, 0.07514549, 0.0006667001, 0.0018498997, -0.012928057, 0.008214033, -0.03086509, 0.0053452165, -0.008815549, 0.034539137, 0.008133889, 0.021855155, -0.059775364, -0.077314116, 0.024118485, -0.023036996, 0.026103243, -0.039466966, -0.002977159, 0.024300907, 0.01985983, -0.027814263, 0.023393909, 0.014221486, 0.008032142, 0.035326842, -0.07147509, 0.00610855, -0.07310015, -0.09929828, 0.0032818501, -0.038566817, 0.02049557, -0.038786467, -0.017542347, -0.04236038, -0.08110735, 0.004544688, -0.0027622352, -0.007807033, 0.09397219, -0.056569874, -0.0040330123, 0.01853306, -0.0035951578, 0.00048597067, 0.046114307, -0.02830799, 0.05801706, 0.026257303, -0.10409066, -0.08646433, -0.0651563, 0.029250324, 0.0013947428, 0.05993298, -0.026438184, 0.041637573, -0.055488877, 0.060910586, 0.10336703, -0.032088377, 0.11574057, 0.023396282, 0.037200652, 0.012775889, 0.11319196, 0.048064597, -0.10101572, -0.04550339, -0.008623377, 0.016256168, 0.080611564, -0.075637825, 0.009094633, -0.004150025, 0.029063923, -0.03882623, 0.004777327, 0.054174457, 0.09910925, -0.033579815, -0.018608812, 0.04819486, -0.09196654, -0.03150324, 0.06776617, -1.6430368e-33, -0.020082867, -0.033476662, -0.011483566, 0.075386174, 0.10118173, -0.010462282, -0.057519656, -0.01380321, -0.06083227, 0.05133998, -0.015611584, -0.028738765, 0.0074157915, 0.05263663, -0.026343618, 0.065136, 0.03085626, -0.012948528, 0.081920624, -0.054210823, 0.0036408824, 0.06714009, 0.0048613297, -0.032086182, 0.006935154, 0.095247135, -0.07351736, -0.017457541, -0.060507566, 0.0049189716, -0.072699346, 0.073657185, -0.0011898965, -0.022706965, 0.032282323, 0.012933244, -0.090916015, -0.038039166, -0.040952478, 0.025902564, -0.06514315, 0.042080857, -0.15684767, 0.051394694, -0.01093092, 0.085700914, -0.005187945, 0.08052482, -0.07356148, 0.066004395, -0.07691928, 0.031332172, -0.14804715, 0.038315207, -0.11701675, 0.015484923, 0.05911154, -0.03687872, 0.05914629, -0.11330228, 0.07911791, 0.02635382, -0.0726331, 0.053837758, 0.029850217, 0.011341584, -0.066457234, 0.008002268, -0.034625527, 0.01551488, -0.039804697, -0.008626384, 0.022096759, -0.0769526, 0.00062925654, 0.07503869, 0.07988938, 0.022358129, -0.05912502, 0.03133418, 0.00064974267, 0.033457987, 0.0799159, 0.017038465, -0.081297986, -0.04147627, 0.049575336, -0.04447641, 0.020843407, 0.012826532, 0.030769857, 0.0123532945, -0.008022552, -0.028793061, -0.009152576, 2.7599726e-34, 0.025007727, -0.0121196825, 0.020517616, -0.07591735, 0.04283048, -0.033128105, -0.09254426, 0.0086931465, 0.014131202, 0.087765895, -0.041934155, -0.0042057727, -0.029612608, 0.057669412, -0.005430036, -0.02944525, 0.09347536, -0.035675615, -0.023041684, 0.045825087, 0.03175208, 0.102326594, -0.063506335, -0.053376365, -0.07028689, 0.095568895, -0.03461568, -0.024337985, -0.0777164, 0.04450111, -0.050133605, -0.059375864, 0.03503431, 0.026860286, 0.032040127, 0.06356483, 0.10553594, -0.004010758, -0.07027428, -0.0027210764, -0.0010034427, 0.0043688384, -0.07041773, 0.11051171, 0.057953883, -0.022254646, -0.04137224, -0.060742464, 0.0131591195, -0.053578924, -0.04768401, 0.007970179, -0.019680044, -0.042398028, -0.026183574, -0.0804661, 0.0013372921, -0.024140507, 0.03920695, 0.09657719, -0.04437437, -0.026659768, -0.032152373, 0.0385326, -0.017618047, -0.052631196, -0.09064694, 0.06902636, -0.040853973, -0.011603324, -0.01193678, 0.043265823, -0.073284544, -0.021141492, -0.0031891153, -0.025540384, 0.08953818, 0.022873575, 0.0361602, 0.005919339, 0.010306058, -0.048097346, -0.025979213, 0.031701393, 0.016273892, 0.07482219, -0.032027144, 0.03743527, -0.0035752894, -0.068276614, 0.03809565, 0.032533113, 0.02516694, -0.047946874, -0.005157353, -5.2158097e-08, -0.15245341, 0.027805682, -0.0061595365, -0.010287918, -0.08778744, -0.1178896, 0.022300223, 0.06372418, 0.02538305, 0.09219966, -0.03773525, 0.051600404, -0.013090643, 0.0011180452, -0.06036024, 0.09942019, -0.029118935, -0.022109706, 0.026035707, 0.08001024, 0.06131532, -0.035470735, 0.04550358, -0.069432415, 0.02572334, -0.054169495, 0.003473276, 0.0014990985, 0.050593376, 0.037941247, -0.056555863, 0.04188681, 0.0086952485, -0.0010246448, -0.036650926, -0.029255012, 0.020911422, 0.01956921, -0.029161526, -0.068659276, -0.008618043, -0.012629113, 0.01475199, 0.005702016, 0.023216156, 0.069185145, 0.08955318, -0.0729314, 0.03307293, 0.034470215, -0.056441218, 0.04299385, 0.041811265, 0.04991018, 0.0047145737, -0.093863174, 0.025176102, 0.0698943, -0.0023249094, 0.001590938, 0.011869093, 0.046947338, -0.030564057, -0.02084614]' WHERE movie_id = 1;
+UPDATE movies SET questions = '[-0.05981895, -0.023309417, 0.010998978, -0.1315234, 0.03451228, -0.0071311295, 0.014751898, 0.12275015, 0.010721676, 0.020358676, 0.036566436, 0.05043441, -0.02374009, 0.050204307, -0.057742495, -0.012560746, 0.07535864, -0.08446361, -0.07917211, -0.0070352694, 0.055406813, -0.061864115, 0.026079275, 0.020658905, -0.05399865, 0.09476403, 0.034239512, -0.016541097, -0.053649344, 0.024967441, 0.14125331, 0.032709498, -0.0071593896, -0.0068715774, -0.08663755, 0.044077717, -0.0016527523, -0.025880987, 0.06583274, -0.07875655, -0.06604436, -0.040202588, 0.0100563755, -0.015144554, 0.05191987, -0.06264339, -0.008218018, -0.024090026, 0.08398684, 0.016498664, 0.022793712, -0.066124916, 0.01907576, 0.022266101, 0.10764702, 0.056642476, -0.06843781, -0.118135735, -0.0041953796, 0.06691189, -0.011676104, 0.008757207, 0.0742434, 0.027567292, 0.06837594, 0.02218203, -0.019394604, 0.040638737, -0.032302007, 0.04246324, -0.023516588, -0.0066938936, 0.005173094, 0.019002201, 0.082324564, -0.028665219, -0.044650257, -0.051103547, 0.024195593, -0.058488827, 0.024454333, -0.12588622, -0.035099637, -0.05923449, 0.008865842, -0.03451321, 0.07106684, -0.03227452, -0.0016710209, 0.063725084, -0.09934951, 0.029285967, -0.019183945, 0.0059421794, -0.048503116, 0.013984077, -0.074142106, -0.07685853, -0.056872293, 0.06361441, -0.065817885, 0.0023764411, 0.0155559685, -0.09950773, 0.035094026, -0.07329799, 0.09259259, 0.041356754, 0.036668193, 0.025238603, 0.016119473, -0.04825631, 0.08829368, -0.0035227253, 0.046858754, -0.013131738, 0.0027909235, 0.025074532, -0.06708953, -0.027809892, 0.017331231, 0.058398824, 0.023657853, 0.072430626, -0.039804265, 0.045730207, 0.023142831, -1.292179e-33, 0.035207964, -0.01417389, -0.038995788, 0.021170221, -0.004593921, -0.010609181, 0.024332311, 0.055428352, -0.08382931, -0.017551491, 0.0064104144, -0.053298164, -0.05997198, -0.0012846395, 0.04671779, -0.0289466, -0.057547927, -0.0147965355, 0.026219567, 0.061255008, -0.027436418, -0.008398503, 0.012328988, -0.03183204, -0.0043551815, -0.04487213, 0.07049371, 0.12864678, 0.095762804, 0.0010454506, -0.0868074, -0.028317055, -0.0320303, 0.00703081, 0.044614587, -0.013688371, -0.03038013, -0.012748919, -0.06074655, 0.027969107, -0.028823838, 0.0010857431, -0.10992434, 0.028260432, -0.030496541, 0.071913145, 0.012095693, 0.06429366, 0.055251736, -0.05555836, -0.015159716, 0.00062378944, -0.03394377, -0.06797914, -0.086689554, 0.070450716, -0.0044049327, -0.044387005, -0.021138333, -0.06131992, -0.0053353026, -0.0113808755, -0.12927507, 0.036849417, -0.06684931, -0.025046814, 0.09204242, 0.013719517, 0.023072848, -0.0062284376, 0.02048773, -0.0070720897, 0.04011269, -0.014179783, 0.0125051495, 0.035523225, 0.011852307, -0.019931378, -0.0040393327, 0.0031124929, 0.01919846, -0.043453373, 0.006391464, -0.003971871, -0.08951391, 0.013358214, -0.014448632, -0.114423685, -0.007935999, -0.04072657, 0.0071989764, -0.033552047, 0.019696102, -0.023035988, 0.047959078, -2.26392e-33, 0.09226721, -0.0026063414, -0.064168, 0.0066772783, 0.09642589, 0.034108587, -0.052064184, 0.025325755, 0.06270105, -0.0066921334, 0.045708217, 0.0014617649, 0.049393304, -0.10559106, 0.065607145, -0.054490365, 0.097872876, -0.050941844, 0.015874295, -0.017988514, 0.10707863, 0.05458774, 0.05330781, -0.024527662, 0.038816664, 0.018058198, -0.0050501404, 0.12934692, -0.045657504, 0.011932867, 0.12519534, -0.049975783, 0.014205936, 0.04864364, -0.05017959, 0.07643995, -0.030244587, -0.035785917, -0.104470946, -0.038177144, 0.008383555, -0.05327015, -0.0658028, 0.058814608, 0.016027158, 0.014432894, -0.0137754595, 0.05198254, -0.023918778, -0.056821242, -0.069650374, 0.010317238, -0.037166324, -0.024278725, 0.020221451, -0.087885395, 0.001152499, 0.0396343, 0.07609932, 0.008831072, -0.0023166952, -0.08970386, 0.045033086, -0.038954884, -0.07892018, -0.06110928, -0.038452175, -0.045513205, -0.019370534, 0.072002836, 0.031455807, -0.0022743384, -0.11614712, -0.034464438, -0.044136953, 0.04177276, -0.004791056, -0.034300104, -0.05804416, -0.0625367, 0.034917094, 0.009422977, 0.033473507, 0.04775234, -0.011416051, -0.016706724, 0.02216939, 0.043320324, -0.0018465326, 0.06602054, -0.0220908, 0.057105456, -0.004456604, -0.13192108, -0.02595567, -5.3504582e-08, -0.019838775, 0.05371821, -0.06976195, -0.07643651, -0.00085929636, -0.042795785, -0.022791626, 0.047602154, 0.10164726, 0.013172189, -0.066499226, -0.04385131, 0.02175293, -0.014806854, -0.028343461, -0.0046081254, 0.036873788, 0.07048361, -0.0073460066, -0.008809973, -0.07575522, -0.059043054, 0.021050502, -0.06387232, -0.045205593, 0.03556013, 0.023932166, -0.07928002, -0.031324327, 0.042363472, -0.026560169, 0.0009331711, 0.034230497, 0.00021357962, 0.017102335, 0.054282848, 0.015100303, 0.0014561552, 0.014629735, 0.07714158, 0.032150164, -0.012003149, -0.012307274, 0.010827777, 0.0007633105, 0.014537119, 0.091233514, 0.0020015896, 0.037053518, 0.038100522, 0.039272476, -0.032688957, -0.089511886, -0.041774582, -0.01027467, -0.032532223, -0.10160038, 0.040170312, -0.04983151, 0.010509751, 0.14421484, 0.07245852, -0.007225581, 0.02995852]' WHERE movie_id = 2;
+UPDATE movies SET questions = '[-0.07285886, -0.05779241, -0.07381102, -0.01767771, 0.019122727, 0.0018151521, 0.085507855, -0.02660585, 0.01049716, -0.017358165, -0.0020758978, 0.0054053897, 0.018991536, 0.025543801, -0.031994577, 0.042620856, -0.01221277, -0.003949109, -0.020401524, 0.016030591, -0.006440479, 0.06193031, 0.075068474, -0.06106403, -0.06593554, -0.052561007, 0.014242381, -0.0038608557, -0.08237256, 0.047879107, 0.034143727, -0.0058708563, -0.0769527, -0.055614665, 0.010922458, 0.0969622, -0.08405303, -0.0031878417, -0.06784459, 0.04404204, -0.03470591, 0.03847585, 0.020138161, 0.014878458, 0.050491527, -0.009567357, -0.04175827, -0.05611446, 0.084584035, 0.0090572, 0.0091598835, -0.022534342, 0.0075731026, -0.049469896, 0.0121693425, 0.0118192565, -0.007556691, -0.040486597, -0.028627282, -0.04625774, 0.043274067, -0.05693021, 0.066644184, 0.00921515, 0.1194655, 0.0025610009, 0.032408644, -0.03805433, -0.061303873, 0.033282474, -0.13220115, -0.012142146, 0.008585243, 0.06649524, -0.065359406, -0.014543861, 0.0084211035, -0.075684875, -0.052907594, 0.05298561, 0.03303341, -0.032954924, 0.067544095, 0.04123282, 0.058497023, -0.009081555, 0.06301522, -0.027177779, -0.06059984, 0.11051589, -0.08694784, -0.0068254275, 0.01895521, 0.059112255, -0.047382243, -0.0074091963, -0.011549374, 0.011651855, -0.11649622, 0.02420424, -0.06551847, -0.0112629505, 0.0071047205, -0.02893538, 0.022684844, 0.008331409, -0.088294104, 0.032755192, -0.0053991466, 0.014941778, -0.0029590165, -0.03736128, -0.03929809, -0.00631517, 0.10986775, 0.01957646, 0.026727602, -0.08115311, -0.004268095, 0.048261914, 0.10251516, 0.088373676, 0.022329587, 0.034398742, 0.09427662, 0.016564896, 0.058422346, -2.2753761e-33, 0.001199966, 0.038008913, -0.01576928, 0.03817649, 0.03377504, -0.06949259, -0.023391636, 0.01575222, -0.018720012, 0.07207276, 0.04479035, 0.012091409, 0.021798927, 0.009995059, -0.11574941, 0.05950401, -0.004337373, -0.061461426, 0.067267284, -0.07118354, -0.05977591, 0.02940063, 0.04886328, 0.02697505, -0.016641624, -0.08159827, -0.03016665, 0.025550406, 0.050592806, -0.03209104, -0.004823802, 0.056970198, -0.03203733, -0.09482967, 0.08407994, -0.041772332, -0.026825158, -0.002415315, -0.022160444, 0.1291904, -0.01155225, -0.012889964, -0.03322733, -0.010210219, -0.018432276, 0.0170627, 0.10798135, 0.053503428, -0.05892857, 0.015435531, 0.11570178, -0.03459384, 0.0077097323, -0.021629857, -0.051550835, 0.033996083, -0.024134537, -0.11070746, 0.03198954, 0.026788933, 0.075729966, -0.048672937, -0.028833462, -0.04344334, -0.061062053, -0.046977933, 0.04833954, -0.06088684, -0.036329743, -0.009820092, 0.007904263, -0.039781768, 0.07485789, -0.02135242, -0.0029149856, 0.052874688, -0.083003424, -0.060549617, -0.048862197, 0.0033874533, 0.047053114, -0.013216601, -0.015584995, -0.03720741, -0.056257345, -0.02285835, 0.030057034, -0.09266072, 0.0024314406, 0.030574065, -0.07092937, -0.0005783994, 0.0011006421, -0.076462, 0.13689701, -8.835015e-34, 0.017207613, -0.018795611, -0.14627129, -0.0020320714, 0.02863423, -0.069989525, -0.010578073, 0.016893357, 0.13151439, -0.0154793905, 0.012081126, 0.015218648, 0.062097855, 0.023281228, 0.11386234, -0.071913846, -0.035372254, -0.02854442, -0.0027639926, 0.044989843, 0.033788707, 1.184654e-05, -0.036174517, -0.07655762, 0.06546563, 0.06388663, -0.07227197, 0.071096785, 0.07151382, -0.0054220706, -0.033456802, 0.02917349, 0.11717306, 0.0040372163, -0.052911635, 0.12659599, -0.001732494, -0.09129568, 0.03746321, -0.028692419, 0.019322913, -0.026135592, 0.019115377, 0.005799959, 0.063667595, 0.03603427, -0.007055105, 0.08564866, -0.00058205763, -0.002778342, -0.005876342, 0.08120358, -0.0025046328, -0.007800121, -0.00584789, -0.009600696, -0.050240275, -0.095912375, 0.010450638, -0.051374517, 0.010942374, -0.010676507, -0.008902081, -0.004655159, -0.06367631, -0.043423638, -0.0032172406, -0.057359874, -0.023846585, 0.051130965, -0.04207277, 0.017260035, -0.049939778, -0.10576741, -0.011908295, 0.0070461673, -0.0077697826, 0.046941023, 0.04603011, -0.040910996, -0.045370623, -0.015114802, 0.04215158, 0.027706115, -0.0060455417, 0.04292568, 0.0095274765, 0.06798481, -0.017517168, -0.07272822, 0.01661093, -0.09560528, 0.054605052, -0.029163182, -0.123820946, -5.0736656e-08, 0.039133538, -0.030759476, -0.02215141, -0.113876306, 0.05301, 0.03798796, 0.047849722, 0.024710111, 0.017473193, 0.07501966, -0.03623585, 0.13399936, -0.0072202855, 0.0115309665, -0.033223618, 0.0836745, -0.053141218, 0.0014912767, -0.0145876985, -0.01685091, -0.03485185, -0.01196831, -0.01889133, 0.010413583, -0.0025548409, 0.03034672, 0.06328016, -0.112924956, -0.0050455118, 0.089180164, -0.06902441, 0.03063083, 0.06953664, -0.0050941627, -0.0067493347, -0.017303903, 0.084730186, 0.051464826, 0.032373454, -0.06628305, 0.019618193, 0.001188112, 0.014626764, -0.027185148, -0.010234761, -0.02637127, 0.049728807, -0.0379119, 0.016915644, 0.019606758, 0.014072302, -0.03466633, -0.080172725, 0.06452872, 0.052021824, -0.033036333, -0.049111973, -0.05487869, -0.07635416, 0.060818553, -0.0011568827, 0.021809205, 0.049586583, -0.055101898]' WHERE movie_id = 3;
+UPDATE movies SET questions = '[0.03373985, 0.0048969346, -0.005641546, -0.053601395, 0.006300477, 0.040614642, 0.015623825, 0.0158418, -0.03746891, -0.07719321, -0.025200339, -0.121928535, 0.011178427, 0.031934645, -0.036522385, -0.084696025, 0.0008199181, -0.07110941, 0.06508497, 0.01857928, 0.023273414, 0.01164348, -0.058755513, 0.057586662, -0.05671234, 0.058081612, 0.14017622, -0.03964132, -0.11372165, -0.029251583, -0.007035752, 0.0021790299, -0.001960716, 0.019355122, -0.079276025, 0.036653813, -0.0009912195, -0.031714227, 0.060562514, 0.04535483, -0.09723911, -0.026677947, -0.05331524, 0.0051766, 0.004555653, -0.0843608, -0.00069039554, 0.043583874, -0.015753156, -0.023612645, 0.02289475, -0.017527383, -0.033488743, 0.020842586, 0.016674299, -0.036655523, -0.0054641166, 0.047502432, 0.08499313, -0.043687098, 0.040625166, 0.018965926, 0.04299457, 0.0429011, 0.07454832, -0.041256998, 0.016293619, 0.08873219, -0.09525246, 0.008479602, -0.022249132, -0.056231685, -0.0056651505, -0.025987456, 0.022744926, -0.025414053, -0.122139715, -0.02893928, -0.048782893, -0.085142635, 0.008696461, -0.038339026, -0.026425287, -0.006172263, 0.024795903, -0.07090906, 0.095489815, -0.031191222, 0.059739776, 0.050853144, -0.036348883, 0.01529476, -0.029332537, 0.04860639, -0.011246012, 0.04513471, 0.0006763913, 0.09876209, -0.054794997, 0.02285395, 0.026777664, -0.018494718, -0.019769235, -0.025003279, 0.047356002, -0.009713641, 0.008810508, -0.01680222, -0.011705285, -0.073039554, -0.02253, -0.015387636, -0.009913432, -0.05069578, 0.09779907, 0.029074313, 0.047132883, -0.0613819, -0.06569492, 0.022015458, 0.084542975, 0.006505036, -0.057156015, 0.011474062, -0.040001143, -0.01833572, 0.026571456, -9.699674e-34, 0.022611627, -0.02896581, -0.052523825, -0.0028198468, 0.009563863, -0.019189553, -0.09571947, 0.11246164, -0.070838265, -0.033545237, -0.06738698, -0.026518183, -0.032451652, -0.0010153538, 0.003696371, 0.057210278, -0.03975809, 0.030135652, 0.007986763, 0.018335022, -0.05828415, 0.049783334, -0.06359598, 0.025551546, -0.14139311, 0.046766307, 0.026955107, -0.07755668, 0.06022069, 0.035433374, -0.032800194, 0.05882878, 0.09843773, -0.009949189, -0.0030847257, 0.0047081765, -0.095948115, -0.020505527, -0.03454941, 0.07159234, -0.01059856, 0.0022473556, -0.086486414, 0.007009063, -0.09536893, 0.031199433, -0.00043469548, -0.044351585, -0.09081653, 0.03807452, 0.054443087, 0.0025638714, 0.0076642046, -0.0024012076, 0.07746728, 0.083650395, -0.040217347, -0.012443409, 0.06863058, -0.0864808, 0.086000256, 0.003849185, 0.08779284, 0.030758843, 0.0052545103, -0.038581315, -0.0016110895, 0.06585499, 0.03579803, -0.039434195, -0.13398975, -0.0036190073, 0.0666425, 0.0062846667, 0.03061631, 0.017067773, 0.009547635, -0.022981416, -0.090065494, 0.04843634, -0.077973545, -0.021453338, 0.044182736, -0.034871936, 0.015214584, 0.024273649, 0.048734725, -0.09640847, -0.05491835, 0.090173565, -0.059498098, -0.008983373, -0.020088745, -0.11224988, 0.08295634, -2.120126e-33, 0.12552427, -0.07744093, -0.08197731, -0.037187662, -0.023048682, -0.0041841255, -0.02611163, -0.008946388, 0.07402122, 0.067895785, -0.020306397, -0.05691325, -0.0008213731, -0.0074578375, 0.003595842, -0.051669776, 0.09306638, -0.06012481, -0.054349616, 0.016521564, 0.054037888, -0.0603187, 0.006876329, -0.025255661, -0.075007774, 0.05096008, -0.022149745, -0.07064754, -0.051314652, 0.03166783, -0.018230759, 0.019384481, 0.0075611915, 0.01692863, -0.08424185, 0.10821394, 0.090172775, -0.051382955, -0.057634663, -0.019690119, 0.009914072, -0.02806274, -0.03340287, 0.02611209, -0.027732061, -0.0065089357, 0.06741511, 0.04546711, -0.0456884, -0.01873071, 0.012566888, 0.121755235, -0.06502437, 0.037137076, -0.012589651, -0.11560209, -0.04022176, 0.00018101666, 0.01816266, 0.029721396, -0.12639235, 0.008612261, -0.054063514, -0.025881728, 0.01859195, 0.039754473, -0.13752574, -0.0018414408, 0.06681146, -0.022875844, 0.029144285, -0.12084849, -0.030351628, 0.013929667, 0.050289687, -0.0005416692, 0.023323486, -0.003831714, -0.046187773, -0.013387727, 0.03918167, -0.07261737, 0.018247034, 0.062337525, -0.031032454, -0.03883624, -0.031439938, 0.010152373, -0.036998797, 0.05942939, 0.023986055, -0.027766783, 0.031896144, -0.05916328, 0.031801954, -4.966703e-08, -0.10543808, 0.008538039, -0.012380632, 0.0286498, 0.0129600745, 0.011482269, -0.0033275431, 0.09640223, 0.0224633, -0.027314965, -0.02620059, 0.016393134, 0.04517423, 0.020078406, 0.05038606, 0.09825181, 0.03479124, -6.959046e-05, -0.0017284777, 0.07517815, 0.04175163, -0.029101368, 0.03940584, -0.00870962, 0.0011430796, 0.062975444, 0.016349398, -0.05368525, 0.053940028, 0.044199314, 0.08624842, 0.032951705, 0.019896235, 0.03559363, 0.049328703, -0.015319532, -0.0058709388, 0.082872316, -0.009866498, -0.04228416, -0.0130763585, -0.0051608193, -0.0038214368, -0.020463917, -0.010367279, 0.06662825, 0.036348324, 0.09575173, 0.018281369, 0.04005468, -0.025712809, 0.017212044, 0.056404706, 0.069724314, 0.039747667, -0.037605688, 0.07807122, -0.08442334, 0.0007497535, -0.024842901, 0.012649355, 0.05257403, 0.072551265, -0.009047538]' WHERE movie_id = 4;
+UPDATE movies SET questions = '[0.021584796, -0.016268289, -0.004957669, -0.038706593, -0.03737637, -0.04597566, 0.062073275, 0.016568858, -0.0017235683, -0.03629599, 0.0524028, -0.026298953, 0.02659363, 0.06844876, -0.021427417, 0.006149201, 0.056762666, -0.058308687, -0.003166077, 0.000738515, 0.044418775, 0.0628706, 0.013658976, 0.10846485, -0.056367736, -0.014060903, 0.0067245816, -0.044827253, -0.067145824, 0.07453372, -0.043106586, 0.12717636, 0.012631225, 0.012103636, -0.019208498, 0.05742966, 0.040404227, -0.018006723, -0.021057563, -0.011753418, -0.085172474, -0.039301697, 0.046803445, -0.015119914, -0.038292736, -0.034924254, 0.084132515, -0.07082663, 0.011658237, -0.13159232, 0.014299281, -0.050246235, -0.087138295, -0.01973635, 0.045803465, 0.041028205, 0.0018424246, -0.0013511599, 0.10988598, -0.021183737, -0.063157216, -0.07636614, 0.119608395, 0.02190871, 0.044568144, 0.02094022, -0.022191456, 0.029063068, 0.018920237, 0.002783447, -0.042021547, -0.010807122, -0.06532515, -0.016351612, 0.040842295, -0.008625781, 0.0143444445, 0.024931492, 0.09328647, -0.016844532, -0.063147254, -0.06632766, 0.07463652, -0.035521634, 0.00879957, -0.018301027, 0.06456135, -0.05351539, -0.060948767, 0.04424899, -0.08263079, -0.0030139291, -0.06743518, 0.03199958, -0.0812397, -0.045421142, -0.0046466733, -0.15977575, 0.028686978, 0.049717244, 0.040453974, 0.038502555, 0.12468385, -0.037096746, 0.0101458635, -0.07172733, 0.14554584, -0.060594626, 0.0081335185, -0.015748192, -0.04959828, -0.036009755, 0.01846295, -0.009591576, 0.0098397955, -0.08639653, 0.09445783, -0.056871586, -0.04315461, -0.073209174, 0.062168043, -0.00533208, 0.02943713, -0.01629209, -0.022676852, -0.0013685381, -0.030299451, 3.258446e-33, -0.005453477, -0.038809758, 0.053693887, 0.014146837, 0.11750628, 0.037424747, 0.049800515, 0.033426885, -0.04071901, -0.012231309, 0.014560377, -0.06900642, -0.052077726, 0.036803324, 0.09466078, 0.028651087, -0.028228436, -0.029502608, 0.03727779, 0.02869712, -0.030454587, 0.0675191, 0.00428545, -0.069442734, -0.037882183, -0.04376021, -0.03166352, 0.0047839754, 0.07026424, 0.00271633, 0.011921838, 0.062216945, -0.052301504, 0.0021047867, 0.0072135716, -0.016466396, 0.009568719, 0.0013281825, 0.020364435, -0.020539494, 0.072364, 0.031515345, -0.031649046, 0.051612902, 0.010785254, 0.111690305, 0.0050647683, 0.05448537, -0.0370752, 0.061566677, -0.06972827, 0.0035004376, 0.012907458, -0.018157648, -0.054455146, 0.055112574, 0.01839428, -0.040349726, -0.05141823, -0.16433579, 0.04925992, -0.03095997, -0.022993809, -0.03160779, 0.02528369, 0.0392158, 0.057577785, 0.07458571, 0.05492315, 0.001789206, 0.011420666, 0.065433145, -0.02352337, 0.032056294, -0.05848096, 0.04856466, 0.044157125, 0.007884159, -0.009987333, 0.013643751, 0.032751866, 0.0018098431, -0.061018463, -0.10120001, 0.016607523, 0.008868296, 0.046656456, -0.14339697, 0.048984524, -0.0014626257, -0.066082686, -0.041042984, 0.035035025, 0.07186397, -0.031051612, -4.4990764e-33, 0.06841928, 0.0508289, -0.0070014317, -0.011899009, 0.10834068, -0.045313127, -0.084042534, -0.010402235, 0.11126737, -0.033607654, -0.05718944, -0.094106644, 0.036514014, -0.021349184, 0.06572217, -0.050243355, 0.053021293, -0.052491896, -0.042069588, -0.09510855, 0.041463662, -0.019001488, -0.026277564, -0.016425673, -0.050080616, 0.010130557, -0.052224223, -0.008931765, -0.04813434, 0.058055755, 0.06574941, -0.05212744, -0.02426901, 0.04185618, -0.10405111, -0.09541422, 0.0048273904, -0.0071367472, -0.03289507, -0.030137245, 0.040948234, -0.040920284, -0.07485076, 0.024800181, 0.02407613, 0.08348112, 0.05193048, -0.0034386355, -0.055512756, -0.011901917, -0.043825485, 0.010629465, -0.012286239, -0.022315215, -0.00792844, -0.08246662, 0.090527594, 0.05124293, -0.041766796, 0.02782405, 0.026543291, -0.073862895, -0.111024134, -0.019540483, -0.05546743, -0.010654111, -0.06618358, -0.10370022, -0.05875861, -0.016805336, 0.035364237, 0.024189113, -0.055809364, -0.002022806, -0.053433, -0.047196534, 0.0050579254, -0.07130852, 0.032846034, -0.012975901, 0.05873663, -0.039170563, -0.0034325663, 0.00016129277, -0.035229694, -0.05801753, -0.009557913, 0.09672281, 0.0069576544, 0.06333416, -0.02060664, 0.0098260855, -0.023196487, -0.030295435, -0.0141048, -5.1512714e-08, 0.01589102, 0.02646172, -0.074108, -0.016750881, -0.034244753, 0.09888089, -0.03826341, 0.037783097, 0.09711037, -0.013549544, -0.07307849, -0.023698654, 0.04691564, -0.037960503, -0.0047307974, 0.08378155, 0.058219127, -0.04930941, 0.017075548, -0.027811747, -0.008767341, -0.05735603, 0.06165111, 0.04819531, -0.054882172, -0.027872205, 0.026808651, 0.026290528, -0.10297251, 0.009458935, -0.015965821, 0.027186943, 0.088429414, 0.056867164, 0.0146223735, 0.049057208, 0.0072210683, 0.015012816, 0.048072215, 0.025472593, -0.011627685, -0.052597523, 0.06902683, -0.034583505, 0.011049568, 0.032863576, 0.06427276, -0.025946863, 0.0529009, 0.08355786, 0.07251275, 0.035438597, 0.008196414, 0.03821204, 0.0018190697, -0.0013130745, -0.03428905, 0.053288795, 0.017844805, 0.0144594265, 0.051704053, 0.02299171, 0.06765648, -0.0107790055]' WHERE movie_id = 5;
+UPDATE movies SET questions = '[-0.09119366, 0.039054018, -0.087493, -0.038663324, 0.005652072, -0.017084206, -0.037226707, -0.0065516834, 0.02175195, -0.13142845, -0.0076226583, 0.020790236, 0.004955551, 0.003330538, 0.008723003, -0.0049247253, -0.0663679, 0.01428769, -0.0019053475, -0.0319845, -0.054839257, -0.03339056, 0.082526915, 0.012290974, -0.09459204, -0.046554737, 0.042661082, 0.035129048, -0.050314065, 0.037688147, 0.04609853, 0.060228903, -0.05433379, 0.044828814, -0.0025061106, 0.02352781, 0.04267854, 0.061284497, -0.01617678, -0.0022651814, -0.033321083, -0.043432977, 0.05703585, -0.008341239, 0.02070066, -0.006657561, 0.025923941, -0.07090006, 0.034098957, 0.06553633, -0.07175882, 0.023104265, 0.033677675, 0.085318506, 0.059015423, 0.048759997, 0.017645169, -0.051289674, -0.04522903, -0.062777124, -0.006295323, -0.102309875, -0.0046151388, -0.04757249, -0.02095302, 0.029134272, -0.07240828, 0.0019028733, -0.014114206, 0.028566975, -0.11968002, -0.08294909, 0.058513086, 0.05007479, -0.017265249, 0.03950091, -0.0856416, -0.01692112, -0.052144717, -0.014782727, -0.06913645, -0.05641379, -0.11867679, -0.054346774, 0.0036915818, -0.037810814, 0.04380715, -0.004284475, -0.037263513, 0.09046489, -0.11836199, 0.018500477, 0.02486231, -0.030836415, 0.013027079, -0.0038958434, 0.019176846, -0.09748258, -0.044646464, 0.004520233, -0.008822278, -0.012774253, 0.08285194, -0.016624529, 0.00050206186, -0.008137833, 0.05091407, 0.04437408, 0.11266292, -0.0006625652, -0.04570313, -0.039860748, 0.11637723, -0.0065660086, 0.05868167, -0.031193234, 0.018931301, 0.0068915715, 5.8033915e-05, -0.03107803, 0.081944846, 0.079877205, 0.030088322, 0.036806066, 0.018563572, -0.045309015, 0.0066616265, 3.1163027e-35, 0.049009487, 0.041868262, -0.056083627, 0.037732534, 0.075307116, 0.023337157, -0.041918986, 0.023493031, -0.024558833, 0.003793041, -0.054129474, -0.063431285, 0.013421344, -0.00061427074, -0.09808156, 0.048565704, -0.0080549745, -0.015879242, 0.098383896, -0.03839153, -0.014041744, 0.03658997, -0.0031245716, 0.013302028, -0.01868638, -0.020458339, -0.005647687, 0.01892934, 0.01755231, -0.005051825, -0.020601729, 0.036891323, -0.023289958, -0.029198844, 0.08869437, -0.06695216, -0.016695198, 0.016301563, 0.06061088, 0.047414273, -0.07158378, 0.0012140162, 0.051766854, -0.023602406, -0.08583877, 0.096121274, 0.033748455, 0.054679736, -0.029674245, 0.015833627, 0.07295959, -0.032410942, 0.06311836, -0.044562854, 0.055334136, 0.030958641, 0.03913274, -0.045410953, -0.022723027, -0.018896649, -0.010912387, 0.013123978, 0.02492749, 0.05946841, 0.034461096, -0.020767827, -0.020196417, 0.06979458, 0.023942893, 0.059572212, 0.0014061085, -0.012367022, -0.013481861, -0.068420485, 0.047428045, -0.012746011, -0.06423362, -0.07201468, 0.037215915, -0.050672747, -0.031066738, -0.035660245, -0.07195971, -0.0910261, -0.062250953, 0.01878718, -0.062603414, -0.11933055, -0.072885215, 0.07525014, -0.0334473, -0.05303763, 0.010978058, 0.06968079, 0.10443406, -2.6360474e-33, 0.07390454, -0.0017716937, 0.013300048, -0.021245616, 0.039582495, -0.028702045, -0.04007367, -0.018345106, 0.1922193, 0.017465066, -0.02632447, -0.01883598, 0.015587663, 0.037623014, 0.07032264, -0.015398051, 0.0467044, -0.014570385, 0.096770726, -0.0056351917, 0.044183034, -0.014226172, -0.103410006, 0.01471801, -0.04653285, -0.0068392097, 0.06896705, 0.03534274, -0.009838354, 0.050363265, -0.035443895, -0.039719254, 0.001753509, -0.03344958, 0.007947711, 0.060138185, -0.08365083, -0.00305654, -0.023078019, -0.08490668, 0.100845665, -0.07063332, -0.0719462, -0.019081457, -0.03268855, -0.017490366, 0.037863184, 0.103940144, -0.086712085, 0.000992166, -0.029621858, 0.047187798, -0.005684169, -0.0064800116, -0.006940884, -0.010224143, 0.04789202, 0.06099491, -0.05830094, -0.0028850755, -0.01704428, 0.014423064, 0.015514887, 0.022126814, -0.05732349, 0.07182293, -0.0354659, -0.019135594, 0.022018805, 0.06727648, 0.012852222, -0.12859416, 0.021570517, -0.030762993, 0.010517295, -0.042167183, 0.010578819, -0.021398313, 0.012714488, -0.040760763, 0.038288098, -0.110501036, 0.020027552, 0.039419238, -0.080219135, 0.054504067, -0.0033390375, 0.0725174, 0.015111439, 0.072770916, 0.06214273, 0.02269387, 0.03180951, -0.05860293, -0.043251444, -5.341361e-08, -0.03477445, -0.06978064, -0.046146948, -0.10905266, -0.009229061, 0.050147012, 0.014014716, 0.109359704, -0.009044421, 0.05766377, 0.031574573, 0.056302205, 0.037111145, -0.01354128, -0.06301739, 0.035560414, -0.0136956945, -0.025869936, -0.0059122327, -0.007896166, -0.041154552, -0.0701305, 0.04405598, 0.092102855, -0.082617246, -0.03032484, 0.10890536, -0.02859356, 0.079033315, 0.06784077, 0.002971005, 0.023147482, -0.0050782934, 0.037134092, -0.0067153852, 0.016457211, -0.018441526, 0.021571284, 0.10568433, -0.005395309, 0.007349535, 0.0029786644, -0.018602733, -0.06470602, -0.103257254, -0.023803834, -0.0010401121, 0.057250287, -0.020143107, 0.046419166, -0.028991178, 0.064927034, -0.051533014, 0.0459758, 0.03660662, -0.010721197, -0.087276146, 0.04063998, 0.017270396, 0.075177826, 0.09248325, 0.021575138, 0.09760888, -0.0894642]' WHERE movie_id = 6;
+UPDATE movies SET questions = '[0.0002559692, -0.054679714, -0.056887697, -0.024572266, 0.014931075, -0.0074242237, 0.051213644, -0.029686801, -0.03709779, -0.10185537, 0.0038274955, 0.070971705, 0.018708665, 0.036072113, -0.00021967689, 0.042305604, 0.03540607, -0.01280584, 0.02886889, -0.00400623, -0.031824693, -0.08764392, 0.025235295, -0.01915203, -0.12671581, -0.13158362, 0.018919375, -0.025559165, -0.041181557, 0.0042096484, -0.016085679, -0.0109022865, -0.09458426, -0.013924168, -0.04837008, -0.033638574, -0.014014766, 0.018921401, -0.0062643066, 0.11489982, 0.019507736, -0.07222281, -0.06381881, -0.011200258, 0.04257182, -0.03719294, -0.011102688, 0.031098038, 0.007041371, 0.0004548159, -0.052420363, 0.08245021, -0.025469178, -0.08467385, -0.031070057, -0.018361304, 0.03369542, -0.017464671, 0.009546554, 0.030314755, 0.042174976, -0.069134064, 0.009266144, 0.057445504, 0.0202565, -0.08820346, 0.018032325, 0.07058669, -0.077023, -0.018094104, -0.099834174, -0.03490926, -0.0030857148, 0.01880075, -0.013268481, 0.001324033, -0.047583435, -0.047025546, -0.008021041, 0.04956842, 0.057903994, -0.09756519, -0.021329522, -0.00021595194, 0.11065712, 0.05182283, 0.038355194, -0.005186496, -0.08351825, 0.13054754, -0.07415009, -0.03704735, 0.06432313, 0.06098052, 0.06283253, 0.040430497, 0.030702101, -0.007718116, -0.08259016, 0.027793167, 0.020912472, -0.07167713, 0.03529504, -0.043837838, 0.030417254, -0.026720589, -0.048976727, 0.03979865, 0.01195503, 0.019378455, 0.034999683, -0.04901942, 0.017997593, -0.052185792, 0.065045275, -0.017804634, 0.11456443, -0.05514594, 0.053208847, -0.044527892, 0.12173369, 0.068292305, 0.03152286, 0.055920225, -0.033371653, -0.010345962, 0.020175282, 4.2927254e-34, 0.032662574, 0.06213352, -0.068896756, -0.04841873, -0.0010117543, 0.108906455, -0.027037112, 0.015715912, -0.021156305, -0.090263166, -0.081416346, -0.021975633, -0.05868601, -0.054888524, -0.062440827, 0.046203546, -0.03463174, 0.03507711, 0.030654052, -0.056659047, 0.025278179, 0.06834492, -0.03316775, -0.004281374, -0.031847794, 0.012726208, -0.082569554, -0.039318845, -0.028463978, 0.026163917, -0.008195439, 0.019944733, 0.012288051, -0.007875397, 0.12320241, -0.055643544, -0.04652607, -0.038761027, -0.032561537, 0.058309175, -0.04245663, -0.012121469, 0.0048428145, 0.034751967, -0.12656793, 0.009867285, 0.07144957, 0.07848194, -0.105612315, 0.02304246, -0.0053045545, -0.00096864655, -0.0075372397, -0.050199836, 0.018327598, 0.035592105, 0.020955974, -0.06120732, 0.06842689, -0.08997822, 0.017255154, 0.01928414, 0.027768692, 0.061254565, 0.03144679, 0.03583757, -0.008579727, 0.0685596, -0.020166088, 0.093796514, 0.046145342, 0.021995734, 0.06092148, -0.0021151723, 0.028086001, 0.01984689, -0.08773245, 0.009631749, -0.027610652, -0.003228166, 0.067935534, -8.1799044e-05, 0.036497742, -0.06393447, -0.098228015, -0.026504181, 0.022812653, -0.03265504, 0.039425682, 0.062211342, 0.034408648, -0.0034198442, 0.043268155, 0.011253995, -0.011598242, -1.997375e-33, -0.011951903, 0.002836034, -0.011186183, -0.011997157, 0.035343245, -0.030062653, -0.048221096, -0.011818799, 0.0265138, -0.01838222, 0.0102840355, -0.12143961, 0.018483117, 0.05937369, -0.036552116, -0.03359626, -0.006497533, -0.057651788, -0.08651997, 0.003981991, 0.04541257, -0.106716804, -0.06961849, 0.08003418, 0.062099162, -0.023555245, 0.07806172, -0.110142104, -0.024535663, 0.03978878, -0.04725812, 0.029496608, -0.014187637, 0.018424418, -0.0005110085, 0.15192357, -0.0029339814, -0.016403116, 0.047962625, 0.022169212, 0.06127026, -0.044784218, 0.029741952, -0.04655275, 0.040620774, -0.031719446, -0.024500031, 0.009033222, -0.08166685, -0.04483015, -0.09904715, 0.071262866, 0.05191884, 0.031194983, -0.03423596, 0.013182077, -0.023177022, 0.03877843, -0.06138989, 0.00467561, -0.030653495, -0.11646128, -0.031646356, 0.032512106, 0.049376555, -0.031478766, -0.04440726, -0.043268632, -0.14511172, 0.013119198, 0.010849451, -0.06659476, -0.025925782, 5.558487e-05, 0.045243602, -0.0328291, 0.023579603, 0.020386502, -0.008327918, 0.03095994, 0.06839413, -0.117056146, 0.067307234, -0.04441394, -0.020484896, 0.06548907, -0.00871543, 0.10213194, -0.07257401, 0.05966277, 0.07960676, 0.025342856, -0.04406004, -0.024742575, 0.08612868, -4.8004253e-08, -0.054055538, 0.005063159, -0.006614594, -0.068764016, -0.032113746, 0.0011838315, 0.009423379, -0.07268535, 0.025151074, -0.013157457, -0.08653819, 0.052607853, -0.009871558, 0.016633298, 0.03926774, 0.046109386, -0.01348562, 0.00048255167, 0.06250407, 0.054423112, 0.039364517, -0.008505618, 0.06715092, -0.018336533, -0.028328298, 0.033738382, 0.00861046, 0.002554141, 0.08534849, 0.085205, -0.016162487, 0.0017316381, -0.050293487, -0.061883226, -0.08134178, 0.081380926, 0.056318372, 0.010129428, 0.05418258, 0.09485938, 0.036443878, 0.015798861, 0.019921081, 0.024274679, 0.033752836, 0.04291829, 0.019345416, -0.023152368, 0.008086128, 0.046355482, 0.057735756, -0.018910158, 0.10137715, -0.02137361, 0.03543856, -0.037701357, 0.006969753, 0.057869047, -0.05754393, 0.011852043, -0.0044805505, 0.06162278, 0.060434654, 0.0031601836]' WHERE movie_id = 7;
+UPDATE movies SET questions = '[0.02060518, 0.008057823, -0.09674523, 0.006206026, 0.019644946, 0.015251523, -0.022302851, -0.12807694, -0.045101795, -0.033065308, 0.07450022, 0.023121282, 0.06535721, 0.023786921, -0.034259796, 0.029072594, -0.058881734, -0.045916677, 0.049180247, -0.0015456302, -0.009895268, 0.012611137, 0.043590844, -0.012890397, -0.026125891, -0.029952144, 0.03786544, 0.0005141064, -0.02644663, 0.06514238, 0.055990666, 0.098835036, 0.021671508, 0.05363278, 0.028336223, -0.050063096, 0.011418979, 0.03232406, -0.029710347, 0.06880422, -0.027711438, -0.02356238, 0.02519388, 0.033773754, 0.023971738, -0.021945959, 0.012328464, -0.05989801, 0.08936123, 0.017672068, 0.03327397, -0.010397106, -0.027687587, -0.00981669, -0.0008154217, -0.03125304, 0.049535643, 0.022761632, -0.076483525, -0.07905021, 0.05159877, -0.078480884, 0.075858526, -0.026625203, 0.04260643, -0.021218771, -0.03579074, 0.020893814, -0.03484857, -0.031009087, -0.010433555, 0.020344049, -0.1038888, 0.039577167, -0.086021125, -0.0765805, -0.13628748, -0.0019621665, -0.010658198, -0.051561248, 0.036398128, -0.034503322, -0.02184915, 0.0024187414, -0.032478325, -0.02764277, -0.0007208255, -0.04246809, 0.0150248, 0.05732956, -0.04459557, 0.069070294, -0.0002690565, 0.031445518, -0.039544962, -0.027700288, 0.06971737, 0.08819877, -0.1317079, 0.08485111, 0.022898197, -0.067031376, 0.005216672, 0.0111368215, 0.0024026006, 0.048819873, 0.03597151, 0.036440305, -0.05574734, 0.044907216, 0.025652204, 0.06521513, -0.0030654192, -0.002062342, -0.011228525, -0.076440565, 0.015687797, -0.019993525, -0.030998921, 0.05394976, 0.036372628, 0.049778204, -0.07079474, 0.08686939, 0.024930222, 0.09687488, -0.0069413423, 7.276608e-34, 0.01360678, -0.03637396, -0.024966123, 0.03780405, 0.02749541, -0.004100195, 0.0017466232, -0.036478627, -0.010921781, -0.008581737, -0.021414423, 0.020591227, -0.022132112, -0.09495521, 0.005441846, 0.059059706, -0.053534217, -0.05408305, 0.10755534, -0.0036931213, -0.070699565, 0.086673185, -0.050812855, -0.043888934, -0.0733786, -0.028345319, -0.036023203, -0.028532607, -0.02458501, -0.061318137, -0.07607538, 0.08282787, 0.056255914, -0.05866789, -0.004480268, -0.071979135, -0.042490836, 0.04654689, -0.04677298, 0.1038349, -0.08276874, 0.040529095, -0.007833044, 0.002915841, 0.057446703, -0.00023784436, 0.028035924, 0.035749238, -0.05074762, 0.07361382, 0.0037392038, -0.021257356, -0.050979458, -0.04086034, -0.043367296, 0.025195008, -0.023034208, 0.02447005, -0.01626614, -0.11474022, 0.14285399, -0.05625224, 0.048708316, 0.04503076, 0.030147113, 0.033399504, -0.002403347, -0.030291103, -0.037320837, 0.012012936, -0.02358348, -0.042899895, 0.01657492, 0.09466306, 0.110278234, -0.012380539, 0.02374154, 0.016105443, -0.015528599, -0.09367488, 0.05812234, -0.032793347, -0.07838007, 0.056442022, 0.014210555, 0.043522317, 0.000728934, -0.13827915, 0.10046182, 0.0009856988, -0.03388868, -0.06705025, -0.076658346, -0.027141927, 0.08059513, -2.7911939e-33, 0.07931605, -0.06897491, -0.025888609, 0.017516281, 0.029451035, 0.018653164, -0.04877048, 0.040923655, 0.09317121, -0.006832775, 0.04882671, -0.09101935, 0.107247755, 0.04457628, 0.05441888, 0.04458438, -0.015457438, 0.010935418, -0.0628594, 0.02003333, 0.004919841, 0.06664854, -0.0636822, -0.06085697, -0.04589457, -0.012866799, -0.09012723, -0.0029296302, -0.041861713, 0.003582635, -0.013033648, -0.048597697, -0.002958649, 0.048687387, -0.10003378, 0.016248869, 0.0036901142, 0.010720833, 0.044335708, -0.026869887, -0.033555344, -0.03458191, 0.01183756, 0.048725665, -0.10512801, -0.021448605, -0.028540714, -0.0070086373, -0.041391954, -0.093635246, -0.034212377, 0.04362023, -0.03240506, -0.033901025, -0.045313127, 0.010840684, 0.03603623, -0.0074459426, 0.121560335, 0.0020952446, -0.044765607, -0.0039950926, -0.0029733467, 0.008048161, -0.03556498, 0.035343416, -0.078621134, 0.069051445, 0.05150901, 0.008715034, 0.021492591, -0.09180736, -0.004074127, 0.007666279, 0.09677564, 0.07251342, -0.0037774183, 0.048457325, -0.040652554, -0.07486408, 0.04016298, -0.053980336, -0.08789668, 0.056924958, 0.031591434, 0.16559201, 0.05013751, 0.0188298, -0.00033778502, 0.027860422, 0.019497162, -0.04392, -0.032740645, 0.018432572, -0.040600948, -5.0436867e-08, -0.021906069, -0.0069031143, -0.05075739, -0.063697785, -0.09535995, 0.014437984, 0.010821124, 0.009481975, 0.021617029, 0.065751374, 0.036490593, 0.049539343, -0.004780457, 0.024120439, -0.05847876, 0.115756355, 0.035491727, -0.0057941847, -0.029518569, 0.022746794, -0.02830535, 0.035199016, 0.014472703, 0.0093671335, 0.021313954, 0.027828678, 0.06720225, -0.021441432, 0.06578416, -0.010598208, 0.027387181, 0.039895177, -0.049347803, 0.02675807, 0.023126584, -0.038386285, -0.008139898, 0.01479742, -0.026727146, -0.06707577, -0.045376923, 0.042893343, -0.07432492, -0.06509404, -0.0034070339, -0.05149234, 0.05560596, 0.017416276, 0.010765874, 0.12377884, 0.06837156, 0.041644465, -0.058933593, 0.022966769, 0.025181692, 0.004846959, 0.04678557, 0.09295222, 0.01046764, -0.07094204, 0.022912057, -0.093840845, 0.029841976, -0.10195574]' WHERE movie_id = 8;
+UPDATE movies SET questions = '[0.016162258, 0.00951719, 0.032094296, -0.034076825, 0.011301096, -0.010164112, -0.026201667, 0.01228109, 0.03043732, -0.077533945, -0.082021, 0.096584864, -0.030778723, 0.033141784, -0.04807508, 0.025380056, 0.09602851, -0.00943741, -0.065888725, -0.062053736, 0.057366557, 0.022514421, 0.008008631, -0.01938082, -0.076690726, -0.05888329, 0.04710881, 0.08909766, -0.05875108, 0.06261955, 0.013107963, 0.010728083, 0.027473258, -0.004904255, -0.06131444, -0.009679748, -0.030114174, 0.035900224, 0.033859283, 0.021086155, 0.015857982, -0.017929053, 0.045142066, -0.014662673, 0.048636317, -0.0653917, -0.033935446, -0.01480206, 0.059632428, 0.04396033, -0.041529354, -0.04308207, -0.004358811, 0.088130295, 0.12162819, -0.048047528, -0.046234623, -0.08967578, 0.025283895, -0.06333962, -0.014886957, -0.03277802, 0.048562292, 0.035892118, 0.06633122, 0.029367972, 0.034992788, 0.043334275, -0.0649422, 0.013227564, -0.019304954, -0.03824875, 0.0027066616, 0.033183947, 0.023067731, -0.124925785, -0.10450787, 0.028906973, 0.021296805, -0.00684166, -0.009515127, -0.087939605, -0.06840407, -0.026596755, -0.0984063, 0.042516254, 0.07912816, 0.029636048, -0.0035806152, -0.01512033, -0.08541339, -0.021454956, -0.011101623, -0.029038265, -0.015224852, 0.0066149016, -0.009827035, -0.012036346, -0.056775756, 0.013320909, 0.06229358, -0.055278353, 0.088200204, -0.10595856, 0.08481375, 0.019870518, 0.05671778, 0.08282883, 0.051359583, -0.05952121, 0.03215684, 0.032005005, 0.03939652, 0.033359945, 0.03157766, 0.0019952643, 0.032885905, 0.022195531, -0.028036533, 0.05963317, 0.08115958, 0.031701393, 0.02287018, 0.027440386, -0.0059039374, 0.046628334, -0.04465562, 4.8553467e-35, 0.027637135, -0.048436727, 0.03801748, 0.037107904, 0.016790902, -0.017574422, 0.004875433, 0.12461359, -0.09507815, 0.03507104, 0.027750878, -0.016258093, -0.010263183, 0.042838655, 0.006128904, 0.045181617, -0.048147857, -0.08521827, 0.06402178, 0.023029212, 0.019901704, 0.032070775, -0.008560868, 0.05434199, -0.090078294, -0.033777468, 0.1000582, 0.0016068935, 0.0015765999, 0.042707432, -0.09931743, 0.030581102, 0.0043379213, -0.033777237, 0.09949956, -0.11658174, -0.03621482, 0.010271584, 0.0077294568, 0.07176528, -0.038327806, -0.039418817, -0.15549044, -0.0080439355, -0.010181979, 0.026485698, 0.03687986, 0.048454702, -0.011196606, 0.09032505, 0.07099785, -0.014313718, 0.023953749, -0.056142475, -0.04389734, 0.0027549046, 0.019333733, -0.024268338, -0.006306065, -0.08057448, 0.008359864, 0.025506513, -0.018771784, 0.12209233, -0.0091808075, 0.022469586, -0.03499802, 0.03226106, -0.034222513, 0.041347567, 0.03429634, -0.049997546, -8.8355766e-05, -0.01215055, 0.012376659, -0.014231694, -0.06857387, 0.07039417, 0.033426892, -0.013304184, 0.013396163, -0.06333777, 0.028415645, -0.09615362, -0.12366856, 0.0025951508, -0.058561496, -0.04564403, 0.01465629, 0.027968353, -0.0026091505, -0.017381852, 0.018971661, -0.010035456, 0.05368294, -2.3065008e-33, 0.010609253, -0.022337487, -0.037784114, 0.074190006, 0.023947192, 0.0020343135, -0.09455327, 0.021180065, 0.0886745, 0.0036855564, -0.031003015, 0.009350412, 0.041298814, -0.038338102, 0.11564748, -0.016207097, 0.030409848, -0.037369873, -0.015954712, -0.017458139, 0.11595774, -0.04626262, 0.04414274, -0.058537755, -0.08206271, -0.00046925497, -0.030925428, 0.02978562, -0.011460738, 0.06650665, -0.07287532, 0.017247086, -0.0015602453, 0.03848175, -0.077625126, -0.002024866, 0.029003842, -0.019300934, 0.010658074, -0.04958177, -0.03748108, -0.06594216, -0.07129284, 0.016765026, 0.001555531, -0.0501392, -0.039028045, -0.022029215, 0.023570089, -0.053350605, -0.09274889, 0.035335727, -0.00905418, -0.038114604, -0.04387039, 0.021593928, -0.0021913873, 0.00090835, -0.013291984, 0.0039812773, -0.065746866, -0.019596165, 0.037018932, 0.020499773, -0.005849119, 0.073263645, -0.05247559, -0.06256411, -0.04840791, 0.02900809, -0.029052166, -0.11962853, -0.025055619, 0.015395077, -0.05480458, 0.074710585, 0.020138884, -0.0063031297, -0.06314062, 0.05732751, 0.09615406, -0.08200959, 0.05163289, 0.06372513, -0.04953254, -0.008967538, 0.011461107, 0.08591467, -0.039717115, 0.08829646, 0.014716711, 0.060246695, 0.03163462, 0.001501403, 0.02824773, -5.0374908e-08, -0.073903054, -0.011151384, -0.10702007, 0.006222929, -0.030387739, -0.021215716, -0.05890965, 0.077529855, 0.054027848, 0.074062824, -0.07331656, 0.015440317, -0.022318186, 0.028934289, -0.0032018838, 0.04582234, 0.036720365, -0.14112881, -0.0108546885, 0.00605861, -0.0029442972, -0.10099688, 0.103854544, 0.014117411, -0.055639364, -0.0653242, -0.005521542, 0.031405438, 0.023694957, 0.09924759, -0.08334653, 0.007473714, -0.12239453, 0.0037822216, -0.043940887, 0.01116012, 0.013945196, -0.008760659, 0.14612362, -0.047981888, 0.033337876, -0.01602861, -0.004300287, -0.02766795, 0.012913985, -0.035237722, 0.07283887, -0.06524593, 0.0013627514, 0.0734729, 0.01744345, -0.0084422035, -0.039750613, 0.004701398, 0.0387859, -0.0122454185, -0.032085318, -0.016547743, 0.04030861, -0.04169433, 0.04930861, 0.08940796, 0.049231887, -0.049914658]' WHERE movie_id = 9;
+UPDATE movies SET questions = '[-0.015234612, 0.019119928, -0.015132052, 0.026890846, 0.01003092, 0.0072356933, 0.032376684, 0.0835289, 0.05040542, -0.032861914, -0.018704195, 0.043792743, 0.04311771, 0.022688694, -0.046140254, 0.05204826, 0.013804189, 0.033549055, -0.011139994, 0.0296934, -0.022835286, 0.00060918427, -0.029683826, 0.01319535, -0.0041343383, 0.065840594, 0.036831874, -0.02539815, -0.08504226, 0.059458464, 0.04450825, -0.023228874, 0.0036929986, 0.062165484, 0.013041576, 0.021499483, -0.06503446, 0.002467377, -0.050930504, -0.06898488, -0.069369584, 0.03248542, 0.03154759, 0.10202895, 0.049626183, -0.007652309, -0.036756113, 0.032773446, 0.021025687, -0.04696269, -0.09947516, 0.051186543, -0.02617116, 0.015209395, 0.030687438, 0.033573307, 0.046657372, 0.04373089, -0.013402306, 0.039586697, -0.0111799855, -0.05737461, 0.05053582, -0.070621826, 0.011696972, 0.057478245, -0.037337087, 0.049372293, 0.03216693, 0.034432326, 0.04237987, -0.03988051, -0.023164356, -0.077433646, -0.027790798, -0.034811094, -0.07903829, -0.057174455, -0.02357068, -0.0009383246, -0.030096922, -0.0593402, 0.0072439644, -0.057573028, -0.0063912766, 0.0074451007, 0.013389599, -0.047193483, -0.078154385, 0.11950863, -0.10105053, -0.122097656, -0.036001716, -0.086794935, -0.059958134, -0.00816626, 0.033626493, 0.036844388, -0.051395837, -0.02745239, 0.05187674, 0.02211355, -0.048882913, -0.025795039, 0.011808116, -0.006024119, -0.012775496, -0.016288804, 0.03429175, 0.0071316166, -0.05109998, 0.00019087084, -0.0550121, 0.009290709, 0.03712833, -0.00074304617, 0.060041506, 0.044960696, 0.025400545, 0.13727628, 0.026428225, -0.012040292, -0.034392525, -0.0072547994, -0.10298477, -0.091106795, 0.056806415, 1.8187326e-33, -0.017479865, -0.048175987, -0.03868605, 0.07976233, -0.009910839, 0.0010664294, -0.083989516, 0.0062013725, -0.0054927333, -0.08659205, 0.04736495, -0.045199137, -0.048027255, 0.0019968715, -0.009834952, 0.018433, -0.14625384, 0.045685444, 0.15142444, 0.025692794, -0.10357492, 0.04673767, 0.005493496, -0.06843197, -0.05233544, -0.027959222, -0.007002111, 0.060636383, 0.019674601, 0.012754494, -0.09940531, 0.07978136, 0.019062804, -0.09939398, 0.030633768, 0.04356473, -0.02025015, -0.013976347, 0.016715182, -0.01229001, -0.051908094, 0.04963474, -0.053721018, -0.09669918, -0.04424492, 0.043498375, 0.13848823, 0.0594225, -0.03789409, -0.012958855, 0.05279463, -0.042047646, -0.0016396745, -0.013014724, -0.02389026, 0.08549681, 0.047478918, -0.0279063, 0.08801515, 0.039535496, 0.08951278, -0.0324985, -0.009313158, 0.04403182, 0.049091414, 0.047118522, -0.05630564, 0.05657759, 0.072654635, 0.06732293, -0.06929513, -0.011067105, -0.0145849865, 0.008696203, -0.021688117, 0.08438361, 0.04870658, 0.064154334, -0.11566798, -0.03164103, 0.038782187, 0.013235002, 0.023043342, -0.04293123, 0.013895755, 0.012073732, -0.013864472, -0.055873793, -0.10303006, 0.058802117, 0.05189626, -0.0959554, 0.050646372, 0.067241006, 0.0112067545, -2.3622428e-33, 0.0033584058, -0.10023107, -0.0093388315, -0.013434215, 0.03815896, -0.13963072, -0.08537441, 0.0005587298, 0.009396029, -0.05225841, -0.07599138, -0.038693834, 0.08886967, 0.16244237, -0.062396277, -0.0024105252, 0.028092178, -0.061412156, -0.012424422, -0.0068592564, -0.0207652, -0.010298826, -0.0071184565, -0.06627658, -0.07437627, 0.06529447, -0.08708937, -0.011304792, 0.031162359, -0.06304967, 0.010730192, -0.01492516, 0.022991292, -0.023626266, -0.017566433, 0.024715569, 0.03768499, -0.07745882, 0.03156273, -0.016259087, -0.003646532, 0.040507082, -0.060044263, -0.040580817, -0.01948196, -0.025388487, 0.030994428, 0.1372622, 0.034917347, 0.00977566, -0.030224657, 0.019597813, -0.07452839, -0.03235743, -0.057400007, -0.05489653, 0.019287478, -0.014124859, 0.069767006, -0.008956678, -0.06064211, 0.04262885, -0.035901707, 0.014745015, -0.021718835, 0.014981328, 0.016373212, -0.019187605, -0.137256, 0.03999178, 0.048525132, -0.0012667436, -0.022287697, 0.06459291, 0.12538539, 0.018184602, -0.040146343, 0.041955646, 0.015707912, -0.032403555, -0.0459182, -0.056630563, 0.041522395, 0.09643894, -0.024164787, -0.0255464, -0.019092256, 0.056900084, 0.010331142, -0.030590925, -0.029173763, 0.03181171, 0.006100836, 0.036580026, -0.01642448, -4.6785047e-08, -0.041867267, -0.09599068, 0.025875311, -0.046170436, 0.030214168, -0.021256799, -0.009296363, 0.051892336, 0.025058476, 0.021559205, -0.034267537, 0.033448525, -0.08740684, -0.03302015, -0.088029064, 0.05092277, 0.076618426, -0.03123567, 0.05355672, 0.036558736, 0.032961976, -0.053262305, 0.058119603, -0.0152471, 0.020222405, 0.035297215, 0.012644923, 0.049067892, -0.007234609, 0.058506753, 0.00041888378, 0.01447418, 0.04845067, -0.030010078, -0.065349184, -0.0013505851, 0.08051022, 0.049111087, 0.0047039916, -0.033653658, 0.05824875, -0.038649943, -0.004109347, 0.022193791, 0.023486288, 0.04191797, 0.07057328, 0.0032338584, -0.0718207, 0.05000671, 0.002737528, -0.048412394, 0.039891277, 0.05911955, 0.048385236, -0.0023954131, 0.04801601, 0.040707767, -0.009811439, -0.055073682, 0.05832403, 0.093233325, 0.054049205, 0.019807974]' WHERE movie_id = 10; 
+            
+
+
+ + + +5. The vectors were created by passing our movie descriptions through an embedding model and storing the results in our table. There are two typical processes to create embeddings in the industry. The one approach is to export data to the model to create the embeddings. This can introduce integration and security challenges. + + Oracle Database 23ai allows you to load models directly into the database meaning you can potentially embed data in near real time as its inserted into the database and you don't have to worry about offloading sensitive data to third party services. + + The creation of the vectors was done beforehand to keep this section concise. If you're interested in how that works, check out the [Complete RAG Application using PL/SQL in Oracle Database 23ai](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3934&clear=RR,180&session=1859311324732) and [7 Easy Steps to Building a RAG Application using LangChain](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3927&clear=RR,180&session=1859311324732) workshops. + +6. To benefit from these vectors and Oracle Database’s AI Vector Search functionality, we’ll use one of the new SQL functions in Oracle Database 23ai. After our objects have been embedded, they exist in a vector space. A simple example of this would be an x,y graph, where a location on the graph would exist in a 2-dimensional plane. + + Our embeddings exist in a much higher dimensional space—384 dimensions, to be exact. The more similar objects are, the closer they exist to each other in this dimensional space. + +7. Let's learn a bit about similarity search and its role in generative AI. What is Similarity Search? @@ -191,102 +373,92 @@ In this lab, you will explore the new vector data type introduced in Oracle Data Let's take a look at this. -2. Vectors can be created directly in SQL using the VECTOR() constructor, we'll use this to show a basic example. Here are some examples of two-dimensional vectors: - ``` - - SELECT VECTOR('[0, 0]'); - SELECT VECTOR('[1, 1]'); - SELECT VECTOR('[5, 0]'); - SELECT VECTOR('[3, -5]'); - - ``` - ![select vectors](images/image.png =50%x*) +8. With Similarity Search, we don't focus on the actual distance between two vectors. Instead, we care about the result set, which is a list of vectors ordered by their distance from a given input/query vector. The exact distances aren't important. **What matters is how close each vector is relative to the others in the list.** - This is what the vectors would look like if we graphed them. -3. The VECTOR_DISTANCE() function calculates the distance between two vectors. For example, the distance between (0,0) and (5,0) is 5. Use the following query to calculate this distance: +9. Following our MovieStreams company example, imagine we know that most of our customers use smart TV remotes with a microphone. We’ve been tasked with creating a new feature that allows customers to search for movies based on natural language. - ``` - - SELECT TO_NUMBER(VECTOR_DISTANCE( - VECTOR('[0, 0]'), - VECTOR('[5, 0]'), - EUCLIDEAN)) AS DISTANCE; - - ``` - ![select vectors again](images/vec7.png =50%x*) + To create this, we would first need to map speech to text using a speech recognition system. Next, we would need to embed the queries as vectors and perform a similarity search. For the sake of time, we’ll create a table and load in some pre-vectorized questions. -4. How about from (1,1) and (3, -5)? ``` - SELECT TO_NUMBER(VECTOR_DISTANCE( - VECTOR('[1, 1]'), - VECTOR('[3, -5]'), - EUCLIDEAN)) AS DISTANCE; - - ``` - ![find the distance](images/vec8.png =50%x*) - -5. Now let's take a look at performing similarity search between multiple different vectors. With Similarity Search, we don't focus on the actual distance between two vectors. Instead, we care about the result set, which is a list of vectors ordered by their distance from a given input/query vector. The exact distances aren't important. **What matters is how close each vector is relative to the others in the list.** + CREATE TABLE IF NOT EXISTS customer_questions ( + id NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY, + customer_id NUMBER, + cust_question CLOB, + embedding VECTOR(384), + FOREIGN KEY (customer_id) REFERENCES customers(customer_id) + ); + + INSERT INTO customer_questions (customer_id, cust_question, embedding) + VALUES + (1, 'I like medieval time period movies, what are some suggestions ', '[-0.0707464, -0.01661913, -0.002593263, -0.113951795, -0.04265089, 0.03758569, -0.09313352, -0.03446582, 0.01936587, -0.010355976, -0.0029676536, -0.027365506, 0.010263237, 0.036095947, -0.044897944, -0.03737873, 0.06305378, 0.07670946, 0.114474714, -0.045342296, -0.008674023, -0.034316514, 0.025904711, 0.013385106, 0.0007525914, -0.024914542, 0.0033227967, 0.0035163348, -0.0985021, -0.017455978, -0.08973421, 0.04001237, -0.071087494, -0.06985979, -0.079971015, 0.049466804, 0.005725448, -0.03477709, -0.040133547, -0.002194659, 0.010187673, 0.03486812, 0.033062894, -0.0548749, 0.06226114, -0.045632705, -0.026842287, -0.021815466, 0.04389736, 0.07036045, 0.0062656947, 0.056750655, -0.069051735, 0.018255552, -0.016426409, -0.09760292, -0.043446247, 0.0044087903, 0.080292545, -0.09696205, -0.04720497, 0.004104739, -0.041300043, -0.02863464, -0.07574268, 0.0011896113, -0.0045508547, 0.0921791, -0.0314868, 0.012630218, -0.12023269, -0.037144817, 0.017518489, -0.007617511, -0.05863477, -0.0131577505, -0.14964211, -0.1482684, -0.12698366, -0.06978375, -0.01881525, -0.009855495, -0.020326821, -0.007744006, -0.040624484, 0.031198855, 0.07678265, -0.042197894, -0.018642692, -0.013794544, -0.03150917, -0.04594764, -0.012994456, 0.11678302, 0.04828263, 0.073116876, 0.037168104, 0.010734932, 0.03964709, 0.0407865, -0.024001757, -0.050678708, -0.008984005, 0.023571307, 0.008893427, 0.0070106057, 0.08950682, -0.04471103, -0.01528616, -0.059020042, 0.0067702373, -0.039735984, -0.020017654, -0.113570504, 0.050727744, 0.007593999, 0.08539904, -0.034478676, -0.025581988, 0.077369645, 0.041788943, 0.008697989, -0.024543183, 0.016489519, 0.064467296, 0.03621743, 0.080725156, -2.7071464e-33, -0.0024949457, -0.01657628, -0.07529198, 0.06995659, 0.051176567, 0.016309466, 0.012622951, -0.0071524205, -0.024544567, -0.04753242, 0.011225469, -0.012852217, -0.11031236, -0.053862248, 0.053371392, -0.037832342, 0.034835864, 0.007738382, 0.14608812, -0.009273282, -0.086492375, 0.009713798, 0.01165408, 0.04107374, -0.03661808, -0.04447341, 0.029904833, -0.021005139, 0.06415092, 0.027711976, 0.052219667, 0.009723421, 0.0032689928, -0.0687986, 0.05388989, 0.07625864, -0.1016104, -0.023794195, 0.052502718, 0.055346254, 0.0028692095, 0.023076795, -0.01753317, -0.009315752, -0.014932581, 0.0376516, 0.07167227, 0.007570556, -0.05946584, 0.015494753, -0.008570694, -0.022733908, -0.05130139, -0.015006969, -0.068904705, 0.009262216, 0.03661053, -0.024988811, -0.02260767, -0.025740756, 0.053059947, 0.03743317, 0.04920889, -0.07848944, -0.021529453, 0.048377357, 0.03071703, 0.019467574, -0.02671018, -0.0058588, -0.078689866, 0.04288792, 0.087129876, 0.0356138, 0.0330658, 0.0857438, -0.02273504, -0.012144004, -0.088560246, -0.07283549, -0.0034917132, -0.07044128, -0.07018506, 0.07460997, 0.008133306, -0.04236237, 0.03992406, -0.06413398, -0.037100673, -0.05248168, -0.026021985, -0.034354616, 0.07709111, -0.0681912, 0.011977301, 1.2913646e-33, 0.08291945, -0.07273404, -0.014820696, 0.03425547, 0.078323685, 0.030976357, -0.106186755, 0.0003750488, 0.064383484, 0.023649476, -0.043406133, -0.0035306774, 0.008598716, -0.008007125, -0.036535654, -0.052574724, 0.048828408, 0.011428035, 0.013432724, 0.052931964, 0.057224374, -0.012959572, -0.034541488, -0.06628312, 0.061774183, 0.07391379, -0.08248612, -0.03658098, -0.077920675, 0.045444846, 0.0034670772, -0.022856949, 0.048886716, -0.009043358, -0.07867487, 0.04255908, 0.08663369, -0.05304385, -0.033011045, 0.042901076, 0.02248999, -0.027022293, 0.07857965, 0.050938465, 0.023153009, 0.031816266, 0.005060663, 0.08178595, 0.010296494, -0.00661973, -0.012497117, 0.10794909, 0.05982001, -0.061118346, 0.006593107, -0.04598047, 0.041519705, -0.060118, 0.024259042, 0.04175685, -0.07898876, -0.030751662, -0.05474619, 0.04867821, -0.058777675, -0.0010305704, -0.034626953, -0.025690807, -0.03117211, -0.056504253, -0.006721161, -0.0091022905, 0.017634396, 0.020063223, 0.007646226, -0.023351735, 0.04818614, 0.013108411, 0.070337325, -0.021506717, 0.035036508, -0.044291932, -0.036453955, 0.041951615, 0.025730925, 0.09752754, 0.0004112461, 0.047304273, -0.038817737, 0.016573334, 0.03983153, -0.013239263, 0.123615265, -0.014987573, 0.048808668, -1.5545144e-08, -0.04043946, -0.019742873, 0.014211572, -0.012092857, -0.03555417, -0.0046741758, -0.039710753, 0.046573658, 0.044500273, -0.02837695, -0.016686419, 0.013288879, 0.07547559, 0.016969262, -0.0099352505, 0.045243487, 0.07203052, -0.15766351, -0.028494606, 0.080396764, 0.037610915, 0.02110095, 0.065263934, -0.031090144, -0.07528839, 0.0065552336, 0.02701542, -0.023554804, 0.084347375, 0.12698245, 0.021037113, 0.031955156, -0.0036422755, -0.07680574, -0.051228996, -0.030743007, -0.029471992, 0.010596199, -0.051227942, -0.020039853, 0.058111444, 0.00038178914, 0.021421613, -0.013987098, 0.06601137, 0.051883806, 0.12001321, -0.05757651, -0.013583953, 0.025692316, 0.047636736, 0.04970589, 0.07531287, 0.032051314, 0.061276868, 0.0025395723, 0.03610605, 0.05595699, -0.0070951874, -0.014759841, 0.095430516, -0.016873155, 0.0011574465, 0.052842245]'), + (1, 'Can you suggest movies that explore dark or serious themes, but still include humor?', '[0.021848066, -0.11394338, -0.029798398, 0.03673288, 0.0088765975, 0.021265494, -0.005375811, 0.011819329, 0.01833497, -0.07522426, -0.0064477376, 0.022833815, -0.057566646, 0.05334373, 0.0036803675, 0.022407861, 0.120274134, 0.02001211, 0.111872815, 0.013072123, 0.034866564, 0.046225086, 0.041070443, -0.046438094, -0.06374621, -0.054826617, 0.023269713, 0.010854754, -0.124397755, -0.019226618, -0.03742599, 0.032678016, -0.056515038, -0.029215354, 0.012677019, -0.01665405, -0.012751518, 0.067705356, 0.02547576, 0.038423024, -0.025174579, 0.07257699, 0.007073048, 0.010122191, 0.0638075, -0.043505657, 0.022943141, 0.012594575, 0.014664204, -0.0003002716, -0.024934342, 0.06584327, -0.11462918, 0.06354213, -0.060153157, 0.008875424, -0.053243063, -0.0464934, 0.030877797, -0.04054544, 0.028055618, -0.05170132, 0.036159072, -0.07717004, 0.035786152, -0.0150357345, -0.0052629896, 0.062095527, -0.016314121, 0.063718, -0.05187633, -0.01121074, 0.015052656, 0.03123377, -0.038161296, 0.06578068, -0.10522416, 0.0025715188, -0.11514192, -0.069947906, 0.013995467, -0.021188362, -0.018964589, -0.05258166, 0.0017468955, 0.017984444, -0.0026282954, 0.017245857, -0.06738264, 0.07734322, -0.06511177, -0.04240543, 0.032789532, 0.025149064, 0.015006466, -0.044717558, 0.0036539114, -0.08281879, -0.052049447, 0.04928855, -0.022532193, -0.04207987, 0.032803364, -0.015722629, 0.071091086, 0.038651787, 0.028001163, -0.09438529, 0.027899858, -0.047190513, 0.0033439167, -0.005826445, 0.03772319, -0.04958616, 0.14317383, 0.0004301479, 0.08529918, -0.013972083, 0.05834708, 0.08852393, 0.058197085, -0.0029187598, 0.010671932, 0.06268242, 0.0017955771, 0.037302338, 0.013898146, -3.5085416e-35, -0.0017873512, -0.03431465, 0.005658186, 0.04297648, 0.0641802, 0.012197141, 0.022069847, -0.051026415, -0.07221925, 0.013852844, -0.042137373, 0.009962172, -0.06593128, -0.012274468, -0.0037802854, 0.055887032, -0.09017675, 0.026547048, 0.10432961, -0.03772284, -0.06321486, 0.0035519148, -0.0036119004, -0.06723482, -0.075643815, -0.04672163, 0.03773678, 0.0043782964, 0.058518786, -0.014630289, -0.043166194, 0.09173053, 0.07166098, -0.05639074, 0.04822629, 0.070504874, -0.11010613, -0.027381334, 0.057953443, 0.03719939, -0.04429136, 0.038195807, -0.082836986, 0.055156164, 0.019816412, 0.05957129, 0.071591236, -0.027727505, -0.060129322, 0.06952502, -0.05840487, -0.02479491, -0.041493393, -0.10451357, -0.029654156, 0.026798584, 0.03653991, -0.023345824, 0.040563103, -0.08020421, 0.0050823535, -0.006827304, -0.05128311, -0.09904508, 0.045633793, 0.090899, 0.027637579, -0.05497295, -0.053873327, -0.058335807, -0.042296484, 0.021001427, 0.095009685, -0.042234696, -0.08394537, 0.053108606, -0.012335877, -0.041343465, -0.01862664, -0.036108557, 0.035855714, 0.0060139103, -0.065708056, 0.0251762, -0.024169624, -0.04683744, 0.04372967, -0.07798563, -0.024459828, -0.0059532933, -0.0218713, -0.05945024, 0.059089303, -0.05603144, 0.021215191, 4.6551284e-34, 0.011685534, -0.08103552, -0.17769581, 0.06000179, 0.08338654, 0.07142231, -0.06155607, -0.07373968, 0.052932825, -0.0149904005, 0.010881098, -0.031504452, 0.0057366984, -0.029146152, 0.06007189, -0.047990933, 0.0318185, 0.0010332266, -0.03580033, 0.06415481, 0.03913559, 0.061403327, -0.05186922, -0.015896937, 0.047548335, 0.061490864, -0.008121296, -0.01559809, -0.06627559, 0.011037318, -0.030143285, 0.0961185, 0.028893696, 0.013387511, -0.040176462, 0.014167117, 0.00011846256, -0.08634593, -0.0009487975, -0.010447382, 0.041321043, 0.01379462, 0.08788877, 0.01750425, -0.029382152, 0.035628147, -0.011452248, 0.019310182, -0.051570423, 0.012263116, -0.038854048, -0.017845022, -0.06611439, -0.03986474, 0.046536077, -0.03934451, 0.022508308, 0.02328622, 0.015758883, 0.076253116, -0.09385713, -0.0013145785, -0.04849781, -0.1071865, -0.0699599, -0.05284832, -0.036129892, 0.047023408, 0.006723843, -0.012485643, 0.023456087, -0.021634238, 0.050619576, -0.010605612, 0.004473206, -0.008932289, 0.08180044, 0.06204696, -0.033639, -0.011842284, 0.0012763349, -0.0038726663, 0.013861359, 0.06119759, 0.024028493, 0.08681134, -0.06976028, 0.11610995, -0.03596753, 0.105144106, 0.019879973, -0.0468245, 0.0521587, -0.061801065, 0.02989132, -1.8344574e-08, -0.030727977, -0.004634176, -0.022090761, 0.016487034, 0.013091832, -0.024300352, 0.0054311603, 0.06827, 0.005424511, 0.0011863665, -0.018779242, 0.012040705, 0.08443225, 0.067803346, -0.04884644, 0.08462549, 0.083572775, -0.050402027, 0.015446095, -0.022115821, -0.022070153, 0.082045145, 0.10938538, -0.056708265, -0.027769804, 0.052495766, 0.00050747313, -0.11007293, 0.09092505, 0.13451119, -0.012639423, 0.027223626, 0.016843265, -0.048208106, -0.052094683, -0.019847274, -0.0038883095, 0.039932087, -0.004212123, 0.023988513, -0.021688914, 0.04593341, 0.033329163, -0.035755172, -0.0030366417, 0.026806526, 0.044489913, -0.03731834, -0.0023119743, 0.033969074, -0.0076914416, 0.016014574, 0.026943862, 0.04995834, 0.03907671, 0.033573605, -0.06348861, 0.08959771, -0.12192161, 0.015729409, 0.07535803, -0.04434151, 0.0071589146, 0.025792258]'), + (1, 'What are some feel good movies', '[-0.10003671, -0.11476838, 0.033741303, -0.004764015, -0.0065133, 0.042791445, 0.07405379, -0.048643626, 0.08495647, -0.066986285, 0.031125927, 0.045025308, -0.026388781, 0.050876297, 0.039246794, 0.028178133, 0.13540208, 0.07828369, 0.013492151, 0.00028761305, -0.026576972, -0.009978121, 0.01589169, 0.019713335, -0.038674384, -0.03893938, 0.0008658615, -0.030500961, -0.063400336, -0.026859228, 0.027635893, 0.030519232, -0.069266886, -0.0397834, 0.00077044044, 0.010875298, -0.008516905, -0.0547743, -0.05451195, -0.026153594, -0.028911041, -0.007356586, 0.0805693, -0.01999386, 0.042402033, -0.08171254, 0.051496185, -0.01857753, 0.06642095, -0.004654548, -0.03766441, 0.035091795, -0.10181511, 0.020732775, 0.04295618, -0.06602387, -0.032032136, -0.047345977, 0.021774197, -0.082953125, 0.047988188, -0.03201628, 0.036587257, -0.07689355, 0.030063365, -0.021218969, -0.00828222, 0.03804862, -0.011483152, 0.024728667, -0.1371603, -0.012350251, 0.03150457, -0.05434683, -0.10873276, 0.016637256, -0.04889556, -0.06469538, -0.08972059, -0.03515399, -0.025525235, -0.026977224, -0.056141175, -0.043829143, -0.03767395, 0.004754025, 0.027163114, 0.021309892, -0.07300698, 0.100545615, -0.079564124, 0.017197073, -0.075881936, 0.05823983, 0.03141008, -0.038890813, -0.08658819, -0.021052333, -0.037790123, 0.101242304, 0.021270849, 0.04031865, -0.04030225, -0.016488966, 0.06549529, -0.047281053, 0.057755243, -0.009936994, -0.023314394, -0.030374257, -0.031563044, -0.01760398, 0.03721875, -0.0040018684, 0.04470101, -0.015825193, 0.14160368, 0.04101362, -0.0073223757, 0.05180954, 0.016946042, -0.0071874713, 0.0024627722, -0.028939538, -0.04820505, -0.01980612, 0.07366473, -3.1445884e-33, -0.01065822, -0.009361784, 0.06597365, 0.026552718, 0.02644827, 0.011779448, -0.019663831, -0.0012847738, -0.06426483, 0.0124926, -0.05224267, 0.015064941, -0.08369373, -0.010146529, 0.0016544965, -0.058366325, -0.080800295, -0.02044953, 0.06283186, 0.057862226, -0.0934759, 0.034307387, -0.065715544, 0.02322287, -0.09782268, -0.0004033358, -0.05642506, 0.0689434, 0.00916675, -0.0012456389, -0.034565087, 0.06464114, 0.009048351, -0.028038705, 0.04820219, 0.01918646, -0.092915796, 0.048664946, 0.04568177, -0.005427862, 0.006726249, 0.073659755, -0.058604922, 0.038118687, 0.025562925, 0.06818594, 0.034538023, 0.01902334, -0.004250366, 0.042606417, -0.033471875, -0.032348447, 0.025739443, -0.025044998, -0.08844773, 0.033047184, 0.034513447, 0.036832556, 0.0355597, -0.09468096, -0.02004276, 0.0066954, -0.014936623, -0.17594014, -0.051865548, 0.06383787, 0.084019, -0.026569653, -0.072183535, -0.010100226, -0.05152821, 0.07360597, -0.006483288, -0.066893615, 0.037760597, -0.01375093, -0.040897656, -0.03758459, -0.042872395, -0.030817328, -0.009620447, -0.038971294, -0.011487512, 0.05524338, 0.05541533, -0.017873112, -0.1036944, -0.09596936, 0.017587781, 0.0056838943, -0.06663307, -0.12565045, 0.09637036, -0.028927792, -0.029951414, 1.3379854e-33, 0.075329326, -0.041473646, -0.08363681, 0.072656944, 0.046876043, -0.026457611, -0.107087635, -0.024863824, -0.026444264, 0.04939302, 0.008765618, -0.051229753, 0.046362426, 0.038031533, 0.0633295, -0.017659282, 0.051541686, 0.010095578, -0.005574506, 0.029500905, 0.044937477, 0.102123015, -0.005131776, 0.013860552, 0.017669713, 0.05990552, -0.06418719, -0.045059226, -0.05316453, -0.021166554, 0.0033705812, 0.035193082, 0.021192318, 0.024574086, -0.069859855, 0.030988257, 0.033959977, -0.043023493, -0.026072476, 0.055908535, 0.05471212, 0.04524076, -0.004569505, 0.1285574, -0.009964195, -0.0027675757, -0.021168556, 0.029148778, -0.08339442, 0.056383446, -0.095605195, 0.090179175, -0.037309807, -0.02291442, 0.06256142, -0.0016680976, -0.037962683, -0.04660121, 0.03305766, 0.021179492, -0.07585256, -0.011390465, -0.043426167, -0.02984754, -0.057111714, -0.028276602, 0.0021605259, 0.02960682, -0.048151128, -0.00078261446, -0.062055558, 0.004356917, -0.082376786, -0.01868883, -0.0014546002, -0.046974573, 0.0504822, -0.012231317, 0.017601935, -0.020898223, -0.01624957, 0.00029358684, 0.019366136, 0.020065885, 0.027092025, 0.11943603, 0.02003181, 0.028258717, -0.047469366, 0.10179686, 0.07033932, 0.029573368, 0.06697101, 0.03865042, -0.059470993, -1.5462138e-08, -0.032372445, -0.0020284064, -0.03222479, -0.0191849, -0.03354525, -0.019094145, -0.10690629, 0.10468298, 0.044580735, 0.016367296, 0.012381727, -0.016602533, -0.021573711, 0.029830953, -0.02928913, 0.09034252, 0.05990938, -0.0033680089, -0.022429707, 0.061090432, 0.023037054, 0.02639929, 0.111168526, 0.031242581, 0.0385991, 0.02844717, 0.023228435, -0.096351355, 0.074502245, 0.09810323, 0.033545956, 0.05861176, -0.011301881, -0.020673297, -0.001882477, 0.016212672, 0.047948647, -0.040588904, 0.011826202, 0.031181322, 0.06273309, 0.07148654, -0.008014908, -0.029753013, 0.014691161, 0.021259762, 0.10081364, -0.09303225, -0.050455075, 0.031489562, 0.04659843, 0.08343122, -0.043179233, 0.04806412, 0.07840783, 0.023222778, -0.020912483, 0.047022052, 0.008750987, -0.0038545663, 0.060460903, 0.0010810476, 0.02225712, 0.01792949]'), + (1, 'Suggest movies my teenage niece might like', '[-0.0091293845, -0.088528715, -0.04065143, -0.025788832, -0.07367743, 0.04775902, -0.008510447, 0.0016755384, 0.016981516, -0.025338467, 0.065530665, 0.016192423, -0.015814036, 0.08096963, 0.011301929, 0.023754258, 0.15547371, 0.049903475, 0.056693457, -0.09337688, -0.008886814, -0.017295001, 0.095895074, 0.05518126, -0.0035936336, 0.04309442, -0.0033681293, -0.015458816, -0.09935964, 0.03408563, -0.016189773, 0.06159852, -0.11868318, -0.028286535, 0.036336377, 0.036518835, 0.01010096, -0.037397847, 0.01077943, -0.023254786, -0.07141724, -0.006624973, 0.011639587, -0.025540708, -0.031328827, -0.068406954, -0.015433034, 0.0024790987, 0.05245563, 0.02828153, -0.008354958, 0.07509822, -0.10141542, -0.030986328, 0.011899657, -0.066327095, -0.12080613, -0.025294488, 0.14131692, -0.08094887, -0.03908414, -0.029055042, -0.06311, -0.046963617, -0.04276683, -0.04015815, 0.040940825, 0.07851382, 0.04411479, 0.0445861, -0.050816044, 0.045730017, 0.025898324, 0.008350466, -0.02767921, 0.011818215, -0.0037584752, -0.013877821, 0.0012782554, -0.027162604, -0.10228884, -0.050730407, 0.014136098, -0.0716236, -0.021425126, -0.0064034304, -0.017302986, -0.036588527, -0.06710172, 0.006047892, -0.03544624, -0.020644445, -0.0008938193, 0.0508143, 0.031353332, -0.010813968, -0.013347764, -0.08256947, -0.019733036, 0.03307429, -0.010313535, 0.024179183, 0.029705105, 0.0037986343, -0.045737855, -0.030244604, 0.106927045, -0.061741203, 0.058297064, 0.026707424, -0.023757823, -0.021766562, 0.037349705, 0.0088304095, 0.04434849, 0.017496858, 0.1318956, 0.0072946004, -0.001724223, -0.0056012897, 0.008024192, -0.017592663, -0.051701713, 0.019242631, 0.024382222, -0.0412737, 0.021537773, -2.188717e-33, 0.02801237, -0.014939531, -0.053655103, 0.06570071, 0.078971334, 0.093679026, 0.08821699, -0.023962386, -0.04463565, -0.023848267, -0.0346025, -0.03358795, -0.072910294, -0.008940544, 0.056945976, 0.02866443, -0.0042609107, 0.049889226, 0.044524346, 0.021934047, -0.055654224, 0.042673852, 0.041657414, 0.037832066, -0.034121178, -0.071803555, -0.037841856, -0.015106416, 0.06506519, 0.037847452, -0.0072146086, 0.05081362, -0.02242864, -0.06720572, 0.00025090599, 0.012125916, -0.03348786, -0.013950931, 0.029273609, 0.010431661, -0.009358641, 0.0137409065, -0.04733644, -0.026821367, -0.012200563, 0.045953084, 0.07569097, 0.049382325, -0.0039313724, 0.011318075, -0.063715704, -0.02576873, -0.042051293, -0.08046057, -0.08667974, 0.076455675, 0.02286978, -0.034211356, 0.029047463, -0.10476559, 0.036089506, 0.009040362, -0.0017661577, -0.061958537, -0.024497295, 0.08229413, 0.13842909, 0.022760367, -0.033422366, -0.00083305547, -0.051721126, 0.09256417, 0.056672234, -0.068493724, -0.03719089, 0.063066006, 0.021015285, -0.032426648, -0.025353473, -0.01097403, 0.033032544, -0.024719417, -0.0034017263, 0.059382167, 0.0011112764, -0.08451338, -0.051042117, -0.05989894, -0.05318306, -0.024058044, -0.020551711, -0.07371874, 0.03552077, -0.026005136, 0.0073028333, 9.991112e-35, 0.07221493, -0.10343378, -0.04692054, -0.037491944, 0.08023996, 0.017151028, -0.0960186, -0.012533467, 0.10249875, -0.040703498, -0.0602506, -0.055947505, -0.06762202, 0.03655877, -0.0007930089, -0.03852939, 0.029616851, 0.040887482, -0.009623766, 0.016259609, -0.0051320978, 0.1062929, -0.029612003, 0.022484351, 0.08039532, -0.028525548, -0.06671482, -0.016531408, -0.058641043, 0.044350304, 0.04807926, -0.012282054, 0.074725114, -0.0045237374, -0.08123452, 0.019218529, 0.016196065, -0.0857704, -0.0468147, 0.0075033563, 0.112960435, -0.006986885, 0.07075142, 0.061254103, 0.029277178, 0.02301692, -0.041601244, 0.096742935, 0.014764836, 0.012574777, -0.0072881123, 0.045896985, 0.045532573, 0.027891338, 0.08696388, -0.03082535, 0.04518854, -0.027961664, 0.04845078, 0.014162713, -0.06570991, -0.06086865, -0.09334978, 0.00937222, -0.07993927, 0.016698113, -0.08786915, -0.05101745, 0.016328933, 0.045533374, -0.04557864, 0.07681615, -0.060805842, -0.06864575, -0.07216988, 0.013957669, 0.05643074, -0.01267112, 0.053980183, -0.0012755973, 0.07248611, 0.045312423, -0.044236634, -0.004320655, 0.06494478, 0.0064359703, 0.006345868, 0.06505073, -0.021158421, 0.034542, 0.031142483, -0.04826837, 0.06486336, -0.058971938, -0.06511342, -1.3838922e-08, 0.058394562, 0.037981115, -0.012971711, 0.015673209, -0.05331348, 0.023330601, 0.0022388569, 0.055947505, 0.08717443, -0.015079467, 0.03258021, -0.036368705, 0.053737983, -0.023813939, -0.03586727, 0.0019528408, 0.0760702, -0.014031442, -0.0005989621, -0.0011210337, 0.007197467, 0.017859763, 0.13078682, 0.036408678, -0.00182043, -0.034878135, 0.034377277, -0.008130891, 0.04140437, 0.07401192, -0.0042326767, 0.0130948415, 0.00680897, -0.027146509, -0.067179024, -0.11127314, 0.027981756, -0.02083313, -0.09420704, -0.012500564, 0.043644775, -0.022241449, 0.0017148356, -0.03282463, 0.02699823, -0.004357275, 0.10342108, -0.1883083, 0.022983866, 0.06918968, -0.042271134, 0.04072012, -0.001612081, 0.0069787796, 0.098949194, 0.059653167, -0.043737546, 0.023920609, -0.049911402, 0.08045531, 0.07480182, 0.02581683, -0.0021460208, 0.04376514]'); -6. Let's create a table and store the vectors from the image above. - ``` - - CREATE TABLE IF NOT EXISTS vector_ss - (id NUMBER, - v VECTOR(2, FLOAT32) - ); ``` -7. Let's insert our simple example vectors. +10. Now we can search for movies based on our customers’ questions using the **new SQL function in 23ai** `VECTOR_DISTANCE`. For example, we could take the question, "Can you suggest movies that explore dark or serious themes, but still include humor?" + + The ID = 2 below refers to the ID of the question that we inserted in the table above. ``` - INSERT INTO vector_ss VALUES (1, '[0, 0]'), - (2, '[1, 1]'), - (3, '[5, 0]'), - (4, '[3, -5]'); - - COMMIT; - - SELECT * FROM vector_ss - ORDER BY id; + SELECT m.title, m.genre, m.director, m.m_description + FROM movies m + CROSS JOIN ( + SELECT embedding AS vector + FROM customer_questions + WHERE id = 2 + ) cq + ORDER BY VECTOR_DISTANCE(m.questions, cq.vector, EUCLIDEAN) + FETCH FIRST 4 ROWS ONLY; ``` - ![insert data](images/vec9.png =50%x*) -8. Now imagine we add a point at (2,0), like the image below. Let's find the closest vectors to that given vector. Remember, we're not interested in the distances. We care about the ids of the rows that're closest to our point. + Remember, our dataset is small, but it suggests both Shaun of the Dead and In Bruges, which could probably be classified as “dark comedy.” - ![show table](images/image2.png " ") +11. Let’s try out a couple of other examples. + + Here, the ID = 4 below refers to the ID of the question "Suggest movies my teenage niece might like" ``` - SELECT id - FROM vector_ss - ORDER BY vector_distance(vector('[2, 0]'), v, EUCLIDEAN) - FETCH FIRST 3 ROWS ONLY; + SELECT m.title, m.genre, m.director, m.m_description + FROM movies m + CROSS JOIN ( + SELECT embedding AS vector + FROM customer_questions + WHERE id = 4 + ) cq + ORDER BY VECTOR_DISTANCE(m.questions, cq.vector, EUCLIDEAN) + FETCH FIRST 4 ROWS ONLY; ``` - ![show distance of table](images/vec10.png =50%x*) -9. What if we moved this? Find which three are closest to the vector (1, -3). +12. Or: - ![show graph of table](images/image3.png " ") + Here, the ID = 4 below refers to the ID of the question "What are some feel good movies?" ``` - SELECT id - FROM vector_ss - ORDER BY vector_distance(vector('[1, -3]'), v, EUCLIDEAN) - FETCH FIRST 3 ROWS ONLY; + SELECT m.title, m.genre, m.director, m.m_description + FROM movies m + CROSS JOIN ( + SELECT embedding AS vector + FROM customer_questions + WHERE id = 3 + ) cq + ORDER BY VECTOR_DISTANCE(m.questions, cq.vector) + FETCH FIRST 4 ROWS ONLY; ``` - ![select from table](images/vec11.png =50%x*) -10. These are very basic use cases as this lab is meant to be a small introduction to the topic. +13. These are very basic use cases, as this lab is meant to be a small introduction to the topic. We have been using the vector_distance() function with the Euclidean Squared Vector distance method. However, Oracle AI Vector Search also allows the use of other distance functions: * Cosine Similarity @@ -303,52 +475,35 @@ In this lab, you will explore the new vector data type introduced in Oracle Data Chapter 6 of the [AI Vector Search User Guide](https://docs.oracle.com/en/database/oracle/oracle-database/23/vecse/oracle-ai-vector-search-users-guide.pdf) shows more about each of the functions and which to pick depending on what you're trying to achieve. -11. Okay, so how does this all work together? - - To understand how this would work, let’s discuss how similarity search is used in creating a chatbot using Retrieval Augmented Generation (RAG). Here’s the high-level overview: - - Embedding Company Data: First, we embed our company's private data (like documents, FAQs, etc.) into vectors using an embedding model. - - Query Processing: When a user asks the chatbot a question, this query is also converted into a vector. - - Similarity Search: The chatbot uses similarity search to find vectors in the database that are closest to the query vector. This helps in identifying the most relevant pieces of information related to the user's question. - - Generating a Response: The chatbot combines the retrieved information with its generative capabilities to craft a precise and relevant response to the question asked. - - By using similarity search, we make sure that the chatbot can quickly and accurately access the relevant information from our massive company dataset. This means that our responses are both precise and informative. - - Interested in building a chatbot using the Oracle Database? Check out this lab - [Complete RAG Application using PL/SQL in Oracle Database 23ai](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3934&clear=RR,180&session=1859311324732) - - - -12. The following lab walked you through a small example of how to work with some of the new AI functionality in the database. +14. The following lab walked you through a small example of how to work with some of the new AI functionality in the database. In this lab, we learned the role vectors play in Generative AI (GenAI) by exploring AI Vector Search in the Oracle Database 23ai environment. Vectors are arrays of numbers, that represent the semantic meaning of large unstructured objects like text, images, and audio. These vectors are generated by embedding models that transform the data into numerical representations. - We started by creating tables with the new vector data type and performed basic operations like inserting, updating, and deleting vector data. This demonstrated how vectors are stored and manipulated within the Oracle database. + We started by creating tables with the new vector data type and performed basic operations. Next, we examined vector dimensionality and formats, understanding that vectors can have different lengths and data formats depending on the embedding model used. We also learned how to define and enforce these properties when creating vector tables. Finally, we explored similarity search, which is a method to find objects that are semantically similar based on their vector representations. This technique is essential for applications like recommendation systems, personalization, pattern recognition, and anomaly detection. By using the VECTOR_DISTANCE function, we performed similarity searches to find the closest vectors to a given query vector. - Overall, this lab provided a foundational understanding of vectors in AI and how they enable advanced AI functionalities such as semantic search and retrieval-augmented generation within Oracle Database 23ai. + Overall, this lab provides a foundational understanding of vectors in AI and how they enable advanced AI functionalities such as semantic search and retrieval-augmented generation within Oracle Database 23ai. -13. As mentioned throughout, this lab is a tiny subset of this functionality. For more in depth labs, please see the following workshops (also linked at the start of this lab): +15. As mentioned throughout, this lab is a tiny subset of this functionality. For more in depth labs, please see the following workshops (also linked at the start of this lab): * [7 Easy Steps to Building a RAG Application using LangChain](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3927&clear=RR,180&session=1859311324732) * [Using Vector Embedding Models with Python](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3928&clear=RR,180&session=1859311324732) * [Using Vector Embedding Models with Nodejs](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=3926&clear=RR,180&session=1859311324732) -14. We can clean up from the lab by dropping our tables. +16. We can clean up from the lab by dropping our tables. ``` - DROP TABLE if exists vector_ss CASCADE CONSTRAINTS; DROP TABLE if exists vector_table CASCADE CONSTRAINTS; DROP TABLE if exists vector_table_2 CASCADE CONSTRAINTS; - DROP TABLE if exists vector_table_3 CASCADE CONSTRAINTS; + DROP TABLE if exists movies CASCADE CONSTRAINTS; + DROP TABLE if exists customers CASCADE CONSTRAINTS; + DROP TABLE if exists ratings CASCADE CONSTRAINTS; ``` You may now **proceed to the next lab** @@ -364,4 +519,4 @@ You may now **proceed to the next lab** ## Acknowledgements * **Author** - Killian Lynch, Database Product Management * **Contributors** - Dom Giles, Distinguished Database Product Manager -* **Last Updated By/Date** - Killian Lynch, April 2024 \ No newline at end of file +* **Last Updated By/Date** - Killian Lynch, September 2024 \ No newline at end of file diff --git a/db-23ai-fundamentals/new-boolean/images/simple-db-actions.png b/db-23ai-fundamentals/new-boolean/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-boolean/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-boolean/new-boolean.md b/db-23ai-fundamentals/new-boolean/new-boolean.md index 38b3bedbc..dafafe2aa 100644 --- a/db-23ai-fundamentals/new-boolean/new-boolean.md +++ b/db-23ai-fundamentals/new-boolean/new-boolean.md @@ -17,8 +17,14 @@ In this lab, you will explore the boolean data type introduced in Oracle Databas ## Task 1: Lab Setup -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. - ![click SQL](images/im1.png " ") +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. + ![click SQL](images/im1.png =50%x*) + + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) 2. Let's start by creating a table with a boolean column. We will use the boolean data type to represent whether a product is available or not. diff --git a/db-23ai-fundamentals/new-developer-role/images/simple-db-actions.png b/db-23ai-fundamentals/new-developer-role/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-developer-role/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-developer-role/new-developer-role.md b/db-23ai-fundamentals/new-developer-role/new-developer-role.md index 7dd28a372..24a36266a 100644 --- a/db-23ai-fundamentals/new-developer-role/new-developer-role.md +++ b/db-23ai-fundamentals/new-developer-role/new-developer-role.md @@ -24,8 +24,12 @@ The objective of this lab is to familiarize you with the Developer Role in Oracl ## Task 2: Generating a list of granted privileges and roles -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. - ![click SQL](images/im1.png " ") +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. + ![click SQL](images/im1.png =50%x*) + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) 2. To check all of the system privileges, object privileges, and roles granted by the Developer Role, run the following PL/SQL script: diff --git a/db-23ai-fundamentals/new-direct-joins-for-updates-deletes/images/simple-db-actions.png b/db-23ai-fundamentals/new-direct-joins-for-updates-deletes/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-direct-joins-for-updates-deletes/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-direct-joins-for-updates-deletes/new-direct-joins-for-updates-deletes.md b/db-23ai-fundamentals/new-direct-joins-for-updates-deletes/new-direct-joins-for-updates-deletes.md index 7f0645816..85ab5c013 100644 --- a/db-23ai-fundamentals/new-direct-joins-for-updates-deletes/new-direct-joins-for-updates-deletes.md +++ b/db-23ai-fundamentals/new-direct-joins-for-updates-deletes/new-direct-joins-for-updates-deletes.md @@ -15,8 +15,14 @@ The goal of this lab is to help you understand and use direct joins effectively ## Task 1: Working with direct joins -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. - ![click SQL](images/im1.png " ") +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. + ![click SQL](images/im1.png =50%x*) + + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) 2. Lets imagine you've built the next movie streaming app, but for some reason, no one wants to watch the thriller movies. You decide to create a small test by artificially improving the rating of thriller movies to see if that coax people into watching them. diff --git a/db-23ai-fundamentals/new-domains/images/im3.png b/db-23ai-fundamentals/new-domains/images/im3.png new file mode 100644 index 000000000..0f75b7aea Binary files /dev/null and b/db-23ai-fundamentals/new-domains/images/im3.png differ diff --git a/db-23ai-fundamentals/new-domains/images/im4.png b/db-23ai-fundamentals/new-domains/images/im4.png new file mode 100644 index 000000000..3e5863ff4 Binary files /dev/null and b/db-23ai-fundamentals/new-domains/images/im4.png differ diff --git a/db-23ai-fundamentals/new-domains/images/im5.png b/db-23ai-fundamentals/new-domains/images/im5.png new file mode 100644 index 000000000..2168c5f6f Binary files /dev/null and b/db-23ai-fundamentals/new-domains/images/im5.png differ diff --git a/db-23ai-fundamentals/new-domains/images/im6.png b/db-23ai-fundamentals/new-domains/images/im6.png new file mode 100644 index 000000000..29ead82b7 Binary files /dev/null and b/db-23ai-fundamentals/new-domains/images/im6.png differ diff --git a/db-23ai-fundamentals/new-domains/images/im7.png b/db-23ai-fundamentals/new-domains/images/im7.png new file mode 100644 index 000000000..a3da08548 Binary files /dev/null and b/db-23ai-fundamentals/new-domains/images/im7.png differ diff --git a/db-23ai-fundamentals/new-domains/images/im8.png b/db-23ai-fundamentals/new-domains/images/im8.png new file mode 100644 index 000000000..7451092cc Binary files /dev/null and b/db-23ai-fundamentals/new-domains/images/im8.png differ diff --git a/db-23ai-fundamentals/new-domains/images/im9.png b/db-23ai-fundamentals/new-domains/images/im9.png new file mode 100644 index 000000000..0f3d36629 Binary files /dev/null and b/db-23ai-fundamentals/new-domains/images/im9.png differ diff --git a/db-23ai-fundamentals/new-domains/images/simple-db-actions.png b/db-23ai-fundamentals/new-domains/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-domains/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-domains/new-domains.md b/db-23ai-fundamentals/new-domains/new-domains.md index a227dde8e..70cf3bf08 100644 --- a/db-23ai-fundamentals/new-domains/new-domains.md +++ b/db-23ai-fundamentals/new-domains/new-domains.md @@ -2,7 +2,7 @@ ## Introduction -Welcome to the "Data Usecase Domains Exploration" lab! Data Usecase Domains play a crucial role in data integrity and consistency within database applications. Data Use Case Domains provide consistent metadata for development, analytics, and ETL applications and tools helping to ensure data consistency and validation throughout the schema. In this lab, we will explore Data Usecase Domains in Oracle Database 23ai, covering single column Data Usecase Domains, multi-column Data Usecase Domains, and flexible Data Usecase Domains. Through these examples, you will gain an understanding of how Data Usecase Domains can be defined, applied, and used to maintain data quality. +Welcome to the "Data Usecase Domains Exploration" lab! Data Usecase Domains play a crucial role in data integrity and consistency within database applications. Data Use Case Domains provide consistent metadata for development, analytics, and ETL applications and tools helping to ensure data consistency and validation throughout the schema. In this lab, we will explore Data Usecase Domains in Oracle Database 23ai, covering single column Data Usecase Domains, multi-column Data Usecase Domains, flexible Data Usecase Domains and enumeration use case domains. Through these examples, you will gain an understanding of how Data Usecase Domains can be defined, applied, and used to maintain data quality. Estimated Lab Time: 20 minutes @@ -19,9 +19,15 @@ The objective of this lab is to provide comprehensive hands-on experience with D ## Task 1: Understanding Data Usecase Domains -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. ![click SQL](images/im1.png =50%x*) + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) + 2. **Overview of Data Usecase Domains:** Data Usecase Domains serve as a way for defining properties and constraints associated with columns. They ensure consistency in data representation and validation throughout the application. Data Use Case Domains also provide consistent metadata for development, analytics, and ETL applications and tools helping to ensure data consistency and validation throughout the schema. @@ -29,11 +35,13 @@ The objective of this lab is to provide comprehensive hands-on experience with D - Single Column Domain: Applies constraints to a single column. - Multi-Column Domain: Applies constraints to multiple columns. - Flexible Domain: Allows dynamic selection of Data Usecase Domains based on specific conditions. - - Enumeration Use Case Domain: ontains a set of names, and optionally, a value corresponding to a name. + - Enumeration Use Case Domain: Contains a set of names, and optionally, a value corresponding to a name. ## Task 2: Creating and Implementing Data Usecase Domains -1. Single Column Domain Example: From the explanation above, let's see what three of the four types of Data Usecase Domains looks like (Enumeration Use Case Domain will be added to the workshop soon). We'll start by creating a single column domain for storing product prices. We will enforce a constraint to ensure that prices are positive numbers. +1. Single Column Domain Example: From the explanation above, let's see what three of the four types of Data Usecase Domains looks like (Enumeration Use Case Domain will be added to the workshop soon). We'll start by creating a single column domain for storing product prices. We will enforce a constraint to ensure that prices are positive numbers. + + **Click** the Run Script button shown in the picture below - we will run the rest of the lab using the Run Script button. ``` @@ -47,7 +55,7 @@ The objective of this lab is to provide comprehensive hands-on experience with D ``` ![create a domain on a single column](images/im2.png " ") -2. Multi-Column Domain Example: Next, we'll create a multi-column domain to represent geographical coordinates. This domain will enforce constraints on latitude and longitude values. +2. Multi-Column Domain Example: Next, we'll create a multi-column domain to represent geographical coordinates. This domain will enforce constraints on latitude and longitude values. Again, **click** the Run Script button shown in the picture below ``` @@ -63,7 +71,11 @@ The objective of this lab is to provide comprehensive hands-on experience with D constraint coordinates check (latitude between -90 and 90 and longitude between -180 and 180); ``` -3. Flexible Domain Example: For the flexible domain, let's consider a scenario where we want to store contact information for individuals. We'll create Data Usecase Domains for different types of contacts and dynamically select the appropriate domain based on the contact type. + + ![create a domain on another column](images/im6.png " ") + + +3. Flexible Domain Example: For the flexible domain, let's consider a scenario where we want to store contact information for individuals. We'll create Data Usecase Domains for different types of contacts and dynamically select the appropriate domain based on the contact type. Again, **click** the Run Script button shown in the picture below. ``` @@ -116,6 +128,9 @@ The objective of this lab is to provide comprehensive hands-on experience with D ``` + + ![create a Flexible domain](images/im7.png " ") + 4. Oracle Database 23ai also has some pre-created Data Usecase Domains that we can use with many more on the way. Let's see what those are. ``` @@ -180,6 +195,8 @@ The objective of this lab is to provide comprehensive hands-on experience with D ``` + ![add data](images/im8.png " ") + 3. Now we can insert into our multi-column domain table and our flexible domain table. Again our first insert into the locations table will fail because our latitude is greater than 90 but our second insert statement will pass because the constraints are correct. ``` @@ -197,6 +214,74 @@ The objective of this lab is to provide comprehensive hands-on experience with D ``` +4. We can also create Enumeration Use Case Domains. These are a list of names with an associated list of values. If we don't manually define the list ourselves, the ordering starts from 1. + ``` + + drop domain if exists order_status_domain; + + create domain order_status_domain as + enum ( + pending, + processing, + shipped, + delivered + ); + + select * from order_status_domain; + + + ``` + ![create an enum domain on a single column](images/im3.png " ") + +5. We can also define the values ourselves. We can use numbers or string values. + + ``` + + drop domain if exists order_status_domain; + + create domain order_status_domain as + enum ( + pending = 5, + processing = 6, + shipped = 7, + delivered = 8 + ); + + select * from order_status_domain; + + + ``` + ![enforce the order on the enum](images/im4.png " ") + +6. As with the other domains, we can also use the enumeration domains in our tables. + + ``` + + drop table if exists orders; + + create table orders ( + id number generated always as identity primary key, + customer varchar2(100), + product varchar2(100), + status order_status_domain + ); + + + insert into orders (customer, product, status) + values + ('Alice', 'Laptop', order_status_domain.pending), + ('Bob', 'Smartphone', order_status_domain.processing), + ('Charlie', 'Headphones', order_status_domain.shipped), + ('Diana', 'Monitor', order_status_domain.delivered); + + select id, customer, product, domain_display(status) as status from orders; + + + ``` + + ![check the domains](images/im9.png " ") + +7. It should be noted that automatically assigned numeration values are just an ordered list, meaning there is no enforced assigned order. If we change an item we could end up corrupting our data. A simple way to avoid this is by assigning the value ourselves. This way the order statuses are consistently defined and immune to logical corruption even if new statuses are added or the order changes in the enumeration domain. ## Task 4: Viewing our Data Usecase Domains 1. We can view our Data Usecase Domains to see their information. The dictionary views: [USER|DBA|ALL]\_DOMAINS and [USER|DBA|ALL]\_DOMAIN_COLS represent Data Usecase Domains and provide the following information about the domain columns. For flexible Data Usecase Domains, the views also include the domain selector expression. @@ -218,23 +303,24 @@ The objective of this lab is to provide comprehensive hands-on experience with D ``` - drop table products purge; - drop table locations purge; - drop table contacts purge; + drop table if exists products purge; + drop table if exists locations purge; + drop table if exists contacts purge; + drop table if exists orders purge; drop domain if exists personal_contact_dom force; drop domain if exists business_contact_dom force; drop domain if exists default_contact_dom force; - + drop domain if exists order_status_domain force; ``` ## Learn More * [Data Usecase Domains Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/23/cncpt/application-data-usage.html#GUID-40EF7B72-ECE3-4BF1-B7CF-0C88B810C9F6) -* [Data Usecase Domains Blog](https://blogs.oracle.com/coretec/post/less-coding-with-sql-domains-in-23ai) +* [Data Usecase Domains Blog](https://blogs.oracle.com/coretec/post/less-coding-with-sql-domains-in-23c) ## Acknowledgements * **Author** - Killian Lynch, Oracle Database Product Manager * **Contributors** - Dom Giles, Distinguished Database Product Manager -* **Last Updated By/Date** - Killian Lynch, Oracle Database Product Management, Product Manager, May 2024 \ No newline at end of file +* **Last Updated By/Date** - Killian Lynch, Oracle Database Product Management, Product Manager, October 2024 \ No newline at end of file diff --git a/db-23ai-fundamentals/new-duality-views/images/simple-db-actions.png b/db-23ai-fundamentals/new-duality-views/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-duality-views/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-duality-views/new-duality-views-15.md b/db-23ai-fundamentals/new-duality-views/new-duality-views-15.md index 0699f9710..e8f295a64 100644 --- a/db-23ai-fundamentals/new-duality-views/new-duality-views-15.md +++ b/db-23ai-fundamentals/new-duality-views/new-duality-views-15.md @@ -272,4 +272,4 @@ If the eTags do not match, which can occur if another concurrent operation updat ## Acknowledgements * **Author** - Killian Lynch, Oracle Database Product Management, Product Manager * **Contributors** - Dominic Giles, Oracle Database Product Management, Distinguished Product Manager -* **Last Updated By/Date** - Briana Ambler, Oracle Database Product Management, Product Manager, August 2024 +* **Last Updated By/Date** - Brianna Ambler, Oracle Database Product Management, Product Manager, September 2024 diff --git a/db-23ai-fundamentals/new-duality-views/new-duality-views-updated.md b/db-23ai-fundamentals/new-duality-views/new-duality-views-updated.md new file mode 100644 index 000000000..64c7fd520 --- /dev/null +++ b/db-23ai-fundamentals/new-duality-views/new-duality-views-updated.md @@ -0,0 +1,371 @@ +# Exploring JSON Relational Duality with SQL + +## Introduction + +Welcome to the "Exploring JSON Relational Duality with SQL" lab. In this lab, you will learn about the JSON Relational Duality feature, which allows for the seamless integration between the relational and JSON data models. This feature provides the strengths of both approaches, allowing you to easily manipulate data in either model. + +This lab is only intended to give you a small taste of what Duality Views have to offer. For full, in-depth free workshops, follow this [link](https://livelabs.oracle.com/pls/apex/f?p=133:100:110578183178299::::SEARCH:duality%20views). + + +### **About JSON Relational Duality** + +JSON Relational Duality is a landmark capability in Oracle Database 23ai providing game-changing flexibility and simplicity for Oracle Database developers. This breakthrough innovation overcomes the historical challenges developers have faced when building applications, using relational or document models. + +“JSON Relational Duality in Oracle Database 23ai brings substantial simplicity and flexibility to modern app dev,” said Carl Olofson, research Vice President, Data Management Software, IDC. “It addresses the age-old object - relational mismatch problem, offering an option for developers to pick the best storage and access formats needed for each use case without having to worry about data structure, data mapping, data consistency, or performance tuning. No other specialized document databases offer such a revolutionary solution.” + +JSON Relational Duality helps to converge the benefits of both document and relational worlds. Developers now get the flexibility and data access benefits of the JSON document model, plus the storage efficiency and power of the relational model. The new feature enabling this convergence is JSON Relational Duality View (Will be referred below as Duality View). + +Key benefits of JSON Relational Duality: +- Experience extreme flexibility in building apps using Duality View. Developers can access the same data relationally or as hierarchical documents based on their use case and are not forced into making compromises because of the limitations of the underlying database. Build document-centric apps on relational data or create SQL apps on documents. +- Experience simplicity by retrieving and storing all the data needed for an app in a single database operation. Duality Views provide fully updateable JSON views over data. Apps can read a document, make necessary changes, and write the document back without worrying about underlying data structure, mapping, consistency, or performance tuning. +- Enable flexibility and simplicity in building multiple apps on same data. Developers can use the power of Duality View to define multiple JSON Views across overlapping groups of tables. This flexible data modeling makes building multiple apps against the same data easy and efficient. +- Duality Views eliminate the inherent problem of data duplication and data inconsistency in document databases. Duality Views are fully ACID (atomicity, consistency, isolation, durability) transactions across multiple documents and tables. It eliminates data duplication across documents data, whereas consistency is maintained automatically. +- Build apps that support high concurrency access and updates. Traditional locks don’t work well for modern apps. A new lock-free concurrency control provided with Duality View supports high concurrency updates. The new-lock free concurrency control also works efficiently for interactive applications since the data is not locked during human thinking time. + +**_Estimated Lab Time: 15 minutes_** + +### **Objectives** + +This lab aims to provide hands-on experience with JSON-relational Duality Views, demonstrating how to get the strengths of both JSON and relational data models. You will learn how to create, query, and update JSON-relational Duality Views using SQL. + +### **Prerequisites** + +This lab assumes you have: + +* Oracle Database 23ai +* Completed the Get Started Lab + +## Task 1: Create Relational Tables + +1. Create the 'customers' and 'orders' relational tables. The following code block creates two tables for customer and order data. Copy and run the following SQL script: + ``` + + DROP TABLE if exists orders CASCADE CONSTRAINTS; + DROP TABLE if exists customers CASCADE CONSTRAINTS; + + -- Create a table to store order data + CREATE TABLE if not exists orders ( + id NUMBER, + product_id NUMBER, + order_date TIMESTAMP, + customer_id NUMBER, + total_value NUMBER(6,2), + order_shipped BOOLEAN, + warranty INTERVAL YEAR TO MONTH + ); + + -- Create a table to store customer data + CREATE TABLE if not exists customers ( + id NUMBER, + first_name VARCHAR2(100), + last_name VARCHAR2(100), + dob DATE, + email VARCHAR2(100), + address VARCHAR2(200), + zip VARCHAR2(10), + phone_number VARCHAR2(20), + credit_card VARCHAR2(20), + joined_date TIMESTAMP DEFAULT SYSTIMESTAMP, + gold_customer BOOLEAN DEFAULT FALSE, + CONSTRAINT new_customers_pk PRIMARY KEY (id) + ); + + -- Add foreign key constraint to new_orders table + ALTER TABLE orders ADD (CONSTRAINT orders_pk PRIMARY KEY (id)); + ALTER TABLE orders ADD (CONSTRAINT orders_fk FOREIGN KEY (customer_id) REFERENCES customers (id)); + + ``` + +## Task 2: Create JSON Relational Duality Views + +1. Create a duality view of the customers table. We'll use this one to manage our customer information. + + Using Duality Views, you can define how the data is accessed and used. Duality Views allow you to specify @insert, @update, and @delete privileges, meaning you define exactly how the applications and/or the developers work with data. + + ``` + + CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW customers_dv AS + customers @insert @update @delete + { + _id : id, + FirstName : first_name, + LastName : last_name, + DateOfBirth : dob, + Email : email, + Address : address, + Zip : zip + phoneNumber : phone_number + creditCard : credit_card + joinedDate : joined_date + goldStatus : gold_customer + } +; + + ``` + +2. Say we want to exclude sensitive personally identifiable information like customers credit card or phone numbers. Let's create another view without those identifiers. + + ``` + + CREATE OR REPLACE JSON RELATIONAL DUALITY VIEW customer_orders_dv AS + customers + { + _id : id, + FirstName : first_name, + LastName : last_name, + Address : address, + Zip : zip, + orders : orders @insert @update @delete + [ + { + OrderID : id, + ProductID : product_id, + OrderDate : order_date, + TotalValue : total_value, + OrderShipped : order_shipped + } + ] + }; + + ``` + + If you notice, this view doesn’t specify @insert, @update, or @delete on our customers table. You created this view so that you can only update orders through the `customer_orders_dv` Duality View, and no sensitive customer information (such as customers’ credit card numbers or phone numbers) will be shown. The only way to manage that information is through the `customers_dv` view. + + ![Creating the Duality View](images/im2.png =50%x*) + +## Task 3: Add Data + +1. Now that the duality view has been created, we can insert data to the relational table or into the duality view. Let's start with adding data directly to the relational tables. + + + ``` + + INSERT INTO customers (id, first_name, last_name, dob, email, address, zip, phone_number, credit_card) + VALUES (1, 'Alice', 'Brown', DATE '1990-01-01', 'alice.brown@example.com', '123 Maple Street', '12345', '555-1234', '4111 1111 1111 1111'); + + + INSERT INTO orders (id, customer_id, product_id, order_date, total_value) + VALUES (100, 1, 101, SYSTIMESTAMP, 300.00); + + + ``` + ![inserting into our new_customers table](images/im3.png " ") + +2. Let's now insert data into the duality view of our customer data. + + ``` + + INSERT INTO customers_DV values ('{"_id": 2, "FirstName": "Jim", "LastName":"Brown", "Email": "jim.brown@example.com", "Address": "456 Maple Street", "Zip": 12345}'); + + commit; + + ``` + +3. Let's see how the duality views have changed. + + This Duality View will show us two customers. + + ``` + + SELECT json_serialize(data PRETTY) FROM customers_dv; + + ``` + This Duality View will show us the same two customers - one with an order and one without. + + ``` + + SELECT json_serialize(data PRETTY) FROM customer_orders_dv; + + ``` +4. Let's see how the relational tables have changed. + + ``` + + select * from customers; + + ``` + +## Task 4: Update Data + +1. Remember, the `customer_orders_dv` duality view only allows us to modify the order data. Let's update Alice's orders. + + + ``` + + UPDATE customer_orders_dv c + SET c.data = json_transform( + data, + APPEND '$.orders' = JSON {'OrderID':123, 'ProductID' : 202, 'OrderDate' : SYSTIMESTAMP, 'TotalValue' : 150.00} + ) + WHERE c.data."_id" =1; + commit; + + select json_serialize(data PRETTY) from customer_orders_dv o where o.data."_id" = 1; + + ``` + + + ![Updating the our customers view](images/im4.png " ") + +2. Let's now try and update Alice's last name. You'll see that this is not allowed! + + ``` + + UPDATE customer_orders_dv c + SET c.data = json_transform( + data, + SET '$.LastName' = 'Browne' + ) + WHERE c.data."_id" =1; + + + ``` + ![selecting from our customers table](images/im5.png " ") + +3. Let's insert some orders for our customer Jim Brown using `mergepatch`. + + ``` + + update customer_orders_dv o set data = json_mergepatch(data,'{"orders" : + [ + { + "OrderID": 100, + "ProductID": 10100, + "OrderDate": "2024-06-27T11:55:20.174683", + "TotalValue": 300, + "OrderShipped": null + }, + { + "OrderID": 200, + "ProductID": 20002, + "OrderDate": "2024-06-27T11:55:50.424141", + "TotalValue": 150, + "OrderShipped": null + } + ]}') + where o.data."_id" = 2; + + commit; + + ``` + +4. Imagine we needed to change one of the Product IDs, for example product_id = 202 shown below. + + ``` + + SELECT json_serialize(data PRETTY) FROM customer_orders_dv; + + ``` + +5. Using a single update statement, we can easily update product_id 202 to 999 in every JSON duality view. + + ``` + + UPDATE orders + SET product_id = 999 + WHERE product_id = 202; + + commit; + + SELECT json_serialize(data PRETTY) FROM customer_orders_dv; + + ``` + + You can now see that the update made to the orders table has propogated to the customer orders duality view, and the same occurs for all other representations of the customers table! + +Note that the "etag" value supplied in the content is used for "out-of-the-box" optimistic locking to prevent the well-known "lost update" problem that can occur with concurrent operations. During a replace operation, the database checks that the eTag provided in the replacement document matches the latest eTag of the target Duality View document. + +If the eTags do not match, which can occur if another concurrent operation updated the same document, an error is thrown. If you get the error, you can reread the updated value (including the updated eTag), and retry the replace operation again, adjusting it (if desired) based on the updated value. + + +## Task 5: (Optional) JSON Relational Duality Views with REST + +1. We can also use Oracle's SODA (Simple Object Data API) or even the Mongo API to work against the Duality View. + + For a small example, I will show this using a macOS native terminal and execute a basic GET request. + +2. Click on SQL under the Development section. The first thing we want to do is enable REST on our Duality Views. Use the Oracle Database Actions Navigator on the left side of the screen, click the drop-down arrow for the box showing the Table objects, and select Views. Refer to the picture below. + + ![load rest](images/rest1.png " ") + +3. Right-click on the CUSTOMERS_DV, hover the mouse over REST, and click Enable if it isn't already enabled. See the picture below. NOTE: If it is enabled already, it will say Disable… instead. If you see Disable… you don't have to do anything. Skip to number 5. + + ![locating rest](images/rest2.png =50%x*) + +4. The REST Enable Object side panel will appear. Select Enable to continue. + + ![pick the rest panel](images/rest3.png " ") + + Alternatively we could have done this in PL/SQL. + +5. Here we will use the SQL Developer Web URL to obtain your ADB instance base URL: + + ``` + ADB_LL_URL = https://xxxxxxxxxx.adb..oraclecloudapps.com + ``` + + ![find the URL](images/r2.png " ") + + For example, mine looks like this: + + ``` + ADB_LL_URL=https://ajs6esm7pafcr84-atp97134.adb.us-ashburn-1.oraclecloudapps.com + ``` + +6. Now, create a variable in your terminal (It shouldn't have / at the end.) + + ``` + + export ADB_LL_URL=https://ajs6esm7pafcr84-atp97134.adb.us-ashburn-1.oraclecloudapps.com + + ``` + +7. Check it was set. + + ``` + + echo $ADB_LL_URL + + ``` + > NOTE: This base url will be unique for each user, verify that you are using the correct URL. + +8. Make a GET request from your laptop terminal command line. + + ``` + + curl -X GET $ADB_LL_URL/ords/admin/customers_dv/ | json_pp + + + ``` + ![pull one doc](images/r1.png " ") + + +9. This lab is only intended to give you a small taste of what Duality Views have to offer. For full, in-depth free workshops, follow the link below: + + [23ai JSON Duality View Workshops](https://livelabs.oracle.com/pls/apex/f?p=133:100:110578183178299::::SEARCH:duality%20views) + + In summary, this lab checks out the power of JSON Relational Duality Views, allowing you to work with data in either JSON Document format or SQL Relational format. Changes made through views are reflected in the corresponding documents and tables. This flexibility enables convenient create, read, update, or delete operations across multiple documents and tables with ease. + +10. We can clean up from the lab by dropping our tables. Navigate back to the SQL editor or go back to task one - step one if you need a reminder where it is. + + ``` + + DROP TABLE orders CASCADE CONSTRAINTS; + DROP TABLE customers CASCADE CONSTRAINTS; + DROP VIEW customer_orders_dv; + DROP VIEW customers_dv; + + + ``` + +**You've completed the workshop!** + +## Learn More + +* [JSON Relational Duality: The Revolutionary Convergence of Document, Object, and Relational Models](https://blogs.oracle.com/database/post/json-relational-duality-app-dev) +* [JSON Duality View documentation](https://docs.oracle.com/en/database/oracle/oracle-database/23/jsnvu/overview-json-relational-duality-views.html#) + +## Acknowledgements +* **Author** - Killian Lynch, Oracle Database Product Management, Product Manager +* **Contributors** - Dominic Giles, Oracle Database Product Management, Distinguished Product Manager +* **Last Updated By/Date** - Brianna Ambler, Oracle Database Product Management, Product Manager, September 2024 diff --git a/db-23ai-fundamentals/new-duality-views/new-duality-views.md b/db-23ai-fundamentals/new-duality-views/new-duality-views.md index 1fdfd48a5..a13fc6c3f 100644 --- a/db-23ai-fundamentals/new-duality-views/new-duality-views.md +++ b/db-23ai-fundamentals/new-duality-views/new-duality-views.md @@ -41,11 +41,16 @@ This lab assumes you have: ## Task 1: Getting Started -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. + ![click SQL](images/im1.png =50%x*) - ![click SQL](images/im1.png =50%x*) + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. -2. Let's create some tables to use in the lab. Copy and run the following SQL script: +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) + +2. Let's create some tables to use in the lab. Paste the following into the SQL Worksheet and click the **Run as Script Button** (shown in the picture below) ``` DROP TABLE if exists orders CASCADE CONSTRAINTS; diff --git a/db-23ai-fundamentals/new-error-message-improvements/images/simple-db-actions.png b/db-23ai-fundamentals/new-error-message-improvements/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-error-message-improvements/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-error-message-improvements/new-error-message-improvements.md b/db-23ai-fundamentals/new-error-message-improvements/new-error-message-improvements.md index 7a0597f94..fa670c305 100644 --- a/db-23ai-fundamentals/new-error-message-improvements/new-error-message-improvements.md +++ b/db-23ai-fundamentals/new-error-message-improvements/new-error-message-improvements.md @@ -17,8 +17,14 @@ The objective of this lab is to familiarize you with the improvements being made 1. Error messages play a crucial role in diagnosing and resolving database issues. Clear and descriptive error messages can greatly reduce the time and effort (and headache) required to troubleshoot problems. This has the chance to lead to faster resolution and better database reliability. -2. From the Autonomous Database home page, **click** Database action and then **click** SQL. - ![click SQL](images/im1.png " ") +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. + ![click SQL](images/im1.png =50%x*) + + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) 2. Let's check out some examples of error message improvements. First we'll add a table and some rows diff --git a/db-23ai-fundamentals/new-if-exists-for-ddl/images/simple-db-actions.png b/db-23ai-fundamentals/new-if-exists-for-ddl/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-if-exists-for-ddl/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-if-exists-for-ddl/new-if-exists-for-ddl.md b/db-23ai-fundamentals/new-if-exists-for-ddl/new-if-exists-for-ddl.md index 214d2ad47..9dd4fd013 100644 --- a/db-23ai-fundamentals/new-if-exists-for-ddl/new-if-exists-for-ddl.md +++ b/db-23ai-fundamentals/new-if-exists-for-ddl/new-if-exists-for-ddl.md @@ -17,8 +17,14 @@ In this lab, you will learn how to use the "IF EXISTS" and "IF NOT EXISTS" state ## Task 1: Exploring IF [NOT] EXISTS Clause -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. - ![click SQL](images/im1.png " ") +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. + ![click SQL](images/im1.png =50%x*) + + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) 2. Let's reset our environment before we start. diff --git a/db-23ai-fundamentals/new-json-schema/images/simple-db-actions.png b/db-23ai-fundamentals/new-json-schema/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-json-schema/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-json-schema/new-json-schema.md b/db-23ai-fundamentals/new-json-schema/new-json-schema.md index 22f28773a..b2467349e 100644 --- a/db-23ai-fundamentals/new-json-schema/new-json-schema.md +++ b/db-23ai-fundamentals/new-json-schema/new-json-schema.md @@ -15,9 +15,15 @@ The objective of this lab is to familiarize you with JSON Schema validation in O ## Task 1: Understanding JSON Schema Validation -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. ![click SQL](images/im1.png =50%x*) + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) + 2. We will define a JSON schema that specifies the structure and constraints for vehicle information. The schema will enforce that the JSON object has three mandatory properties: "make" (a string), "model" (a string), and "year" (an integer between 1886 and the current year). ``` diff --git a/db-23ai-fundamentals/new-property-graph/images/im12.png b/db-23ai-fundamentals/new-property-graph/images/im12.png new file mode 100644 index 000000000..01c16a2e5 Binary files /dev/null and b/db-23ai-fundamentals/new-property-graph/images/im12.png differ diff --git a/db-23ai-fundamentals/new-property-graph/images/im19.png b/db-23ai-fundamentals/new-property-graph/images/im19.png new file mode 100644 index 000000000..c6965bc7b Binary files /dev/null and b/db-23ai-fundamentals/new-property-graph/images/im19.png differ diff --git a/db-23ai-fundamentals/new-property-graph/images/im20.png b/db-23ai-fundamentals/new-property-graph/images/im20.png new file mode 100644 index 000000000..a17f189ea Binary files /dev/null and b/db-23ai-fundamentals/new-property-graph/images/im20.png differ diff --git a/db-23ai-fundamentals/new-property-graph/images/simple-db-actions.png b/db-23ai-fundamentals/new-property-graph/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-property-graph/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-property-graph/new-property-graph.md b/db-23ai-fundamentals/new-property-graph/new-property-graph.md index 60c63ee5b..65dbafaae 100644 --- a/db-23ai-fundamentals/new-property-graph/new-property-graph.md +++ b/db-23ai-fundamentals/new-property-graph/new-property-graph.md @@ -7,13 +7,13 @@ Welcome to the "Exploring SQL Property Graphs and SQL/PGQ in Oracle Database 23a Estimated Lab Time: 20 minutes Watch the video below for a walkthrough of the lab. -[Lab walkthrough video](videohub:1_nyvxwdwz) +[Lab walkthrough video](videohub:1_hxipitm1) ### Objective: The objective of this workshop is to show you SQL property graphs and demo their practical use. By the end of this workshop, you will be able to create property graphs, query them using SQL/PGQ, and visualize the relationships within your data. -This lab is just a short overview of the functionality brought forth by Property Graphs in Oracle Database 23ai and is meant to give you a small example of what is possible. For more in depth Property Graphs explanations and workshops check out the following labs +This lab is just a short overview of the functionality introduced with Property Graphs in Oracle Database 23ai and is meant to give you a small example of what is possible. For more in depth Property Graphs explanations and workshops check out the following labs * [Graphs in the Oracle Database](https://livelabs.oracle.com/pls/apex/f?p=133:100:105582422382278::::SEARCH:graph) @@ -24,19 +24,69 @@ This lab is just a short overview of the functionality brought forth by Property ## Task 1: Lab Setup -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. ![click SQL](images/im1.png =50%x*) -2. For demo purposes we will be using the ADMIN user so we don't need to grant any additional roles. The database schema that contains the graph tables (either Property Graph schema objects or relational tables that will be directly loaded as a graph in memory) requires certain privileges found [here](https://docs.oracle.com/en/database/oracle/property-graph/24.2/spgdg/graph-developers-guide-property-graph.pdf). Here is an example of granting SQL property graph related privileges +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) + +3. Here we can go ahead and create our user for this lab. We'll call our user `DB23AI` and grant the user the new developer role and the graph developer role. ``` - GRANT CREATE PROPERTY GRAPH, CREATE ANY PROPERTY GRAPH, ALTER ANY PROPERTY GRAPH, DROP ANY PROPERTY GRAPH, READ ANY PROPERTY GRAPH TO ; + + -- USER SQL + CREATE USER DB23AI IDENTIFIED BY Oracledb_4U#; + + -- ADD ROLES + GRANT DB_DEVELOPER_ROLE TO DB23AI; + + GRANT CONNECT TO DB23AI; + GRANT RESOURCE TO DB23AI; + GRANT CONSOLE_DEVELOPER TO DB23AI; + GRANT GRAPH_DEVELOPER TO DB23AI; + + + -- REST ENABLE + BEGIN + ORDS_ADMIN.ENABLE_SCHEMA( + p_enabled => TRUE, + p_schema => 'DB23AI', + p_url_mapping_type => 'BASE_PATH', + p_url_mapping_pattern => 'db23ai', + p_auto_rest_auth=> TRUE + ); + -- ENABLE DATA SHARING + C##ADP$SERVICE.DBMS_SHARE.ENABLE_SCHEMA( + SCHEMA_NAME => 'DB23AI', + ENABLED => TRUE + ); + commit; + END; + / + + ALTER USER DB23AI DEFAULT ROLE CONSOLE_DEVELOPER,DB_DEVELOPER_ROLE,GRAPH_DEVELOPER; + ALTER USER DB23AI GRANT CONNECT THROUGH GRAPH$PROXY_USER; + + -- QUOTA + ALTER USER DB23AI QUOTA UNLIMITED ON DATA; + + ``` +4. Let's sign in as our new user. Click on the admin profile in the top right hand of Database Actions and sign out. + + ![log out of our admin user](images/im12.png " ") + +5. Sign in with the username **DB23AI** and password **Oracledb_4U#** + + ![sign in with db23ai](images/im19.png =50%x*) - Always check the Security Best Practices when creating new users. Best security practices for graph users can be found [here](https://docs.oracle.com/en/database/oracle/property-graph/20.4/spgdg/property-graph-overview-spgdg.html#GUID-98F3A3D7-9B97-40AD-8944-B261D8B60F08). +6. Click SQL to open the SQL editor. -3. Lets create some tables for our demo. We'll create a people and relationship table which will be our vertices (people) and edges (relationship) of the graph. + ![Open SQL with db23ai](images/im20.png " ") + +7. Lets create some tables for our demo. We'll create a people and relationship table which will be our vertices (people) and edges (relationship) of the graph. ``` @@ -123,6 +173,119 @@ This lab is just a short overview of the functionality brought forth by Property ![create the property graph](images/im3.png =50%x*) + +## Task 3: Discovering Graph Studio + +1. Now we're going to take a look at Graph Studio. Click the hamburger menu and then select Graph Studio. + + ![Updating the our customers view](images/im7.png " ") + +2. Login with our db23ai user credentials. + + Username: db23ai + Password: Oracledb_4U# + + ![Updating the our customers view](images/im8.png " ") + +3. Inside Graph Studio, click on Notebooks. + + ![Updating the our customers view](images/im9.png " ") + +4. Select **Create** in the upper right hand corner. + + ![Updating the our customers view](images/im10.png " ") + +5. Give your notebook a name. I'll go with **cust_graph** + + ![Updating the our customers view](images/im11.png " ") + +6. If the compute environment pops up, click close in the bottom right corner. + ![Updating the our customers view](images/im13.png " ") + +7. Since we haven't set up the compute server, and don't need it for this lab, you may get an error saying it wasn't able to create. Close these messages. + ![Updating the our customers view](images/im14.png " ") + + +8. Hover over the middle of the textbox and click add SQL Paragraph. See the gif below for an example + + ![Updating the our customers view](images/im12.gif " ") + + +9. We can now query this graph using the new SQL/PGQ extension in Oracle Database 23ai. The following query looks for customers, starting at the vertices 'Jim Brown' and then his friends (directional) within 1 to 3 hops. The important step here is the match clause which allows us to define the nodes we are looking for in our graph. We indicate we are starting from V1. We then apply a filter to, select Jim Brown. We tell it to traverse the graph in a single direction with -> navigating all edges that are marked friends from 1 to 3 hops. We finally tell the query to return the paths for the hops that match the query. + + Paste the following and click the run query button + + **Keep the %sql at the top of each SQL paragraph in the notebook** + + ``` + + select distinct + full_names, + cust_id + from graph_table(moviestreams_pg + match + (v1 is customer) ( -[e is related where e.relationship = 'Friend']-> (v2 is customer where v2.first_name != 'Jim')) {1,3} + where v1.first_name = 'Jim' and v1.last_name = 'Brown' + columns (LISTAGG(v2.first_name ||' '|| v2.last_name, ', ') as full_names, + LISTAGG(v2.customer_id, ', ') as cust_id, + v1.first_name ||' '|| v1.last_name as source) + ) + + ``` + + ![Updating the our customers view](images/im15.png " ") + +8. If we add new customers and relationships they are part of the graph and can be queried instantly. Add the insert statement into the a paragraph and run the query + + ``` + + INSERT INTO customers (customer_id, first_name, last_name, email, signup_date, has_sub) + VALUES + (9, 'Jwan', 'Brown', 'Jwan.brown@example.com', SYSDATE, TRUE) + + ``` + + ![Updating the our customers view](images/im16.png " ") + +9. Add the customer relationship into the next cell and run the query. + + ``` + + INSERT INTO customer_relationships (SOURCE_ID, TARGET_ID, RELATIONSHIP) + VALUES + (9, 7, 'Cousin'), + (7, 9, 'Cousin') + + ``` + ![Updating the our customers view](images/im17.png " ") + + +10. We can update the first cell and change Friend to Cousin + + ``` + + select distinct + full_names, + cust_id + from graph_table(moviestreams_pg + match + (v1 is customer) ( -[e is related where e.relationship = 'Cousin']-> (v2 is customer where v2.first_name != 'Jim')) {1} + where v1.first_name = 'Jim' and v1.last_name = 'Brown' + columns (LISTAGG(v2.first_name ||' '|| v2.last_name, ', ') as full_names, + LISTAGG(v2.customer_id, ', ') as cust_id, + v1.first_name ||' '|| v1.last_name as source) + ) + + ``` + ![Updating the our customers view](images/im18.png " ") + + +11. Navigate back to SQL Developer Web by switching your browser tabs. + + +12. In this short lab we've looked at SQL property graphs and SQL/PGQ in Oracle Database 23ai. We've learned how to create property graphs from existing tables, query these graphs to discover relationships, and prepare data for visualization. + + ## Task 3: Querying Property Graphs with SQL/PGQ 1. Now we can use SQL/PQG to query and work with our property graphs. We'll use the GRAPH_TABLE operator here to display people who are connected to each other. diff --git a/db-23ai-fundamentals/new-read-only-users/images/simple-db-actions.png b/db-23ai-fundamentals/new-read-only-users/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-read-only-users/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-read-only-users/new-read-only-users.md b/db-23ai-fundamentals/new-read-only-users/new-read-only-users.md index 0afdcb536..1d0a12f11 100644 --- a/db-23ai-fundamentals/new-read-only-users/new-read-only-users.md +++ b/db-23ai-fundamentals/new-read-only-users/new-read-only-users.md @@ -17,6 +17,15 @@ The objective of this lab is to familiarize you with setting up read-only users ## Task 1: Understanding Read-Only Users +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. + ![click SQL](images/im1.png =50%x*) + + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) + 1. Read-only users in Oracle Database 23ai are configured to allow `SELECT` operations only, disallowing any modifications such as `CREATE`, `INSERT`, `UPDATE`, or `DELETE`. 2. This feature provides flexibility for administrators to setup read-only access temporarily or permanently, improving database security and governance. diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/00.png b/db-23ai-fundamentals/new-schema-level-privileges/images/00.png new file mode 100644 index 000000000..62d5f513f Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/00.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/1.png b/db-23ai-fundamentals/new-schema-level-privileges/images/1.png new file mode 100644 index 000000000..6c1f9c022 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/1.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/10.png b/db-23ai-fundamentals/new-schema-level-privileges/images/10.png new file mode 100644 index 000000000..e16741618 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/10.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/11.png b/db-23ai-fundamentals/new-schema-level-privileges/images/11.png new file mode 100644 index 000000000..2de75776d Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/11.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/12.png b/db-23ai-fundamentals/new-schema-level-privileges/images/12.png new file mode 100644 index 000000000..07a9a8d51 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/12.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/13.png b/db-23ai-fundamentals/new-schema-level-privileges/images/13.png new file mode 100644 index 000000000..0b70fa973 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/13.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/14.png b/db-23ai-fundamentals/new-schema-level-privileges/images/14.png new file mode 100644 index 000000000..3a15acb14 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/14.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/15.png b/db-23ai-fundamentals/new-schema-level-privileges/images/15.png new file mode 100644 index 000000000..9cd5e38dd Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/15.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/16.png b/db-23ai-fundamentals/new-schema-level-privileges/images/16.png new file mode 100644 index 000000000..1fb83a129 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/16.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/17.png b/db-23ai-fundamentals/new-schema-level-privileges/images/17.png new file mode 100644 index 000000000..2ce368a2f Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/17.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/18.png b/db-23ai-fundamentals/new-schema-level-privileges/images/18.png new file mode 100644 index 000000000..58a728ea4 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/18.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/19.png b/db-23ai-fundamentals/new-schema-level-privileges/images/19.png new file mode 100644 index 000000000..189b41fd9 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/19.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/1a.png b/db-23ai-fundamentals/new-schema-level-privileges/images/1a.png new file mode 100644 index 000000000..e771ebc09 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/1a.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/1b.png b/db-23ai-fundamentals/new-schema-level-privileges/images/1b.png new file mode 100644 index 000000000..db93ad68c Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/1b.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/1c.png b/db-23ai-fundamentals/new-schema-level-privileges/images/1c.png new file mode 100644 index 000000000..be0047270 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/1c.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/1d.png b/db-23ai-fundamentals/new-schema-level-privileges/images/1d.png new file mode 100644 index 000000000..b45d29bad Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/1d.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/1e.png b/db-23ai-fundamentals/new-schema-level-privileges/images/1e.png new file mode 100644 index 000000000..1cc43ce1a Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/1e.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/2.png b/db-23ai-fundamentals/new-schema-level-privileges/images/2.png new file mode 100644 index 000000000..346d1c2a4 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/2.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/20.png b/db-23ai-fundamentals/new-schema-level-privileges/images/20.png new file mode 100644 index 000000000..e5134dd8b Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/20.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/21.png b/db-23ai-fundamentals/new-schema-level-privileges/images/21.png new file mode 100644 index 000000000..4c0a4906f Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/21.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/22.png b/db-23ai-fundamentals/new-schema-level-privileges/images/22.png new file mode 100644 index 000000000..1fb83a129 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/22.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/23.png b/db-23ai-fundamentals/new-schema-level-privileges/images/23.png new file mode 100644 index 000000000..0e17d995c Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/23.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/24.png b/db-23ai-fundamentals/new-schema-level-privileges/images/24.png new file mode 100644 index 000000000..09c42274a Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/24.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/25.png b/db-23ai-fundamentals/new-schema-level-privileges/images/25.png new file mode 100644 index 000000000..2ce368a2f Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/25.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/26.png b/db-23ai-fundamentals/new-schema-level-privileges/images/26.png new file mode 100644 index 000000000..58a728ea4 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/26.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/27.png b/db-23ai-fundamentals/new-schema-level-privileges/images/27.png new file mode 100644 index 000000000..36922f977 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/27.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/28.png b/db-23ai-fundamentals/new-schema-level-privileges/images/28.png new file mode 100644 index 000000000..e5134dd8b Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/28.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/29.png b/db-23ai-fundamentals/new-schema-level-privileges/images/29.png new file mode 100644 index 000000000..a85d19a4c Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/29.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/3.png b/db-23ai-fundamentals/new-schema-level-privileges/images/3.png new file mode 100644 index 000000000..9427aaf09 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/3.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/4.png b/db-23ai-fundamentals/new-schema-level-privileges/images/4.png new file mode 100644 index 000000000..86123eb37 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/4.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/5.png b/db-23ai-fundamentals/new-schema-level-privileges/images/5.png new file mode 100644 index 000000000..4f335d08a Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/5.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/6.png b/db-23ai-fundamentals/new-schema-level-privileges/images/6.png new file mode 100644 index 000000000..9d2003ad9 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/6.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/7.png b/db-23ai-fundamentals/new-schema-level-privileges/images/7.png new file mode 100644 index 000000000..8b9436418 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/7.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/8.png b/db-23ai-fundamentals/new-schema-level-privileges/images/8.png new file mode 100644 index 000000000..07a9a8d51 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/8.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/9.png b/db-23ai-fundamentals/new-schema-level-privileges/images/9.png new file mode 100644 index 000000000..abdd68328 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/9.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/I.png b/db-23ai-fundamentals/new-schema-level-privileges/images/I.png new file mode 100644 index 000000000..aade08c52 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/I.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/J1.png b/db-23ai-fundamentals/new-schema-level-privileges/images/J1.png new file mode 100644 index 000000000..b5999173f Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/J1.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/L.png b/db-23ai-fundamentals/new-schema-level-privileges/images/L.png new file mode 100644 index 000000000..c21415e77 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/L.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/M.png b/db-23ai-fundamentals/new-schema-level-privileges/images/M.png new file mode 100644 index 000000000..7fadb5a33 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/M.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/N.png b/db-23ai-fundamentals/new-schema-level-privileges/images/N.png new file mode 100644 index 000000000..49b18e109 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/N.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/P.png b/db-23ai-fundamentals/new-schema-level-privileges/images/P.png new file mode 100644 index 000000000..65ae4cdb2 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/P.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/a.png b/db-23ai-fundamentals/new-schema-level-privileges/images/a.png new file mode 100644 index 000000000..f146cde96 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/a.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/admin.png b/db-23ai-fundamentals/new-schema-level-privileges/images/admin.png new file mode 100644 index 000000000..e1f5ac8e9 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/admin.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/b.png b/db-23ai-fundamentals/new-schema-level-privileges/images/b.png new file mode 100644 index 000000000..b2ec4b594 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/b.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/c.png b/db-23ai-fundamentals/new-schema-level-privileges/images/c.png new file mode 100644 index 000000000..f07cfe377 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/c.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/d.png b/db-23ai-fundamentals/new-schema-level-privileges/images/d.png new file mode 100644 index 000000000..4fcf0fe55 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/d.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/e.png b/db-23ai-fundamentals/new-schema-level-privileges/images/e.png new file mode 100644 index 000000000..6f2298e79 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/e.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/e1.png b/db-23ai-fundamentals/new-schema-level-privileges/images/e1.png new file mode 100644 index 000000000..526cb1fed Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/e1.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/f.png b/db-23ai-fundamentals/new-schema-level-privileges/images/f.png new file mode 100644 index 000000000..851ed1199 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/f.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/f1.png b/db-23ai-fundamentals/new-schema-level-privileges/images/f1.png new file mode 100644 index 000000000..dd1d0f8d9 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/f1.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/h.png b/db-23ai-fundamentals/new-schema-level-privileges/images/h.png new file mode 100644 index 000000000..255abd8a9 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/h.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/j.png b/db-23ai-fundamentals/new-schema-level-privileges/images/j.png new file mode 100644 index 000000000..3e296923a Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/j.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/k.png b/db-23ai-fundamentals/new-schema-level-privileges/images/k.png new file mode 100644 index 000000000..3b1ebf713 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/k.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/o.png b/db-23ai-fundamentals/new-schema-level-privileges/images/o.png new file mode 100644 index 000000000..57584250b Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/o.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/reservationinfo.png b/db-23ai-fundamentals/new-schema-level-privileges/images/reservationinfo.png new file mode 100644 index 000000000..a0399d8e6 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/reservationinfo.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/images/simple-db-actions.png b/db-23ai-fundamentals/new-schema-level-privileges/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-schema-level-privileges/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-schema-level-privileges/new-schema-level-privileges-15.md b/db-23ai-fundamentals/new-schema-level-privileges/new-schema-level-privileges-15.md index 0eeb88f2a..ea5323334 100644 --- a/db-23ai-fundamentals/new-schema-level-privileges/new-schema-level-privileges-15.md +++ b/db-23ai-fundamentals/new-schema-level-privileges/new-schema-level-privileges-15.md @@ -4,17 +4,16 @@ Welcome to the Working with Schema-Level Privileges lab. In this lab, you will learn how to work with the new schema-level privilege management feature introduced in Oracle Database 23ai. -**_Estimated Lab Time: 10 minutes_** +Estimated Lab Time: 15 minutes -### **Objective** +### Objective: The objective of this workshop is to learn how to work with the schema-level privilege grant in Oracle Database 23ai and demonstrate its practical applications for managing access to application schemas in an easy way. -### **Prerequisites** +### Prerequisites: - Access to Oracle Database 23ai. - Basic understanding of database schemas and privileges is recommended but not required. -## Task 1: Understanding Schema-Level Privileges - +## Task 1: Overview of Traditional Privilege Management 1. Before we get into the code examples, let's briefly talk about the traditional methods of privilege management in Oracle databases. * **Individual Privilege Grants**: This involves granting individual privileges on each table or view in the application schema. While granular, it's cumbersome and could cause user errors, especially with schema changes. @@ -23,89 +22,372 @@ The objective of this workshop is to learn how to work with the schema-level pri * Oracle Database 23ai introduces a simpler approach: **Schema-Level Privileges**. This allows granting privileges at the schema level, offering a balance between granularity and convenience. -## Task 2: Benefiting from Schema-Level Privileges +## Task 2: Exploring Schema-Level Privileges 1. From the Autonomous Database home page, **click** Database action and then **click** SQL. ![click SQL](images/im1.png " ") -2. Let's now look at the syntax and usage of schema-level privileges in Oracle Database 23ai. First, we'll add a couple of test users. +2. Let's first drop roles and users. + + ``` + + -- Drop users if they already exist + DROP USER IF EXISTS hr_user CASCADE; + DROP USER IF EXISTS it_user CASCADE; + + ``` + ![drops users and roles](images/a.png " ") + +3. We will next create users. To change the password for the users use the "alter user identified by "new password" command. Throughout this workshop we will use Oracle123long for the password. + + ``` + + -- Create users + CREATE USER hr_user IDENTIFIED BY Oracle123long; + CREATE USER it_user IDENTIFIED BY Oracle123long; + + ``` + ![creates users](images/1a.png " ") + + + If you'd like to change the password for the individual users, you'd run the following and make sure to replace `new_password_here` with your new password(needs one uppercase letter and atleast one number). + ``` + + ALTER USER hr_user IDENTIFIED BY new_password_here; + ``` + ``` + ALTER USER hr_user IDENTIFIED BY Oracle123long; + ``` + ![changes password for hr user](images/1b.png " ") + + + This will change the password for it_user + ``` + + ALTER USER it_user IDENTIFIED BY new_password_here; + ``` + ``` + ALTER USER it_user IDENTIFIED BY Oracle123long; + ``` + ![changes password for it user](images/1c.png " ") + +4. Now we will be granting the respective roles to the users to enable webconsole access as well as the quota for the tablespace. + + + ``` + + -- ADD HR_USER ROLES + GRANT CONNECT TO HR_USER; + GRANT DWROLE TO HR_USER; + GRANT RESOURCE TO HR_USER; + ALTER USER HR_USER DEFAULT ROLE CONNECT,DWROLE,RESOURCE; + + -- REST ENABLE + BEGIN + ORDS_ADMIN.ENABLE_SCHEMA( + p_enabled => TRUE, + p_schema => 'HR_USER', + p_url_mapping_type => 'BASE_PATH', + p_url_mapping_pattern => 'hr_user', + p_auto_rest_auth=> FALSE + ); + -- ENABLE DATA SHARING + C##ADP$SERVICE.DBMS_SHARE.ENABLE_SCHEMA( + SCHEMA_NAME => 'HR_USER', + ENABLED => TRUE + ); + commit; + END; + / + -- ADD IT_USER ROLES + GRANT CONNECT TO IT_USER; + GRANT DWROLE TO IT_USER; + GRANT RESOURCE TO IT_USER; + ALTER USER IT_USER DEFAULT ROLE CONNECT,DWROLE,RESOURCE; + + -- REST ENABLE + BEGIN + ORDS_ADMIN.ENABLE_SCHEMA( + p_enabled => TRUE, + p_schema => 'IT_USER', + p_url_mapping_type => 'BASE_PATH', + p_url_mapping_pattern => 'it_user', + p_auto_rest_auth=> FALSE + ); + -- ENABLE DATA SHARING + C##ADP$SERVICE.DBMS_SHARE.ENABLE_SCHEMA( + SCHEMA_NAME => 'IT_USER', + ENABLED => TRUE + ); + commit; + END; + / + + -- Grant quota for tablespace use + ALTER USER hr_user QUOTA UNLIMITED ON DATA; + ALTER USER it_user QUOTA UNLIMITED ON DATA; + + ``` + ![grants users access to webconsole](images/c.png " ") + +6. Now we will create `employees`, `department` and `salary` tables. These tables will demonstarte how different levels of privilege can be applied. + + ``` + + -- Create employees and department + CREATE TABLE hr_user.employees (id NUMBER PRIMARY KEY, name VARCHAR2(50), salary NUMBER); + CREATE TABLE hr_user.departments (id NUMBER PRIMARY KEY, department_name VARCHAR2(100)); + + -- Create salary table which is sensitive and only accessible by hr_user + CREATE TABLE hr_user.salaries (employee_id NUMBER REFERENCES hr_user.employees(id), salary NUMBER); + + -- Insert some sample data into employees and departments + INSERT INTO hr_user.employees (id, name) VALUES (1, 'John Doe'); + INSERT INTO hr_user.employees (id, name) VALUES (2, 'Sammy Smith'); + INSERT INTO hr_user.employees (id, name) VALUES (3, 'Alisa Brown'); + INSERT INTO hr_user.departments (id, department_name) VALUES (1, 'HR'); + INSERT INTO hr_user.departments (id, department_name) VALUES (2, 'IT'); + INSERT INTO hr_user.departments (id, department_name) VALUES (3, 'IT'); + + --Insert salary data into salaries table + INSERT INTO hr_user.salaries (employee_id, salary) VALUES (1, 50000); + INSERT INTO hr_user.salaries (employee_id, salary) VALUES (2, 60000); + INSERT INTO hr_user.salaries (employee_id, salary) VALUES (3, 70000); + + ``` + + ![tables created](images/d.png " ") + +## Task 3: Apply Schema-Level Privileges +1. Now, we will grant schema-level privileges. Instead of granting access to individual tables, we will allow the `hr_user` to access all current and future tables within the `hr_user` schema. `it_user` will have access to the `employee` and `departments` tables, but no access to the `salaries` table. + + ``` + + -- Grant schema-level privileges to HR user + GRANT SELECT ANY TABLE ON SCHEMA hr_user TO hr_user; + + -- IT user can access to employees and departments but not salaries + GRANT SELECT ON hr_user.employees TO it_user; + GRANT SELECT ON hr_user.departments TO it_user; + + ``` + + ![granting schema level privileges](images/e.png " ") + +3. Oracle Database 23ai simplifies privilege management with dedicated views. We can use views like `DBA_SCHEMA_PRIVS` to check the schema-level privileges granted to users. Others include ROLE\_SCHEMA\_PRIVS, USER\_SCHEMA\_PRIVS, and SESSION\_SCHEMA\_PRIVS. + + ``` + + SELECT * FROM DBA_SCHEMA_PRIVS WHERE GRANTEE = 'HR_USER'; + SELECT * FROM DBA_SCHEMA_PRIVS WHERE GRANTEE = 'IT_USER'; + SELECT * FROM DBA_TAB_PRIVS WHERE GRANTEE = 'IT_USER'; + + ``` + + Since only `hr_user` has schema-level privileges, when we run `DBA_SCHEMA_PRIVS`, we see that the privilege SELECT is set to ANY. Meanwhile, since `it_user` does not have schema-level privileges, when running the same command it returns no data found as it does not have the correct privileges. It is only with `DBA_TAB_PRIVS` that we can see it's table privileges. + ![view privileges](images/f1.png " ") + +## Task 4: Demonstrating Schema-Level Privileges +1. To explore the new schema-level privileges, `Sign out` of the `ADMIN` account and log in as the `hr_user` user. At the login screen, enter the login credentials for the `hr_user` user: + - `USERNAME`: hr_user + - `PASSWORD`: Oracle123long + + ![signout from admin](images/16.png " ") + ![login screen for hr_user](images/7.png " ") + ![click on sql](images/8.png " ") + + +2. Schema-level privileges dynamically adapt to schema changes. When new tables or views are added to the schema, users granted schema-level access instantly gain the ability to query them without requiring any further administrative actions. With `hr_user` having schema-level privileges, they should be able to query data from `employees`, `department` and `salaries`. + + ``` + + SELECT * FROM hr_user.employees; + SELECT * FROM hr_user.departments; + SELECT * FROM hr_user.salaries; + + ``` + ![view hr user select](images/9.png " ") + +3. If successful, all the 3 tables will return data, demonstrating the schema-level privileges have been applied. Now verified, sign out of the `hr_user` session and log into `it_user`. We will see how the privileges of this user is limited when compared to hr_user. + - `USERNAME`: it_user + - `PASSWORD`: Oracle123long + + ![signout from admin](images/10.png " ") + ![login screen for hr_user](images/11.png " ") + ![click on sql](images/12.png " ") + +4. Within the SQL developer web, we shall now test the restricted access. Notice that `employees` and `departments` tables shall be successful but the `salaries` will return an error. ``` - drop user if exists bob cascade; - drop user if exists sally cascade; - create user bob identified by Oracle123long; - create user sally identified by Oracle123long; + SELECT * FROM hr_user.employees; + SELECT * FROM hr_user.departments; + SELECT * FROM hr_user.salaries; ``` - ![drop and create the needed users for the lab](images/im2.png " ") + ![it user viewing from tables](images/13.png " ") + +5. Let's return to the `Admin` account by logging out of the `it_user` session. To grab the Admin password, return to our reservation information window found in our workshop notebook and copy the value next to `Admin Password`. + - `USERNAME`: ADMIN + - `PASSWORD`: `paste_the_value_here` - Now we can grant our bob user various privileges to other users or roles. + ![signout hr_user](images/14.png " ") + ![adb sql returning to admin](images/reservationinfo.png " ") + ![adb sql returning to admin](images/admin.png " ") + +6. To show the flexibility of schema-level privileges, we will also be creating a new table called projects + + ``` + + -- Create a new table called projects + CREATE TABLE hr_user.projects ( + project_id NUMBER PRIMARY KEY, + project_name VARCHAR2(100) + ); + + -- Insert some data into projects + INSERT INTO hr_user.projects (project_id, project_name) VALUES (1, 'Project Alpha'); + INSERT INTO hr_user.projects (project_id, project_name) VALUES (2, 'Project Beta'); + + ``` + ![creating new projects table](images/I.png " ") +7. Now, let's grant schema-level privileges to the it_user ``` - -- tables, views, and materialized views - grant select any table on schema sally to bob; - grant insert any table on schema sally to bob; - grant update any table on schema sally to bob; - grant delete any table on schema sally to bob; + -- Grant schema-level privileges directly to hr_user + GRANT SELECT ANY TABLE ON SCHEMA hr_user TO it_user; - -- procedures, functions, packages, and sequences - grant execute any procedure on schema sally to bob; - grant select any sequence on schema sally to bob; + SELECT * FROM DBA_SCHEMA_PRIVS WHERE GRANTEE = 'IT_USER'; ``` + ![grants schemalevel privileges to ituser](images/h.png " ") - ![grant the schema level privileges](images/im3.png " ") - These grants provides user bob with select, insert, update, delete, execute any procedures, functions, packages, and select sequence privileges on all tables and views within the schema sally. +8. Sign out of the `ADMIN` session and log into `it_user`. We will see how the privileges of this user is limited when compared to hr_user. + - `Path` : it_user + - `USERNAME`: it_user + - `PASSWORD`: Oracle123long -3. Schema-level privileges dynamically adapt to schema changes. If new tables or views are added to the schema, users granted schema-level privileges instantly gain access without additional management. + ![signout from admin](images/16.png " ") + ![login screen for it_user](images/17.png " ") + ![click on sql](images/18.png " ") -4. Oracle Database 23ai simplifies privilege management with dedicated views. We can use views like `DBA_SCHEMA_PRIVS` to check the schema-level privileges granted to users. Others include ROLE\_SCHEMA\_PRIVS, USER\_SCHEMA\_PRIVS, and SESSION\_SCHEMA\_PRIVS. +9. Witin `it_user` now let's view our tables. You should be able to see the 3 original tables, as well as the newest, `projects` table we created after granting `it_user` schema-level privileges. ``` - SELECT * FROM DBA_SCHEMA_PRIVS WHERE GRANTEE = 'BOB'; + SELECT * FROM hr_user.employees; + SELECT * FROM hr_user.departments; + SELECT * FROM hr_user.salaries; + SELECT * FROM hr_user.projects; ``` - ![check the grantees](images/im4.png " ") -5. Just as expected, we can revoke the privileges too. Let's revoke bobs privileges on sally's schema + ![it user viewing all the tables](images/J1.png " ") + +10. Sign out of the `it_user` session and log into `hr_user`. We will see how the privileges of this user is limited when compared to hr_user. + - `USERNAME`: hr_user + - `PASSWORD`: Oracle123long + ![signout from admin](images/16.png " ") + ![login screen for hr_user](images/17.png " ") + ![click on sql](images/18.png " ") + +11. Now that we have returned to `hr_user` which was the original user with schema-level privileges, we will see how not only do we have access to the first 3 tables, we can also `SELECT` from `projects`. ``` - -- tables, views, and materialized views - revoke select any table on schema sally from bob; - revoke insert any table on schema sally from bob; - revoke update any table on schema sally from bob; - revoke delete any table on schema sally from bob; + SELECT * FROM hr_user.employees; + SELECT * FROM hr_user.departments; + SELECT * FROM hr_user.salaries; + SELECT * FROM hr_user.projects; + + ``` + ![hr user viewing all the tables](images/J1.png " ") - -- procedures, functions, packages, and sequences - revoke execute any procedure on schema sally from bob; - revoke select any sequence on schema sally from bob; + +12. Let's return to the `Admin` account by logging out of the `hr_user` session. To grab the Admin password, return to our reservation information window found in our workshop notebook and copy the value next to `Admin Password`. + - `USERNAME`: ADMIN + - `PASSWORD`: `paste_the_value_here` + + ![signout from hr user](images/10.png " ") + ![adb sql returning to admin](images/reservationinfo.png " ") + ![adb sql returning to admin](images/admin.png " ") + +## Task 5: Revoking Schema-Level Privileges +1. As expected, we can also revoke schema-level privileges when they are no longer required. In the `ADMIN` profile, let's proceed by revoking the `SELECT` privilege that was granted to the `it_user` for the schema. + + ``` + + -- Revoke schema-level privileges from IT_USER + REVOKE SELECT ANY TABLE ON SCHEMA hr_user FROM it_user; ``` - ![check the grantees](images/im5.png " ") + ![revoking access from it user](images/M.png " ") +2. Once the privileges have been revoked, we can verify the updated access by reviewing the remaining privileges granted to `it_user`. `DBA_SCHEMA_PRVIS` will return no data found, but `DBA_TAB_PRIVS` will show that our original privileges are still there. + ``` + + SELECT * FROM DBA_SCHEMA_PRIVS WHERE GRANTEE = 'IT_USER'; + + ``` + ![showing schema level priv is gone](images/N.png " ") -## Task 3: Understanding Advanced Privilege Management + ``` + + SELECT * FROM DBA_TAB_PRIVS WHERE GRANTEE = 'IT_USER'; + + ``` + ![showing table level priv is back to normal](images/o.png " ") -1. You can also grant schema-level privileges on schemas without special privileges. However, granting privileges on other schemas requires additional privileges like GRANT ANY SCHEMA PRIVILEGE. +3. We will `Sign out` of ADMIN account and switch to `it_user` account. At the login screen, enter the login credentials we set up for the it_user user. + - `USERNAME`: it_user + - `PASSWORD`: Oracle123long -3. In this lab, you've explored the schema-level privilege management in Oracle Database 23ai. By using schema-level privileges, you can drastically reduce the management and administration needed to grant schema privileges prior to 23ai and improve security through their use. + ![signout admin](images/24.png " ") + ![login to hr_user](images/25.png " ") -4. We can clean up from the lab by dropping our tables. +4. Now we will see that our schema-level privileges have been revoked. `it_user` will not be able to `SELECT` from all the tables as before, only `employees` and `department` which were originally granted. ``` - drop user if exists bob cascade; - drop user if exists sally cascade; + SELECT * FROM hr_user.employees; + SELECT * FROM hr_user.departments; + SELECT * FROM hr_user.salaries; + SELECT * FROM hr_user.projects; + + ``` + ![view output ](images/P.png " ") + +5. Let's return to the `Admin` account by logging out of the `it_user` session. To grab the Admin password, return to our reservation information window found in our workshop notebook and copy the value next to `Admin Password`. + - `USERNAME`: ADMIN + - `PASSWORD`: `paste_the_value_here` + + ![signout hr_user](images/28.png " ") + ![adb sql returning to admin](images/reservationinfo.png " ") + ![adb sql returning to admin](images/admin.png " ") +## Task 6: Cleanup +1. Finally, let's clean up the environment by dropping the the users, roles, and objects created. (Note: You may see an error stating that you can not drop a user who is currently connect. If this is the case, wait a minute and run the command again.) + + ``` + + -- Drop users, roles, and related objects + DROP USER IF EXISTS hr_user CASCADE; + DROP USER IF EXISTS it_user CASCADE; + DROP ROLE IF EXISTS hr_user; + DROP ROLE IF EXISTS it_user; ``` - You may now **proceed to the next lab** + ![drop the users and roles](images/29.png " ") + +## Task 7: Understanding Advanced Privilege Management +1. You can also grant schema-level privileges on schemas that do not belong to the current user. However, doing this requires additonal permissions such as `GRANT ANY SCHEMA PRIVILEGE`, which allows you to grant privileges on other users' schemas. + +2. Throughout this lab, you've explored how schema-level privilege management simplifies user access control in Oracle Database 23ai. By using schema-level privileges, you can drastically reduce the management and administration needed to grant schema privileges prior to 23ai and improve security through their use. + +You may now **proceed to the next lab** ## Learn More @@ -114,5 +396,5 @@ The objective of this workshop is to learn how to work with the schema-level pri ## Acknowledgements * **Author** - Killian Lynch, Database Product Management -* **Contributors** - Dom Giles, Distinguished Database Product Manager -* **Last Updated By/Date** - Killian Lynch, April 2024 +* **Contributors** - Dom Giles, Distinguished Database Product Manager, Francis Regalado, Database Product Manager +* **Last Updated By/Date** - Francis Regalado, Database Product Manager October 2024 diff --git a/db-23ai-fundamentals/new-schema-level-privileges/new-schema-level-privileges.md b/db-23ai-fundamentals/new-schema-level-privileges/new-schema-level-privileges.md index 7f7a5b0a5..ebba85550 100644 --- a/db-23ai-fundamentals/new-schema-level-privileges/new-schema-level-privileges.md +++ b/db-23ai-fundamentals/new-schema-level-privileges/new-schema-level-privileges.md @@ -25,8 +25,14 @@ The objective of this workshop is to learn how to work with the schema-level pri ## Task 2: Benefiting from Schema-Level Privileges -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. - ![click SQL](images/im1.png " ") +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. + ![click SQL](images/im1.png =50%x*) + + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) 2. Let's now look at the syntax and usage of schema-level privileges in Oracle Database 23ai. First, we'll add a couple of test users. diff --git a/db-23ai-fundamentals/new-schema-level-privileges/new-schema-level-privileges2.md b/db-23ai-fundamentals/new-schema-level-privileges/new-schema-level-privileges2.md new file mode 100644 index 000000000..a5e681f9d --- /dev/null +++ b/db-23ai-fundamentals/new-schema-level-privileges/new-schema-level-privileges2.md @@ -0,0 +1,426 @@ +# Working with Schema-Level Privileges + +## Introduction + +Welcome to the Working with Schema-Level Privileges lab. In this lab, you will learn how to work with the new schema-level privilege management feature introduced in Oracle Database 23ai. + +Estimated Lab Time: 15 minutes + +### Objective: +The objective of this workshop is to learn how to work with the schema-level privilege grant in Oracle Database 23ai and demonstrate its practical applications for managing access to application schemas in an easy way. + +### Prerequisites: +- Access to Oracle Database 23ai. +- Basic understanding of database schemas and privileges is recommended but not required. + +## Task 1: Overview of Traditional Privilege Management +1. Before we get into the code examples, let's briefly talk about the traditional methods of privilege management in Oracle databases. + + * **Individual Privilege Grants**: This involves granting individual privileges on each table or view in the application schema. While granular, it's cumbersome and could cause user errors, especially with schema changes. + + * **ANY Privileges**: Granting "ANY" privileges (e.g., `SELECT ANY TABLE`) provides broad access but compromises security by granting excessive permissions. + + * Oracle Database 23ai introduces a simpler approach: **Schema-Level Privileges**. This allows granting privileges at the schema level, offering a balance between granularity and convenience. + +## Task 2: Exploring Schema-Level Privileges + +1. From the Autonomous Database home page, **click** Database action and then **click** SQL. + ![click SQL](images/im1.png " ") + +2. Let's first drop roles and users. + + ``` + + -- Drop users if they already exist + DROP USER IF EXISTS hr_user CASCADE; + DROP USER IF EXISTS it_user CASCADE; + DROP USER IF EXISTS it_manager CASCADE; + + ``` + ![drops users and roles](images/a.png " ") + +3. We will next create users. To change the password for the users use the "alter user identified by "new password" command. With the syntax below for distinct users, Throughout this workshop we will use the Oracle123long password. + + ``` + + -- Create users + CREATE USER hr_user IDENTIFIED BY Oracle123long; + CREATE USER it_user IDENTIFIED BY Oracle123long; + + ``` + ![creates users](images/1a.png " ") + + + If you'd like to change the password for the individual users, you'd run the following and make sure to replace `new_password_here` with your new password(needs one uppercase letter and atleast one number). + ``` + + ALTER USER hr_user IDENTIFIED BY new_password_here; + ``` + ``` + ALTER USER hr_user IDENTIFIED BY Oracle123long; + ``` + ![changes password for hr user](images/1b.png " ") + + + This will change the password for it_user + ``` + + ALTER USER it_user IDENTIFIED BY new_password_here; + ``` + ``` + ALTER USER it_user IDENTIFIED BY Oracle123long; + ``` + ![changes password for it user](images/1c.png " ") + + + This will change the password for it_manager + ``` + + ALTER USER it_manager IDENTIFIED BY new_password_here; + ``` + ``` + ALTER USER it_manager IDENTIFIED BY Oracle123long; + ``` + ![changes password for it manager](images/1d.png " ") + +4. Now we will be granting the respective roles to the users as well as the quota for the tablespace. + ``` + + --Grant roles to user + GRANT CONNECT, RESOURCE TO hr_user, it_user, it_manager; + GRANT DWROLE TO hr_user, it_user, it_manager; + GRANT CREATE SESSION TO hr_user, it_user, it_manager; + + -- Grant quota for tablespace use + ALTER USER hr_user QUOTA UNLIMITED ON DATA; + ALTER USER it_user QUOTA UNLIMITED ON DATA; + ALTER USER it_manager QUOTA UNLIMITED ON DATA; + + ``` + ![creates and grants users and roles](images/1e.png " ") + + +5. With this next code, we will enable web access to our 3 users. + + ``` + + -- REST ENABLE FOR HR_USER + BEGIN + ORDS_ADMIN.ENABLE_SCHEMA( + p_enabled => TRUE, + p_schema => 'HR_USER', + p_url_mapping_type => 'BASE_PATH', + p_url_mapping_pattern => 'hr_user', + p_auto_rest_auth=> FALSE + ); + -- ENABLE DATA SHARING + C##ADP$SERVICE.DBMS_SHARE.ENABLE_SCHEMA( + SCHEMA_NAME => 'HR_USER', + ENABLED => TRUE + ); + commit; + END; + / + + -- REST ENABLE for IT_USER + BEGIN + ORDS_ADMIN.ENABLE_SCHEMA( + p_enabled => TRUE, + p_schema => 'IT_USER', + p_url_mapping_type => 'BASE_PATH', + p_url_mapping_pattern => 'it_user', + p_auto_rest_auth=> FALSE + ); + -- ENABLE DATA SHARING + C##ADP$SERVICE.DBMS_SHARE.ENABLE_SCHEMA( + SCHEMA_NAME => 'IT_USER', + ENABLED => TRUE + ); + commit; + END; + / + + -- REST ENABLE for IT_MANAGER + BEGIN + ORDS_ADMIN.ENABLE_SCHEMA( + p_enabled => TRUE, + p_schema => 'IT_MANAGER', + p_url_mapping_type => 'BASE_PATH', + p_url_mapping_pattern => 'it_manager', + p_auto_rest_auth=> FALSE + ); + -- ENABLE DATA SHARING + C##ADP$SERVICE.DBMS_SHARE.ENABLE_SCHEMA( + SCHEMA_NAME => 'IT_MANAGER', + ENABLED => TRUE + ); + commit; + END; + / + + ``` + ![grants users access to webconsole](images/c.png " ") + +6. Now we will create `employees`, `department` and `salary` tables. These tables will demonstarte how different levels of privilege can be applied. + + ``` + + -- Create employees and department + CREATE TABLE hr_user.employees (id NUMBER PRIMARY KEY, name VARCHAR2(50), salary NUMBER); + CREATE TABLE hr_user.departments (id NUMBER PRIMARY KEY, department_name VARCHAR2(100)); + + -- Create salary table which is sensitive and only accessible by hr_user and it_manager + CREATE TABLE hr_user.salaries (employee_id NUMBER REFERENCES hr_user.employees(id), salary NUMBER); + + -- Insert some sample data into employees and departments + INSERT INTO hr_user.employees (id, name) VALUES (1, 'John Doe'); + INSERT INTO hr_user.employees (id, name) VALUES (2, 'Sammy Smith'); + INSERT INTO hr_user.employees (id, name) VALUES (3, 'Alisa Brown'); + INSERT INTO hr_user.departments (id, department_name) VALUES (1, 'HR'); + INSERT INTO hr_user.departments (id, department_name) VALUES (2, 'IT'); + INSERT INTO hr_user.departments (id, department_name) VALUES (3, 'IT'); + + --Insert salary data into salaries table + INSERT INTO hr_user.salaries (employee_id, salary) VALUES (1, 50000); + INSERT INTO hr_user.salaries (employee_id, salary) VALUES (2, 60000); + INSERT INTO hr_user.salaries (employee_id, salary) VALUES (3, 70000); + + ``` + + ![tables created](images/d.png " ") + +## Task 3: Apply Schema-Level Privileges +1. Now, we will grant schema-level privileges. Instead of granting access to individual tables, we will allow the `hr_user` to access all current and future tables within the `hr_user` schema. Both `it_manager` and `it_user` will have access to the `employee` and `departments` tables, but no access to the `salaries` table. + + ``` + + -- Grant schema-level privileges to HR, IT, and IT Manager roles + GRANT SELECT ANY TABLE ON SCHEMA hr_user TO hr_user; + + -- IT user and It manager can access to employees and departments but not salaries + GRANT SELECT ON hr_user.employees TO it_user; + GRANT SELECT ON hr_user.departments TO it_user; + GRANT SELECT ON hr_user.employees TO it_manager; + GRANT SELECT ON hr_user.departments TO it_manager; + + ``` + + ![granting schema level privileges](images/e.png " ") + +3. Oracle Database 23ai simplifies privilege management with dedicated views. We can use views like `DBA_SCHEMA_PRIVS` to check the schema-level privileges granted to users. Others include ROLE\_SCHEMA\_PRIVS, USER\_SCHEMA\_PRIVS, and SESSION\_SCHEMA\_PRIVS. + + ``` + + SELECT * FROM DBA_SCHEMA_PRIVS WHERE GRANTEE = 'HR_USER'; + SELECT * FROM DBA_SCHEMA_PRIVS WHERE GRANTEE = 'IT_USER'; + SELECT * FROM DBA_SCHEMA_PRIVS WHERE GRANTEE = 'IT_MANAGER'; + SELECT * FROM DBA_TAB_PRIVS WHERE GRANTEE = 'IT_USER'; + SELECT * FROM DBA_TAB_PRIVS WHERE GRANTEE = 'IT_MANAGER'; + + ``` + + Since only `hr_user` has schema-level privileges, when we run `DBA_SCHEMA_PRIVS`, we see that the privilege SELECT is set to ANY. Meanwhile, since both `it_user` and `it_manager` neither have schema-level privileges, when running the same command for both they return no data found as neither has the correct privileges. It is only with `DBA_TAB_PRIVS` that we can see their privileges. + ![view privileges](images/f1.png " ") + +## Task 4: Demonstrating Schema-Level Privileges +1. To explore the new schema-level privileges, `Sign out` of the `ADMIN` account and log in as the `hr_user` user. At the login screen, enter the login credentials for the `hr_user` user: + - `USERNAME`: hr_user + - `PASSWORD`: Oracle123long + + ![signout from admin](images/16.png " ") + ![login screen for hr_user](images/7.png " ") + ![click on sql](images/8.png " ") + + +2. Schema-level privileges dynamically adapt to schema changes. When new tables or views are added to the schema, users granted schema-level access instantly gain the ability to query them without requiring any further administrative actions. With `hr_user` having schema-level privileges, they should be able to query data from `employees`, `department` and `salaries`. + + ``` + + SELECT * FROM hr_user.employees; + SELECT * FROM hr_user.departments; + SELECT * FROM hr_user.salaries; + + ``` + ![view hr user select](images/9.png " ") + +3. If successful, all the 3 tables will return data, demonstrating the schema-level privileges have been applied. Now verified, sign out of the `hr_user` session and log into `it_user`. We will see how the privileges of this user is limited when compared to hr_user. + - `USERNAME`: it_user + - `PASSWORD`: Oracle123long + + ![signout from admin](images/10.png " ") + ![login screen for hr_user](images/11.png " ") + ![click on sql](images/12.png " ") + +4. Within the SQL developer, we shall now test the restricted access. Notice that `employees` and `departments` tables shall be successful but the `salaries` will return an error. + + ``` + + SELECT * FROM hr_user.employees; + SELECT * FROM hr_user.departments; + SELECT * FROM hr_user.salaries; + + ``` + + ![it user viewing from tables](images/13.png " ") + +5. Now that this has been verified, let's return to the `Admin` account by logging out of the `it_user` session. Navigate back to the ADB screen on OCI ,click on SQL again to automatically return to the `ADMIN`. + ![signout hr_user](images/14.png " ") + ![adb sql returning to admin](images/im1.png " ") + +6. We will be granting schema-level privileges to the it_user + ``` + + -- Grant schema-level privileges directly to hr_user and it_manager + GRANT SELECT ANY TABLE ON SCHEMA hr_user TO it_user; + + SELECT * FROM DBA_SCHEMA_PRIVS WHERE GRANTEE = 'IT_USER'; + + ``` + ![grants schemalevel privileges to ituser](images/h.png " ") + +7. To show the flexibility of schema-level privileges, we will also be creating a new table called projects + + ``` + + -- Create a new table called projects + CREATE TABLE hr_user.projects ( + project_id NUMBER PRIMARY KEY, + project_name VARCHAR2(100) + ); + + -- Insert some data into projects + INSERT INTO hr_user.projects (project_id, project_name) VALUES (1, 'Project Alpha'); + INSERT INTO hr_user.projects (project_id, project_name) VALUES (2, 'Project Beta'); + + ``` + ![creating new projects table](images/I.png " ") + + +8. Now, sign out of the `ADMIN` session and log into `it_user`. We will see how the privileges of this user is limited when compared to hr_user. + - `Path` : it_user + - `USERNAME`: it_user + - `PASSWORD`: Oracle123long + + ![signout from admin](images/16.png " ") + ![login screen for hr_user](images/17.png " ") + ![click on sql](images/18.png " ") + +9. Witin `it_user` now let's view our tables. You should be able to see the 3 original tables, as well as the newest, `projects` table we created after granting `it_user` schema-level privileges. + + ``` + + SELECT * FROM hr_user.employees; + SELECT * FROM hr_user.departments; + SELECT * FROM hr_user.salaries; + SELECT * FROM hr_user.projects; + + ``` + + ![it user viewing all the tables](images/J.png " ") + +10. Sign out of the `it_user` session and log into `hr_user`. We will see how the privileges of this user is limited when compared to hr_user. + - `USERNAME`: hr_user + - `PASSWORD`: Oracle123long + + ![signout from admin](images/16.png " ") + ![login screen for hr_user](images/17.png " ") + ![click on sql](images/18.png " ") + +11. Now that we have returned to `hr_user` which was the original user with schema-level privileges, we will see how not only do we have access to the first 3 tables, we can also `SELECT` from `projects`. + ``` + + SELECT * FROM hr_user.employees; + SELECT * FROM hr_user.departments; + SELECT * FROM hr_user.salaries; + SELECT * FROM hr_user.projects; + + ``` + ![hr user viewing all the tables](images/J1.png " ") + + +12. Let's return to the `Admin` account by logging out of the `hr_user` session. Navigate back to the ADB screen on OCI ,click on SQL again to automatically return to the `ADMIN`. + ![signout from hr user](images/10.png " ") + ![adb sql returning to admin](images/im1.png " ") + +## Task 5: Revoking Schema-Level Privileges +1. As expected, we can also revoke schema-level privileges when they are no longer required. In the `ADMIN` profile, let's proceed by revoking the `SELECT` privilege that was granted to the `it_user` for the schema. + + ``` + + -- Revoke schema-level privileges from IT_USER + REVOKE SELECT ANY TABLE ON SCHEMA hr_user FROM it_user; + + ``` + ![revoking access from it user](images/M.png " ") + +2. Once the privileges have been revoked, we can verify the updated access by reviewing the remaining privileges granted to `it_user`. `DBA_SCHEMA_PRVIS` will return no data found, but `DBA_TAB_PRIVS` will show that our original privileges are still there. + ``` + + SELECT * FROM DBA_SCHEMA_PRIVS WHERE GRANTEE = 'IT_USER'; + + ``` + ![showing schema level priv is gone](images/N.png " ") + + ``` + + SELECT * FROM DBA_TAB_PRIVS WHERE GRANTEE = 'IT_USER'; + + ``` + ![showing table level priv is back to normal](images/O.png " ") + +3. We will `Sign out` of ADMIN account and switch to it_user account. At the login screen, enter the login credentials we set up for the it_user user. + - `USERNAME`: it_user + - `PASSWORD`: Oracle123long + + ![signout admin](images/24.png " ") + ![login to hr_user](images/25.png " ") + +4. Now we will see that our schema-level privileges have been revoked. `it_user` will not be able to `SELECT` from all the tables as before, only `employees` and `department` which were originally granted. + + ``` + + SELECT * FROM hr_user.employees; + SELECT * FROM hr_user.departments; + SELECT * FROM hr_user.salaries; + SELECT * FROM hr_user.projects; + + ``` + ![view output ](images/P.png " ") + +5. Let's return to the `Admin` account by logging out of the `it_user` session. Navigate back to the ADB screen on OCI ,click on SQL again to automatically return to the `ADMIN`. + ![signout hr_user](images/28.png " ") + ![adb sql returning to admin](images/im1.png " ") + +## Task 6: Cleanup +1. Finally, let's clean up the environment by dropping the the users, roles, and objects created + + ``` + + -- Drop users, roles, and related objects + DROP USER IF EXISTS hr_user CASCADE; + DROP USER IF EXISTS it_user CASCADE; + DROP USER IF EXISTS it_manager CASCADE; + DROP ROLE IF EXISTS hr_user; + DROP ROLE IF EXISTS it_user; + DROP ROLE IF EXISTS it_manager; + + ``` + + ![drop the users and roles](images/29.png " ") + +## Task 7: Understanding Advanced Privilege Management +1. You can also grant schema-level privileges on schemas that do not belong to the current user. However, doing this requires additonal permissions such as `GRANT ANY SCHEMA PRIVILEGE`, which allows you to grant privileges on other users' schemas. + +2. Throughout this lab, you've explored how schema-level privilege management simplifies user access control in Oracle Database 23ai. By using schema-level privileges, you can drastically reduce the management and administration needed to grant schema privileges prior to 23ai and improve security through their use. + +You may now **proceed to the next lab** + +## Learn More + +- [Oracle Database 23ai Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/index.html) +- [Oracle Blog - Exploring Schema-Level Privileges](https://blogs.oracle.com/cloudsecurity/post/schemalevel-privilege-grants-with-database-23c) + +## Acknowledgements +* **Author** - Killian Lynch, Database Product Management +* **Contributors** - Dom Giles, Distinguished Database Product Manager, Francis Regalado, Database Product Manager +* **Last Updated By/Date** - Francis Regalado, Database Product Manager October 2024 diff --git a/db-23ai-fundamentals/new-shrink-tablespace/images/simple-db-actions.png b/db-23ai-fundamentals/new-shrink-tablespace/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-shrink-tablespace/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-shrink-tablespace/new-shrink-tablespace.md b/db-23ai-fundamentals/new-shrink-tablespace/new-shrink-tablespace.md index 75851ec75..37118dcc5 100644 --- a/db-23ai-fundamentals/new-shrink-tablespace/new-shrink-tablespace.md +++ b/db-23ai-fundamentals/new-shrink-tablespace/new-shrink-tablespace.md @@ -15,6 +15,15 @@ The objective of this lab is to show you the `shrink_tablespace` procedure in Or ## Task 1: Understanding the need for tablespace shrinkage +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. + ![click SQL](images/im1.png =50%x*) + + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) + 1. Before we jump into the process of using the `shrink_tablespace` procedure, let's understand why reclaiming unused space in tablespaces is important. Unused or free space within tablespaces can grow over time, reducing database efficiency and performance. Shrinking tablespaces helps optimize database resource utilization by reclaiming unused space. The `shrink_tablespace` procedure provides a convenient solution for resizing data files and organizing objects. diff --git a/db-23ai-fundamentals/new-sql-analysis-report/images/simple-db-actions.png b/db-23ai-fundamentals/new-sql-analysis-report/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-sql-analysis-report/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-sql-analysis-report/new-sql-analysis-report.md b/db-23ai-fundamentals/new-sql-analysis-report/new-sql-analysis-report.md index d901a1c7e..35c01ed72 100644 --- a/db-23ai-fundamentals/new-sql-analysis-report/new-sql-analysis-report.md +++ b/db-23ai-fundamentals/new-sql-analysis-report/new-sql-analysis-report.md @@ -18,8 +18,14 @@ The objective of this lab is to show you the SQL Analysis Report feature in Orac ## Task 1: Lab setup and understanding SQL Analysis Reports -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. - ![click SQL](images/im1.png " ") +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. + ![click SQL](images/im1.png =50%x*) + + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) 2. SQL Analysis Reports provide insights and suggestions for SQL queries. These reports show potential issues, such as Cartesian products, expensive operations, and inefficient use of hints, to help you optimize your queries for better performance. SQL analysis is enabled by default. diff --git a/db-23ai-fundamentals/new-sql-firewall/images/simple-db-actions.png b/db-23ai-fundamentals/new-sql-firewall/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-sql-firewall/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-sql-firewall/new-sql-firewall.md b/db-23ai-fundamentals/new-sql-firewall/new-sql-firewall.md index a9281612d..e1d4fcdbf 100644 --- a/db-23ai-fundamentals/new-sql-firewall/new-sql-firewall.md +++ b/db-23ai-fundamentals/new-sql-firewall/new-sql-firewall.md @@ -17,8 +17,12 @@ The objective of this workshop is to familiarize you with the SQL Firewall featu ## Task 1: Enabling SQL Firewall -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. - ![click SQL](images/im1.png " ") +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. + ![click SQL](images/im1.png =50%x*) + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) 2. For this lab, we'll create two new users, 'TEST' and 'DB23AI' and grant necessary roles including SQL\_FIREWALL\_ADMIN and the developer role respectively. @@ -200,8 +204,11 @@ The objective of this workshop is to familiarize you with the SQL Firewall featu WHERE username = 'DB23AI'; ``` + ![review capture logs](images/im12.png " ") + Remember we are capturing everything. We are going to see the statements we ran as well as the things we clicked on inside of database actions, like signing in and out of our user. + 2. Check the allow list, which will initially be empty. ``` diff --git a/db-23ai-fundamentals/new-table-value-clause/images/simple-db-actions.png b/db-23ai-fundamentals/new-table-value-clause/images/simple-db-actions.png new file mode 100644 index 000000000..0022fa3c4 Binary files /dev/null and b/db-23ai-fundamentals/new-table-value-clause/images/simple-db-actions.png differ diff --git a/db-23ai-fundamentals/new-table-value-clause/new-table-value-clause.md b/db-23ai-fundamentals/new-table-value-clause/new-table-value-clause.md index abb2c797a..d59407d79 100644 --- a/db-23ai-fundamentals/new-table-value-clause/new-table-value-clause.md +++ b/db-23ai-fundamentals/new-table-value-clause/new-table-value-clause.md @@ -15,9 +15,15 @@ The objective of this lab is to familiarize you with the table value constructor ## Task 1: Lab setup -1. From the Autonomous Database home page, **click** Database action and then **click** SQL. - ![click SQL](images/im1.png " ") - +1. If you haven't done so already, from the Autonomous Database home page, **click** Database action and then **click** SQL. + ![click SQL](images/im1.png =50%x*) + + Using the ADMIN user isn’t typically advised due to the high level of access and security concerns it poses. **However**, for this demo, we’ll use it to simplify the setup and ensure we can show the full range of features effectively. + +2. Before we begin, this lab will be using Database Actions Web. If you're unfamiliar, please see the picture below for a simple explanation of the tool. You can click on the photo to enlarge it. + + ![click SQL](images/simple-db-actions.png =50%x*) + 2. Let's create some tables to use in the lab. Copy and run the following SQL script: ``` diff --git a/db-23ai-fundamentals/workshops/ocw24-sandbox/manifest.json b/db-23ai-fundamentals/workshops/ocw24-sandbox/manifest.json index 1bc282776..a547e8b18 100644 --- a/db-23ai-fundamentals/workshops/ocw24-sandbox/manifest.json +++ b/db-23ai-fundamentals/workshops/ocw24-sandbox/manifest.json @@ -28,7 +28,7 @@ "title": "Lab 3: JSON Duality Views", "description": "Building Duality Views", "type": "livelabs", - "filename": "../../new-duality-views/new-duality-views-ocw24.md" + "filename": "../../new-duality-views/new-duality-views-updated.md" }, { "title": "Lab 4: Property Graphs", diff --git a/heatwave-genai/connect-dbs-vscode/connect-dbs-vscode.md b/heatwave-genai/connect-dbs-vscode/connect-dbs-vscode.md new file mode 100644 index 000000000..09565179a --- /dev/null +++ b/heatwave-genai/connect-dbs-vscode/connect-dbs-vscode.md @@ -0,0 +1,161 @@ +# Connect to the HeatWave Instance + +## Introduction + +In this lab you will setup MySQL Shell for Visual Studio Code, and connect to the HeatWave instance you created in Lab 1 from VS Code. + +_Estimated Time:_ 30 minutes + +### Objectives + +In this lab, you will be guided through the following tasks: + +- Setup MySQL Shell for Visual Studio Code. +- Connect to the OCI tenancy. +- Connect to the HeatWave instance. + +### Prerequisites + +- You have completed Lab 2. +- Visual Studio Code is installed. If you do not have it installed, download and install from [here](https://code.visualstudio.com/download). + +## Task 1: Setup MySQL Shell for Visual Studio Code + +1. Launch **Visual Studio Code**. + +2. Click **Extensions** and search for **MySQL Shell for VS Code**. + +3. Click **Install**. + ![Installing MySQL Shell for VS Code](./images/1-installing-mysql-shell-for-vscode.png "Installing MySQL Shell for VS Code") + +4. After MySQL Shell for VS Code is installed, you can see the following icon: + ![MySQL Shell installed](./images/2-installed-mysql-shell-for-vscode.png "MySQL Shell installed") + + + + +## Task 2: Connect to the HeatWave instance + +1. In Visual Studio Code, click the **MySQL Shell for VS Code** icon in the activity bar. + +2. Click **Create New DB Connection**. + + ![Create New DB Connection](./images/connect-database.png "Create New DB Connection") + +3. In the **Database Connection Configuration** dialog, enter/select the following: + + - **Database Type**: **MySQL** + + - **Caption**: + + ```bash + heatwave-genai-db-connection + ``` + +4. Under **Connection Details**, in the **Basic** tab, enter the following: + + - **Hostname or IP Address**: Private IP address of the DB system that you had noted in Lab 1, Task 5, Step 19. + + - **User Name**: + + ```bash + admin + ``` + + - **Tunneling Options**: Select **Connect Using SSH Tunnel**. + + ![Database Connection Configuration](./images/database-connection-details.png "Database Connection Configuration") + +5. Click **Store Passsword**, and enter the password. + + ![Enter password](./images/password.png "Enter password") + +6. Under **Connection Details**, click **SSH Tunnel**. + + ![Click SSH tunnel](./images/ssh-tunnel.png "Click SSH tunnel") + +7. Enter the following details: + + - **SSH URI**: opc@ComputeIPAddress. Replace ComputeIPAddress with the IP address of the compute that you had noted in Lab 2, Task 1, Step 13. + + - **SSH Private Key File**: Browse to the SSH folder and select the SSH key + + - **Custom Path for the SSH Configuration File**: Browse to the SSH folder and select the SSH key + + ![SSH details](./images/ssh-details.png "SSH details") + +8. Click **OK**. + +9. Under **DATABASE CONNECTIONS**, click **Open New Database Connection** icon next to your HeatWave instance to connect to it. + + ![Open New Database Connection](./images/open-connection.png "Open New Database Connection") + +10. Click **Yes** to confirm your connection request. + + ![Confirm New Database Connection](./images/confrm-connection.png "Confirm New Database Connection") + +11. Check whether you are connected to the HeatWave instance by entering the following command and clicking **Execute the selection or full block on HeatWave and create a new block**. + + ```bash + show databases; + ``` + + ![New Database Connection](./images/12-show-databases.png "New Database Connection") + +You may now **proceed to the next lab**. + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 \ No newline at end of file diff --git a/heatwave-genai/connect-dbs-vscode/images/1-cloud-account-name.png b/heatwave-genai/connect-dbs-vscode/images/1-cloud-account-name.png new file mode 100644 index 000000000..10a14eb92 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/1-cloud-account-name.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/1-installing-mysql-shell-for-vscode.png b/heatwave-genai/connect-dbs-vscode/images/1-installing-mysql-shell-for-vscode.png new file mode 100644 index 000000000..4454660e7 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/1-installing-mysql-shell-for-vscode.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/10-database-connection.png b/heatwave-genai/connect-dbs-vscode/images/10-database-connection.png new file mode 100644 index 000000000..1f24ca9f4 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/10-database-connection.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/11-load-llm.png b/heatwave-genai/connect-dbs-vscode/images/11-load-llm.png new file mode 100644 index 000000000..3cff76a81 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/11-load-llm.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/11-open-database-connection.png b/heatwave-genai/connect-dbs-vscode/images/11-open-database-connection.png new file mode 100644 index 000000000..c47ce29c8 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/11-open-database-connection.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/12-llm-response.png b/heatwave-genai/connect-dbs-vscode/images/12-llm-response.png new file mode 100644 index 000000000..06526c595 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/12-llm-response.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/12-show-databases.png b/heatwave-genai/connect-dbs-vscode/images/12-show-databases.png new file mode 100644 index 000000000..319a50582 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/12-show-databases.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/13-summarize-query.png b/heatwave-genai/connect-dbs-vscode/images/13-summarize-query.png new file mode 100644 index 000000000..e4df6e7ac Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/13-summarize-query.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/14-llm-summarize.png b/heatwave-genai/connect-dbs-vscode/images/14-llm-summarize.png new file mode 100644 index 000000000..7f1e8ecd6 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/14-llm-summarize.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/15-identity-domain.png b/heatwave-genai/connect-dbs-vscode/images/15-identity-domain.png new file mode 100644 index 000000000..6ed41588d Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/15-identity-domain.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/16-default-identity-domain.png b/heatwave-genai/connect-dbs-vscode/images/16-default-identity-domain.png new file mode 100644 index 000000000..a220b8d56 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/16-default-identity-domain.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/17-oci-api-key.png b/heatwave-genai/connect-dbs-vscode/images/17-oci-api-key.png new file mode 100644 index 000000000..316178621 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/17-oci-api-key.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/18-new-connection.png b/heatwave-genai/connect-dbs-vscode/images/18-new-connection.png new file mode 100644 index 000000000..25996f3eb Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/18-new-connection.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/2-installed-mysql-shell-for-vscode.png b/heatwave-genai/connect-dbs-vscode/images/2-installed-mysql-shell-for-vscode.png new file mode 100644 index 000000000..883e97342 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/2-installed-mysql-shell-for-vscode.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/2-username.png b/heatwave-genai/connect-dbs-vscode/images/2-username.png new file mode 100644 index 000000000..2eaf7c993 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/2-username.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/3-profile.png b/heatwave-genai/connect-dbs-vscode/images/3-profile.png new file mode 100644 index 000000000..c708d0b35 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/3-profile.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/4-add-api-key.png b/heatwave-genai/connect-dbs-vscode/images/4-add-api-key.png new file mode 100644 index 000000000..e5d3e575f Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/4-add-api-key.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/5-copy-config.png b/heatwave-genai/connect-dbs-vscode/images/5-copy-config.png new file mode 100644 index 000000000..d633fe097 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/5-copy-config.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/6-save-config.png b/heatwave-genai/connect-dbs-vscode/images/6-save-config.png new file mode 100644 index 000000000..dd9fdc56d Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/6-save-config.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/7-tenancy-details.png b/heatwave-genai/connect-dbs-vscode/images/7-tenancy-details.png new file mode 100644 index 000000000..273bab794 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/7-tenancy-details.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/8-create-bastion.png b/heatwave-genai/connect-dbs-vscode/images/8-create-bastion.png new file mode 100644 index 000000000..b2fb4a2cd Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/8-create-bastion.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/9-create-new-bastion.png b/heatwave-genai/connect-dbs-vscode/images/9-create-new-bastion.png new file mode 100644 index 000000000..fbb41d136 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/9-create-new-bastion.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/confrm-connection.png b/heatwave-genai/connect-dbs-vscode/images/confrm-connection.png new file mode 100644 index 000000000..6e8a5d3b7 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/confrm-connection.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/connect-database.png b/heatwave-genai/connect-dbs-vscode/images/connect-database.png new file mode 100644 index 000000000..fd926889e Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/connect-database.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/database-connection-details.png b/heatwave-genai/connect-dbs-vscode/images/database-connection-details.png new file mode 100644 index 000000000..146a1839e Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/database-connection-details.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/open-connection.png b/heatwave-genai/connect-dbs-vscode/images/open-connection.png new file mode 100644 index 000000000..69ff8259d Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/open-connection.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/password.png b/heatwave-genai/connect-dbs-vscode/images/password.png new file mode 100644 index 000000000..b76a36612 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/password.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/ssh-details.png b/heatwave-genai/connect-dbs-vscode/images/ssh-details.png new file mode 100644 index 000000000..dd7a08de9 Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/ssh-details.png differ diff --git a/heatwave-genai/connect-dbs-vscode/images/ssh-tunnel.png b/heatwave-genai/connect-dbs-vscode/images/ssh-tunnel.png new file mode 100644 index 000000000..0b632d55d Binary files /dev/null and b/heatwave-genai/connect-dbs-vscode/images/ssh-tunnel.png differ diff --git a/heatwave-genai/create-compute/create-compute.md b/heatwave-genai/create-compute/create-compute.md new file mode 100644 index 000000000..0c0dfc42d --- /dev/null +++ b/heatwave-genai/create-compute/create-compute.md @@ -0,0 +1,94 @@ +# Create Linux Compute Instance + + +## Introduction + +Oracle Cloud Infrastructure Compute lets you provision and manage compute hosts, known as instances . You can create instances as needed to meet your compute and application requirements. After you create an instance, you can access it securely from your computer or cloud shell. + + +**Create Linux Compute Instance** + +In this lab, you use Oracle Cloud Infrastructure to create an Oracle Linux instance. + +_Estimated Time:_ 10 minutes + +### Objectives + +In this lab, you will be guided through the following tasks: + +- Create Compute Instance + +### Prerequisites + +- An Oracle Free Tier or Paid Cloud Account +- You have completed Lab 2. + +## Task 1: Create Compute Instance + +You need a compute instance to connect to the Heatwave instance. + +1. Click the **Navigation menu** in the upper left, navigate to **Compute**, and under **Compute**, select **Instances**. + + ![Click compute](./images/click-compute.png "Click compute") + +2. Ensure **heatwave-genai** compartment is selected, and click click **Create instance**. + + ![Create instance](./images/create-instance.png "Create instance") + +3. On **Create compute instance** page, enter the name of the compute instance. + + ```bash + heatwave-genai-compute + ``` + +4. Ensure **heatwave-genai** compartment is selected. + + ![Compute instance name](./images/compute-name.png "Compute instance name") + +5. In the **Placement** field, keep the selected **Availability Domain**. + +6. In the **Image and Shape** field, keep the selected image, **Oracle Linux 8**, and the default shape. + + ![Compute image and shape](./images/compute-image-shape.png "Compute image and shape") + +7. In **Primary VNIC information** field, ensure the following settings are selected: + + - **Primary Network**: **heatwave-genai-vcn** + + - **Subnet**: **public-subnet-heatwave-genai-vcn** + +8. In **Primary VNIC IP addresses** field, ensure the following settings are selected: + + - **Private IPv4 address**: **Automatically assign private IPv4 address** + + - **Public IPv4 address**: Selected + + ![Network settings](./images/networking.png "Network settings") + +9. In **Add SSH keys** field, click **Generate a key pair for me**. + + ![Add SSH Keys](./images/ssh-keys.png "Add SSH Keys") + +10. Save the downloaded SSH keys in your .ssh folder. and rename the key. For example: + + ```bash + ssh-key-2024 + ``` + + ![Save SSH keys](./images/ssh-key-store.png "Save SSH Keys") + +11. Click '**Create**' to create your compute instance. + +12. The compute instance will be ready to use after a few minutes. The state is shown as **Provisioning** while the instance is creating. + +13. When the compute instance is ready to use, the state is shown as **Running**. *Note* the **Public IP address** and the **Username**. + + ![Compute instance is created](./images/compute.png "Compute instance is created") + +You may now **proceed to the next lab**. + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, September 2024 diff --git a/heatwave-genai/create-compute/images/00-mds-image.png b/heatwave-genai/create-compute/images/00-mds-image.png new file mode 100644 index 000000000..581019360 Binary files /dev/null and b/heatwave-genai/create-compute/images/00-mds-image.png differ diff --git a/heatwave-genai/create-compute/images/05compute-id-rsa-paste.png b/heatwave-genai/create-compute/images/05compute-id-rsa-paste.png new file mode 100644 index 000000000..76c5b69f4 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute-id-rsa-paste.png differ diff --git a/heatwave-genai/create-compute/images/05compute-shape-old.png b/heatwave-genai/create-compute/images/05compute-shape-old.png new file mode 100644 index 000000000..41efe7df0 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute-shape-old.png differ diff --git a/heatwave-genai/create-compute/images/05compute-shape.png b/heatwave-genai/create-compute/images/05compute-shape.png new file mode 100644 index 000000000..7d9c3b97c Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute-shape.png differ diff --git a/heatwave-genai/create-compute/images/05compute01.png b/heatwave-genai/create-compute/images/05compute01.png new file mode 100644 index 000000000..8850f7d16 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute01.png differ diff --git a/heatwave-genai/create-compute/images/05compute02-00.png b/heatwave-genai/create-compute/images/05compute02-00.png new file mode 100644 index 000000000..f839c597a Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute02-00.png differ diff --git a/heatwave-genai/create-compute/images/05compute02.png b/heatwave-genai/create-compute/images/05compute02.png new file mode 100644 index 000000000..239fe9f36 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute02.png differ diff --git a/heatwave-genai/create-compute/images/05compute03-old.png b/heatwave-genai/create-compute/images/05compute03-old.png new file mode 100644 index 000000000..50baefd81 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute03-old.png differ diff --git a/heatwave-genai/create-compute/images/05compute03.png b/heatwave-genai/create-compute/images/05compute03.png new file mode 100644 index 000000000..58129fc89 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute03.png differ diff --git a/heatwave-genai/create-compute/images/05compute04.png b/heatwave-genai/create-compute/images/05compute04.png new file mode 100644 index 000000000..92a7822e7 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute04.png differ diff --git a/heatwave-genai/create-compute/images/05compute05.png b/heatwave-genai/create-compute/images/05compute05.png new file mode 100644 index 000000000..20f1628b0 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute05.png differ diff --git a/heatwave-genai/create-compute/images/05compute06.png b/heatwave-genai/create-compute/images/05compute06.png new file mode 100644 index 000000000..533f8648a Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute06.png differ diff --git a/heatwave-genai/create-compute/images/05compute07.png b/heatwave-genai/create-compute/images/05compute07.png new file mode 100644 index 000000000..ddc61c563 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute07.png differ diff --git a/heatwave-genai/create-compute/images/05compute08-a.png b/heatwave-genai/create-compute/images/05compute08-a.png new file mode 100644 index 000000000..9ac9e1d68 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute08-a.png differ diff --git a/heatwave-genai/create-compute/images/05compute08-b.png b/heatwave-genai/create-compute/images/05compute08-b.png new file mode 100644 index 000000000..f3caceac0 Binary files /dev/null and b/heatwave-genai/create-compute/images/05compute08-b.png differ diff --git a/heatwave-genai/create-compute/images/06connect01-signin.png b/heatwave-genai/create-compute/images/06connect01-signin.png new file mode 100644 index 000000000..2e6978b2f Binary files /dev/null and b/heatwave-genai/create-compute/images/06connect01-signin.png differ diff --git a/heatwave-genai/create-compute/images/06connect02-shell.png b/heatwave-genai/create-compute/images/06connect02-shell.png new file mode 100644 index 000000000..d83fc8380 Binary files /dev/null and b/heatwave-genai/create-compute/images/06connect02-shell.png differ diff --git a/heatwave-genai/create-compute/images/06connect02.png b/heatwave-genai/create-compute/images/06connect02.png new file mode 100644 index 000000000..90a4ebfce Binary files /dev/null and b/heatwave-genai/create-compute/images/06connect02.png differ diff --git a/heatwave-genai/create-compute/images/cat-in-cloudshell.png b/heatwave-genai/create-compute/images/cat-in-cloudshell.png new file mode 100644 index 000000000..65337e80b Binary files /dev/null and b/heatwave-genai/create-compute/images/cat-in-cloudshell.png differ diff --git a/heatwave-genai/create-compute/images/cat.png b/heatwave-genai/create-compute/images/cat.png new file mode 100644 index 000000000..ae5dd81d9 Binary files /dev/null and b/heatwave-genai/create-compute/images/cat.png differ diff --git a/heatwave-genai/create-compute/images/click-compute.png b/heatwave-genai/create-compute/images/click-compute.png new file mode 100644 index 000000000..2e95a5578 Binary files /dev/null and b/heatwave-genai/create-compute/images/click-compute.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell-10.png b/heatwave-genai/create-compute/images/cloudshell-10.png new file mode 100644 index 000000000..2180d63cf Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell-10.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell-11.png b/heatwave-genai/create-compute/images/cloudshell-11.png new file mode 100644 index 000000000..1b1e45a36 Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell-11.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell-ssh-keygen-2.png b/heatwave-genai/create-compute/images/cloudshell-ssh-keygen-2.png new file mode 100644 index 000000000..10327d481 Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell-ssh-keygen-2.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell-ssh-keygen.png b/heatwave-genai/create-compute/images/cloudshell-ssh-keygen.png new file mode 100644 index 000000000..4917d817c Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell-ssh-keygen.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell-ssh.png b/heatwave-genai/create-compute/images/cloudshell-ssh.png new file mode 100644 index 000000000..56b5de96f Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell-ssh.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell.png b/heatwave-genai/create-compute/images/cloudshell.png new file mode 100644 index 000000000..916c2c374 Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell.png differ diff --git a/heatwave-genai/create-compute/images/cloudshell01.png b/heatwave-genai/create-compute/images/cloudshell01.png new file mode 100644 index 000000000..14133ebfc Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshell01.png differ diff --git a/heatwave-genai/create-compute/images/cloudshellopen.png b/heatwave-genai/create-compute/images/cloudshellopen.png new file mode 100644 index 000000000..b6d8cc183 Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshellopen.png differ diff --git a/heatwave-genai/create-compute/images/cloudshellsetup.png b/heatwave-genai/create-compute/images/cloudshellsetup.png new file mode 100644 index 000000000..00645e882 Binary files /dev/null and b/heatwave-genai/create-compute/images/cloudshellsetup.png differ diff --git a/heatwave-genai/create-compute/images/compute-image-shape.png b/heatwave-genai/create-compute/images/compute-image-shape.png new file mode 100644 index 000000000..5254673bc Binary files /dev/null and b/heatwave-genai/create-compute/images/compute-image-shape.png differ diff --git a/heatwave-genai/create-compute/images/compute-name.png b/heatwave-genai/create-compute/images/compute-name.png new file mode 100644 index 000000000..a430e5ca7 Binary files /dev/null and b/heatwave-genai/create-compute/images/compute-name.png differ diff --git a/heatwave-genai/create-compute/images/compute.png b/heatwave-genai/create-compute/images/compute.png new file mode 100644 index 000000000..903109092 Binary files /dev/null and b/heatwave-genai/create-compute/images/compute.png differ diff --git a/heatwave-genai/create-compute/images/copy-cat.png b/heatwave-genai/create-compute/images/copy-cat.png new file mode 100644 index 000000000..e0e16156d Binary files /dev/null and b/heatwave-genai/create-compute/images/copy-cat.png differ diff --git a/heatwave-genai/create-compute/images/copy-publickey-cloudshell.png b/heatwave-genai/create-compute/images/copy-publickey-cloudshell.png new file mode 100644 index 000000000..5fe304f71 Binary files /dev/null and b/heatwave-genai/create-compute/images/copy-publickey-cloudshell.png differ diff --git a/heatwave-genai/create-compute/images/create-instance.png b/heatwave-genai/create-compute/images/create-instance.png new file mode 100644 index 000000000..419238805 Binary files /dev/null and b/heatwave-genai/create-compute/images/create-instance.png differ diff --git a/heatwave-genai/create-compute/images/db-active.png b/heatwave-genai/create-compute/images/db-active.png new file mode 100644 index 000000000..8e28c0d99 Binary files /dev/null and b/heatwave-genai/create-compute/images/db-active.png differ diff --git a/heatwave-genai/create-compute/images/db-list.png b/heatwave-genai/create-compute/images/db-list.png new file mode 100644 index 000000000..077046146 Binary files /dev/null and b/heatwave-genai/create-compute/images/db-list.png differ diff --git a/heatwave-genai/create-compute/images/examine-cloudshell-keys.png b/heatwave-genai/create-compute/images/examine-cloudshell-keys.png new file mode 100644 index 000000000..bdd777221 Binary files /dev/null and b/heatwave-genai/create-compute/images/examine-cloudshell-keys.png differ diff --git a/heatwave-genai/create-compute/images/green-compute-vcn.png b/heatwave-genai/create-compute/images/green-compute-vcn.png new file mode 100644 index 000000000..54a78ba10 Binary files /dev/null and b/heatwave-genai/create-compute/images/green-compute-vcn.png differ diff --git a/heatwave-genai/create-compute/images/green-configure-vcn.png b/heatwave-genai/create-compute/images/green-configure-vcn.png new file mode 100644 index 000000000..f27ee0795 Binary files /dev/null and b/heatwave-genai/create-compute/images/green-configure-vcn.png differ diff --git a/heatwave-genai/create-compute/images/heatwave-load-01-shell.png b/heatwave-genai/create-compute/images/heatwave-load-01-shell.png new file mode 100644 index 000000000..b73b6bc7e Binary files /dev/null and b/heatwave-genai/create-compute/images/heatwave-load-01-shell.png differ diff --git a/heatwave-genai/create-compute/images/ls.png b/heatwave-genai/create-compute/images/ls.png new file mode 100644 index 000000000..772f545f0 Binary files /dev/null and b/heatwave-genai/create-compute/images/ls.png differ diff --git a/heatwave-genai/create-compute/images/mkdir.png b/heatwave-genai/create-compute/images/mkdir.png new file mode 100644 index 000000000..58c389628 Binary files /dev/null and b/heatwave-genai/create-compute/images/mkdir.png differ diff --git a/heatwave-genai/create-compute/images/networking.png b/heatwave-genai/create-compute/images/networking.png new file mode 100644 index 000000000..201db8d01 Binary files /dev/null and b/heatwave-genai/create-compute/images/networking.png differ diff --git a/heatwave-genai/create-compute/images/notepad-rsa-key-1.png b/heatwave-genai/create-compute/images/notepad-rsa-key-1.png new file mode 100644 index 000000000..f7949c0d2 Binary files /dev/null and b/heatwave-genai/create-compute/images/notepad-rsa-key-1.png differ diff --git a/heatwave-genai/create-compute/images/notepad-rsa-key-compute-mds-1.png b/heatwave-genai/create-compute/images/notepad-rsa-key-compute-mds-1.png new file mode 100644 index 000000000..f9ba98e31 Binary files /dev/null and b/heatwave-genai/create-compute/images/notepad-rsa-key-compute-mds-1.png differ diff --git a/heatwave-genai/create-compute/images/notepad1.png b/heatwave-genai/create-compute/images/notepad1.png new file mode 100644 index 000000000..027e349ac Binary files /dev/null and b/heatwave-genai/create-compute/images/notepad1.png differ diff --git a/heatwave-genai/create-compute/images/notepad2-old.png b/heatwave-genai/create-compute/images/notepad2-old.png new file mode 100644 index 000000000..e17872046 Binary files /dev/null and b/heatwave-genai/create-compute/images/notepad2-old.png differ diff --git a/heatwave-genai/create-compute/images/notepad2.png b/heatwave-genai/create-compute/images/notepad2.png new file mode 100644 index 000000000..4cdd8d7a6 Binary files /dev/null and b/heatwave-genai/create-compute/images/notepad2.png differ diff --git a/heatwave-genai/create-compute/images/see-IP-address.png b/heatwave-genai/create-compute/images/see-IP-address.png new file mode 100644 index 000000000..f48751769 Binary files /dev/null and b/heatwave-genai/create-compute/images/see-IP-address.png differ diff --git a/heatwave-genai/create-compute/images/ssh-details.png b/heatwave-genai/create-compute/images/ssh-details.png new file mode 100644 index 000000000..f8c18f311 Binary files /dev/null and b/heatwave-genai/create-compute/images/ssh-details.png differ diff --git a/heatwave-genai/create-compute/images/ssh-key-store.png b/heatwave-genai/create-compute/images/ssh-key-store.png new file mode 100644 index 000000000..2ea9cd8e7 Binary files /dev/null and b/heatwave-genai/create-compute/images/ssh-key-store.png differ diff --git a/heatwave-genai/create-compute/images/ssh-key01.png b/heatwave-genai/create-compute/images/ssh-key01.png new file mode 100644 index 000000000..722879314 Binary files /dev/null and b/heatwave-genai/create-compute/images/ssh-key01.png differ diff --git a/heatwave-genai/create-compute/images/ssh-keys.png b/heatwave-genai/create-compute/images/ssh-keys.png new file mode 100644 index 000000000..18182c1f1 Binary files /dev/null and b/heatwave-genai/create-compute/images/ssh-keys.png differ diff --git a/heatwave-genai/create-compute/images/ssh-ls-01.png b/heatwave-genai/create-compute/images/ssh-ls-01.png new file mode 100644 index 000000000..d88ff20e6 Binary files /dev/null and b/heatwave-genai/create-compute/images/ssh-ls-01.png differ diff --git a/heatwave-genai/create-compute/images/sshkeygen.png b/heatwave-genai/create-compute/images/sshkeygen.png new file mode 100644 index 000000000..248ca839f Binary files /dev/null and b/heatwave-genai/create-compute/images/sshkeygen.png differ diff --git a/heatwave-genai/create-heatwave/create-heatwave.md b/heatwave-genai/create-heatwave/create-heatwave.md new file mode 100644 index 000000000..da4f18d3d --- /dev/null +++ b/heatwave-genai/create-heatwave/create-heatwave.md @@ -0,0 +1,255 @@ +# Create a HeatWave instance + +## Introduction + +In this lab, you will create a create a compartment, a Virtual Cloud Network, and a Heatwave instance. + +_Estimated Time:_ 30 minutes + +### Objectives + +In this lab, you will be guided through the following tasks: + +- Create compartment. +- Create Virtual Cloud Network. +- Configure security list to allow incoming connections. +- Configure security list to allow HTTP incoming connections. +- Create a HeatWave instance. + +### Prerequisites + +- An Oracle trial or paid cloud account. +- Some experience with MySQL Shell. +- You have logged into the OCI Console using the default identity domain. + +## Task 1: Create Compartment + +1. Click the **Navigation menu** in the upper left, navigate to **Identity & Security**, and under **Identity**, select **Compartments**. + + ![Select compartment](./images/1-select-compartment.png "Select compartment") + +2. On the Compartments page, click **Create Compartment**. + +3. In the **Create Compartment** dialog box, enter the following: + + **Name**: + + ```bash + heatwave-genai + ``` + + **Description**: + + ```bash + Compartment for HeatWave GenAI + ``` + +5. Click **Create Compartment**. + + ![Create a compartment](./images/2-create-compartment.png "Create a compartment") + +## Task 2: Create Virtual Cloud Network + +1. Click the **Navigation menu** in the upper left, navigate to **Networking**, and select **Virtual cloud networks**. + + ![Select VCN](./images/3-select-vcn.png "Select VCN") + +2. Under **Compartment**, select **heatwave-genai**, and Click **Start VCN Wizard**. + + ![Start VCN Wizard](./images/4-start-vcn-wizard.png "Start VCN Wizard ") + +3. In the **Start VCN Wizard** dialog box, select **Create VCN with Internet Connectivity**, and click **Start VCN Wizard**. + + ![Start VCN Wizard](./images/5-start-vcn-wizard-dialog-box.png "Start VCN Wizard ") + +4. Under **Basic information**, provide a **VCN name**: + + ```bash + heatwave-genai-vcn + ``` + + 5. Ensure that **heatwave-genai** compartment is selected, and click **Next**. + + ![VCN configuration](./images/6-create-vcn-internet-connectivity.png "VCN configuration") + +6. Review Oracle Virtual Cloud Network (VCN), Subnets, and Gateways, and click **Create**. + + ![Create VCN](./images/7-create-vcn.png "Create VCN") + +7. When the Virtual Cloud Network is created, click **View VCN** to display the created VCN. + + ![View VCN](./images/8-view-vcn.png "View VCN") + +## Task 3: Configure security list to allow incoming connections + +1. On the **heatwave-genai-vcn** page, under **Subnets**, click **private subnet-heatwave-genai-vcn**. + + ![Show subnet details](./images/9-heatwave-genai-vcn-subnets.png "Show subnet details") + +2. On **private subnet-heatwave-genai-vcn** page, under **Security Lists**, click **security List for private subnet-heatwave-vcn**. + + ![Select security lists](./images/10-select-security-list.png "Select security lists") + +3. On the **security list for private subnet-heatwave-genai-vcn** page, under **Ingress Rules**, click **Add Ingress Rules**. + + ![Add ingress rules](./images/11-add-ingress-rules.png "Add ingress rules") + +4. On **Add Ingress Rules** panel, enter the following, and click **Add Ingress Rules**: + + **Source CIDR**: + + ```bash + 0.0.0.0/0 + ``` + + **Destination Port Range**: + + ```bash + 3306,33060 + ``` + + ![Ingress rules](./images/12-enter-ingress-rules.png "Ingress rules") + +5. On **security list for private subnet-heatwave-genai-vcn** page, the new ingress rules are shown under **Ingress Rules**. + + ![New ingress rules](./images/13-new-ingress-rules.png "New ingress rules") + +## Task 4: Configure security list to allow HTTP incoming connections + +1. Click the **Navigation menu** in the upper left, navigate to **Networking**, and select **Virtual cloud networks**. + + ![Select VCN](./images/3-select-vcn.png "Select VCN") + +2. Under **Compartment**, ensure **heatwave-genai** is selected, and click the VCN you created, **heatwave-genai-vcn**. + + ![Select VCN](./images/14-select-vcn.png "Select VCN") + +3. On the **heatwave-genai-vcn** page, under **Subnets**, click **public subnet-heatwave-genai-vcn**. + + ![Select public subnet](./images/15-public-subnet.png "Select public subnet") + +4. Click **Default Security List for heatwave-genai-vcn**. + + ![Default security list](./images/16-default-security-list.png "Default security list") + +5. On **Default Security List for heatwave-genai-vcn** page, under **Ingress Rules**, click **Add Ingress Rules**. + + ![Add ingress rules in default security list](./images/17-add-ingress-rules-default-security-list.png "Add ingress rules in default security list") + +6. On **Add Ingress Rules** panel, enter the following, and click **Add Ingress Rules**: + + **Source CIDR**: + + ```bash + 0.0.0.0/0 + ``` + + **Destination Port Range**: + + ```bash + 80,443 + ``` + + ![Ingress rules](./images/18-enter-ingess-rules-default-security-list.png "Ingress rules") + +7. On **Default Security List for heatwave-genai-vcn** page, the new ingress rules are shown under **Ingress Rules**. + + ![New ingress rules](./images/19-new-ingress-rules-default-security-list.png "New ingress rules") + +## Task 5: Create a HeatWave instance + +1. Click the **Navigation menu** in the upper left, navigate to **Databases**, and under **HeatWave**, select **DB Systems**. + + ![Select HeatWave DB System](./images/20-select-heatwave-db-system.png "Select HeatWave DB System") + +2. Ensure that **heatwave-genai** compartment is selected, and click **Create DB system**. + + ![Create DB system](./images/21-create-dbs.png "Create DB system") + +3. In the **Create DB system** panel, select **Development or Testing**. + +4. Under **Create in compartment**, ensure **heatwave-genai** is selected, and enter a name for the DB system. + + **Name**: + + ```bash + heatwave-genai-dbs + ``` + +5. Enter the administrator credentials. *Note* the administrator credentials as you will need them to connect to the DB system. + + ![HeatWave DB system details](./images/22-create-dbs-admin.png "HeatWave DB system details") + +6. Select **Standalone** instance, and select the VCN, **heatwave-genai-vcn**, and private subnet, **private subnet-heatwave-genai-vcn**, which you created earlier. + + ![Configure networking](./images/23-configure-networking.png "Configure networking") + +7. Let the **Configure placement** settings remain as is. + +8. Under **Configure hardware**, select **Enable HeatWave cluster**, and click **Change shape**. + + ![Change shape](./images/24-change-shape.png "Change shape") + +9. In the **Browse all shapes** page, ensure the compute model is **ECPU**, select **MySQL.32** shape, and click **Select a shape**. The ECPU Shape of the DB system must be MySQL.32. + + ![Select MySQL.32 shape](./images/25-select-mysql-32.png "Select MySQL.32 shape") + +10. Click **Configure HeatWave cluster**. + + ![Configure HeatWave cluster](./images/26-configure-heatwave-cluster.png "Configure HeatWave cluster") + +11. In **Configure HeatWave cluster** page, click **Change shape**. + + ![Change HeatWave shape](./images/27-change-heatwave-shape.png "Change Heatwave shape") + +12. In the **Browse all shapes** page, select **HeatWave.512** shape, and click **Select a shape**. The HeatWave Shape must be HeatWave.512. + + ![Change HeatWave shape](./images/28-select-heatwave-512.png "Change Heatwave shape") + +13. Select **HeatWave Lakehouse**, and click **Save changes**. HeatWave Lakehouse must be enabled on the DB system. + + ![Enable Lakehouse](./images/29-enable-lakehouse.png "Enable Lakehouse") + +14. Click **Show advanced options**. + +15. Go to the **Configuration** tab, and under **Database version**, select version **9.0.0 - Innovation** or higher version. + + ![Select database innovation version](./images/31-innovation-version.png "Select database innovation version") + +16. Go to the **Connections** tab, enter the **Hostname**, which is same as DB system name, and click **Create**: + + **Hostname**: + + ```bash + heatwave-genai-dbs + ``` + + ![HeatWave hostname](./images/32-heatwave-hostname.png "HeatWave hostname") + +17. While the DB system is created, the state is shown as **CREATING**. + + ![Show creating state](./images/33-dbs-creating.png "Show creating state") + +18. The new DB system will be ready to use after a few minutes. The state **ACTIVE** indicates that the DB system is ready for use. + + ![Show active state](./images/34-dbs-active.png "Show active state") + +19. In the **Connections** tab, note the **Private IP address** of the DB system, which is the HeatWave endpoint. + + ![Heatwave endpoint](./images/35-heatwave-endpoint.png "Heatwave endpoint") + +You may now **proceed to the next lab**. + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 diff --git a/heatwave-genai/create-heatwave/images/1-select-compartment.png b/heatwave-genai/create-heatwave/images/1-select-compartment.png new file mode 100644 index 000000000..10f68c5d1 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/1-select-compartment.png differ diff --git a/heatwave-genai/create-heatwave/images/10-select-security-list.png b/heatwave-genai/create-heatwave/images/10-select-security-list.png new file mode 100644 index 000000000..2481facac Binary files /dev/null and b/heatwave-genai/create-heatwave/images/10-select-security-list.png differ diff --git a/heatwave-genai/create-heatwave/images/11-add-ingress-rules.png b/heatwave-genai/create-heatwave/images/11-add-ingress-rules.png new file mode 100644 index 000000000..92a309766 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/11-add-ingress-rules.png differ diff --git a/heatwave-genai/create-heatwave/images/12-enter-ingress-rules.png b/heatwave-genai/create-heatwave/images/12-enter-ingress-rules.png new file mode 100644 index 000000000..ffd606367 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/12-enter-ingress-rules.png differ diff --git a/heatwave-genai/create-heatwave/images/13-new-ingress-rules.png b/heatwave-genai/create-heatwave/images/13-new-ingress-rules.png new file mode 100644 index 000000000..60c77e62e Binary files /dev/null and b/heatwave-genai/create-heatwave/images/13-new-ingress-rules.png differ diff --git a/heatwave-genai/create-heatwave/images/14-select-vcn.png b/heatwave-genai/create-heatwave/images/14-select-vcn.png new file mode 100644 index 000000000..5924ad2a8 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/14-select-vcn.png differ diff --git a/heatwave-genai/create-heatwave/images/15-public-subnet.png b/heatwave-genai/create-heatwave/images/15-public-subnet.png new file mode 100644 index 000000000..f4827103f Binary files /dev/null and b/heatwave-genai/create-heatwave/images/15-public-subnet.png differ diff --git a/heatwave-genai/create-heatwave/images/16-default-security-list.png b/heatwave-genai/create-heatwave/images/16-default-security-list.png new file mode 100644 index 000000000..0307c6e75 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/16-default-security-list.png differ diff --git a/heatwave-genai/create-heatwave/images/17-add-ingress-rules-default-security-list.png b/heatwave-genai/create-heatwave/images/17-add-ingress-rules-default-security-list.png new file mode 100644 index 000000000..5bb0a7c02 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/17-add-ingress-rules-default-security-list.png differ diff --git a/heatwave-genai/create-heatwave/images/18-enter-ingess-rules-default-security-list.png b/heatwave-genai/create-heatwave/images/18-enter-ingess-rules-default-security-list.png new file mode 100644 index 000000000..3807c5619 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/18-enter-ingess-rules-default-security-list.png differ diff --git a/heatwave-genai/create-heatwave/images/19-new-ingress-rules-default-security-list.png b/heatwave-genai/create-heatwave/images/19-new-ingress-rules-default-security-list.png new file mode 100644 index 000000000..c0d158e85 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/19-new-ingress-rules-default-security-list.png differ diff --git a/heatwave-genai/create-heatwave/images/2-create-compartment.png b/heatwave-genai/create-heatwave/images/2-create-compartment.png new file mode 100644 index 000000000..02644cbb7 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/2-create-compartment.png differ diff --git a/heatwave-genai/create-heatwave/images/20-select-heatwave-db-system.png b/heatwave-genai/create-heatwave/images/20-select-heatwave-db-system.png new file mode 100644 index 000000000..d35a137a3 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/20-select-heatwave-db-system.png differ diff --git a/heatwave-genai/create-heatwave/images/21-create-dbs.png b/heatwave-genai/create-heatwave/images/21-create-dbs.png new file mode 100644 index 000000000..1b4d47716 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/21-create-dbs.png differ diff --git a/heatwave-genai/create-heatwave/images/22-create-dbs-admin.png b/heatwave-genai/create-heatwave/images/22-create-dbs-admin.png new file mode 100644 index 000000000..1d720d387 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/22-create-dbs-admin.png differ diff --git a/heatwave-genai/create-heatwave/images/23-configure-networking.png b/heatwave-genai/create-heatwave/images/23-configure-networking.png new file mode 100644 index 000000000..690beae47 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/23-configure-networking.png differ diff --git a/heatwave-genai/create-heatwave/images/24-change-shape.png b/heatwave-genai/create-heatwave/images/24-change-shape.png new file mode 100644 index 000000000..1e1644f47 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/24-change-shape.png differ diff --git a/heatwave-genai/create-heatwave/images/25-select-mysql-32.png b/heatwave-genai/create-heatwave/images/25-select-mysql-32.png new file mode 100644 index 000000000..883733138 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/25-select-mysql-32.png differ diff --git a/heatwave-genai/create-heatwave/images/26-configure-heatwave-cluster.png b/heatwave-genai/create-heatwave/images/26-configure-heatwave-cluster.png new file mode 100644 index 000000000..992292e85 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/26-configure-heatwave-cluster.png differ diff --git a/heatwave-genai/create-heatwave/images/27-change-heatwave-shape.png b/heatwave-genai/create-heatwave/images/27-change-heatwave-shape.png new file mode 100644 index 000000000..e884a1e3f Binary files /dev/null and b/heatwave-genai/create-heatwave/images/27-change-heatwave-shape.png differ diff --git a/heatwave-genai/create-heatwave/images/28-select-heatwave-512.png b/heatwave-genai/create-heatwave/images/28-select-heatwave-512.png new file mode 100644 index 000000000..81838fa67 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/28-select-heatwave-512.png differ diff --git a/heatwave-genai/create-heatwave/images/29-enable-lakehouse.png b/heatwave-genai/create-heatwave/images/29-enable-lakehouse.png new file mode 100644 index 000000000..d6b218877 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/29-enable-lakehouse.png differ diff --git a/heatwave-genai/create-heatwave/images/3-select-vcn.png b/heatwave-genai/create-heatwave/images/3-select-vcn.png new file mode 100644 index 000000000..9844352d2 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/3-select-vcn.png differ diff --git a/heatwave-genai/create-heatwave/images/30-database-version.png b/heatwave-genai/create-heatwave/images/30-database-version.png new file mode 100644 index 000000000..c9d7ed89a Binary files /dev/null and b/heatwave-genai/create-heatwave/images/30-database-version.png differ diff --git a/heatwave-genai/create-heatwave/images/31-innovation-version.png b/heatwave-genai/create-heatwave/images/31-innovation-version.png new file mode 100644 index 000000000..809227a33 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/31-innovation-version.png differ diff --git a/heatwave-genai/create-heatwave/images/32-heatwave-hostname.png b/heatwave-genai/create-heatwave/images/32-heatwave-hostname.png new file mode 100644 index 000000000..ef91e9f82 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/32-heatwave-hostname.png differ diff --git a/heatwave-genai/create-heatwave/images/33-dbs-creating.png b/heatwave-genai/create-heatwave/images/33-dbs-creating.png new file mode 100644 index 000000000..c6e8f3c61 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/33-dbs-creating.png differ diff --git a/heatwave-genai/create-heatwave/images/34-dbs-active.png b/heatwave-genai/create-heatwave/images/34-dbs-active.png new file mode 100644 index 000000000..2f008051c Binary files /dev/null and b/heatwave-genai/create-heatwave/images/34-dbs-active.png differ diff --git a/heatwave-genai/create-heatwave/images/35-heatwave-endpoint.png b/heatwave-genai/create-heatwave/images/35-heatwave-endpoint.png new file mode 100644 index 000000000..33195c53b Binary files /dev/null and b/heatwave-genai/create-heatwave/images/35-heatwave-endpoint.png differ diff --git a/heatwave-genai/create-heatwave/images/36-private-ip-address.png b/heatwave-genai/create-heatwave/images/36-private-ip-address.png new file mode 100644 index 000000000..49284c8ad Binary files /dev/null and b/heatwave-genai/create-heatwave/images/36-private-ip-address.png differ diff --git a/heatwave-genai/create-heatwave/images/4-start-vcn-wizard.png b/heatwave-genai/create-heatwave/images/4-start-vcn-wizard.png new file mode 100644 index 000000000..390f3cab0 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/4-start-vcn-wizard.png differ diff --git a/heatwave-genai/create-heatwave/images/5-start-vcn-wizard-dialog-box.png b/heatwave-genai/create-heatwave/images/5-start-vcn-wizard-dialog-box.png new file mode 100644 index 000000000..56c74b6a4 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/5-start-vcn-wizard-dialog-box.png differ diff --git a/heatwave-genai/create-heatwave/images/6-create-vcn-internet-connectivity.png b/heatwave-genai/create-heatwave/images/6-create-vcn-internet-connectivity.png new file mode 100644 index 000000000..41a25f25c Binary files /dev/null and b/heatwave-genai/create-heatwave/images/6-create-vcn-internet-connectivity.png differ diff --git a/heatwave-genai/create-heatwave/images/7-create-vcn.png b/heatwave-genai/create-heatwave/images/7-create-vcn.png new file mode 100644 index 000000000..41c229040 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/7-create-vcn.png differ diff --git a/heatwave-genai/create-heatwave/images/8-view-vcn.png b/heatwave-genai/create-heatwave/images/8-view-vcn.png new file mode 100644 index 000000000..26a6661bf Binary files /dev/null and b/heatwave-genai/create-heatwave/images/8-view-vcn.png differ diff --git a/heatwave-genai/create-heatwave/images/9-heatwave-genai-vcn-subnets.png b/heatwave-genai/create-heatwave/images/9-heatwave-genai-vcn-subnets.png new file mode 100644 index 000000000..cc53fb044 Binary files /dev/null and b/heatwave-genai/create-heatwave/images/9-heatwave-genai-vcn-subnets.png differ diff --git a/heatwave-genai/develop-app/develop-app.md b/heatwave-genai/develop-app/develop-app.md new file mode 100644 index 000000000..657a10ae1 --- /dev/null +++ b/heatwave-genai/develop-app/develop-app.md @@ -0,0 +1,424 @@ +# Build HeatWave RAG Chat Application + +## Introduction + +HeatWave seamlessly integrates with existing Oracle services, such as Oracle Analytics Cloud, making it ideal for development tasks. Additionally, you can use HeatWave to create new applications using the LAMP stack (Linux, Apache, MySQL, PHP) or other software stacks. + +In this lab you will build a LAMP stack and deploy a prebuilt HeatWave RAG Chat Application. The application is designed to make interacting with HeatWave GenAI Retrieval-Augmented Generation (RAG) capabilities straightforward and user-friendly. + +### Objectives + +In this lab, you will be guided through the following tasks: + +- Connect to compute instance using VS Code and SSH +- Install Apache Server. +- Install PHP. +- Create HeatWave/PHP connect test app. +- Deploy HeatWave RAG chat application. +- Test HeatWave RAG chat application. + +### Prerequisites + +- Completed Lab 5. + +### About the HeatWave RAG Chat Application + +This application provides a user-friendly web interface for interacting with HeatWave GenAI Retrieval-Augmented Generation (RAG) capabilities. It enables you to ask questions and receive AI-generated responses based on the information stored in HeatWave. + +#### HeatWave RAG Chat Application Architecture Diagram + +The following diagram provides details of how the different components of the HeatWave RAG chat application are structured and how they interact with each other. The arrows indicate the flow of data and interactions between the components. For example: + +- The web browser interacts with the web server. +- The PHP Runtime manages the chat interface and HeatWave RAG class. +- The HeatWave RAG class interacts with the HeatWave instance. +- The chat interface interacts with the PHP session for storing chat history. + + ![Chat application architecture](./images/chat-app-flow.png "Chat application architecture") + +#### Key Features + +- Simple Web Interface: Easy-to-use chat interface for asking questions and viewing responses. +- RAG Integration: Utilizes MySQL HeatWave's RAG functionality to generate informed responses. +- Chat History: Maintains a session-based chat history for continuous conversations. +- Citation Display: Shows relevant citations for the AI's responses, enhancing transparency and trustworthiness. +- Clear History Option: Allows users to reset the chat history as needed. + +#### Overview + +- Backend: Linux, Apache, PHP, and HeatWave integration +- Frontend: HTML and CSS for a responsive design +- Data Storage: HeatWave Lakehouse and HeatWave for vector embeddings and RAG processing + +This solution bridges the gap between complex database operations and user-friendly interaction, making it easy for users to leverage the power of HeatWave GenAI capabilities through a simple chat interface. + +_Note:_ This application code is intended for educational purposes only. It is designed to help developers learn and practice application development skills with HeatWave on OCI. The code is not designed to be used in a production environment. + +_Estimated Time:_ 20 minutes + +## Task 1: Connect to Compute instance using VS Code and SSH + +1. In Visual Studio Code, in the menu bar, click **Terminal**, and then **New Terminal**. + + ![New terminal](./images/new-terminal.png "New terminal") + +2. Click **Maximize Panel Size** to set the terminal to full screen. + + ![Maximize panel size](./images/maximize-panel.png "Maximize panel") + +3. Connect to the compute instance from the terminal using SSH. + + ```bash + ssh -i ~/.ssh/ opc@ + ``` + - You had stored the ssh keys in Lab 2, Task 1, Step 10. + - You had noted the public IP address o the compute instance in Lab 2, Task 1, Step 13. + + For example: + + ```bash + ssh -i ~/.ssh/ssh-key-2024.key opc@129.153.218.143 + ``` + ![SSH compute](./images/ssh-compute.png "SSH compute") + +## Task 2: Install Apache App Server + +1. Using Visual Studio Code, install Apache app server. + + ```bash + sudo yum install httpd -y + ``` + ![Install Apache](./images/install-apache.png "Install Apache") + +2. Enable Apache. + + ```bash + sudo systemctl enable httpd + ``` + +3. Start Apache. + + ```bash + sudo systemctl restart httpd + ``` + +4. Setup firewall. + + ```bash + sudo firewall-cmd --permanent --add-port=80/tcp + ``` + +5. Reload firewall. + + ```bash + sudo firewall-cmd --reload + ``` + + ![Start Apache](./images/start-apache.png "Start Apache") + +6. From a web browser, test apache from your local machine using the public IP address of your compute instance. You had noted the public IP address of the compute instance in Lab 2, Task 1, Step 13. + + ```bash + http:// + ``` + For example: + + http://129.153.218.143 + + ![Test Apache](./images/test-apache.png "Test Apache") + +## Task 3: Install PHP + +1. Using Visual Studio Code, install PHP 7.4. + + ```bash + sudo dnf module install php:7.4 -y + ``` + + ![Install PHP](./images/install-php.png "Install PHP") + +2. Install associated PHP libraries. + + ```bash + sudo yum install php-cli php-mysqlnd php-zip php-gd php-mbstring php-xml php-json -y + ``` + + ![Install PHP libraries](./images/install-php-libraries.png "Install PHP libraries") + +3. View PHP/MySQL libraries. + + ```bash + php -m |grep mysql + ``` + +4. View PHP version. + + ```bash + php -v + ``` + +5. Restart Apache application server. + + ```bash + sudo systemctl restart httpd + ``` + + ![View PHP libraries](./images/view-php-libraries.png "View PHP libraries") + +6. Create the test PHP file, info.php. + + ```bash + sudo nano /var/www/html/info.php + ``` + ![Edit info.php](./images/edit-info-php.png "Edit info.php") + +7. Paste the following code in the info.php file. + + ```bash + + ``` + + ![Paste code](./images/paste-info-php.png "Paste code") + +8. Click ctrl+O, followed by **Enter** to save the file. + +9. Click ctrl+X to exit the editor. + +10. From a web browser, test the info.php file. + + ```bash + http:///info.php + ``` + For example: + + http://129.153.218.143/info.php + + ![Info.php page output](./images/output-info-php.png "Info.php page output") + +## Task 4: Create HeatWave/PHP Connect Test App + +1. Using Visual Studio Code, allow Apache application server to connect to the HeatWave instance. + + ```bash + sudo setsebool -P httpd_can_network_connect 1 + ``` + ![Allow Apache application](./images/allow-apache.png "Allow Apache application") + +2. Create config.php file. + + ```bash + sudo nano /var/www/html/config.php + ``` + +3. Paste the following code in the config.php file. + + ```bash + + + ``` + + ![Paste config.php](./images/paste-config-php.png "Paste config.php") + +5. Update the following: + + - DB_SERVER: Specify the IP address of the HeatWave instance. + - DB_USERNAME: Specify administrator username, **admin**, which you had provided in Lab 1, Task 5, Step 5. + - DB_PASSWORD: Specify the password, which you had provided in Lab 1, Task 5, Step 5. + - DB_NAME: Specify the schema, **genai-db**, which you had provided in Lab 5, Task 6, Step 2. + + ![config.php](./images/config-php.png "config.php") + +6. Click ctrl+O, followed by **Enter** to save the file. + +7. Click ctrl+X to exit the editor. + +8. From a web browser, test the config.php file. You should be able to connect to the HeatWave instance. + + ```bash + http:///config.php + ``` + For example: + + http://129.153.218.143/config.php + + ![config.php page output](./images/output-config-php.png "config.php page output") + +9. Create the dbtest.php file. + + ```bash + sudo nano /var/www/html/dbtest.php + ``` + ![dbtest.php](./images/dbtest.png "dbtest.php") + +10. Paste the following code in the dbtest.php file. + + ```bash + + prepare($query)) { + $stmt->execute(); + $stmt->bind_result($user); + echo ""; + echo ""; + echo ""; + echo ""; + + while ($stmt->fetch()) { + echo ""; + echo ""; + echo ""; + } + + $stmt->close(); + } + ?> + + ``` + + ![Update dbtest.php](./images/paste-dbtest-php.png "Update dbtest.php") + +11. Click ctrl+O, followed by **Enter** to save the file. + +12. Click ctrl+X to exit the editor. + +13. From a web browser, test the dbtest.php file. You should be able to see the MySQL users in the instance. + + ```bash + http:///dbtest.php + ``` + For example: + + http://129.153.218.143/dbtest.php + + ![dbtest.php page output](./images/output-dbtest-php.png "dbtest.php page output") + +## Task 5: Deploy HeatWave RAG Chat Application + +1. Go to the development folder. + + ```bash + cd /var/www/html + ``` + +2. Download the application code. + + ```bash + sudo wget https://objectstorage.us-ashburn-1.oraclecloud.com/p/r73t2H8D425uNocg2E22-B_2vfPXG86Opsfdb6CGglaiw6Zy7IRyFdfBbOe93qXF/n/mysqlpm/b/mysql_gen_ai/o/php-rag-chat-app/app.zip + ``` + ![Download application code](./images/application-code.png "Download application code") + +3. Unzip the application code. + + ```bash + sudo unzip app.zip + ``` +4. Go to the app folder. + + ```bash + cd app + ``` + +5. View the files in the application folder. + + ```bash + ls -l + ``` + + You should see the following two files: + + - chat_interface.php + - HeatWaveRAG.php + +6. Open the chat_interface.php file. + + ```bash + sudo nano chat_interface.php + ``` + + ![Chat interface](./images/chat-interface-php.png "Chat interface") + +7. Locate the following line in the chat_interface.php file: + + ```bash + "$rag = new HeatWaveRAG('your_mysql_host', 'your_username', 'your_password', 'genai_db');" + ``` + ![Provide your administrator details](./images/rag-replace.png "Provide your administrator details") + +8. Replace the following: + + - **your\_mysql\_host**: Specify the IP address of the HeatWave instance, **heatwave-genai-db**. For example, 10.0.0.123. + - **your\_username**: Specify the username you had used for the Heatwave instance. If you arefollowing the lab instructions, specify **admin**. + - **your\_password**: Specify the pasword you used when creating the HeatWave instance. + + Note to not change **genai\_db** as it is the schema name that we had specified for the vector store. + + ![Updated chat interace](./images/updated-chat-interface.png "Updated chat interace") + +## Task 6: Test HeatWave RAG Chat Application + +1. From your web browser, access the chat_interface.php. + + ```bash + http:///app/chat_interface.php) + ``` + + For example: + + http://129.153.218.143/app/chat_interface.php + +2. You'll see a chat interface with a text input field. + + ![Input field](./images/input-field.png "Input field") + +3. Type your question into the input field and click **Send** or **Enter**. + + For example: + + - What is HeatWave AutoML? + - What is MySQL? + - Is HeatWave available on AWS? + + The application will send your query to the HeatWave RAG system and display the response along with any relevant citations. Your chat history will be maintained across page reloads using PHP sessions. + + ![Enter your questions](./images/queries.png "Enter your questions") + +5. To clear the chat history, click **Clear Chat History**. + +You may now **proceed to the next lab**. + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + +You may now **proceed to the next lab**. + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Perside Foster, MySQL Principal Solution Engineer +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, September 2024 \ No newline at end of file diff --git a/heatwave-genai/develop-app/images/allow-apache.png b/heatwave-genai/develop-app/images/allow-apache.png new file mode 100644 index 000000000..405d3b663 Binary files /dev/null and b/heatwave-genai/develop-app/images/allow-apache.png differ diff --git a/heatwave-genai/develop-app/images/application-code.png b/heatwave-genai/develop-app/images/application-code.png new file mode 100644 index 000000000..5cce0a6ef Binary files /dev/null and b/heatwave-genai/develop-app/images/application-code.png differ diff --git a/heatwave-genai/develop-app/images/chat-app-flow.png b/heatwave-genai/develop-app/images/chat-app-flow.png new file mode 100644 index 000000000..b25a4e8d5 Binary files /dev/null and b/heatwave-genai/develop-app/images/chat-app-flow.png differ diff --git a/heatwave-genai/develop-app/images/chat-interface-php.png b/heatwave-genai/develop-app/images/chat-interface-php.png new file mode 100644 index 000000000..451973326 Binary files /dev/null and b/heatwave-genai/develop-app/images/chat-interface-php.png differ diff --git a/heatwave-genai/develop-app/images/config-connect.png b/heatwave-genai/develop-app/images/config-connect.png new file mode 100644 index 000000000..9bc918a60 Binary files /dev/null and b/heatwave-genai/develop-app/images/config-connect.png differ diff --git a/heatwave-genai/develop-app/images/config-php.png b/heatwave-genai/develop-app/images/config-php.png new file mode 100644 index 000000000..fae19f742 Binary files /dev/null and b/heatwave-genai/develop-app/images/config-php.png differ diff --git a/heatwave-genai/develop-app/images/create-config-php.png b/heatwave-genai/develop-app/images/create-config-php.png new file mode 100644 index 000000000..3a4c845fb Binary files /dev/null and b/heatwave-genai/develop-app/images/create-config-php.png differ diff --git a/heatwave-genai/develop-app/images/dbtest.png b/heatwave-genai/develop-app/images/dbtest.png new file mode 100644 index 000000000..2fbfb585b Binary files /dev/null and b/heatwave-genai/develop-app/images/dbtest.png differ diff --git a/heatwave-genai/develop-app/images/edit-info-php.png b/heatwave-genai/develop-app/images/edit-info-php.png new file mode 100644 index 000000000..5b06311cd Binary files /dev/null and b/heatwave-genai/develop-app/images/edit-info-php.png differ diff --git a/heatwave-genai/develop-app/images/input-field.png b/heatwave-genai/develop-app/images/input-field.png new file mode 100644 index 000000000..73a47207b Binary files /dev/null and b/heatwave-genai/develop-app/images/input-field.png differ diff --git a/heatwave-genai/develop-app/images/install-apache.png b/heatwave-genai/develop-app/images/install-apache.png new file mode 100644 index 000000000..e8799c0de Binary files /dev/null and b/heatwave-genai/develop-app/images/install-apache.png differ diff --git a/heatwave-genai/develop-app/images/install-php-libraries.png b/heatwave-genai/develop-app/images/install-php-libraries.png new file mode 100644 index 000000000..080874aca Binary files /dev/null and b/heatwave-genai/develop-app/images/install-php-libraries.png differ diff --git a/heatwave-genai/develop-app/images/install-php.png b/heatwave-genai/develop-app/images/install-php.png new file mode 100644 index 000000000..0ab8fc30d Binary files /dev/null and b/heatwave-genai/develop-app/images/install-php.png differ diff --git a/heatwave-genai/develop-app/images/maximize-panel.png b/heatwave-genai/develop-app/images/maximize-panel.png new file mode 100644 index 000000000..af0d103f7 Binary files /dev/null and b/heatwave-genai/develop-app/images/maximize-panel.png differ diff --git a/heatwave-genai/develop-app/images/new-terminal.png b/heatwave-genai/develop-app/images/new-terminal.png new file mode 100644 index 000000000..c8de9e532 Binary files /dev/null and b/heatwave-genai/develop-app/images/new-terminal.png differ diff --git a/heatwave-genai/develop-app/images/output-config-php.png b/heatwave-genai/develop-app/images/output-config-php.png new file mode 100644 index 000000000..16ae4aa18 Binary files /dev/null and b/heatwave-genai/develop-app/images/output-config-php.png differ diff --git a/heatwave-genai/develop-app/images/output-dbtest-php.png b/heatwave-genai/develop-app/images/output-dbtest-php.png new file mode 100644 index 000000000..bc1cc9e51 Binary files /dev/null and b/heatwave-genai/develop-app/images/output-dbtest-php.png differ diff --git a/heatwave-genai/develop-app/images/output-info-php.png b/heatwave-genai/develop-app/images/output-info-php.png new file mode 100644 index 000000000..16f0ee187 Binary files /dev/null and b/heatwave-genai/develop-app/images/output-info-php.png differ diff --git a/heatwave-genai/develop-app/images/paste-config-php.png b/heatwave-genai/develop-app/images/paste-config-php.png new file mode 100644 index 000000000..51e008e0b Binary files /dev/null and b/heatwave-genai/develop-app/images/paste-config-php.png differ diff --git a/heatwave-genai/develop-app/images/paste-dbtest-php.png b/heatwave-genai/develop-app/images/paste-dbtest-php.png new file mode 100644 index 000000000..3daaa2f3e Binary files /dev/null and b/heatwave-genai/develop-app/images/paste-dbtest-php.png differ diff --git a/heatwave-genai/develop-app/images/paste-info-php.png b/heatwave-genai/develop-app/images/paste-info-php.png new file mode 100644 index 000000000..5924ba554 Binary files /dev/null and b/heatwave-genai/develop-app/images/paste-info-php.png differ diff --git a/heatwave-genai/develop-app/images/queries.png b/heatwave-genai/develop-app/images/queries.png new file mode 100644 index 000000000..f89205a55 Binary files /dev/null and b/heatwave-genai/develop-app/images/queries.png differ diff --git a/heatwave-genai/develop-app/images/rag-app-list.png b/heatwave-genai/develop-app/images/rag-app-list.png new file mode 100644 index 000000000..000fc8788 Binary files /dev/null and b/heatwave-genai/develop-app/images/rag-app-list.png differ diff --git a/heatwave-genai/develop-app/images/rag-app.png b/heatwave-genai/develop-app/images/rag-app.png new file mode 100644 index 000000000..48dc0e68e Binary files /dev/null and b/heatwave-genai/develop-app/images/rag-app.png differ diff --git a/heatwave-genai/develop-app/images/rag-replace.png b/heatwave-genai/develop-app/images/rag-replace.png new file mode 100644 index 000000000..33217876f Binary files /dev/null and b/heatwave-genai/develop-app/images/rag-replace.png differ diff --git a/heatwave-genai/develop-app/images/ssh-compute.png b/heatwave-genai/develop-app/images/ssh-compute.png new file mode 100644 index 000000000..b2f1f4bbc Binary files /dev/null and b/heatwave-genai/develop-app/images/ssh-compute.png differ diff --git a/heatwave-genai/develop-app/images/start-apache.png b/heatwave-genai/develop-app/images/start-apache.png new file mode 100644 index 000000000..1e6431205 Binary files /dev/null and b/heatwave-genai/develop-app/images/start-apache.png differ diff --git a/heatwave-genai/develop-app/images/test-apache.png b/heatwave-genai/develop-app/images/test-apache.png new file mode 100644 index 000000000..557517b66 Binary files /dev/null and b/heatwave-genai/develop-app/images/test-apache.png differ diff --git a/heatwave-genai/develop-app/images/updated-chat-interface.png b/heatwave-genai/develop-app/images/updated-chat-interface.png new file mode 100644 index 000000000..55f0dbd04 Binary files /dev/null and b/heatwave-genai/develop-app/images/updated-chat-interface.png differ diff --git a/heatwave-genai/develop-app/images/view-php-libraries.png b/heatwave-genai/develop-app/images/view-php-libraries.png new file mode 100644 index 000000000..d9044e0fa Binary files /dev/null and b/heatwave-genai/develop-app/images/view-php-libraries.png differ diff --git a/heatwave-genai/generate-content/generate-content.md b/heatwave-genai/generate-content/generate-content.md new file mode 100644 index 000000000..926b8f9c8 --- /dev/null +++ b/heatwave-genai/generate-content/generate-content.md @@ -0,0 +1,100 @@ +# Use HeatWave in-database LLM to Generate and Summarize Content + +## Introduction + +HeatWave GenAI supports two in-database large language models (LLM): mistral-7b-instruct-v1 and llama2-7b-v1. You can use any of these models to generate response or summarize. + +_Estimated Time:_ 10 minutes + +### Objectives + +In this lab, you will be guided through the following task: + +- Generate response using in-database LLMs. +- Summarize text using in-database LLMs. + +### Prerequisites + +- Must complete Lab 3. + + +## Task 1: Generate response using in-database LLMs + +1. Load the LLM in HeatWave, and click **Execute the selection or full block on HeatWave and create a new block**: + + - To load mistral-7b-instruct-v1 model: + + ```bash + call sys.ML_MODEL_LOAD('mistral-7b-instruct-v1', NULL); + ``` + + ![Load LLMs](./images/1-load-llm.png "Load LLMs") + +2. Set the @query session variable with your query in natural language, and click **Enter**. + + ```bash + set @query=""; + ``` + + For example: + + ```bash + set @query="What is the use of generative AI in 200 words"; + ``` +3. Generate the response from LLM by entering the following command and click **Execute the selection or full block on HeatWave and create a new block**: + + ```bash + select sys.ML_GENERATE(@query, JSON_OBJECT("task", "generation", "model_id", "mistral-7b-instruct-v1")); + ``` + + ![Generate response](./images/2-generate-response.png "Generate response") + +4. HeatWave GenAI generates a response using the in-database LLMs. + + ![HeatWave GenAI output](./images/3-llm-ouput.png "HeatWave GenAI output") + +## Task 2: Summarize text using in-database LLMs + +1. Define the text that you want to summarize, and click **Enter**: + + ```bash + set @text=""; + ``` + + For example: + ```bash + set @text="Artificial Intelligence (AI) is an ever-expanding field that holds immense potential to transform our societal and professional landscapes. AI pertains to the creation of computer systems capable of simulating human intelligence to carry out tasks such as visual perception, speech recognition, decision-making, and language translation. A significant stride in AI development is the ascension of machine learning, a segment of AI that empowers computers to glean insights from data without explicit programming. By analyzing copious amounts of data and recognizing patterns, machine learning algorithms are becoming increasingly proficient at forecasting outcomes and making decisions. The integration of AI is already underway across diverse industries, ranging from healthcare and finance to transportation. In the healthcare sector, AI is playing a pivotal role in crafting personalized treatment plans for patients based on their unique medical history and genetic composition. In finance, AI is instrumental in detecting fraudulent activities and offering investment advice. Furthermore, in transportation, AI is driving advancements in self-driving vehicle technology and optimizing traffic management systems. Despite the manifold advantages associated with AI, there exist apprehensions regarding its potential societal impact. Some express concern about the possibility of AI leading to job displacement, as machines become more adept at performing tasks traditionally undertaken by humans. Additionally, there are worries about the potential malicious applications of AI technology."; + ``` + + ![Define text to summarize](./images/4-define-text-to-summarize.png "Define text to summarize") + +2. Generate the summarized text by entering the following command and click **Execute the selection or full block on HeatWave and create a new block**: + + ```bash + select sys.ML_GENERATE(@text, JSON_OBJECT("task", "summarization","model_id", "mistral-7b-instruct-v1")); + ``` + + ![Summarize text](./images/5-summarize-text.png "Summarize text") + + 3. LLM generates a summary of your text: + + ![Summarized text](./images/6-summarized-text.png "Summarized text") + + +You may now **proceed to the next lab**. + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager, Aijaz Fatima, Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 + diff --git a/heatwave-genai/generate-content/images/1-load-llm.png b/heatwave-genai/generate-content/images/1-load-llm.png new file mode 100644 index 000000000..b159908ac Binary files /dev/null and b/heatwave-genai/generate-content/images/1-load-llm.png differ diff --git a/heatwave-genai/generate-content/images/2-generate-response.png b/heatwave-genai/generate-content/images/2-generate-response.png new file mode 100644 index 000000000..8b18e316b Binary files /dev/null and b/heatwave-genai/generate-content/images/2-generate-response.png differ diff --git a/heatwave-genai/generate-content/images/3-llm-ouput.png b/heatwave-genai/generate-content/images/3-llm-ouput.png new file mode 100644 index 000000000..3428b5d35 Binary files /dev/null and b/heatwave-genai/generate-content/images/3-llm-ouput.png differ diff --git a/heatwave-genai/generate-content/images/4-define-text-to-summarize.png b/heatwave-genai/generate-content/images/4-define-text-to-summarize.png new file mode 100644 index 000000000..be0eac211 Binary files /dev/null and b/heatwave-genai/generate-content/images/4-define-text-to-summarize.png differ diff --git a/heatwave-genai/generate-content/images/5-summarize-text.png b/heatwave-genai/generate-content/images/5-summarize-text.png new file mode 100644 index 000000000..7229b764e Binary files /dev/null and b/heatwave-genai/generate-content/images/5-summarize-text.png differ diff --git a/heatwave-genai/generate-content/images/6-summarized-text.png b/heatwave-genai/generate-content/images/6-summarized-text.png new file mode 100644 index 000000000..674836fa6 Binary files /dev/null and b/heatwave-genai/generate-content/images/6-summarized-text.png differ diff --git a/heatwave-genai/get-started/get-started.md b/heatwave-genai/get-started/get-started.md new file mode 100644 index 000000000..9cc16911e --- /dev/null +++ b/heatwave-genai/get-started/get-started.md @@ -0,0 +1,57 @@ +# Get Started + +## Introduction + +Oracle Cloud is the industry's broadest and most integrated cloud provider, with deployment options ranging from the public cloud to your data center. Oracle Cloud offers best-in-class services across Software as a Service (SaaS), Platform as a Service (PaaS), and Infrastructure as a Service (IaaS). + +_Estimated Time:_ 15 minutes + +We offer two types of Cloud Accounts: + +- _Free Tier Accounts_: After you sign up for the free [Oracle Cloud promotion](https://signup.cloud.oracle.com/?sourceType=:ow:lp:cpo::::RC_WWMK211125P00013:llid=3306) or sign up for a paid account, you’ll get a welcome email. The email provides you with your cloud account details and sign in credentials. + +- _Oracle Cloud Paid Accounts_: When your tenancy is provisioned, Oracle sends an email to the default administrator at your company with the sign-in credentials and URL. This administrator can then create a user for each person who needs access to the Oracle Cloud. Check your email or contact your administrator for your credentials and account name. + +### Objectives + +In this lab, you will be guided through the following tasks: + +- Learn how to log in to your Oracle Cloud Account. + +### Prerequisites + +- Cloud Account Name - The name of your tenancy (supplied by the administrator or in your Oracle Cloud welcome email) +- Username +- Password + +## Task 1: Log in to Oracle Cloud + +1. Go to cloud.oracle.com and enter your **Cloud Account Name** and click **Next**. This is the name you chose while creating your account in the previous section. It's NOT your email address. If you've forgotten the name, see the confirmation email. + +2. Click **Continue** to reveal the login input fields. + + ![Enable Lakehouse](./images/1-enable-lakehouse.png "Enable Lakehouse") + +3. Enter your Cloud Account credentials and click **Sign In**. Your username is your email address. The password is what you chose when you signed up for an account. + + ![Enable Lakehouse dialog](./images/2-enable-lakehouse-dialog.png "Enable Lakehouse dialog") + +4. Based on the Multi-factor authentication setup for your account, provide authentication to sign into the account. For example, click **Allow** on the app or enter your **authentication code** and click **Verify** based on the authentication setup. For more details, refer the [Managing Multifactor Authentication documentation](https://docs.oracle.com/en-us/iaas/Content/Identity/Tasks/usingmfa.htm) + + ![Lakehouse enabled](./images/3-lakehouse-enabled.png "Lakehouse enabled") + +You may now **proceed to the next lab**. + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 \ No newline at end of file diff --git a/heatwave-genai/introduction/images/1-heatwave-genai.png b/heatwave-genai/introduction/images/1-heatwave-genai.png new file mode 100644 index 000000000..f5bc1e548 Binary files /dev/null and b/heatwave-genai/introduction/images/1-heatwave-genai.png differ diff --git a/heatwave-genai/introduction/images/2-heatwave-components.png b/heatwave-genai/introduction/images/2-heatwave-components.png new file mode 100644 index 000000000..7d235edcc Binary files /dev/null and b/heatwave-genai/introduction/images/2-heatwave-components.png differ diff --git a/heatwave-genai/introduction/images/heatwave-aws-architect.png b/heatwave-genai/introduction/images/heatwave-aws-architect.png new file mode 100644 index 000000000..243bff98b Binary files /dev/null and b/heatwave-genai/introduction/images/heatwave-aws-architect.png differ diff --git a/heatwave-genai/introduction/images/hwonaws.png b/heatwave-genai/introduction/images/hwonaws.png new file mode 100644 index 000000000..b63cace0c Binary files /dev/null and b/heatwave-genai/introduction/images/hwonaws.png differ diff --git a/heatwave-genai/introduction/images/hwonaws_lakehouse.png b/heatwave-genai/introduction/images/hwonaws_lakehouse.png new file mode 100644 index 000000000..f65b49863 Binary files /dev/null and b/heatwave-genai/introduction/images/hwonaws_lakehouse.png differ diff --git a/heatwave-genai/introduction/images/mhds-hw-oci-integration.png b/heatwave-genai/introduction/images/mhds-hw-oci-integration.png new file mode 100644 index 000000000..254c3fb7f Binary files /dev/null and b/heatwave-genai/introduction/images/mhds-hw-oci-integration.png differ diff --git a/heatwave-genai/introduction/introduction.md b/heatwave-genai/introduction/introduction.md new file mode 100644 index 000000000..4b728b4e1 --- /dev/null +++ b/heatwave-genai/introduction/introduction.md @@ -0,0 +1,51 @@ +# Introduction + +HeatWave GenAI lets organizations easily process and analyze vast amounts of proprietary unstructured documents in Object Storage. They can develop turnkey AI-powered applications with enhanced performance and enterprise-grade data security. HeatWave genAI supports in-database large language models (LLMs), an automated, in-database vector store, scale-out vector processing, and has the ability to have contextual conversations in natural language. + +HeatWave GenAI is unique because it seamlessly integrates large language models (LLMs) and embedding generation within the database, eliminating the need for external services. This integration enhances performance and security, simplifies application complexity, and reduces costs as it runs on CPUs. HeatWave GenAI integrates seamlessly with other in-database HeatWave capabilities such as machine learning, analytics, and Lakehouse, opening up a new class of applications and providing higher-quality responses. With HeatWave GenAI, you can effortlessly generate new and realistic content, speed up manual or repetitive tasks like summarizing large documents, and engage in natural language interactions. + +![HeatWave GenAI](./images/1-heatwave-genai.png "HeatWave GenAI") + + +## About this Workshop + +In this LiveLab, you will first setup Visual Studio Code. You will then create a HeatWave instance, and connect to it from Visual Studio Code. Subsequently, you will use HeatWave GenAI to generate content in natural language, summarize text, and perform vector search on your enterprise data. + +_Estimated Time:_ 1.5 hours + +## About Product/Technology + +HeatWave is a fully managed cloud service that enables organizations to efficiently run analytics, transaction processing, machine learning, and generative AI using a single service without the need for ETL. Its scale-out architecture is designed to process data stored in Object Storage and MySQL databases, delivering industry-leading performance and price-performance. HeatWave can process structured, semi-structured, and unstructured data in Object Storage. It provides the capability to create a vector store from Object Storage files and enables enterprises to utilize LLMs and generative AI on their internal content. This opens the door to a new class of applications built with HeatWave, including the ability to interact with HeatWave using natural language. HeatWave is available on OCI, AWS, and Azure. + +The following diagram illustrates HeatWave components at a glance. + +![HeatWave components](./images/2-heatwave-components.png "HeatWave components") + +## Objectives + +In this lab, you will be guided through the following steps: + +1. Setup MySQL Shell for Visual Studio Code +2. Create a HeatWave instance +3. Connect to the HeatWave instance from Visual Studio Code +4. Generate content +5. Perform a vector search +6. Build HeatWave RAG Chat Application + +## Prerequisites + +Please make sure you can sign in to your HeatWave OCI Cloud Account. + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 diff --git a/heatwave-genai/stop-services/images/1-stop-dbs.png b/heatwave-genai/stop-services/images/1-stop-dbs.png new file mode 100644 index 000000000..697612bc6 Binary files /dev/null and b/heatwave-genai/stop-services/images/1-stop-dbs.png differ diff --git a/heatwave-genai/stop-services/images/2-stop-dialog.png b/heatwave-genai/stop-services/images/2-stop-dialog.png new file mode 100644 index 000000000..4b3653cf6 Binary files /dev/null and b/heatwave-genai/stop-services/images/2-stop-dialog.png differ diff --git a/heatwave-genai/stop-services/images/3-delete-bucket.png b/heatwave-genai/stop-services/images/3-delete-bucket.png new file mode 100644 index 000000000..96a02a014 Binary files /dev/null and b/heatwave-genai/stop-services/images/3-delete-bucket.png differ diff --git a/heatwave-genai/stop-services/images/4-confirm-deletion.png b/heatwave-genai/stop-services/images/4-confirm-deletion.png new file mode 100644 index 000000000..b5db82019 Binary files /dev/null and b/heatwave-genai/stop-services/images/4-confirm-deletion.png differ diff --git a/heatwave-genai/stop-services/stop-services.md b/heatwave-genai/stop-services/stop-services.md new file mode 100644 index 000000000..9a968272a --- /dev/null +++ b/heatwave-genai/stop-services/stop-services.md @@ -0,0 +1,62 @@ +# Stop Services + +## Introduction + +In this lab you will use the Console to stop all of the Services you created in this workshop. + +_Estimated Time:_ 5 min + +### Objectives + +In this lab, you will be guided through the following task: + +- Stop the HeatWave instance. +- Delete the bucket. + +### Prerequisites + +- An Oracle Trial or Paid Cloud Account +- Some Experience with MySQL Shell +- Completed Lab1-5 + +## Task 1: Stop the HeatWave instance + +1. Click the **Navigation Menu** in the upper left, navigate to **Databases**, and under HeatWave select **DB Systems**. + +2. In the **heatwave-geni** Compartment, select the **heatwave-genai-dbs**, under **Actions**, click **Stop**. + + ![Stop DB system](./images/1-stop-dbs.png "Stop DB system") + +3. In the **Stop DB systems** dialog box, click **Stop DB Systems**. + + ![Stop DB system](./images/2-stop-dialog.png "Stop DB system") + +## Task 2: Delete the bucket + +1. Open the **Navigation menu** and click **Storage**. Under **Object Storage & Archive Storage**, click **Buckets**. + +2. Select the compartment from the list under List Scope. + +3. Click the **More Actions** menu besides your bucket, **bucket-vector-search**, and click **Delete**. + + ![Delete bucket](./images/3-delete-bucket.png "Delete bucket") + +4. In the **Delete Bucket** panel, confirm the bucket name, **bucket-vector-search**, and click **Delete**. + + ![Confirm deletion](./images/4-confirm-deletion.png "Confirm deletion") + +**Congratulations! You have successfully finished the Workshop.** + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 diff --git a/heatwave-genai/vector-search/images/1-click-bucket.png b/heatwave-genai/vector-search/images/1-click-bucket.png new file mode 100644 index 000000000..82f60d057 Binary files /dev/null and b/heatwave-genai/vector-search/images/1-click-bucket.png differ diff --git a/heatwave-genai/vector-search/images/10-copy-par.png b/heatwave-genai/vector-search/images/10-copy-par.png new file mode 100644 index 000000000..06ec8bd19 Binary files /dev/null and b/heatwave-genai/vector-search/images/10-copy-par.png differ diff --git a/heatwave-genai/vector-search/images/11-create-database.png b/heatwave-genai/vector-search/images/11-create-database.png new file mode 100644 index 000000000..4714d04c3 Binary files /dev/null and b/heatwave-genai/vector-search/images/11-create-database.png differ diff --git a/heatwave-genai/vector-search/images/12-call-procedure.png b/heatwave-genai/vector-search/images/12-call-procedure.png new file mode 100644 index 000000000..440baa6b4 Binary files /dev/null and b/heatwave-genai/vector-search/images/12-call-procedure.png differ diff --git a/heatwave-genai/vector-search/images/13-reload-database-information.png b/heatwave-genai/vector-search/images/13-reload-database-information.png new file mode 100644 index 000000000..be50e3418 Binary files /dev/null and b/heatwave-genai/vector-search/images/13-reload-database-information.png differ diff --git a/heatwave-genai/vector-search/images/14-ingest-files.png b/heatwave-genai/vector-search/images/14-ingest-files.png new file mode 100644 index 000000000..c6ea2b63a Binary files /dev/null and b/heatwave-genai/vector-search/images/14-ingest-files.png differ diff --git a/heatwave-genai/vector-search/images/15-check-count.png b/heatwave-genai/vector-search/images/15-check-count.png new file mode 100644 index 000000000..83e35b83d Binary files /dev/null and b/heatwave-genai/vector-search/images/15-check-count.png differ diff --git a/heatwave-genai/vector-search/images/16-load-llm.png b/heatwave-genai/vector-search/images/16-load-llm.png new file mode 100644 index 000000000..b2dc477ed Binary files /dev/null and b/heatwave-genai/vector-search/images/16-load-llm.png differ diff --git a/heatwave-genai/vector-search/images/17-set-options.png b/heatwave-genai/vector-search/images/17-set-options.png new file mode 100644 index 000000000..07fa2e535 Binary files /dev/null and b/heatwave-genai/vector-search/images/17-set-options.png differ diff --git a/heatwave-genai/vector-search/images/18-vector-search-output.png b/heatwave-genai/vector-search/images/18-vector-search-output.png new file mode 100644 index 000000000..0e9318f95 Binary files /dev/null and b/heatwave-genai/vector-search/images/18-vector-search-output.png differ diff --git a/heatwave-genai/vector-search/images/19-click-domain.png b/heatwave-genai/vector-search/images/19-click-domain.png new file mode 100644 index 000000000..e49b210be Binary files /dev/null and b/heatwave-genai/vector-search/images/19-click-domain.png differ diff --git a/heatwave-genai/vector-search/images/2-create-bucket.png b/heatwave-genai/vector-search/images/2-create-bucket.png new file mode 100644 index 000000000..c55060c16 Binary files /dev/null and b/heatwave-genai/vector-search/images/2-create-bucket.png differ diff --git a/heatwave-genai/vector-search/images/20-current-domain.png b/heatwave-genai/vector-search/images/20-current-domain.png new file mode 100644 index 000000000..afa1c5255 Binary files /dev/null and b/heatwave-genai/vector-search/images/20-current-domain.png differ diff --git a/heatwave-genai/vector-search/images/21-click-dynamic-group.png b/heatwave-genai/vector-search/images/21-click-dynamic-group.png new file mode 100644 index 000000000..729cc14ed Binary files /dev/null and b/heatwave-genai/vector-search/images/21-click-dynamic-group.png differ diff --git a/heatwave-genai/vector-search/images/22-create-dynamic-group.png b/heatwave-genai/vector-search/images/22-create-dynamic-group.png new file mode 100644 index 000000000..3a2494129 Binary files /dev/null and b/heatwave-genai/vector-search/images/22-create-dynamic-group.png differ diff --git a/heatwave-genai/vector-search/images/23-click-compartment.png b/heatwave-genai/vector-search/images/23-click-compartment.png new file mode 100644 index 000000000..1b3806611 Binary files /dev/null and b/heatwave-genai/vector-search/images/23-click-compartment.png differ diff --git a/heatwave-genai/vector-search/images/24-copy-comparment-ocid.png b/heatwave-genai/vector-search/images/24-copy-comparment-ocid.png new file mode 100644 index 000000000..b737f1847 Binary files /dev/null and b/heatwave-genai/vector-search/images/24-copy-comparment-ocid.png differ diff --git a/heatwave-genai/vector-search/images/25-enter-dynamic-group-details.png b/heatwave-genai/vector-search/images/25-enter-dynamic-group-details.png new file mode 100644 index 000000000..97a4368fb Binary files /dev/null and b/heatwave-genai/vector-search/images/25-enter-dynamic-group-details.png differ diff --git a/heatwave-genai/vector-search/images/26-enter-ocid.png b/heatwave-genai/vector-search/images/26-enter-ocid.png new file mode 100644 index 000000000..3ab01e56b Binary files /dev/null and b/heatwave-genai/vector-search/images/26-enter-ocid.png differ diff --git a/heatwave-genai/vector-search/images/27-click-create-dynamic-group.png b/heatwave-genai/vector-search/images/27-click-create-dynamic-group.png new file mode 100644 index 000000000..18d74d082 Binary files /dev/null and b/heatwave-genai/vector-search/images/27-click-create-dynamic-group.png differ diff --git a/heatwave-genai/vector-search/images/28-click-policies.png b/heatwave-genai/vector-search/images/28-click-policies.png new file mode 100644 index 000000000..c8dd7fbeb Binary files /dev/null and b/heatwave-genai/vector-search/images/28-click-policies.png differ diff --git a/heatwave-genai/vector-search/images/29-create-policies.png b/heatwave-genai/vector-search/images/29-create-policies.png new file mode 100644 index 000000000..92496f464 Binary files /dev/null and b/heatwave-genai/vector-search/images/29-create-policies.png differ diff --git a/heatwave-genai/vector-search/images/3-enter-bucket-details.png b/heatwave-genai/vector-search/images/3-enter-bucket-details.png new file mode 100644 index 000000000..48c22cff9 Binary files /dev/null and b/heatwave-genai/vector-search/images/3-enter-bucket-details.png differ diff --git a/heatwave-genai/vector-search/images/30-enter-policy-details.png b/heatwave-genai/vector-search/images/30-enter-policy-details.png new file mode 100644 index 000000000..7134fd796 Binary files /dev/null and b/heatwave-genai/vector-search/images/30-enter-policy-details.png differ diff --git a/heatwave-genai/vector-search/images/31-create-new-folder.png b/heatwave-genai/vector-search/images/31-create-new-folder.png new file mode 100644 index 000000000..4e62d1a5f Binary files /dev/null and b/heatwave-genai/vector-search/images/31-create-new-folder.png differ diff --git a/heatwave-genai/vector-search/images/32-enter-folder-details.png b/heatwave-genai/vector-search/images/32-enter-folder-details.png new file mode 100644 index 000000000..44de9a072 Binary files /dev/null and b/heatwave-genai/vector-search/images/32-enter-folder-details.png differ diff --git a/heatwave-genai/vector-search/images/33-click-bucket-folder.png b/heatwave-genai/vector-search/images/33-click-bucket-folder.png new file mode 100644 index 000000000..732bd65ac Binary files /dev/null and b/heatwave-genai/vector-search/images/33-click-bucket-folder.png differ diff --git a/heatwave-genai/vector-search/images/34-click-upload.png b/heatwave-genai/vector-search/images/34-click-upload.png new file mode 100644 index 000000000..73b5b023e Binary files /dev/null and b/heatwave-genai/vector-search/images/34-click-upload.png differ diff --git a/heatwave-genai/vector-search/images/35-bucket-namespace.png b/heatwave-genai/vector-search/images/35-bucket-namespace.png new file mode 100644 index 000000000..2c53fe121 Binary files /dev/null and b/heatwave-genai/vector-search/images/35-bucket-namespace.png differ diff --git a/heatwave-genai/vector-search/images/36-create-domain.png b/heatwave-genai/vector-search/images/36-create-domain.png new file mode 100644 index 000000000..7b282f667 Binary files /dev/null and b/heatwave-genai/vector-search/images/36-create-domain.png differ diff --git a/heatwave-genai/vector-search/images/37-dynamic-group-rule.png b/heatwave-genai/vector-search/images/37-dynamic-group-rule.png new file mode 100644 index 000000000..4651355e6 Binary files /dev/null and b/heatwave-genai/vector-search/images/37-dynamic-group-rule.png differ diff --git a/heatwave-genai/vector-search/images/38-create-dynamic-group.png b/heatwave-genai/vector-search/images/38-create-dynamic-group.png new file mode 100644 index 000000000..0eb371588 Binary files /dev/null and b/heatwave-genai/vector-search/images/38-create-dynamic-group.png differ diff --git a/heatwave-genai/vector-search/images/39-default-domain.png b/heatwave-genai/vector-search/images/39-default-domain.png new file mode 100644 index 000000000..fb02d0f45 Binary files /dev/null and b/heatwave-genai/vector-search/images/39-default-domain.png differ diff --git a/heatwave-genai/vector-search/images/4-created-bucket.png b/heatwave-genai/vector-search/images/4-created-bucket.png new file mode 100644 index 000000000..10507268b Binary files /dev/null and b/heatwave-genai/vector-search/images/4-created-bucket.png differ diff --git a/heatwave-genai/vector-search/images/5-view-bucket-details.png b/heatwave-genai/vector-search/images/5-view-bucket-details.png new file mode 100644 index 000000000..d5d2428b2 Binary files /dev/null and b/heatwave-genai/vector-search/images/5-view-bucket-details.png differ diff --git a/heatwave-genai/vector-search/images/6-upload-files.png b/heatwave-genai/vector-search/images/6-upload-files.png new file mode 100644 index 000000000..c77a23fdc Binary files /dev/null and b/heatwave-genai/vector-search/images/6-upload-files.png differ diff --git a/heatwave-genai/vector-search/images/7-upload-files-finished.png b/heatwave-genai/vector-search/images/7-upload-files-finished.png new file mode 100644 index 000000000..1673bccee Binary files /dev/null and b/heatwave-genai/vector-search/images/7-upload-files-finished.png differ diff --git a/heatwave-genai/vector-search/images/8-create-par.png b/heatwave-genai/vector-search/images/8-create-par.png new file mode 100644 index 000000000..a5207bcf5 Binary files /dev/null and b/heatwave-genai/vector-search/images/8-create-par.png differ diff --git a/heatwave-genai/vector-search/images/9-par-details.png b/heatwave-genai/vector-search/images/9-par-details.png new file mode 100644 index 000000000..bd71d8363 Binary files /dev/null and b/heatwave-genai/vector-search/images/9-par-details.png differ diff --git a/heatwave-genai/vector-search/images/vector-search-folder.png b/heatwave-genai/vector-search/images/vector-search-folder.png new file mode 100644 index 000000000..88ab6ce4d Binary files /dev/null and b/heatwave-genai/vector-search/images/vector-search-folder.png differ diff --git a/heatwave-genai/vector-search/images/vscode-connection.png b/heatwave-genai/vector-search/images/vscode-connection.png new file mode 100644 index 000000000..dc74a6fec Binary files /dev/null and b/heatwave-genai/vector-search/images/vscode-connection.png differ diff --git a/heatwave-genai/vector-search/vector-search.md b/heatwave-genai/vector-search/vector-search.md new file mode 100644 index 000000000..8e413c2f0 --- /dev/null +++ b/heatwave-genai/vector-search/vector-search.md @@ -0,0 +1,356 @@ +# Perform Retrieval Augmented Generation + +## Introduction + +Using the in-database vector store and retrieval-augmented generation (RAG), you can load and query unstructured documents stored in Object Storage using natural language within the HeatWave ecosystem. + +_Estimated Time:_ 30 minutes + +### Objectives + +In this lab, you will be guided through the following task: + +- Download HeatWave files. +- Create a bucket and a folder. +- Upload files to the bucket folder. +- Create a dynamic group. +- Write policies for the dynamic group. +- Set up a vector store. +- Perform a vector search. + +### Prerequisites + +- Must complete Lab 4. + +## Task 1: Download HeatWave files + +Download HeatWave files on which we will perform a vector search. + +1. Download the following files and save it in your local computer. + + - https://www.oracle.com/a/ocom/docs/mysql-heatwave-technical-brief.pdf + - https://www.oracle.com/a/ocom/docs/mysql/mysql-heatwave-on-aws-brief.pdf + - https://www.oracle.com/a/ocom/docs/mysql/mysql-heatwave-ml-technical-brief.pdf + - https://www.oracle.com/a/ocom/docs/mysql/mysql-heatwave-lakehouse-technical-brief.pdf + + ![Download files](./images/vector-search-folder.png "Download files") + +## Task 2: Create a bucket and a folder + +The Object Storage service provides reliable, secure, and scalable object storage. Object Storage uses buckets to organize your files. + +1. Open the **Navigation menu** and click **Storage**. Under **Object Storage & Archive Storage**, click **Buckets**. + + ![Click bucket](./images/1-click-bucket.png "Click bucket") + +2. In the **heatwave-genai** compartment, click **Create Bucket**. + + ![Create bucket](./images/2-create-bucket.png "Create bucket") + +3. Enter the **Bucket Name**, and accept the defaults for the rest of the fields. + + ```bash + bucket-vector-search + ``` + +4. Click **Create**. + + ![Enter bucket details](./images/3-enter-bucket-details.png "Enter bucket details") + +5. Once the bucket is created, click the name of the bucket to open the **Bucket Details** page. + + ![Created bucket](./images/4-created-bucket.png "Created bucket") + +6. Copy the bucket name and **Namespace**, and paste the it somewhere for future reference. + + ![Bucket namespace](./images/35-bucket-namespace.png "Bucket namespace") + +7. Under **Objects**, click **More Actions**, and then click **Create New Folder**. + + ![Create new folder](./images/31-create-new-folder.png "Create new folder") + +8. In the **Create New Folder** page, enter a **Name** of the folder, and note it for future reference. + + ```bash + bucket-folder-heatwave + ``` + + ![Enter new folder details](./images/32-enter-folder-details.png "Enter new folder details") + +9. Click **Create**. + +## Task 3: Upload files to the bucket folder + +1. In the **Bucket Details** page, under **Objects**, click the bucket folder name. + + ![Click bucket folder](./images/33-click-bucket-folder.png "Click bucket folder") + +2. Click **Upload**. + + ![Click upload](./images/34-click-upload.png "Click upload") + +3. Click **select files** to display a file selection dialog box. + +4. Select the files you had downloaded earlier in Task 1, and click **Upload**. + + ![Upload files](./images/6-upload-files.png "Upload files") + +5. When the file status shows **Finished**, click **Close** to return to the bucket. + + ![Upload files finished](./images/7-upload-files-finished.png "Upload files finished") + + +## Task 4: Create a dynamic group + +Dynamic groups allow you to group Oracle Cloud Infrastructure resources as principal. You can then create policies to permit the dynamic groups to access Oracle Cloud Infrastructure services. + +1. Open the **Navigation menu**, click **Identity & Security**, and under **Identity**, click **Compartments**. + + ![Click Domain](./images/23-click-compartment.png "Click Domain") + +2. In the **Compartments** page, hover over the OCID of your compartment, click **Copy**, and paste the OCID somewhere for future reference. + + ![Copy compartment OCID](./images/24-copy-comparment-ocid.png "Copy compartment OCID") + +3. Open the **Navigation menu**, click **Identity & Security**, and under **Identity**, click **Domains**. + + ![Click Domain](./images/19-click-domain.png "Click Domain") + +4. Click the domain, **Default**. Note that you had logged into OCI Console using the default identity domain. + + ![Click default domain](./images/39-default-domain.png "Click default domain") + +5. Under **Identity domain**, click **Dynamic groups**. + + ![Click dynamic group](./images/21-click-dynamic-group.png "Click group") + +6. Click **Create dynamic group**. + +7. In the **Create dynamic group** page, enter a **Name** and a **Description** for the dynamic group. *Note* the name of the dynamic group. + + **Name**: + + ```bash + heatwave-genai-dynamic-group + ``` + **Description**: + + ```bash + Dynamic group for HeatWave GenAI + ``` + + ![Create dynamic group](./images/38-create-dynamic-group.png "Create dynamic group") + +8. Enter the followng rule: + + ```bash + ALL{resource.type='mysqldbsystem', resource.compartment.id = ''} + ``` + Replace OCIDComparment with the OCID of the compartment you had copied in Task 3. + + For example: + + ```bash + ALL{resource.type='mysqldbsystem', resource.compartment.id = 'ocid1.compartment.oc1..aaaaaaaad2mplktxh7unkxodwcqpvtj32ierpvvixvu7qedzsfonq'} + ``` + + ![Enter rule](./images/37-dynamic-group-rule.png "Enter rule") + +9. Click **Create**. + + +## Task 5: Write policies for the dynamic group to access Object Storage bucket + +To access Object Storage from HeatWave, you must define a policy that enables the dynamic group to access to buckets and its folders. + + 1. Open the **Navigation menu**, click **Identity & Security**, and under **Identity**, click **Policies**. + + ![Click policy](./images/28-click-policies.png "Click policy") + + 2. Click **Create Policy**. + + ![Create dynamic group](./images/29-create-policies.png "Create dynamic group") + +3. In **Create policy** page, enter the **Name**, and **Description** of the policy. + + **Name**: + + ```bash + heatwave-genai-policy + ``` + **Description**: + ```bash + Policy for HeatWave GenAI + ``` + +4. Ensure that the Compartment is **heatwave-genai**. + +5. Toggle the **Show manual editor** button, and paste the following policy. *Note* that you can use the following command only when you have logged into OCI Console using the default domain. + + ```bash + Allow dynamic-group to read buckets in compartment + Allow dynamic-group to read objects in compartment + ``` + Replace DynamicGroupName with the name of the dynamic group, and CompartmentName with the name of the compartment. + + For example: + + ```bash + Allow dynamic-group heatwave-genai-dynamic-group to read buckets in compartment heatwave-genai + Allow dynamic-group heatwave-genai-dynamic-group to read objects in compartment heatwave-genai + ``` + + 6. Click **Create**. + + ![Enter policy details](./images/30-enter-policy-details.png "Enter policy details") + + + + + +## Task 6: Set up a vector store + +1. Go to Visual Studio Code, and under **DATABASE CONNECTIONS**, click **Open New Database Connection** icon next to your HeatWave instance to connect to it. + + ![Connect database](./images/vscode-connection.png "Connect database") + +2. Create a new schema and select it. + + ```bash + create database genai_db; + use genai_db; + ``` + + ![Create database](./images/11-create-database.png "Create database") + +2. Call the following procedure to create a schema that is used for task management. + + ```bash + select mysql_task_management_ensure_schema(); + ``` + + ![Call procedure](./images/12-call-procedure.png "Call procedure") + +3. Click **Reload Database Information** to view the mysql\_task\_management schema. + + ![Reload Database Information](./images/13-reload-database-information.png "Reload Database Information") + +4. Ingest the file from the Object Storage, create vector embeddings, and load the vector embeddings into HeatWave: + + ```bash + call sys.VECTOR_STORE_LOAD('oci://BucketName@Namespace/Path/', '{"table_name": "VectorStoreTableName"}'); + ``` + Replace the following: + + - BucketName: The OCI Object Storage bucket name that you created in Task 2. + - Namespace: The name of the Object Storage bucket namespace that you copied in Task 2, Step 6. + - Path: Path to the folder that contains the source file that you created in Task 2, Step 7. + - VectorStoreTableName: The name you want for the vector store table + + For example: + + ```bash + call sys.VECTOR_STORE_LOAD('oci://bucket-vector-search@axqzijr6ae84/bucket-folder-heatwave/', '{"table_name": "livelab_embedding"}'); + ``` + + ![Ingest files from Object Storage](./images/14-ingest-files.png "Ingest files from Object Storage") + +5. Wait for a few minutes, and verify that embeddings are loaded in the vector embeddings table. + + ```bash + select count(*) from ; + ``` + For example: + ```bash + select count(*) from livelab_embedding_pdf; + ``` + It takes a couple of minutes to create vector embeddings. You should see a numerical value in the output, which means your embeddings are successfully loaded in the table. + + ![Vector embeddings](./images/15-check-count.png "Vector embeddings") + +## Task 7: Perform retrieval augmented generation + +HeatWave retrieves content from the vector store and provide that as context to the LLM. This process is called as retrieval-augmented generation or RAG. This helps the LLM to produce more relevant and accurate results for your queries. + +1. Set the @options session variable to specify the table for retrieving the vector embeddings, and click **Enter**. + + ```bash + set @options = JSON_OBJECT("vector_store", JSON_ARRAY(".")); + ``` + + For example: + + ```bash + set @options = JSON_OBJECT("vector_store", JSON_ARRAY("genai_db.livelab_embedding_pdf")); + ``` + +2. Set the session @query variable to define your natural language query, and click **Enter**. + + ```bash + set @query=""; + ``` + + Replace AddYourQuery with your natural language query. + + For example: + + ```bash + set @query="What is HeatWave AutoML?"; + ``` + +3. Retrieve the augmented prompt, using the ML_RAG routine, and click **Execute the selection or full block on HeatWave and create a new block**. + + ```bash + call sys.ML_RAG(@query,@output,@options); + ``` + + ![Set options](./images/17-set-options.png "Set options") + +4. Print the output: + + ```bash + select JSON_PRETTY(@output); + ``` + + Text-based content that is generated by the LLM in response to your query is printed as output. The output generated by RAG is comprised of two parts: + + - The text section contains the text-based content generated by the LLM as a response for your query. + + - The citations section shows the segments and documents it referred to as context. + + ![Vector search results](./images/18-vector-search-output.png "Vector search results") + +## Learn More + +- [HeatWave User Guide](https://dev.mysql.com/doc/heatwave/en/) + +- [HeatWave on OCI User Guide](https://docs.oracle.com/en-us/iaas/mysql-database/index.html) + +- [MySQL Documentation](https://dev.mysql.com/) + + +## Acknowledgements + +- **Author** - Aijaz Fatima, Product Manager +- **Contributors** - Mandy Pang, Senior Principal Product Manager, Aijaz Fatima, Product Manager +- **Last Updated By/Date** - Aijaz Fatima, Product Manager, August 2024 \ No newline at end of file diff --git a/heatwave-genai/workshops/freetier/index.html b/heatwave-genai/workshops/freetier/index.html new file mode 100644 index 000000000..634101864 --- /dev/null +++ b/heatwave-genai/workshops/freetier/index.html @@ -0,0 +1,61 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + diff --git a/heatwave-genai/workshops/freetier/manifest.json b/heatwave-genai/workshops/freetier/manifest.json new file mode 100644 index 000000000..225a91959 --- /dev/null +++ b/heatwave-genai/workshops/freetier/manifest.json @@ -0,0 +1,57 @@ +{ + "workshoptitle": "Get started with HeatWave GenAI", + "help": "livelabs-help-oci_us@oracle.com", + "tutorials": [ + { + "title": "Introduction", + "description": "The Introduction is always second. The title and contents menu title match for the Introduction.", + "filename": "../../introduction/introduction.md" + }, + + { + "title": "Get Started", + "description": "Prerequisites for LiveLabs (Oracle-owned tenancies). The title of the lab and the Contents Menu title (the title above) match for Prerequisite lab. This lab is always first.", + "filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/cloud-login.md" + }, + + { + "title": "Lab 1: Create a HeatWave instance ", + "filename": "../../create-heatwave/create-heatwave.md" + }, + + { + "title": "Lab 2: Create a Compute instance ", + "filename": "../../create-compute/create-compute.md" + }, + + { + "title": "Lab 3: Connect to the HeatWave Instance from Visual Studio Code", + "filename": "../../connect-dbs-vscode/connect-dbs-vscode.md" + }, + + { + "title": "Lab 4: Use HeatWave In-database LLM to Generate and Summarize Content", + "filename": "../../generate-content/generate-content.md" + }, + + { + "title": "Lab 5: Perform Retrieval Augmented Generation", + "filename": "../../vector-search/vector-search.md" + }, + + { + "title": "Lab 6: Build HeatWave RAG Chat Application", + "filename": "../../develop-app/develop-app.md" + }, + + { + "title": "Stop Services", + "filename": "../../stop-services/stop-services.md" + }, + + { + "title": "Need Help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "filename":"https://oracle-livelabs.github.io/common//labs/need-help/need-help-freetier.md" } + ] +} diff --git a/heatwave-movie-stream/add-data-mysql/add-data-mysql.md b/heatwave-movie-stream/add-data-mysql/add-data-mysql.md index 1fa1b8390..3cb9bacff 100644 --- a/heatwave-movie-stream/add-data-mysql/add-data-mysql.md +++ b/heatwave-movie-stream/add-data-mysql/add-data-mysql.md @@ -254,7 +254,7 @@ You may now **proceed to the next lab** - **Author** - Cristian Aguilar, MySQL Solution Engineering - **Contributors** - Perside Foster, MySQL Principal Solution Engineering -- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, February 2024 +- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, November 2024 - **Dataset** - F. Maxwell Harper and Joseph A. Konstan. 2015. The MovieLens Datasets: History and Context. ACM Transactions on Interactive Intelligent diff --git a/heatwave-movie-stream/apex-heatwave/apex-heatwave.md b/heatwave-movie-stream/apex-heatwave/apex-heatwave.md index 575114922..385f7415f 100644 --- a/heatwave-movie-stream/apex-heatwave/apex-heatwave.md +++ b/heatwave-movie-stream/apex-heatwave/apex-heatwave.md @@ -271,7 +271,7 @@ In this lab, you will be guided through the following task: | --------| -------:| | Name | mysqlheatwave | | Static ID | mysqlheatwave | - | Authentication Type | Oracle Cloud Infraestructure (OCI) | + | Authentication Type | OCI Native Authentication | | OCI User ID | **< YourUserOCID >** | | OCI Private Key | **< ContentOfYourSavedPrivateKey >** | | OCI Tenancy ID | **< YourTenancyOCID >** | @@ -328,4 +328,4 @@ You may now **proceed to the next lab** - **Author** - Cristian Aguilar, MySQL Solution Engineering - **Contributors** - Perside Foster, MySQL Principal Solution Engineering -- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, February 2024 +- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, November 2024 diff --git a/heatwave-movie-stream/app-configure-apex/app-configure-apex.md b/heatwave-movie-stream/app-configure-apex/app-configure-apex.md index 7837d799e..db9ae2e29 100644 --- a/heatwave-movie-stream/app-configure-apex/app-configure-apex.md +++ b/heatwave-movie-stream/app-configure-apex/app-configure-apex.md @@ -30,7 +30,7 @@ In this lab, you will be guided through the following tasks: 1. Download the MovieHub application template: - Click on this link to **Download file** [MovieHub.zip](https://objectstorage.us-phoenix-1.oraclecloud.com/p/p_59Wj-TSoegriKLewLSQEC3T7IBIkCllrs5ztNZ5TDvtbLGSu2RR4pH6u8oQ8J6/n/idazzjlcjqzj/b/bucket-images/o/MovieHub_V2.zip) to your local machine + Click on this link to **Download file** [MovieHub.zip](https://objectstorage.us-ashburn-1.oraclecloud.com/p/IV9G5YNe0k7TxBeL-kIs7APtLwgHBEXHGc9nxARpsgS1lxcNg6tm6qTVIsbOdnw6/n/idi1o0a010nx/b/Bucket-CA/o/LiveLab-MovieHub-images/MovieHub_V3.zip) to your local machine ## Task 2: Import the sample application - MovieHub @@ -180,4 +180,4 @@ You may now **proceed to the next lab** - **Author** - Cristian Aguilar, MySQL Solution Engineering - **Contributors** - Perside Foster, MySQL Principal Solution Engineering -- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, February 2024 \ No newline at end of file +- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, November 2024 \ No newline at end of file diff --git a/heatwave-movie-stream/create-automl/create-automl.md b/heatwave-movie-stream/create-automl/create-automl.md index d02d9032a..5b55eb13b 100644 --- a/heatwave-movie-stream/create-automl/create-automl.md +++ b/heatwave-movie-stream/create-automl/create-automl.md @@ -243,4 +243,4 @@ You may now **proceed to the next lab** - **Author** - Cristian Aguilar, MySQL Solution Engineering - **Contributors** - Perside Foster, MySQL Principal Solution Engineering -- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, February 2024 +- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, November 2024 diff --git a/heatwave-movie-stream/create-bastion-with-python/create-bastion-with-python.md b/heatwave-movie-stream/create-bastion-with-python/create-bastion-with-python.md index e1258a83e..d63a2f8d1 100644 --- a/heatwave-movie-stream/create-bastion-with-python/create-bastion-with-python.md +++ b/heatwave-movie-stream/create-bastion-with-python/create-bastion-with-python.md @@ -68,7 +68,7 @@ The Cloud Shell machine is a small virtual machine running a Bash shell which yo ![ssh key list ](./images/shh-key-list.png "shh key list") - Note in the output there are two files, a *private key:* `id_rsa` and a *public key:* `id_rsa.pub`. Keep the private key safe and don't share its content with anyone. The public key will be needed for various activities and can be uploaded to certain systems as well as copied and pasted to facilitate secure communications in the cloud. + Note: In the output there are two files, a *private key:* `id_rsa` and a *public key:* `id_rsa.pub`. Keep the private key safe and don't share its content with anyone. The public key will be needed for various activities and can be uploaded to certain systems as well as copied and pasted to facilitate secure communications in the cloud. ## Task 2: Create Compute instance @@ -188,14 +188,20 @@ You will need a compute Instance to connect to your brand new MySQL database. ![connect signin](./images/connect-first-signin.png "connect signin ") -3. You will need a MySQL client tool to connect to your new MySQL HeatWave System from the Batien. +3. You will need a MySQL client tool to connect to your new MySQL HeatWave System from the Bastion. You can download the specific desired version and architecture at [MySQL Community Dowloads](https://dev.mysql.com/downloads/shell/) - Install MySQL Shell with the following command (enter y for each question) + To Install the current latest version MySQL Shell version, you can follow the instructions: + + a. Install MySQL Shell with the following command (enter y for each question) **[opc@…]$** ```bash - sudo yum install mysql-shell -y + wget https://dev.mysql.com/get/Downloads/MySQL-Shell/mysql-shell-9.1.0-1.el8.x86_64.rpm + ``` + + ```bash + sudo yum install mysql-shell-9* -y ``` ![mysql shell install](./images/mysql-install-shell.png "mysql shell install ") @@ -227,4 +233,4 @@ You may now **proceed to the next lab** - **Author** - Perside Foster, MySQL Principal Solution Engineering - **Contributors** - Mandy Pang, MySQL Principal Product Manager, Nick Mader, MySQL Global Channel Enablement & Strategy Manager, Cristian Aguilar, MySQL Solution Engineering -- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, February 2024 \ No newline at end of file +- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, November 2024 \ No newline at end of file diff --git a/heatwave-movie-stream/create-db/create-db.md b/heatwave-movie-stream/create-db/create-db.md index 320a74f52..207b5d38a 100644 --- a/heatwave-movie-stream/create-db/create-db.md +++ b/heatwave-movie-stream/create-db/create-db.md @@ -281,4 +281,4 @@ You may now **proceed to the next lab** - **Author** - Perside Foster, MySQL Principal Solution Engineering - **Contributors** - Mandy Pang, MySQL Principal Product Manager, Nick Mader, MySQL Global Channel Enablement & Strategy Manager -- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, February 2024 \ No newline at end of file +- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, November 2024 \ No newline at end of file diff --git a/heatwave-movie-stream/create-movie-tables/create-movie-tables.md b/heatwave-movie-stream/create-movie-tables/create-movie-tables.md index cf7b7c080..0c86f8165 100644 --- a/heatwave-movie-stream/create-movie-tables/create-movie-tables.md +++ b/heatwave-movie-stream/create-movie-tables/create-movie-tables.md @@ -329,4 +329,4 @@ You may now **proceed to the next lab** - **Author** - Perside Foster, MySQL Principal Solution Engineering - **Contributors** - Mandy Pang, MySQL Principal Product Manager, Nick Mader, MySQL Global Channel Enablement & Strategy Manager -- **Last Updated By/Date** - Perside Foster, MySQL Solution Engineering, February 2024 +- **Last Updated By/Date** - Perside Foster, MySQL Solution Engineering, November 2024 diff --git a/heatwave-movie-stream/develop-moviehub-apex-app/develop-moviehub-apex-app.md b/heatwave-movie-stream/develop-moviehub-apex-app/develop-moviehub-apex-app.md index 06364d242..8994fd7c1 100644 --- a/heatwave-movie-stream/develop-moviehub-apex-app/develop-moviehub-apex-app.md +++ b/heatwave-movie-stream/develop-moviehub-apex-app/develop-moviehub-apex-app.md @@ -168,4 +168,4 @@ You may now **proceed to the next lab** - **Author** - Cristian Aguilar, MySQL Solution Engineering - **Contributors** - Perside Foster, MySQL Principal Solution Engineering -- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, February 2024 +- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, November 2024 diff --git a/heatwave-movie-stream/improve-app-hw/improve-app-hw.md b/heatwave-movie-stream/improve-app-hw/improve-app-hw.md index 56f3d7ef8..9b38db185 100644 --- a/heatwave-movie-stream/improve-app-hw/improve-app-hw.md +++ b/heatwave-movie-stream/improve-app-hw/improve-app-hw.md @@ -25,7 +25,7 @@ In this lab, you will be guided through the following tasks: ## Task 1: Download sample display images from a Bucket in OCI Object Store: -1. Click on this link to Download the images [MovieHub Sample Images](https://objectstorage.us-phoenix-1.oraclecloud.com/p/Uim7lrT2O4eMuGunwu608ejFy-nlvNTtfEBNbElXaaAwTafZn2QveR6kgWJE5atV/n/idazzjlcjqzj/b/bucket-images/o/moviehub_imgs.zip) from the Demo to your local machine +1. Click on this link to Download the images [MovieHub Sample Images](https://objectstorage.us-ashburn-1.oraclecloud.com/p/IQ5Zvpi-KPjZMgVUMfAQfkzwezllFxOzLgEZ9tuLdkQilotp3WzvUh58eMGRXGTc/n/idi1o0a010nx/b/Bucket-CA/o/LiveLab-MovieHub-images/moviehub_imgs.zip) from the Demo to your local machine ## Task 2: Upload Images to the OCI Object Store: @@ -191,4 +191,4 @@ In this lab, you will be guided through the following tasks: - **Author** - Cristian Aguilar, MySQL Solution Engineering - **Contributors** - Perside Foster, MySQL Principal Solution Engineering -- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, February 2024 \ No newline at end of file +- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, November 2024 \ No newline at end of file diff --git a/heatwave-movie-stream/introduction/introduction.md b/heatwave-movie-stream/introduction/introduction.md index 17c8825c0..f8d75504b 100644 --- a/heatwave-movie-stream/introduction/introduction.md +++ b/heatwave-movie-stream/introduction/introduction.md @@ -44,7 +44,7 @@ You may now **proceed to the next lab** - **Author** - Cristian Aguilar, MySQL Solution Engineering - **Contributors** - Perside Foster, MySQL Principal Solution Engineering -- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, February 2024 +- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, November 2024 - **Dataset** - F. Maxwell Harper and Joseph A. Konstan. 2015. The MovieLens Datasets: History and Context. ACM Transactions on Interactive Intelligent diff --git a/heatwave-movie-stream/query-from-movies-predictions/query-from-movies-predictions.md b/heatwave-movie-stream/query-from-movies-predictions/query-from-movies-predictions.md index 0caaf00e0..14424d413 100644 --- a/heatwave-movie-stream/query-from-movies-predictions/query-from-movies-predictions.md +++ b/heatwave-movie-stream/query-from-movies-predictions/query-from-movies-predictions.md @@ -188,4 +188,4 @@ You may now **proceed to the next lab** - **Author** - Cristian Aguilar, MySQL Solution Engineering - **Contributors** - Perside Foster, MySQL Principal Solution Engineering -- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, February 2024 +- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, November 2024 diff --git a/heatwave-movie-stream/setup-hw-cluster/setup-hw-cluster.md b/heatwave-movie-stream/setup-hw-cluster/setup-hw-cluster.md index fdb1c1de0..405fe78ca 100644 --- a/heatwave-movie-stream/setup-hw-cluster/setup-hw-cluster.md +++ b/heatwave-movie-stream/setup-hw-cluster/setup-hw-cluster.md @@ -55,4 +55,4 @@ You may now **proceed to the next lab** - **Author** - Perside Foster, MySQL Principal Solution Engineering - **Contributors** - Mandy Pang, MySQL Principal Product Manager, Nick Mader, MySQL Global Channel Enablement & Strategy Manager, Cristian Aguilar, MySQL Solution Engineering -- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, February 2024 \ No newline at end of file +- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, November 2024 \ No newline at end of file diff --git a/heatwave-movie-stream/transform-data/transform-data.md b/heatwave-movie-stream/transform-data/transform-data.md index 478b7634a..06400b485 100644 --- a/heatwave-movie-stream/transform-data/transform-data.md +++ b/heatwave-movie-stream/transform-data/transform-data.md @@ -100,7 +100,7 @@ In this lab, you will be guided through the following tasks: Enter the following command at the prompt ```bash - sudo wget https://objectstorage.us-phoenix-1.oraclecloud.com/p/uaOgU_UDi0OIvgvS1R0-UPSD9PqK0UXHtojya5VZrrFtTbssGq_8dhNNmmkUnFyb/n/idazzjlcjqzj/b/bucket-images/o/scripts.zip + sudo wget https://objectstorage.us-ashburn-1.oraclecloud.com/p/7yuwIwQMyXC5lTzpv-mKaXbnqAnIDTdubHnHsCaWd0LyUgs7KGVxphWDMaFZpviL/n/idi1o0a010nx/b/Bucket-CA/o/LiveLab-MovieHub-images/scripts.zip ``` Unzip the application code. Be sure to include the -j option to avoid creating a new folder. @@ -185,7 +185,7 @@ You may now **proceed to the next lab** - **Author** - Cristian Aguilar, MySQL Solution Engineering - **Contributors** - Perside Foster, MySQL Principal Solution Engineering -- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, February 2024 +- **Last Updated By/Date** - Cristian Aguilar, MySQL Solution Engineering, November 2024 - **Dataset** - F. Maxwell Harper and Joseph A. Konstan. 2015. The MovieLens Datasets: History and Context. ACM Transactions on Interactive Intelligent diff --git a/heatwave-movie-stream/workshops/tenancy/index.html b/heatwave-movie-stream/workshops/tenancy/index.html new file mode 100644 index 000000000..bc2e5bfac --- /dev/null +++ b/heatwave-movie-stream/workshops/tenancy/index.html @@ -0,0 +1,61 @@ + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/heatwave-movie-stream/workshops/tenancy/manifest.json b/heatwave-movie-stream/workshops/tenancy/manifest.json new file mode 100644 index 000000000..d07b6c867 --- /dev/null +++ b/heatwave-movie-stream/workshops/tenancy/manifest.json @@ -0,0 +1,84 @@ +{ + "workshoptitle": "Build a Movie Recommendation App with Machine Learning in MySQL HeatWave", + "help": "livelabs-help-oci_us@oracle.com", + "tutorials": [ + { + "title": "Introduction", + "description": "The Introduction is always second. The title and contents menu title match for the Introduction.", + "filename": "../../introduction/introduction.md" + }, + + { + "title": "Get Started", + "description": "This is the prerequisites for customers using Free Trial and Paid tenancies. The title of the lab and the Contents Menu title (the title above) match for Prerequisite lab. This lab is always first.", + "filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/pre-register-free-tier-account.md" + }, + + { + "title": "Lab 1: Create MySQL HeatWave Database System", + "filename": "../../create-db/create-db.md" + }, + + { + "title": "Lab 2: Setup a HeatWave Cluster for OLAP/AutoML", + "filename": "../../setup-hw-cluster/setup-hw-cluster.md" + }, + + { + "title": "Lab 3: Create Bastion Server for MySQL Data", + "filename": "../../create-bastion-with-python/create-bastion-with-python.md" + }, + + { + "title": "Lab 4: Download & Transform the MovieLens dataset files", + "filename": "../../transform-data/transform-data.md" + }, + + { + "title": "Lab 5: Add MovieLens data to MySQL HeatWave", + "filename": "../../add-data-mysql/add-data-mysql.md" + }, + + { + "title": "Lab 6: Create and test HeatWave AutoML Recommender System", + "filename": "../../create-automl/create-automl.md" + }, + + { + "title": "Lab 7: Create the base Movies Database Tables for the Movie App", + "filename": "../../create-movie-tables/create-movie-tables.md" + }, + + { + "title": "Lab 8: Query Information from the movies and predictions tables", + "filename": "../../query-from-movies-predictions/query-from-movies-predictions.md" + }, + + { + "title": "Lab 9: Create a Low Code Application with Oracle APEX and REST SERVICES for MySQL", + "filename": "../../apex-heatwave/apex-heatwave.md" + }, + + { + "title": "Lab 10: Setup the APEX Application and Workspace", + "filename": "../../app-configure-apex/app-configure-apex.md" + }, + + { + "title": "Lab 11: Explore the Movie Recommendation App with data inside MySQL HeatWave", + "filename": "../../develop-moviehub-apex-app/develop-moviehub-apex-app.md" + }, + + { + "title": "Lab 12: (Bonus) Add your images to the MovieHub App for display", + "filename": "../../improve-app-hw/improve-app-hw.md" + }, + + { + "title": "Need Help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "filename":"https://oracle-livelabs.github.io/common/labs/need-help/need-help-freetier.md" + } + ] + } + diff --git a/hitchhikers-guide-upgrade-to-23ai/00-introduction/introduction.md b/hitchhikers-guide-upgrade-to-23ai/00-introduction/introduction.md index ffd14b6e5..58fd45bb3 100644 --- a/hitchhikers-guide-upgrade-to-23ai/00-introduction/introduction.md +++ b/hitchhikers-guide-upgrade-to-23ai/00-introduction/introduction.md @@ -6,7 +6,7 @@ Oracle Database 23ai is a *Long Term Support Release*. It is available or will b Estimated Workshop Time: 120 minutes -[Hitchhiker's Guide Introduction](videohub:1_6uk85vku) +[Hitchhiker's Guide Introduction](youtube:lwvdaM4v4tQ) ### Objectives diff --git a/hitchhikers-guide-upgrade-to-23ai/01-initialize-environment/initialize-environment.md b/hitchhikers-guide-upgrade-to-23ai/01-initialize-environment/initialize-environment.md index a78eda5e8..b7a950bb1 100644 --- a/hitchhikers-guide-upgrade-to-23ai/01-initialize-environment/initialize-environment.md +++ b/hitchhikers-guide-upgrade-to-23ai/01-initialize-environment/initialize-environment.md @@ -6,7 +6,7 @@ In this lab, you will check all components required to successfully run this wor Estimated Time: 5 Minutes -[Hitchhiker's Guide LAB1](videohub:1_gu082fvs) +[Hitchhiker's Guide Lab 1](youtube:lwvdaM4v4tQ?start=268) ### Objectives diff --git a/hitchhikers-guide-upgrade-to-23ai/02-explore-multitenant/explore-multitenant.md b/hitchhikers-guide-upgrade-to-23ai/02-explore-multitenant/explore-multitenant.md index 87e0143d5..a7d68c7f9 100644 --- a/hitchhikers-guide-upgrade-to-23ai/02-explore-multitenant/explore-multitenant.md +++ b/hitchhikers-guide-upgrade-to-23ai/02-explore-multitenant/explore-multitenant.md @@ -6,7 +6,7 @@ In this lab, you will familiarize yourself with the multitenant architecture. Estimated Time: 10 minutes -[Hitchhiker's Guide LAB2](videohub:1_0ingf3gr) +[Hitchhiker's Guide Lab 2](youtube:lwvdaM4v4tQ?start=444) ### Objectives diff --git a/hitchhikers-guide-upgrade-to-23ai/03-awr-snapshot/awr-snapshot.md b/hitchhikers-guide-upgrade-to-23ai/03-awr-snapshot/awr-snapshot.md index 87fd5c892..0f9eb3f7e 100644 --- a/hitchhikers-guide-upgrade-to-23ai/03-awr-snapshot/awr-snapshot.md +++ b/hitchhikers-guide-upgrade-to-23ai/03-awr-snapshot/awr-snapshot.md @@ -6,7 +6,7 @@ In this lab, you will execute an application workload using HammerDB on the *UPG Estimated Time: 15 Minutes -[Hitchhiker's Guide LAB3](videohub:1_533ui7ij) +[Hitchhiker's Guide Lab 3](youtube:lwvdaM4v4tQ?start=1290) ### Objectives diff --git a/hitchhikers-guide-upgrade-to-23ai/04-capture-sql/capture-sql.md b/hitchhikers-guide-upgrade-to-23ai/04-capture-sql/capture-sql.md index ca87d3c41..bfb298a7d 100644 --- a/hitchhikers-guide-upgrade-to-23ai/04-capture-sql/capture-sql.md +++ b/hitchhikers-guide-upgrade-to-23ai/04-capture-sql/capture-sql.md @@ -6,7 +6,7 @@ In this lab, you will capture and preserve SQL statements and information from t Estimated Time: 5 minutes -[Hitchhiker's Guide LAB4](videohub:1_lomvncan) +[Hitchhiker's Guide Lab 4](youtube:lwvdaM4v4tQ?start=1860) ### Objectives diff --git a/hitchhikers-guide-upgrade-to-23ai/05-autoupgrade/autoupgrade.md b/hitchhikers-guide-upgrade-to-23ai/05-autoupgrade/autoupgrade.md index 405be3482..1f88122f0 100644 --- a/hitchhikers-guide-upgrade-to-23ai/05-autoupgrade/autoupgrade.md +++ b/hitchhikers-guide-upgrade-to-23ai/05-autoupgrade/autoupgrade.md @@ -6,7 +6,7 @@ In this lab, you will upgrade the *UPGR* database from Oracle Database 19c to 23 Estimated Time: 45 minutes -[Hitchhiker's Guide LAB5](videohub:1_k95lbxlz) +[Hitchhiker's Guide Lab 5](youtube:lwvdaM4v4tQ?start=1966) ### Objectives diff --git a/hitchhikers-guide-upgrade-to-23ai/06-awr-compare/awr-compare.md b/hitchhikers-guide-upgrade-to-23ai/06-awr-compare/awr-compare.md index 34615160a..2a0dec357 100644 --- a/hitchhikers-guide-upgrade-to-23ai/06-awr-compare/awr-compare.md +++ b/hitchhikers-guide-upgrade-to-23ai/06-awr-compare/awr-compare.md @@ -8,7 +8,7 @@ Those reports give you a first indication of issues you may see (or performance Estimated Time: 10 minutes -[Hitchhiker's Guide LAB6](videohub:1_rid0tt2a) +[Hitchhiker's Guide Lab 6](youtube:lwvdaM4v4tQ?start=2782) ### Objectives diff --git a/hitchhikers-guide-upgrade-to-23ai/07-spa/spa.md b/hitchhikers-guide-upgrade-to-23ai/07-spa/spa.md index 569a6edc0..7787c15d7 100644 --- a/hitchhikers-guide-upgrade-to-23ai/07-spa/spa.md +++ b/hitchhikers-guide-upgrade-to-23ai/07-spa/spa.md @@ -6,7 +6,7 @@ In this lab, you will use the SQL Performance Analyzer (SPA) that is a part of t Estimated Time: 10 minutes -[Hitchhiker's Guide LAB7](videohub:1_khvx83yu) +[Hitchhiker's Guide Lab 7](youtube:lwvdaM4v4tQ?start=3165) ### Objectives diff --git a/hitchhikers-guide-upgrade-to-23ai/08-spm/spm.md b/hitchhikers-guide-upgrade-to-23ai/08-spm/spm.md index 4bbec37a7..4a8819728 100644 --- a/hitchhikers-guide-upgrade-to-23ai/08-spm/spm.md +++ b/hitchhikers-guide-upgrade-to-23ai/08-spm/spm.md @@ -8,7 +8,7 @@ Credits: You will use scripts written by Carlos Sierra. Estimated Time: 15 minutes -[Hitchhiker's Guide LAB8](videohub:1_0m3rb2yz) +[Hitchhiker's Guide Lab 8](youtube:lwvdaM4v4tQ?start=3855) ### Objectives diff --git a/hitchhikers-guide-upgrade-to-23ai/09-sqltune/sqltune.md b/hitchhikers-guide-upgrade-to-23ai/09-sqltune/sqltune.md index 1fef0fc86..bb4d12bde 100644 --- a/hitchhikers-guide-upgrade-to-23ai/09-sqltune/sqltune.md +++ b/hitchhikers-guide-upgrade-to-23ai/09-sqltune/sqltune.md @@ -6,7 +6,7 @@ In this lab, you will use SQL Tuning Advisor (STA) to find suggestions for impro Estimated Time: 10 minutes -[Hitchhiker's Guide LAB9](videohub:1_prpaczgp) +[Hitchhiker's Guide Lab 9](youtube:lwvdaM4v4tQ?start=4242) ### Objectives diff --git a/mds-intro/enableopsi/enableopsi.md b/mds-intro/enableopsi/enableopsi.md new file mode 100644 index 000000000..5d73d608e --- /dev/null +++ b/mds-intro/enableopsi/enableopsi.md @@ -0,0 +1,292 @@ +## Introduction + +In this lab, you will go through the steps to enable and explore Ops Insights for HeatWave MySQL DB System which includes ML based resource usage trending, capacity planning, and SQL Insights. + +Estimated time: 20 minutes + +### Objectives + +- Log into OCI Tenancy. +- Enable Ops Insights Demo Mode. +- Explore capacity planning and SQL Insights. + +### Prerequisites + +- Your Oracle Cloud Trial Account + +## Task 1: Enable Demo Mode + +1. To access Ops Insights, click on the Oracle Cloud Console **Navigation menu** (aka hamburger menu) located in the upper left. Under **Observability & Management**, go to **Ops Insights** and click **Overview**. + + ![Ops Insights](./images/opsi-main.png " ") + +2. Click on **Enable Demo Mode** to enable Demo Mode. + + ![Enable Demo Mode](./images/opsi-enable-demo.png " ") + +3. On the **Complete prerequisites** pop-up click on **Apply**. When enabling demo mode, a policy is created to allow read-only access to the demo tenancy's data. It may take up to 1 or 2 minutes for the policy to allow data access across the tenancies. If you are receiving authorization errors you may need to refresh the page until they have cleared, or you will need to engage an administrator or user with elevated privileges to create the policy. + + ![Complete Prereqs](./images/opsi-complete-prereqs.png " ") + +4. Click **Close** after the policy has been created. + + ![Apply Policy](./images/opsi-apply-policy.png " ") + +5. Once the mode is enabled the overview page will now show resource information for the OperationsInsights compartment, notice the upper-right hand corner will show Demo Mode is now ON for your session. When you would like to exit demo mode you can either click the disable link in the corner or click the **Disable Demo Mode** button where you initially enabled it on the overview page. + + ![Demo Mode ON](./images/opsi-demo-mode-on.png " ") + +6. On the left-hand pane you will find links to quickly navigate to Ops Insights offerings for HeatWave MySQL which includes Capacity Planning, SQL Insights and Dashboards. + + ![Left Pane](./images/opsi-left-pane.png " ") + +## Task 2: Capacity Planning - Databases + +1. On the **Ops Insights Overview** page, from the left pane click on **Capacity Planning**. + + ![Left Pane](./images/capacity-planning.png " ") + +2. On the **Database Capacity Planning** page, you will obtain a fleet-wide overview of your resource consumption and trends. CPU insights, storage insights, and memory insights give a quick view into top resource consumers now and forecast potential resource bottlenecks over the selected period. + + ![Left Pane](./images/database-capacity-planning.png " ") + + From this page you can perform the following tasks in support of the Capacity Planning use case goals: + + * View total allocation and utilization of CPU, Storage, Memory, and I/O resources for all (enabled) databases in the compartment + * Identify top-5 databases of CPU, Storage, and Memory by absolute usage or utilization percentage + * Identify top-5 databases by CPU, Storage, and Memory growth over the period + * See aggregated historical usage trends for CPU, Storage, and Memory over the period + +3. From **Database type** on the left pane select **HeatWave MySQL**. + + ![Left Pane](./images/database-capacity-planning-mysql.png " ") + +4. From **Time Range** on the left pane select **Last 90 days**. + + ![Left Pane](./images/time-range.png " ") + + You can filter based on **Time range**, **Database type** or **Tags**. This let’s you customize the fleet of database of your choice by using combination of one of these. + + ![Left Pane](./images/filter.png " ") + +5. Review the **Inventory** section. The **Inventory** section displays the total number of databases enabled for Ops Insights along with the database types. In addition, the CPU, Storage, Memory, and I/O usage charts display overall resource consumption (Top Consumers and Usage Trend) by these database targets. + + ![Left Pane](./images/inventory.png " ") + +6. **CPU Insights** - Database utilization percentage for the 90th percentile value of the daily average CPU Usage over the selected time period. These sections show the number of databases running with low (0–25%) and high (75–100%) utilization of CPU. + + ![Left Pane](./images/cpu-insights.png " ") + +7. **Storage Insights** - Database utilization percentage for the 90th percentile value of the daily average Storage Usage over the selected time period. These sections show the number of databases running with low (0–25%) and high (75–100%) utilization of storage. + + ![Left Pane](./images/storage-insights.png " ") + +8. **Memory Insights** - Database utilization percentage for the 90th percentile value of the daily average Memory Usage over the selected time period. These sections show the number of databases running with low (0–25%) and high (75–100%) utilization of memory. + + ![Left Pane](./images/memory-insights.png " ") + +## Task 3: Capacity Planning - CPU + +1. On the **Database Capacity Planning** page, from the left pane click on **CPU**. + + ![Left Pane](./images/database-cpu.png " ") + +2. **Database CPU** page has a master-detail design with three primary components: + + * Insights – table of databases flagged for CPU utilization insights + * Aggregate – treemap of CPU utilization over all databases in the compartment + * Trend & Forecast – time series charts of CPU usage trends and forecasts for individual or groups of databases + + ![Left Pane](./images/database-cpu2.png " ") + +3. On the **Database CPU** page, under **Insights** tab, select **30 Day Low Utilization Forecast** against **Databases**, to view database CPU utilization forecast for next 30 days. + + ![Left Pane](./images/utilization-forecast.png " ") + +4. Under the **Database Display Name** column, select the row corresponding to the **employeesdb** database. + + ![Left Pane](./images/employeesdb-database.png " ") + +5. Check the **Utilization (%)** and **Usage Change (%)** for database **employeesdb**. + + * Utilization (%) - Utilization percentage for the 90th percentile value of the daily average storage usage over the selected time period + * Usage Change (%): Percentage change in the linear trend of storage usage over the selected time + +6. The **Trend and Forecast** chart displays historical time series plots related to CPU allocation and usage for the selected database **employeesdb**. + + ![Left Pane](./images/trend-and-forecast.png " ") + +7. Historical CPU Usage (dark solid green line) is the Avg Usage - average value of daily (hourly) CPU usage data + +8. Avg Usage Forecast - forecast of Avg Usage data using linear forecast model (Dashed Green line) and the Max Allocation - maximum allocation of CPU for the database. + +9. The value **0.17** AVG ACTIVE CPU USAGE is forecasted for after 15 days for Avg usage of CPU. + +10. Select **Max Usage** from the legend on the right side. The red line is **Max Usage** - maximum value of daily (hourly) CPU usage data for database **employeesdb**. + + ![Left Pane](./images/max-usage-cpu.png " ") + +11. Select **Max Usage Forecast** from the legend on the right side. + + ![Left Pane](./images/max-usage-forecast.png " ") + +12. The value **1.33** AVG ACTIVE CPU USAGE is forecasted for after 15 days for Max usage of CPU. + + You can see the difference in average forecasted value v/s Max forecasted value. If the workload is critical and cannot tolerate any performance issues then the database must be allocated the max forecasted value. If the workload is not so critical and can tolerate deviations in performance then it is ok to allocate CPU based on average forecasted value and save money. + +13. The trending and forecast chart facilitates: + + * Forecast future maximum and average demand for CPU resources + * Compare current usage to allocation to detect over-provisioning + * Compare maximum to average usage and trends to assess demand volatility + * Forecast difference between the maximum and average daily CPU usage to estimate potential savings from workload smoothing + +14. The following models can be selected for display on the upper right of the Trend and Forecast chart: + + * **Linear regression**: The linear regression model assumes a linear relationship across variables to predict the future resource usage. + + ![Left Pane](./images/forecast-linear.png " ") + + * **Seasonality aware**: The seasonal option combines a simple model that detects basic seasonality with dynamic, user-selectable data. + + ![Left Pane](./images/forecast-seasonality.png " ") + + * **AutoML forecasting**: The AutoML forecasting option selects the best fit from multiple machine learning models trained on fixed data window. AutoML (Machine Learning) forecasting leverages Oracle Data Science, employing metalearning to quickly identify the most relevant features, model and hyperparameters for a given training dataset. Forecast and model are precomputed and the forecasts are periodically retrained. The forecast uses up to 13 months of data, or the highest amount of data available for a resource if the resource has less than 13 months since onboarding. + + On the **Database CPU** page, under **Insights** tab, select **All** against **Databases** and choose database **departmentsdb**. Within the **Trend & Forecast** chart, click **AutoML forecasting** + + ![Left Pane](./images/auto-ml.png " ") + + A new pop up will appear with the AutoML forecasting charts loaded. It will state the training period and the selected forecast algorithms for maximum usage and average usage. The maximum and average confidence channels are also displayed within the chart. The confidence interval for these are 95%, meaning that 95% of future points are expected to fall within this radius from the forecast. + + ![Left Pane](./images/automl-database.png " ") + + Click **Close** to close the **AutoML forecasting** pop-up and return to **Database CPU** page. + +15. Click **Aggregate** on the top and from **Grouping** select **Database Type**. + + ![Left Pane](./images/aggregate-database.png " ") + + The page displays a Treemap of all databases breaking it down by Database Type. This lets you compare how your different, individual databases are using their resources as well as between various database types. + +## Task 4: Capacity Planning - Storage + +1. Click on the **Storage** menu on the left panel. + + ![Left Pane](./images/storage-menu-ocw.png " ") + +2. You get a complete view of storage usage across all Ops Insights enabled databases. + + ![Left Pane](./images/database-storage.png " ") + + From here we can identify servers with underused or overused storage and also compare storage utilization between databases. + +3. From the drop-down on the top select **30 Days Low Utilization Forecast**. + + ![Left Pane](./images/utilization-forecast.png " ") + +4. In the **Trend & Forecast** chart view the storage trend and usage forecast for the selected database. + + ![Left Pane](./images/storage-trend-forecast.png " ") + +5. Select **Max usage** and **Max usage forecast** from the right panel. + + ![Left Pane](./images/storage-trend-max.png " ") + + You can see the average forecasted value v/s Max forecasted value for storage. **Max Usage Forecast** for this database is 0.01 TB, whereas **Allocation** shows that total storage allocated to this database is 2 TB. Since, allocation is more but storage used or forecasted is less, it is ok release some storage for this database and save money on storage. + +6. In the **Trend & Forecast** chart view, the **AutoML forecasting** option selects the best fit from multiple machine learning models trained on fixed data window. AutoML (Machine Learning) forecasting leverages Oracle Data Science, employing metalearning to quickly identify the most relevant features, model and hyperparameters for a given training dataset. Forecast and model are precomputed and the forecasts are periodically retrained. The forecast uses up to 13 months of data, or the highest amount of data available for a resource if the resource has less than 13 months since onboarding. + + ![Left Pane](./images/storage-trend-forecast-ml.png " ") + ![Left Pane](./images/storage-trend-forecast-auto-ml.png " ") + + Click **Close** to go back to the **Database Storage** page. + +## Task 5: SQL Insights + +1. On the **Ops Insights Overview** page, from the left pane click **SQL Insights**. On the **SQL Insights - Fleet analysis** page and filter by database type as **MySQL**. Now you can view insights and analysis for HeatWave MySQL databases enabled in the compartment. + + ![Left Pane](./images/sql-insights.png " ") + +3. Click the database **departmentsdb** to view **SQL Insights - Database: For database level insights** + + ![Left Pane](./images/sql-departments-db.png " ") + +4. HeatWave MySQL DB system dashboard provides a broad overview of the SQL workload executing in the database. This includes basic properties of the database and the SQL collected from it. SQL activity is shown by day broken down by command type and database, exposing changes in the workload over time. Average Active Session (AAS) by database schemas, latency type and Top SQLs additionally provide workload characteristics over time. + + ![Left Pane](./images/departments-db-insights.png " ") + +5. Click on **SQL activity by latency type**. + + ![Left Pane](./images/sql-latency-insights.png " ") + + The Database analysis dashboard is designed to give a broad overview of the SQL workload executing in the database. + +## Task 6: SQL Explorer + +SQL Explorer provides an easy-to-use interface that lets you interactively explore and visualize detailed performance statistics stored in Ops Insights SQL Warehouse. + +With SQL Explorer, you can explore performance statistics via a SQL query to extract the data with which to create an intuitive visualization. This provides interactive data exploration and visualization for deep exploration of application SQL performance statistics. The user interface is designed to simplify and streamline query development. + +In this lab create visualizations using pre-existing performance statistics via a SQL query. + +1. In this example we will calculate the average latency per execution to analyze the performance of operations over time. + +2. On the **Ops Insights Overview** page, from the left pane click **SQL Insights** and then click **SQL Explorer**. + + ![SQL Explorer](./images/sql-explorer.png " ") + +3. This will take you to the **SQL Explorer** page. + + ![SQL Explorer](./images/sql-explorer-main.png " ") + +4. Enter the following SQL in the SQL query section (copy & paste the statement line by line) + + ``` + + SELECT ROLLUP_TIME_UTC, AVG(TOTAL_LATENCY/EXEC_COUNT)/1000000000 as AVG_LATENCY_SEC + WHERE + GROUP BY ROLLUP_TIME_UTC + HAVING + ORDER BY ROLLUP_TIME_UTC ASC + ``` + + ![SQL Query](./images/sql-query.png " ") + +5. Click **Run** to execute the query. + +6. This will display the query result in a tabular format. + + ![SQL Output](./images/sql-query-table.png " ") + +7. Under the **Visualization** tab on the right pane, select the following - + + **Chart type** : **Area Chart** + + **Y axis** : **AVG\_LATENCY\_SEC** + + **X axis** : **ROLLUP\_TIME\_UTC** + + Check mark **Correlated tooltips** + + ![SQL Visualization](./images/sql-query-visual.png " ") + +9. This will display the visualization as an **Area Chart**. + +10. Click on **Clear** to clear the query section. + + ![SQL Visualization](./images/sql-explorer-clear.png " ") + +10. Click on **Advanced** Mode to view **SQL Explorer** in advanced mode. The advanced mode give you more control over the SQL queries that you are running against your database to view database performance. + + ![SQL Visualization](./images/sql-explorer-advanced.png " ") + +11. This will take you to the **SQL Explorer Advanced** Mode page. Advanced mode can be used to execute your own custom queries and obtain more information above the SQLs running in the database. + + ![SQL Visualization](./images/sql-explorer-advanced-main.png " ") + +## Acknowledgements + +- **Author** - Sindhuja Banka, HeatWave MySQL Product Manager +- **Contributors** - Sindhuja Banka, Sriram Vrinda, Anand Prabhu, Murtaza Husain +- **Last Updated By/Date** - Sindhuja Banka, October 2024 diff --git a/mds-intro/enableopsi/images/aggregate-database.png b/mds-intro/enableopsi/images/aggregate-database.png new file mode 100644 index 000000000..723742873 Binary files /dev/null and b/mds-intro/enableopsi/images/aggregate-database.png differ diff --git a/mds-intro/enableopsi/images/auto-ml.png b/mds-intro/enableopsi/images/auto-ml.png new file mode 100644 index 000000000..aa696fa41 Binary files /dev/null and b/mds-intro/enableopsi/images/auto-ml.png differ diff --git a/mds-intro/enableopsi/images/automl-database.png b/mds-intro/enableopsi/images/automl-database.png new file mode 100644 index 000000000..2b94d98e7 Binary files /dev/null and b/mds-intro/enableopsi/images/automl-database.png differ diff --git a/mds-intro/enableopsi/images/capacity-planning.png b/mds-intro/enableopsi/images/capacity-planning.png new file mode 100644 index 000000000..eba83c6eb Binary files /dev/null and b/mds-intro/enableopsi/images/capacity-planning.png differ diff --git a/mds-intro/enableopsi/images/cpu-insights.png b/mds-intro/enableopsi/images/cpu-insights.png new file mode 100644 index 000000000..ca61d2aba Binary files /dev/null and b/mds-intro/enableopsi/images/cpu-insights.png differ diff --git a/mds-intro/enableopsi/images/database-capacity-planning-mysql.png b/mds-intro/enableopsi/images/database-capacity-planning-mysql.png new file mode 100644 index 000000000..baba71d41 Binary files /dev/null and b/mds-intro/enableopsi/images/database-capacity-planning-mysql.png differ diff --git a/mds-intro/enableopsi/images/database-capacity-planning.png b/mds-intro/enableopsi/images/database-capacity-planning.png new file mode 100644 index 000000000..85e91fedb Binary files /dev/null and b/mds-intro/enableopsi/images/database-capacity-planning.png differ diff --git a/mds-intro/enableopsi/images/database-cpu.png b/mds-intro/enableopsi/images/database-cpu.png new file mode 100644 index 000000000..b4a739b54 Binary files /dev/null and b/mds-intro/enableopsi/images/database-cpu.png differ diff --git a/mds-intro/enableopsi/images/database-cpu2.png b/mds-intro/enableopsi/images/database-cpu2.png new file mode 100644 index 000000000..70f2a044d Binary files /dev/null and b/mds-intro/enableopsi/images/database-cpu2.png differ diff --git a/mds-intro/enableopsi/images/database-storage.png b/mds-intro/enableopsi/images/database-storage.png new file mode 100644 index 000000000..c54775aaf Binary files /dev/null and b/mds-intro/enableopsi/images/database-storage.png differ diff --git a/mds-intro/enableopsi/images/departments-db-insights.png b/mds-intro/enableopsi/images/departments-db-insights.png new file mode 100644 index 000000000..8a78094dd Binary files /dev/null and b/mds-intro/enableopsi/images/departments-db-insights.png differ diff --git a/mds-intro/enableopsi/images/employeesdb-database.png b/mds-intro/enableopsi/images/employeesdb-database.png new file mode 100644 index 000000000..9d2c31834 Binary files /dev/null and b/mds-intro/enableopsi/images/employeesdb-database.png differ diff --git a/mds-intro/enableopsi/images/filter.png b/mds-intro/enableopsi/images/filter.png new file mode 100644 index 000000000..bf2e14ceb Binary files /dev/null and b/mds-intro/enableopsi/images/filter.png differ diff --git a/mds-intro/enableopsi/images/forecast-linear.png b/mds-intro/enableopsi/images/forecast-linear.png new file mode 100644 index 000000000..3b1393700 Binary files /dev/null and b/mds-intro/enableopsi/images/forecast-linear.png differ diff --git a/mds-intro/enableopsi/images/forecast-seasonality.png b/mds-intro/enableopsi/images/forecast-seasonality.png new file mode 100644 index 000000000..9e5009e66 Binary files /dev/null and b/mds-intro/enableopsi/images/forecast-seasonality.png differ diff --git a/mds-intro/enableopsi/images/inventory.png b/mds-intro/enableopsi/images/inventory.png new file mode 100644 index 000000000..8783fdfac Binary files /dev/null and b/mds-intro/enableopsi/images/inventory.png differ diff --git a/mds-intro/enableopsi/images/max-usage-cpu.png b/mds-intro/enableopsi/images/max-usage-cpu.png new file mode 100644 index 000000000..605b7f822 Binary files /dev/null and b/mds-intro/enableopsi/images/max-usage-cpu.png differ diff --git a/mds-intro/enableopsi/images/max-usage-forecast.png b/mds-intro/enableopsi/images/max-usage-forecast.png new file mode 100644 index 000000000..007db3d6b Binary files /dev/null and b/mds-intro/enableopsi/images/max-usage-forecast.png differ diff --git a/mds-intro/enableopsi/images/memory-insights.png b/mds-intro/enableopsi/images/memory-insights.png new file mode 100644 index 000000000..77d42e12b Binary files /dev/null and b/mds-intro/enableopsi/images/memory-insights.png differ diff --git a/mds-intro/enableopsi/images/opsi-apply-policy.png b/mds-intro/enableopsi/images/opsi-apply-policy.png new file mode 100644 index 000000000..6ccc02278 Binary files /dev/null and b/mds-intro/enableopsi/images/opsi-apply-policy.png differ diff --git a/mds-intro/enableopsi/images/opsi-complete-prereqs.png b/mds-intro/enableopsi/images/opsi-complete-prereqs.png new file mode 100644 index 000000000..084c01b83 Binary files /dev/null and b/mds-intro/enableopsi/images/opsi-complete-prereqs.png differ diff --git a/mds-intro/enableopsi/images/opsi-demo-mode-on.png b/mds-intro/enableopsi/images/opsi-demo-mode-on.png new file mode 100644 index 000000000..fa0032fdc Binary files /dev/null and b/mds-intro/enableopsi/images/opsi-demo-mode-on.png differ diff --git a/mds-intro/enableopsi/images/opsi-enable-demo.png b/mds-intro/enableopsi/images/opsi-enable-demo.png new file mode 100644 index 000000000..56d3ccdb8 Binary files /dev/null and b/mds-intro/enableopsi/images/opsi-enable-demo.png differ diff --git a/mds-intro/enableopsi/images/opsi-left-pane.png b/mds-intro/enableopsi/images/opsi-left-pane.png new file mode 100644 index 000000000..6e4196649 Binary files /dev/null and b/mds-intro/enableopsi/images/opsi-left-pane.png differ diff --git a/mds-intro/enableopsi/images/opsi-main.png b/mds-intro/enableopsi/images/opsi-main.png new file mode 100644 index 000000000..caee8abba Binary files /dev/null and b/mds-intro/enableopsi/images/opsi-main.png differ diff --git a/mds-intro/enableopsi/images/sql-departments-db.png b/mds-intro/enableopsi/images/sql-departments-db.png new file mode 100644 index 000000000..ef85f0fb2 Binary files /dev/null and b/mds-intro/enableopsi/images/sql-departments-db.png differ diff --git a/mds-intro/enableopsi/images/sql-explorer-advanced-main.png b/mds-intro/enableopsi/images/sql-explorer-advanced-main.png new file mode 100644 index 000000000..3a5be0843 Binary files /dev/null and b/mds-intro/enableopsi/images/sql-explorer-advanced-main.png differ diff --git a/mds-intro/enableopsi/images/sql-explorer-advanced.png b/mds-intro/enableopsi/images/sql-explorer-advanced.png new file mode 100644 index 000000000..499689d8a Binary files /dev/null and b/mds-intro/enableopsi/images/sql-explorer-advanced.png differ diff --git a/mds-intro/enableopsi/images/sql-explorer-clear.png b/mds-intro/enableopsi/images/sql-explorer-clear.png new file mode 100644 index 000000000..d8266503f Binary files /dev/null and b/mds-intro/enableopsi/images/sql-explorer-clear.png differ diff --git a/mds-intro/enableopsi/images/sql-explorer-main.png b/mds-intro/enableopsi/images/sql-explorer-main.png new file mode 100644 index 000000000..53e3f50df Binary files /dev/null and b/mds-intro/enableopsi/images/sql-explorer-main.png differ diff --git a/mds-intro/enableopsi/images/sql-explorer.png b/mds-intro/enableopsi/images/sql-explorer.png new file mode 100644 index 000000000..793fb831b Binary files /dev/null and b/mds-intro/enableopsi/images/sql-explorer.png differ diff --git a/mds-intro/enableopsi/images/sql-insights.png b/mds-intro/enableopsi/images/sql-insights.png new file mode 100644 index 000000000..e72d06251 Binary files /dev/null and b/mds-intro/enableopsi/images/sql-insights.png differ diff --git a/mds-intro/enableopsi/images/sql-latency-insights.png b/mds-intro/enableopsi/images/sql-latency-insights.png new file mode 100644 index 000000000..3b3c66882 Binary files /dev/null and b/mds-intro/enableopsi/images/sql-latency-insights.png differ diff --git a/mds-intro/enableopsi/images/sql-query-table.png b/mds-intro/enableopsi/images/sql-query-table.png new file mode 100644 index 000000000..cb342b9a3 Binary files /dev/null and b/mds-intro/enableopsi/images/sql-query-table.png differ diff --git a/mds-intro/enableopsi/images/sql-query-visual.png b/mds-intro/enableopsi/images/sql-query-visual.png new file mode 100644 index 000000000..63472f172 Binary files /dev/null and b/mds-intro/enableopsi/images/sql-query-visual.png differ diff --git a/mds-intro/enableopsi/images/sql-query.png b/mds-intro/enableopsi/images/sql-query.png new file mode 100644 index 000000000..47bbec709 Binary files /dev/null and b/mds-intro/enableopsi/images/sql-query.png differ diff --git a/mds-intro/enableopsi/images/storage-insights.png b/mds-intro/enableopsi/images/storage-insights.png new file mode 100644 index 000000000..635de5f11 Binary files /dev/null and b/mds-intro/enableopsi/images/storage-insights.png differ diff --git a/mds-intro/enableopsi/images/storage-menu-ocw.png b/mds-intro/enableopsi/images/storage-menu-ocw.png new file mode 100644 index 000000000..0685da3a7 Binary files /dev/null and b/mds-intro/enableopsi/images/storage-menu-ocw.png differ diff --git a/mds-intro/enableopsi/images/storage-trend-forecast-auto-ml.png b/mds-intro/enableopsi/images/storage-trend-forecast-auto-ml.png new file mode 100644 index 000000000..84c10d93a Binary files /dev/null and b/mds-intro/enableopsi/images/storage-trend-forecast-auto-ml.png differ diff --git a/mds-intro/enableopsi/images/storage-trend-forecast-ml.png b/mds-intro/enableopsi/images/storage-trend-forecast-ml.png new file mode 100644 index 000000000..24be9da33 Binary files /dev/null and b/mds-intro/enableopsi/images/storage-trend-forecast-ml.png differ diff --git a/mds-intro/enableopsi/images/storage-trend-forecast.png b/mds-intro/enableopsi/images/storage-trend-forecast.png new file mode 100644 index 000000000..f2fd3eaac Binary files /dev/null and b/mds-intro/enableopsi/images/storage-trend-forecast.png differ diff --git a/mds-intro/enableopsi/images/storage-trend-max.png b/mds-intro/enableopsi/images/storage-trend-max.png new file mode 100644 index 000000000..1c21f594e Binary files /dev/null and b/mds-intro/enableopsi/images/storage-trend-max.png differ diff --git a/mds-intro/enableopsi/images/storage-utilization-forecast.png b/mds-intro/enableopsi/images/storage-utilization-forecast.png new file mode 100644 index 000000000..239d95d0e Binary files /dev/null and b/mds-intro/enableopsi/images/storage-utilization-forecast.png differ diff --git a/mds-intro/enableopsi/images/time-range.png b/mds-intro/enableopsi/images/time-range.png new file mode 100644 index 000000000..29ee697eb Binary files /dev/null and b/mds-intro/enableopsi/images/time-range.png differ diff --git a/mds-intro/enableopsi/images/trend-and-forecast.png b/mds-intro/enableopsi/images/trend-and-forecast.png new file mode 100644 index 000000000..569ece39a Binary files /dev/null and b/mds-intro/enableopsi/images/trend-and-forecast.png differ diff --git a/mds-intro/enableopsi/images/utilization-forecast.png b/mds-intro/enableopsi/images/utilization-forecast.png new file mode 100644 index 000000000..ee0f1b290 Binary files /dev/null and b/mds-intro/enableopsi/images/utilization-forecast.png differ diff --git a/mds-intro/introduction/introduction.md b/mds-intro/introduction/introduction.md index 24f5f8892..e73cc9a23 100644 --- a/mds-intro/introduction/introduction.md +++ b/mds-intro/introduction/introduction.md @@ -3,10 +3,10 @@ ## About this Workshop This lab will introduce you to a powerful union between MySQL Enterprise Edition and Oracle Cloud Infrastructure (OCI). You will learn how to create your first MySQL HeatWave Database Service in a secure OCI environment. You will also learn how to connect and use your MySQL HeatWave Database Service with the MySQL Shell tool. -EstimatedTime: 60 minutes +EstimatedTime: 80 minutes ### About this Product -The NEW MySQL HeatWave Database Service is the only database service that is 100% developed, managed, and supported by the MySQL team. +The NEW MySQL HeatWave Database Service is the only database service that is 100% developed, managed, and supported by the MySQL team. MySQL HeatWave Database Service is a fully managed service, running on Oracle Cloud Infrastructure. It enables you to: @@ -36,7 +36,7 @@ In this lab, you will be guided through the following steps: * Configure a client Linux virtual machine. * Connect to and use MySQL HeatWave Database Service. * Manage MySQL HeatWave Database Service. - +* Explore capacity planning and SQL Insights for HeatWave MySQL. ## Prerequisites @@ -50,4 +50,4 @@ In this lab, you will be guided through the following steps: - **Author** - Perside Foster, MySQL Solution Engineering - **Contributors** - Sriram Vrinda, MySQL Product Manager -- **Last Updated By/Date** - Perside Foster, MySQL Solution Engineering, March 2024 +- **Last Updated By/Date** - Sindhuja Banka, October 2024 diff --git a/mds-intro/workshops/freetier/manifest.json b/mds-intro/workshops/freetier/manifest.json index 15bce9f70..62deecc52 100644 --- a/mds-intro/workshops/freetier/manifest.json +++ b/mds-intro/workshops/freetier/manifest.json @@ -1,7 +1,7 @@ { "workshoptitle": "Launch Your First MySQL HeatWave Database System - Administrators", "help": "livelabs-help-db_us@oracle.com", - "tutorials": [ + "tutorials": [ { "title": "Introduction", "description": "The Introduction is always second. The title and contents menu title match for the Introduction.", @@ -25,10 +25,14 @@ "title": "Lab 3: Enable and explore Database Management for MySQL Heatwave", "filename": "../../enabledbm/enabledbm.md" }, + { + "title": "Lab 4: Enable and explore Ops Insights for HeatWave MySQL", + "filename": "../../enableopsi/enableopsi.md" + }, { "title": "Need Help?", "description": "Solutions to Common Problems and Directions for Receiving Live Help", "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-freetier.md" } ] -} +} \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/dbca-typical-advanced.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/dbca-typical-advanced.md new file mode 100644 index 000000000..bbc08b11f --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/dbca-typical-advanced.md @@ -0,0 +1,301 @@ +# Create Container Database + +## Introduction + +This lab shows how to create an Oracle Database using Oracle Database Configuration Assistant (Oracle DBCA). + +If your host has only the database software, then you run Oracle DBCA and create a database. Along the database software if you have created an Oracle Database and want to create additional databases, then you can use Oracle DBCA. Oracle DBCA helps you create databases, but it does not install the database software. + +With Oracle DBCA, you can create a database in the following modes. + - *Typical* + - *Advanced* + +Estimated time: 1 hour + +### Objectives + + - Start Oracle DBCA from Oracle home 1 + - Create an Oracle Database with *Typical configuration* in Oracle home 1 + - Start Oracle DBCA from Oracle home 2 + - Create an Oracle Database with *Advanced configuration* in Oracle home 2 + +> **Note**: [](include:oracle-home) + +### Prerequisites + +This lab assumes you have - + - An Oracle Cloud account + - Completed all previous labs successfully + - Installed the Oracle Database software, configured Oracle homes, and created databases on the host + +> **Note**: [](include:example-values) + +## Task 1: Start Oracle DBCA from Oracle home 1 + +You can run Oracle DBCA only after you install the Oracle Database software using the database installer.  + +In this task, you will start Oracle DBCA from Oracle home 1. + +1. Open a terminal window and go to the `bin` directory in Oracle home 1. + This is the directory where Oracle DBCA is located. + + ``` + $ cd /u01/app/oracle/product/23.4.0/dbhome_1/bin + ``` + + > **Note**: [](include:oracle-user) + +1. Run this command to start Oracle DBCA. + + ``` + $ ./dbca + ``` + +Now, create a database with *Typical configuration* as explained in the next task. + +## Task 2: Create a Container Database with Typical configuration + +With Typical configuration, you can create an Oracle Database in few steps with minimal options. + +In this task, you will select *Typical configuration* to create an Oracle Database, *orcl2*, in Oracle home 1. + +1. Oracle DBCA starts with the Database Operation window and displays with the default option **Create a database** selected. Click **Next**. + + ![Create a database](./../intro-install/images/dbca23-common-01-create-db.png " ") + + > **Tip**: With Oracle DBCA, you can perform other administrative tasks, such as configure or delete an existing database and manage PDBs and templates. These are not included in this workshop. + +1. The window displays the default creation mode, **Typical configuration**, selected with prefilled basic configuration.  + + For this task, specify the following. + + - **Global database name** - Enter a unique name, for example *orcl2.us.oracle.com* + - **Administrative password** - Set the password for database administrators, for example *We!come1* + The password must conform to the Oracle recommended standards. + - **Pluggable database name** - Enter a name for the pdb, for example *orcl2pdb* + + For the remaining fields, leave the defaults and click **Next**. + + ![Select Typical configuration](./images/dbca23-typical-02-create-mode.png " ") + + [](include:global-dbname) + + [](include:adm-users) + + The default **Database Character set** for Oracle Database is *AL32UTF8 - Unicode UTF-8 Universal character set*. + + > [](include:char-set) + + Along with the Container Database (CDB), Oracle DBCA also creates a Pluggable Database (PDB) with the name you specify in this window. + +1. Before creating the database, the Summary window displays the database configuration for final review. You can verify the details in this window. + + ![Review Summary](./images/dbca23-typical-03-summary-top.png " ") + + Click **Finish** to create your Oracle Database. The Progress Page window displays the status of database creation. + + > **Note**: You require scripts to configure the Oracle Database software but for creating a database, you do not require any scripts. + + On completion, Oracle DBCA displays the Finish window.  + + ![Finish database creation](./images/dbca23-typical-05-finish.png " ") + + You have successfully created an Oracle Database, *orcl2*, using Oracle DBCA in Oracle home 1. + + **Password Management** + + In the Finish window, click **Password Management** to view the preexisting user accounts in your database. Except SYS and SYSTEM, all users are initially in locked state. + + ![Password Management](./images/dbca23-typical-06-pwd-mgmt.png " ") + + You can administer user accounts in the Password Management window, such as unlock a user or set the password. However, you can do these tasks later. + + Click **OK** if you want to save any changes and close the Password Management window. + +Click **Close** in the Finish window to exit Oracle DBCA. + +Next, you will create a database with Advanced configuration. Though you can create multiple databases using different modes in the same Oracle home, for this lab, run Oracle DBCA from another Oracle home.  + +## Task 3: Start Oracle DBCA from Oracle home 2 + +In this task, you will start Oracle DBCA from Oracle home 2. + +1. Open a terminal window and go to the `bin` directory in Oracle home 2. + This is the directory where Oracle DBCA is located. + + ``` + $ cd /u01/app/oracle/product/23.4.0/dbhome_2/bin + ``` + +1. Run this command to start Oracle DBCA. + + ``` + $ ./dbca + ``` + +Now, create and configure a database in the *Advanced mode* as explained in the next task. + +## Task 4: Create and configure a Container Database with Advanced configuration + +Using the Advanced configuration option, you can specify detailed configuration of your Oracle Database.  + +In this task, you will select *Advanced configuration* to create an Oracle Database, *orcl3*, in Oracle home 2. + +1. Oracle DBCA starts with the Database Operation window and displays with the default option **Create a database** selected. Click **Next**. + + ![Create a database](./../intro-install/images/dbca23-common-01-create-db.png " ") + +1. In the Creation Mode window, select **Advanced configuration** and click **Next**. + + ![Select Advanced configuration](./images/dbca23-adv-02-adv-mode.png " ") + + [](include:dbca-adv) + +1. You can select the database type and template suitable for your Oracle Database in the Deployment Type window. + + For this lab, leave the defaults and click **Next**. + - **Database type**: *Oracle Single Instance database* + - **Template name**: *General Purpose or Transaction Processing* + + This template includes basic configuration for the database, such as database components, initialization parameters, data files, control files, and redo log groups. + + ![Select database template](./images/dbca23-adv-03-template.png " ") + + > **Tip**: For environments that are more complex, you can select the Custom Database option. This option does not use any templates and it usually increases the time taken to create an Oracle Database. For this lab, do not select this option. + +1. The Database Identification window displays prefilled names and Oracle System Identifier (SID) for your database. + + ![Define Oracle SID](./images/dbca23-adv-04-sid.png " ") + + For this task, specify the following. + - **Global database name** - Enter a unique name, for example *orcl3.us.oracle.com* + - **SID** - *orcl3* + - **PDB name** - *orcl3pdb1* + + > [](include:oracle-sid) + + Along with the CDB, Oracle DBCA also creates a PDB with the name you specify in this window. Though you can create multiple PDBs together, for this task, create only a single PDB. + For the remaining fields, leave the defaults and click **Next**. + +1. The Storage Option window displays the default option **Use template file for database storage attributes** selected. + + In this option, the database uses the directory information specified in the *General Purpose or Transaction Processing* template. + + ![Select Storage file system](./images/dbca23-adv-05-storage.png " ") + + For this task, leave the defaults and click **Next**. + + > **Tip**: You can specify another location to store the database files with the **Use following for the database storage attributes** option. With this option, you can select the storage type as File system or Oracle Automatic Storage Management (Oracle ASM). For this lab, do not select these options. + +1. Select **Specify Fast Recovery Area** to set up a backup and recovery area for your database. The recovery information will be stored as File System in the specified location.  + + ![Enable Recovery](./images/dbca23-adv-06-recovery.png " ") + + The Fast Recovery Option window displays the default parameters prefilled. + + - **Recovery files storage type** - *File System* + - **Fast Recovery Area** - the directory for recovery-related files + - **Fast Recovery Area size** - size of the recovery area + + You can select the storage type or specify the directory location and size of the recovery area. For this task, leave the defaults and click **Next**. + + > **Tip**: The **Enable archiving** option is for archiving the online redo log files. These files are useful during Oracle Database recovery. For this task, do not select this option. + +1. In the Network Configuration window, you can view the existing listener and select it for your database or create a new listener. For this task, deselect the existing listener if already selected. + + Select the option **Create a new listener** and enter the following: + - **Listener name** - *LISTENER1* + - **Listener port** - *1526* + + ![Specify Listener configuration](./images/dbca23-adv-07-listener.png " ") + + > A ***Listener*** is a network service that runs on the database server. It is responsible for receiving incoming connection requests to and from the database and for managing the network traffic. + - If you created an Oracle Database earlier, then a listener already exists on your host. + - If you installed only the Oracle Database software and did not create a database, then your host does not have any listener. + + You cannot create multiple listeners on a host with the same name. If a listener with the specified name already exists, then enter a different name, for example, *LISTENER23*. Similarly, specify a *unique port number* for each listener on the host.  + +1. With Oracle DBCA you can configure Oracle Database Vault and Oracle Label Security to control administrative access to your data and to individual table rows. + + ![Oracle Data Vault Security](./images/dbca23-adv-08-vault.png " ") + + For this task, do not select these options and click **Next**. + +1. You can specify the following configuration options for Oracle Database.  + + - **Memory** - The *Use Automatic Shared Memory Management* method enables you to allocate specific volume of memory to SGA and aggregate PGA. For optimum use of disk space, you can move the indicator to the left and decrease the size of the SGA and PGA values. + + Oracle Database enables automatic shared memory for SGA and distributes the remaining memory among individual PGAs as required. + For more information about memory management, see [About Automatic Shared Memory Management](https://docs.oracle.com/en/database/oracle/oracle-database/23/admin/managing-memory.html#GUID-B8B8923C-4213-42A9-8ED3-4ABE48C23914). + + ![Specify memory](./images/dbca23-adv-09a-memory.png " ") + + - *Manual Shared Memory Management* - to enter specific values for each SGA component and the aggregate PGA. It is useful for advanced database administration. + + - *Automatic Memory Management* - to set the usable memory in the memory target. The system then dynamically configures the memory components of both SGA and PGA instances. + + > **Tip**: If the total physical memory of your Oracle Database instance is greater than 4 GB, you cannot select the `Use Automatic Memory Management` option. Instead, *Use Automatic Shared Memory Management* to distribute the available memory among various components as required, thus the system can maximize the use of all available SGA memory. + + - **Sizing** - Specify the maximum number of processes that can connect simultaneously to your Oracle Database, for example, *320*. + + ![Block size and processes](./images/dbca23-adv-09b-size.png " ") + + > While using predefined templates, the **Block size** option is not enabled. Oracle DBCA creates an Oracle Database with the default block size of *8 KB*. + + - **Character sets** - The *Use Unicode (AL32UTF8)* option is selected by default. + + ![Select Character set](./images/dbca23-adv-09c-char-set.png " ") + + > [](include:char-set) + + - **Connection mode** - *Dedicated server mode* uses a dedicated server process for each user process. + + ![Select Dedicated server mode](./images/dbca23-adv-09d-conn-mode.png " ") + + For this task, leave the defaults for each tab and continue. + +1. In the Management Options window, you can register your database with Oracle Enterprise Manager (EM).  + + For this lab, leave this option unselected and click **Next**. + + ![Register with EM](./images/dbca23-adv-10-em.png " ") + + > **Note**: [](include:register-em) + +1. Set the password for the database administrators. Though you can specify different passwords for each user, for this lab, select **Use the same administrative password for all accounts**. + + Enter the password, for example *We!come1*, and click **Next**. + The password must conform to the Oracle recommended standards. + + ![Set administrative password](./images/dbca23-adv-11-sys-pwd.png " ") + + [](include:adm-users) + +1. The Creation Option window displays the default option **Create database** selected. + For the remaining fields, leave the defaults and click **Next**. + + ![Select database create options](./images/dbca23-adv-12-create-options.png " ") + +1. Before installing the database, the Summary window displays the database configuration for final review. You can verify the details in this window. + + ![Review Summary](./images/dbca23-adv-13-summary-top.png " ") + + Click **Finish** to create your Oracle Database. The Progress Page window displays the status of database creation.  + + On completion, Oracle DBCA displays the Finish window. + + ![Finish database creation](./images/dbca23-adv-15-finish.png " ") + +You have successfully created an Oracle Database using Oracle DBCA in Oracle home 2. Click **Close** in the Finish window to exit Oracle DBCA. + +> **Note**: The Password Management window functions the same as explained in the previous task. You can administer the user accounts in your database, such as unlock a user or set the passwords. However, you can do these tasks later. + +Congratulations! You have reached the end of this workshop on *Oracle Database installation*. + +In this workshop, you learned how to install the Oracle Database software on your host using the database installer and configure a database with Desktop class and Server class. You also created additional databases using Oracle DBCA with both Typical configuration and Advanced configuration. You can now manage and administer your Oracle Database. + +## Acknowledgments + + - **Author**: Manish Garodia, Database User Assistance Development + - **Contributors**: Prakash Jashnani, Subhash Chandra, Subrahmanyam Kodavaluru, Manisha Mati + - **Last Updated By/Date**: Manish Garodia, October 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-02-adv-mode.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-02-adv-mode.png new file mode 100644 index 000000000..ddcef5171 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-02-adv-mode.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-03-template.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-03-template.png new file mode 100644 index 000000000..5f15466e1 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-03-template.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-04-sid.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-04-sid.png new file mode 100644 index 000000000..4fd978f43 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-04-sid.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-05-storage.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-05-storage.png new file mode 100644 index 000000000..f7dd21e47 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-05-storage.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-06-recovery.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-06-recovery.png new file mode 100644 index 000000000..5e4fd53be Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-06-recovery.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-07-listener.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-07-listener.png new file mode 100644 index 000000000..d52d8c77a Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-07-listener.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-08-vault.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-08-vault.png new file mode 100644 index 000000000..32eab302e Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-08-vault.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-09a-memory.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-09a-memory.png new file mode 100644 index 000000000..157fc4b1e Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-09a-memory.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-09b-size.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-09b-size.png new file mode 100644 index 000000000..ecdb5d17a Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-09b-size.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-09c-char-set.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-09c-char-set.png new file mode 100644 index 000000000..9abd22901 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-09c-char-set.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-09d-conn-mode.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-09d-conn-mode.png new file mode 100644 index 000000000..fc40e0976 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-09d-conn-mode.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-10-em.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-10-em.png new file mode 100644 index 000000000..18aec4b8a Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-10-em.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-11-sys-pwd.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-11-sys-pwd.png new file mode 100644 index 000000000..a2638ee3b Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-11-sys-pwd.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-12-create-options.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-12-create-options.png new file mode 100644 index 000000000..ddc11cdc3 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-12-create-options.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-13-summary-top.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-13-summary-top.png new file mode 100644 index 000000000..fb10b4e76 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-13-summary-top.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-15-finish.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-15-finish.png new file mode 100644 index 000000000..3b5a6af12 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-adv-15-finish.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-typical-02-create-mode.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-typical-02-create-mode.png new file mode 100644 index 000000000..f61229669 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-typical-02-create-mode.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-typical-03-summary-top.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-typical-03-summary-top.png new file mode 100644 index 000000000..40035fc11 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-typical-03-summary-top.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-typical-05-finish.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-typical-05-finish.png new file mode 100644 index 000000000..68b183d47 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-typical-05-finish.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-typical-06-pwd-mgmt.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-typical-06-pwd-mgmt.png new file mode 100644 index 000000000..8e16ebd15 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/dbca-typical-advanced/images/dbca23-typical-06-pwd-mgmt.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-02-desktop-class.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-02-desktop-class.png new file mode 100644 index 000000000..ca4ffd413 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-02-desktop-class.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-03-config.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-03-config.png new file mode 100644 index 000000000..e27cff66d Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-03-config.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-04-inventory.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-04-inventory.png new file mode 100644 index 000000000..d98f06f9b Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-04-inventory.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-05-root-script.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-05-root-script.png new file mode 100644 index 000000000..af8a84ce9 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-05-root-script.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-06-prereq-check.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-06-prereq-check.png new file mode 100644 index 000000000..99a095705 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-06-prereq-check.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-07-summary-top.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-07-summary-top.png new file mode 100644 index 000000000..f9a0b2107 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-07-summary-top.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-08-root-script.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-08-root-script.png new file mode 100644 index 000000000..97c9de441 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-08-root-script.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-09-install-success.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-09-install-success.png new file mode 100644 index 000000000..0c07d1195 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-desk-09-install-success.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-016-root-script.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-016-root-script.png new file mode 100644 index 000000000..40434ea84 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-016-root-script.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-02-server-class.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-02-server-class.png new file mode 100644 index 000000000..4044ac5a9 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-02-server-class.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-03-edition.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-03-edition.png new file mode 100644 index 000000000..67b579d66 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-03-edition.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-04-base-dir.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-04-base-dir.png new file mode 100644 index 000000000..0aa4a54c4 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-04-base-dir.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-05-config-template.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-05-config-template.png new file mode 100644 index 000000000..3220d3ba3 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-05-config-template.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-06-sid.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-06-sid.png new file mode 100644 index 000000000..1568d824e Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-06-sid.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-07a-memory.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-07a-memory.png new file mode 100644 index 000000000..d0b8f7a55 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-07a-memory.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-07b-char-set.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-07b-char-set.png new file mode 100644 index 000000000..2203dff88 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-07b-char-set.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-08-storage-filesys.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-08-storage-filesys.png new file mode 100644 index 000000000..b248c483e Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-08-storage-filesys.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-09-em.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-09-em.png new file mode 100644 index 000000000..79dc84be5 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-09-em.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-10-recovery.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-10-recovery.png new file mode 100644 index 000000000..82f92b586 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-10-recovery.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-11-adm-pwd.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-11-adm-pwd.png new file mode 100644 index 000000000..85201ae37 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-11-adm-pwd.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-12-os-groups.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-12-os-groups.png new file mode 100644 index 000000000..3681fc398 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-12-os-groups.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-13-root-script.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-13-root-script.png new file mode 100644 index 000000000..04d2a5ad4 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-13-root-script.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-15-summary.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-15-summary.png new file mode 100644 index 000000000..b9f384342 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-15-summary.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-17-install-success.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-17-install-success.png new file mode 100644 index 000000000..c7dc837e4 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/images/db23-srv-17-install-success.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/install-desktop-server.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/install-desktop-server.md new file mode 100644 index 000000000..766a6744f --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/install-desktop-server/install-desktop-server.md @@ -0,0 +1,410 @@ +# Install Oracle Database + +## Introduction + +This lab walks you through the steps for installing the Oracle Database software, setting up Oracle home, and creating a database on your host using Oracle Database Setup Wizard (Database Installer). + +Estimated time: 1 hour + +### Objectives + + - Run the database installer from Oracle home 1 + - Install Oracle Database with *Desktop class* in Oracle home 1 + - Run the database installer from Oracle home 2 + - Install Oracle Database with *Server class* in Oracle home 2 + +To install both system classes on the same host, you require different Oracle home locations. + +> **Note**: [](include:oracle-home) + +### Prerequisites + +This lab assumes you have - + - An Oracle Cloud account + - Completed all previous labs successfully + - Downloaded the database installer + + > **Tip**: You can get the database installer from Oracle's [download site](https://www.oracle.com/database/free/get-started/). If you have reserved a Livelabs environment, then it has the installer already. + +Besides, you are installing Oracle Database for the first time and do not have Oracle home already configured on your host. + +> **Note**: [](include:example-values) + +## Task 1: Run the database installer from Oracle home 1 + +To install Oracle Database, the first step is to access and run the database installer. For this task, you require an installer in Oracle home 1. + +1. Open a terminal window and go to Oracle home 1 where the database installer resides. + In the Livelabs environment, an installer is located in the following directory. + + ``` + $ cd /u01/app/oracle/product/23.4.0/dbhome_1 + ``` + + > **Note**: [](include:oracle-user) + +1. From Oracle home 1, run this command to start the installer. + + ``` + $ ./runInstaller + ``` + +The installer displays the wizard to start Oracle Database installation. + +> **Note**: To run the installer, ensure that the `xdpyinfo` program is installed on your host. If the `oracle` user does not have executable privileges, then log in as `root` and run this command: +`xhost +SI:localuser:oracle` + +## Task 2: Install Oracle Database with Desktop class + +With Desktop class, you can install Oracle Database in few steps with basic configuration. + +In this task, you will select *Desktop class* to install the database software and create a database, *orcl*, in Oracle home 1. + +1. The Configuration Option window opens with the default option **Create and configure a single instance database** selected. This option helps you create a database.  + + ![Create a single instance database](./../intro-install/images/db23-common-01-install-db.png " ") + + > **Note**: The *Set Up Software Only* option installs only the database software but does not create any database. You can create a container database later with Oracle DBCA. For this lab, do not select this option. + + Click **Next**. + +1. The System Class window displays the default option **Desktop class** selected.  + In this system class, the database installer provides basic configuration for database installation. + + ![Select Desktop class](./images/db23-desk-02-desktop-class.png " ") + + Click **Next**. + +1. The Typical Install Configuration window displays prefilled names and values with configuration parameters. + + For this task, specify the following. + - **OSDBA group** - *dba* + - **Global database name** - Enter a unique name, for example *orcl.us.oracle.com* + - **Password** - Set the password for database administrators, for example *We!come1* + The password must conform to the Oracle recommended standards. + - **Pluggable database name** - Leave the default name, *orclpdb* + + For the remaining fields, leave the defaults and click **Next**. + + ![Select Typical configuration](./images/db23-desk-03-config.png " ") + + [](include:global-dbname) + + [](include:adm-users) + + The installer internally runs Oracle DBCA to create an Oracle Database. Along with the Container Database (CDB), it also creates a Pluggable Database (PDB) with the name you specify in this window. + +1. The installer prompts you to specify the location for *`oraInventory`*. This is the centralized inventory for all Oracle software products installed on the host. + + ![Set Inventory location](./images/db23-desk-04-inventory.png " ") + + > **Note**: The first time you install Oracle Database, the installer offers you to specify the inventory location. If Oracle Database is already installed on your host, then the next time you run the database installer, it does not prompt to configure inventory. The inventory location for your database is already set.  + + For this lab, do not change the default **Inventory Directory**. Select the operating system group for Oracle inventory as *dba* and click **Next**. + Note that *dba* is the primary group of the user who is installing the database.  + +1. The installer requires you to run scripts as the `root` user to configure the database software.  + Leave the option **Automatically run configuration scripts** unselected and click **Next**.  + + ![Check Root scripts](./images/db23-desk-05-root-script.png " ") + + > **Note**: If you specify the root credentials, then the installer will run the configuration scripts automatically. For this lab, run the scripts manually as explained later.  + +1. [](include:prereq-check) + + ![View Prerequisite checks](./images/db23-desk-06-prereq-check.png " ") + + Click **Next**. + +1. Before installing the database, the Summary window displays the database configuration for final review. You can verify the details in this window.  + + ![Review Summary](./images/db23-desk-07-summary-top.png " ") + + Click **Install** to start the database installation. The Install Product window displays the progress of database installation. + +1. During the installation, the installer displays the configuration scripts to run as the `root` user. Run these scripts to proceed with the installation. + + > **Caution**: Do not close this window. + + ![Run root scripts](./images/db23-desk-08-root-script.png " ") + + The installer displays this window because you opted to run the scripts manually in a previous step. Note that the window displays two scripts, of which *`orainstRoot.sh`* is to configure the inventory. The next time you run the database installer on the same host, it displays only one script, *`root.sh`*. + +1. Open a new terminal window and run the script *`orainstRoot.sh`* located in the `oraInventory` directory. + + ``` + $ sudo /u01/app/oraInventory/orainstRoot.sh + ``` + + > **Note**: You can run this script as `root` if you have the privileges. For this lab, use the `sudo` command. + + It returns the following. + + ``` + Changing permissions of /u01/app/oraInventory. + Adding read,write permissions for group. + Removing read,write,execute permissions for world. + + Changing groupname of /u01/app/oraInventory to dba. + The execution of the script is complete. + ``` + +1. In the same terminal, run another script *`root.sh`* located in Oracle home 1. + + ``` + $ sudo /u01/app/oracle/product/23.4.0/dbhome_1/root.sh + ``` + + > **Note**: You can run this script as `root` if you have the privileges. For this lab, use the `sudo` command. + + It returns the following. + + ``` + The following environment variables are set as: + + ORACLE_OWNER= oracle + ORACLE_HOME= /u01/app/oracle/product/23.4.0/dbhome_1 + + Enter the full pathname of the local bin directory: [/usr/local/bin]: + ``` + + Press Enter to continue. + + ``` + /usr/local/bin is read only. Continue without copy (y/n) or retry (r)? [y]: + ``` + + Press Enter to continue. + + ``` + Warning: /usr/local/bin is read only. No files will be copied. + + + Creating /etc/oratab file... + Entries will be added to the /etc/oratab file as needed by + Database Configuration Assistant when a database is created + Finished running generic part of root script. + Now product-specific root actions will be performed. + ``` + + You can close the terminal window. Running scripts are applicable for Linux and UNIX operating systems only. + +1. Return to the Run Configuration Scripts window and click **OK** to continue. The installer proceeds with creating the database according to your configuration. + + On completion, the installer displays the Finish window. + + ![Finish database installation](./images/db23-desk-09-install-success.png " ") + +Congratulations! You have successfully installed your Oracle Database, *orcl*, in Oracle home 1. Click **Close** in the Finish window to exit the database installer. + +Next, you will install Oracle Database with *Server class*. + +## Task 3: Run the database installer from Oracle home 2 + +To install the Oracle Database software again on the same host, you require another database installer in a different Oracle home location, Oracle home 2. + + +1. Open a terminal window and go to Oracle home 2 where another installer resides. + In the Livelabs environment, the installer is located in the following directory. + + ``` + $ cd /u01/app/oracle/product/23.4.0/dbhome_2 + ``` + +1. From Oracle home 2, run this command to start the installer. + + ``` + $ ./runInstaller + ``` + +The installer displays the wizard to start Oracle Database installation. + +## Task 4: Install and configure Oracle Database with Server class + +Using the Server class option, you can perform advanced database installation with detailed configuration.  + +In this task, you will select *Server class* to install the database software and create a database, *orcl1*, in Oracle home 2.  + +1. The Configuration Option window displays the default option to create and configure a database. + + ![Create a single instance database](./../intro-install/images/db23-common-01-install-db.png " ") + + > **Note**: The *Set Up Software Only* option installs only the database software. For this task, do not select this option. + + Click **Next**. + +1. Select **Server class** in the System Class window to perform a detailed installation.  + In this system class, the database installer provides more options to configure your database. + + ![Select Server class](./images/db23-srv-02-server-class.png " ") + + Click **Next**. + +1. The Database Edition window displays the default option, **Enterprise Edition**, selected. + This option installs a database suitable for large enterprises. Click **Next**. + + ![Select Enterprise Edition](./images/db23-srv-03-edition.png " ") + + > **Tip**: *Standard Edition 2* is suitable for small and medium-sized businesses. + +1. In the Installation Location window, you can select the Oracle base location.  + + ![Specify Oracle Base directory](./images/db23-srv-04-base-dir.png " ") + + For this task, leave the default location and click **Next**. + +1. The installer does not prompt to configure the inventory location and goes directly to the Configuration Type window. + + The window displays the default template **General Purpose / Transaction Processing** selected. This template includes basic configuration for the database, such as database components, initialization parameters, data files, control files, and redo log groups.  + + ![Select database template](./images/db23-srv-05-config-template.png " ") + + > **Note**: If a host does not have Oracle Database installed, then the installer displays an option to set up inventory. As you have installed Oracle Database in the previous task, inventory on your host is already configured. + + Leave the default template and click **Next**. + +1. The Database Identifiers window displays prefilled names and Oracle System Identifier (SID) for your database. + + ![Define Oracle SID](./images/db23-srv-06-sid.png " ") + + For this task, specify the following. + - **Global database name** - Enter a unique name, for example *orcl1.us.oracle.com* + - **Oracle system identifier (SID)** - *orcl1* + - **Pluggable database name** - *orcl1pdb* + + > [](include:oracle-sid) + + The installer internally runs Oracle DBCA to create an Oracle Database. Along with the CDB, it also creates a PDB with the name you specify in this window. + +1. In the Configuration Options window, you can allocate memory and select character sets for your database.  + + - **Memory** - Specify the memory you want to allocate for your database, for example *6347* MB. + For optimum use of disk space, you can move the indicator next to **Allocate memory** to the left and decrease the size of the SGA and PGA values. + + ![Specify memory](./images/db23-srv-07a-memory.png " ") + + For this task, do not enable automatic memory management. To learn more about memory management, see [About Automatic Memory Management Installation Options](https://docs.oracle.com/en/database/oracle/oracle-database/23/ladbi/about-automatic-memory-management-installation-options.html#GUID-38F46564-B167-4A78-A974-8C7CEE34EDFE). + Go to the next tab.  + + - **Character sets** - The *Use Unicode (AL32UTF8)* option is selected by default. + + ![Select Character set](./images/db23-srv-07b-char-set.png " ") + + > [](include:char-set) + + For this lab, leave the defaults and click **Next**. + +1. The installer displays options to select the storage type and data file location for your database. + Leave the defaults and click **Next**. + + ![Select Storage file system](./images/db23-srv-08-storage-filesys.png " ") + + Using Oracle Automatic Storage Management (Oracle ASM), you can store your data files in ASM disk groups. For this lab, do not select this option. + +1. In the Management Options window, you can register your database with Oracle Enterprise Manager (EM).  + For this lab, leave this option unselected and click **Next**. + + ![Register with EM](./images/db23-srv-09-em.png " ") + + > **Tip**: [](include:register-em) + +1. Select **Enable Recovery** in the Recovery Options window for restoration of Oracle Database in event of a failure. + The recovery information will be stored as File System in the specified location. Click **Next**. + + ![Enable Recovery](./images/db23-srv-10-recovery.png " ") + +1. Set the password for the database administrators. Though you can specify different passwords for each user, for this lab, select **Use the same password for all accounts**. + + Enter the password, for example *We!come1*, and click **Next**. + The password must conform to the Oracle recommended standards. + + ![Set administrative password](./images/db23-srv-11-adm-pwd.png " ") + + [](include:adm-users) + +1. You can select specific OS groups to grant the corresponding SYS privileges to database administrators. The drop-down menu displays the groups to which your user belongs.  + For this lab, select *dba* for all groups and click **Next**. + + ![Select OS groups](./images/db23-srv-12-os-groups.png " ") + +1. The installer requires you to run scripts as the root user to configure the database software.  + Leave the option **Automatically run configuration scripts** unselected and click **Next**.  + + ![Check Root scripts](./images/db23-srv-13-root-script.png " ") + + > **Note**: If you specify the root credentials, then the installer will run the configuration scripts automatically. For this lab, run the scripts manually as explained later.  + +1. [](include:prereq-check) + + If you have fixed the issues in the previous task using the autogenerated script, then the installer does not display any problems and goes to the next window. + +1. Before installing the database, the Summary window displays the database configuration for final review. You can verify the details in this window.  + + ![Review Summary](./images/db23-srv-15-summary.png " ") + + Click **Install** to start the database installation. The Install Product window displays the progress of database installation. + +1. During the installation, the installer displays the configuration script to run as the `root` user. Run the script to proceed with the installation. + + > **Caution**: Do not close this window. + + ![Run root scripts](./images/db23-srv-016-root-script.png " ") + + The installer displays this window because you opted to run the scripts manually in a previous step. Note that the window displays only one script, *`root.sh`*. It does not display any script to configure the inventory. As you have installed Oracle Database in the previous task, inventory on your host is already configured. + +1. Open a new terminal window and run another script *`root.sh`* located in Oracle home 2. + + ``` + $ sudo /u01/app/oracle/product/23.4.0/dbhome_2/root.sh + ``` + + > **Note**: You can run this script as `root` if you have the privileges. For this lab, use the `sudo` command. + + It returns the following. + + ``` + The following environment variables are set as: + + ORACLE_OWNER= oracle + ORACLE_HOME= /u01/app/oracle/product/23.4.0/dbhome_2 + + Enter the full pathname of the local bin directory: [/usr/local/bin]: + ``` + + Press Enter to continue. + + ``` + /usr/local/bin is read only. Continue without copy (y/n) or retry (r)? [y]: + ``` + + Press Enter to continue. + + ``` + Warning: /usr/local/bin is read only. No files will be copied. + + + Entries will be added to the /etc/oratab file as needed by + Database Configuration Assistant when a database is created + Finished running generic part of root script. + Now product-specific root actions will be performed. + ``` + + You can close the terminal window. Running scripts are applicable for Linux and UNIX operating systems only.  + +1. Return to the Run Configuration Scripts window and click **OK** to continue. The installer proceeds with creating the database according to your configuration. + + On completion, the installer displays the Finish window. + + ![Finish database installation and configuration](./images/db23-srv-17-install-success.png " ") + +You have successfully installed and configured your Oracle Database, *orcl1*, in Oracle home 2. Click **Close** in the Finish window to exit the database installer.  + +In this lab, you installed Oracle Database with Desktop class in Oracle home 1 location and with Server class in Oracle home 2. You used the database installer for configuring the database software and creating databases, *orcl* and *orcl1*. You now have two Oracle homes configured on your host. Next, you can create additional databases using Oracle DBCA.  + +You may now **proceed to the next lab**. + +## Acknowledgments + + - **Author**: Manish Garodia, Database User Assistance Development + - **Contributors**: Prakash Jashnani, Subhash Chandra, Subrahmanyam Kodavaluru, Manisha Mati + - **Last Updated By/Date**: Manish Garodia, October 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/adm-users.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/adm-users.txt new file mode 100644 index 000000000..ed063626e --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/adm-users.txt @@ -0,0 +1 @@ +Oracle Database contains schemas or users for management and administrative actions. The password you specify in this window is for the administrators, namely SYS, SYSTEM, and PDBADMIN. Note the password you enter in this window. After the installation, you require this password to connect to the database. diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/char-set.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/char-set.txt new file mode 100644 index 000000000..afdf64efa --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/char-set.txt @@ -0,0 +1 @@ +*AL32UTF8* is Oracle's name for the standard Unicode encoding UTF-8, which enables universal support for virtually all languages of the world. diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/dbca-adv.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/dbca-adv.txt new file mode 100644 index 000000000..1f5115804 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/dbca-adv.txt @@ -0,0 +1 @@ +In this mode, you can customize the configurations of your database, such as initialization parameters, network configurations, memory management, passwords for administrators, and so on. diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/example-values.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/example-values.txt new file mode 100644 index 000000000..ba6609575 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/example-values.txt @@ -0,0 +1 @@ +This lab contains system-specific values and paths. These details might vary depending on the system you are using. \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/global-dbname.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/global-dbname.txt new file mode 100644 index 000000000..2d313f448 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/global-dbname.txt @@ -0,0 +1 @@ +You cannot create multiple databases on a host with the same **Global database name**. If an Oracle Database with the specified name already exists, then enter a different name, for example *orcl4.us.oracle.com*. diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/oracle-home.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/oracle-home.txt new file mode 100644 index 000000000..3c1b8d35a --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/oracle-home.txt @@ -0,0 +1 @@ +This workshop uses two Oracle homes for demonstration purpose. It is not a requirement for Oracle Database to have two homes. A single Oracle home is sufficient to install and manage a single instance multitenant Container Database (CDB). \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/oracle-sid.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/oracle-sid.txt new file mode 100644 index 000000000..4fcbbe5ca --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/oracle-sid.txt @@ -0,0 +1,2 @@ +***Oracle SID*** is a unique name given to an Oracle Database. It distinguishes Oracle Database instances installed on your host. +You cannot create multiple Oracle Databases on a host with the same SID. If an Oracle Database with the specified SID already exists, then enter a different SID, for example *orcl4*. Similarly, specify a *unique Global database name* for each Oracle Database on the host. diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/oracle-user.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/oracle-user.txt new file mode 100644 index 000000000..a8df4eff9 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/oracle-user.txt @@ -0,0 +1 @@ +You are logged in to your host as the *oracle* user. This user is authorized to install the Oracle Database software and create Oracle Database. diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/prereq-check.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/prereq-check.txt new file mode 100644 index 000000000..e398c2039 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/prereq-check.txt @@ -0,0 +1,4 @@ +The database installer performs prerequisite checks to verify the installation and configuration requirements on the target environment. + + - If the verification result shows failures, then click **Fix & Check Again**. The installer generates a script that you can run and fix the issues automatically. + - If the issues are minor, then you can click **Ignore All** and proceed with the installation. diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/register-em.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/register-em.txt new file mode 100644 index 000000000..39c05685b --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/files/register-em.txt @@ -0,0 +1,2 @@ +If you register with Oracle Enterprise Manager, then you can manage your database in a web browser from the EM console. To register with EM, you require some details, such as OMS host name, port number, and the EM administrative credentials. +However, instead of registering from this window, you can use the discovery process in EM and add your Oracle Database as a managed target. diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/images/db23-common-01-install-db.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/images/db23-common-01-install-db.png new file mode 100644 index 000000000..7b454ff6d Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/images/db23-common-01-install-db.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/images/dbca23-common-01-create-db.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/images/dbca23-common-01-create-db.png new file mode 100644 index 000000000..d1cda9ea1 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/images/dbca23-common-01-create-db.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/images/install-db.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/images/install-db.png new file mode 100644 index 000000000..f69dfe588 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/images/install-db.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/intro-install.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/intro-install.md new file mode 100644 index 000000000..2247e2b1c --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/intro-install/intro-install.md @@ -0,0 +1,125 @@ +# Oracle Database installation + +## About this workshop + +This workshop provides detailed steps for installing a new *Oracle Database 23ai* on your host. It helps you install the Oracle Database software and create a single instance database. It demonstrates different ways of installing the software and creating additional databases. + +> **Note**: Upgrading an existing Oracle Database to a later version is not within the scope of this workshop.  + +Estimated workshop time: 2 hours 45 minutes + +Watch this video to learn about the *highlights of Oracle Database 23ai*. + +[](youtube:TRDDsStoMxc) + +### Objectives + +In this workshop, you will do the following. + - Install Oracle Database with - + - *Desktop class* + - *Server class* + - Create a database with - + - *Typical configuration* + - *Advanced configuration* + +> For database installation, use **Oracle Database Setup Wizard (Database Installer)**. +> For creating databases, use **Oracle Database Configuration Assistant (Oracle DBCA)**. + +### Prerequisites + +This lab assumes you have - + + - An Oracle Cloud account + +## How to install Oracle Database? + +![Install Oracle Database](./images/install-db.png " ") + +You can install Oracle Database in two ways: + + - Create and configure a single instance database + - Install Oracle Database software and then create the database + +For this purpose, Oracle provides the following tools: + + - Database installer + - Oracle DBCA + +### About database installer + +The database installer is a graphical user interface utility to systematically install Oracle Database through a wizard. Using the installer, you can install the database software, set Oracle home, and create an Oracle Database. + +The installer has the ability to verify whether Oracle home is already configured on your host. When you install Oracle Database for the first time, the installer provides option to configure the central inventory location. If Oracle home is already configured on your host, then the installer uses the existing centralized inventory for additional software installation and database creation. + +For database installation, the installer offers two system classes - + - *Desktop class* with minimal configuration + - *Server class* with advanced configuration + +In a single Oracle home, you install the database software only one-time but can create multiple databases. Hence, to install both the system classes on the same host, you require different Oracle home locations.  + +In this workshop, you will install Oracle Database with Desktop class in one Oracle home and with Server class in another Oracle home. + +> **Note**: [](include:oracle-home) + +**Types of database installation** + +When you run the installer, you can select from the following options. + + - **Create and configure a single instance database** - to install the Oracle Database software and create an Oracle Database. + - **Set Up Software Only** - to install only the database software but not create any database. You can create the database later using Oracle DBCA. + +Depending on the type of installation, the installer can run Oracle DBCA internally or you can run Oracle DBCA after the installation. + +Consider the scenarios: + + - **Case #1**: You have installed only the database software with the database installer. Then, you must run Oracle DBCA to create a database. + + - **Case #2**: Along with installing the database software, you have also created a database with the installer. You can still run Oracle DBCA to create additional databases. + +### About Oracle DBCA + +The Oracle DBCA tool helps you create and configure a single-instance Oracle Database in an already-installed Oracle home but does not install the database software.  + +> **Note**: You can run Oracle DBCA only after you install the Oracle Database software using the database installer. + +Oracle DBCA provides two database creation modes.  + + - *Typical* - In this mode, you have limited options to configure but can create a database in few steps. + - *Advanced* - [](include:dbca-adv) + +Follow the subsequent labs to install Oracle Database on your host and explore these options in detail. + +### Installation prerequisites + +Before installing the Oracle Database software, the installer performs several automated checks to verify whether the hardware and the software required for installation are available. If your system does not meet any specific requirement, then it displays a corresponding error message. The requirements may vary depending upon the system and the operating system you are using. + +### Minimum recommendations + + - 2 GB RAM + - Oracle Enterprise Linux 8.6, Red Hat Enterprise Linux 8.6 or later + - Sufficient swap space + - Installation of service packages and patches + - Use the correct file system format + - Access to the database installer + - General knowledge about product installation + +Oracle Database Enterprise Edition requires *8.3 GB* of local disk storage space to install the Oracle Database software. + +Oracle recommends that you allocate approximately *100 GB* to provide additional space for applying any future patches on top of the existing Oracle home. + +For more information, refer [Oracle Database Installation Checklist](https://docs.oracle.com/en/database/oracle/oracle-database/23/ladbi/oracle-database-installation-checklist.html#GUID-E847221C-1406-4B6D-8666-479DB6BDB046). + +Click the next lab to **Get Started**. + +## Learn more + + - [Oracle Database documentation](https://docs.oracle.com/database/oracle/oracle-database/index.html) + - [Oracle Database Free](https://www.oracle.com/in/database/free/) + - [Oracle Database Insider](https://blogs.oracle.com/database/) + - [Oracle Cloud Infrastructure documentation](https://docs.oracle.com/iaas/Content/home.htm) + +## Acknowledgments + + - **Author**: Manish Garodia, Database User Assistance Development + - **Contributors**: Prakash Jashnani, Subhash Chandra, Subrahmanyam Kodavaluru, Manisha Mati + - **Last Updated By/Date**: Manish Garodia, October 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/prepare-setup/prepare-setup.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/prepare-setup/prepare-setup.md new file mode 100644 index 000000000..a040911cd --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/prepare-setup/prepare-setup.md @@ -0,0 +1,62 @@ +# Prepare setup + +## Introduction + +This lab will show you how to download the Oracle Resource Manager (ORM) stack zip file needed to setup the resource needed to run this workshop. This workshop requires a compute instance running a marketplace image and a Virtual Cloud Network (VCN). + +Estimated time: 10 minutes + +### Objectives + + - Download ORM stack + - Configure an existing Virtual Cloud Network (VCN) + +### Prerequisites + +This lab assumes you have - + - An Oracle Cloud account + +## Task 1: Download Oracle Resource Manager (ORM) stack zip file + +1. Click on the link below to download the Resource Manager zip file you need to build your environment: + + - [instdb21c-mkplc-freetier.zip](https://objectstorage.us-ashburn-1.oraclecloud.com/p/mZMIb1j-Ne-DYQ4wH1ZjkfIDjX3deu5NSvlDsQjFZ4sInFIBSFpFJtpEUP2gCSRe/n/natdsecurity/b/stack/o/instdb21c-mkplc-freetier.zip) + +1. Save in your downloads folder. + +We recommend using this stack to create a self-contained/dedicated VCN with your instance(s). Skip to [Task 3](?lab=prepare-setup#Task3:Setupcompute) to follow our recommendations. If you would rather use an existing VCN then proceed to the next task as indicated below to update your existing VCN with the required Egress rules. + +## Task 2: Add security rules to an existing VCN + +This workshop requires a certain number of ports to be available, a requirement that can be met by using the default ORM stack execution that creates a dedicated VCN. In order to use an existing VCN, the following ports should be added to Egress rules. + +| Port | Description | +| :------------- | :------------------------------------ | +| 22 | SSH | +| 6080 | noVNC Remote Desktop | +{: title="Enable ports"} + +1. Go to **Networking** > **Virtual Cloud Networks** +1. Choose your network +1. Under **Resources**, select **Security Lists** +1. Click **Default Security Lists** under the **Create Security List** button +1. Click the **Add Ingress Rule** button +1. Enter the following: + - Source CIDR: 0.0.0.0/0 + - Destination Port Range: *Refer to the table* +1. Click the **Add Ingress Rules** button + +## Task 3: Setup compute + +Using the details from the previous two tasks, proceed to the lab **Setup compute instance** to setup your workshop environment using Oracle Resource Manager (ORM) and one of the following options: + + - Create Stack: **Compute + Networking** + - Create Stack: **Compute only** with an existing VCN where security lists have been updated as per *Task 2* of this lab + +You may now **proceed to the next lab**. + +## Acknowledgments + + - **Author** - Rene Fontcha, LiveLabs Platform Lead, NA Technology + - **Contributors** - Meghana Banka, Manish Garodia, Manisha Mati + - **Last Updated By/Date** - Manish Garodia, October 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/desktop/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/desktop/index.html new file mode 100644 index 000000000..6acdb69d1 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/desktop/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/desktop/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/desktop/manifest.json new file mode 100644 index 000000000..39a510fbe --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/desktop/manifest.json @@ -0,0 +1,48 @@ +{ + "workshoptitle": "DBA Essentials - Install Oracle Database 23ai software and create a database", + "help": "livelabs-help-db_us@oracle.com", + "include": { + "adm-users": "./../../intro-install/files/adm-users.txt", + "char-set": "./../../intro-install/files/char-set.txt", + "dbca-adv": "./../../intro-install/files/dbca-adv.txt", + "example-values": "./../../intro-install/files/example-values.txt", + "global-dbname": "./../../intro-install/files/global-dbname.txt", + "oracle-home": "./../../intro-install/files/oracle-home.txt", + "oracle-sid": "./../../intro-install/files/oracle-sid.txt", + "oracle-user": "./../../intro-install/files/oracle-user.txt", + "prereq-check": "./../../intro-install/files/prereq-check.txt", + "register-em": "./../../intro-install/files/register-em.txt" + }, + "tutorials": [ + { + "title": "Introduction", + "description": "The workshop on Oracle Database 23ai Installation.", + "publisheddate": "10/14/2024", + "filename": "./../../intro-install/intro-install.md" + }, + { + "title": "Use noVNC remote desktop", + "description": "Use noVNC Remote Desktop", + "publisheddate": "03/22/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/remote-desktop/using-novnc-remote-desktop.md" + }, + { + "title": "Lab 1: Install Oracle Database", + "description": "How to install the Oracle Database software and create a database with Desktop class (minimal configuration) and Server class (advanced configuration).", + "publisheddate": "10/14/2024", + "filename": "./../../install-desktop-server/install-desktop-server.md" + }, + { + "title": "Lab 2: Create Container Database", + "description": "How to create databases using Oracle DBCA with typical configuration and advanced configuration. It does not install the Oracle Database software.", + "publisheddate": "10/14/2024", + "filename": "./../../dbca-typical-advanced/dbca-typical-advanced.md" + }, + { + "title": "Need help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "publisheddate": "05/24/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-livelabs.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/sandbox/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/sandbox/index.html new file mode 100644 index 000000000..6acdb69d1 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/sandbox/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/sandbox/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/sandbox/manifest.json new file mode 100644 index 000000000..871d28eda --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/sandbox/manifest.json @@ -0,0 +1,48 @@ +{ + "workshoptitle": "DBA Essentials - Install Oracle Database 23ai software and create a database", + "help": "livelabs-help-db_us@oracle.com", + "include": { + "adm-users": "./../../intro-install/files/adm-users.txt", + "char-set": "./../../intro-install/files/char-set.txt", + "dbca-adv": "./../../intro-install/files/dbca-adv.txt", + "example-values": "./../../intro-install/files/example-values.txt", + "global-dbname": "./../../intro-install/files/global-dbname.txt", + "oracle-home": "./../../intro-install/files/oracle-home.txt", + "oracle-sid": "./../../intro-install/files/oracle-sid.txt", + "oracle-user": "./../../intro-install/files/oracle-user.txt", + "prereq-check": "./../../intro-install/files/prereq-check.txt", + "register-em": "./../../intro-install/files/register-em.txt" + }, + "tutorials": [ + { + "title": "Introduction", + "description": "The workshop on Oracle Database 23ai Installation.", + "publisheddate": "10/14/2024", + "filename": "./../../intro-install/intro-install.md" + }, + { + "title": "Lab 1: Verify compute instance setup", + "description": "Verify Setup of compute instance", + "publisheddate": "05/06/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/verify-compute/verify-compute-novnc.md" + }, + { + "title": "Lab 2: Install Oracle Database", + "description": "How to install the Oracle Database software and create a database with Desktop class (minimal configuration) and Server class (advanced configuration).", + "publisheddate": "10/14/2024", + "filename": "./../../install-desktop-server/install-desktop-server.md" + }, + { + "title": "Lab 3: Create Container Database", + "description": "How to create databases using Oracle DBCA with typical configuration and advanced configuration. It does not install the Oracle Database software.", + "publisheddate": "10/14/2024", + "filename": "./../../dbca-typical-advanced/dbca-typical-advanced.md" + }, + { + "title": "Need help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "publisheddate": "05/24/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-livelabs.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/tenancy/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/tenancy/index.html new file mode 100644 index 000000000..6acdb69d1 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/tenancy/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/tenancy/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/tenancy/manifest.json new file mode 100644 index 000000000..96402d5ce --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws1-install-db/workshops/tenancy/manifest.json @@ -0,0 +1,61 @@ +{ + "workshoptitle": "DBA Essentials - Install Oracle Database 23ai software and create a database", + "help": "livelabs-help-db_us@oracle.com", + "include": { + "adm-users": "./../../intro-install/files/adm-users.txt", + "char-set": "./../../intro-install/files/char-set.txt", + "dbca-adv": "./../../intro-install/files/dbca-adv.txt", + "example-values": "./../../intro-install/files/example-values.txt", + "global-dbname": "./../../intro-install/files/global-dbname.txt", + "oracle-home": "./../../intro-install/files/oracle-home.txt", + "oracle-sid": "./../../intro-install/files/oracle-sid.txt", + "oracle-user": "./../../intro-install/files/oracle-user.txt", + "prereq-check": "./../../intro-install/files/prereq-check.txt", + "register-em": "./../../intro-install/files/register-em.txt" + }, + "tutorials": [ + { + "title": "Introduction", + "description": "The workshop on Oracle Database 23ai Installation.", + "publisheddate": "10/14/2024", + "filename": "./../../intro-install/intro-install.md" + }, + { + "title": "Get started", + "description": "Get a Free Trial", + "publisheddate": "03/22/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/cloud-login.md" + }, + { + "title": "Lab 1: Prepare setup", + "description": "How to download your ORM stack and update security rules for an existing VCN.", + "publisheddate": "11/24/2022", + "filename": "./../../prepare-setup/prepare-setup.md", + "type": "default" + }, + { + "title": "Lab 2: Setup compute instance", + "description": "How to provision the workshop environment and connect to it", + "publisheddate": "03/22/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/setup-compute-generic/setup-compute-novnc.md" + }, + { + "title": "Lab 3: Install Oracle Database", + "description": "How to install the Oracle Database software and create a database with Desktop class (minimal configuration) and Server class (advanced configuration).", + "publisheddate": "10/14/2024", + "filename": "./../../install-desktop-server/install-desktop-server.md" + }, + { + "title": "Lab 4: Create Container Database", + "description": "How to create databases using Oracle DBCA with typical configuration and advanced configuration. It does not install the Oracle Database software.", + "publisheddate": "10/14/2024", + "filename": "./../../dbca-typical-advanced/dbca-typical-advanced.md" + }, + { + "title": "Need help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "publisheddate": "05/24/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-freetier.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/deinstall-db/deinstall-db.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/deinstall-db/deinstall-db.md new file mode 100644 index 000000000..3d64706d9 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/deinstall-db/deinstall-db.md @@ -0,0 +1,285 @@ +# Deinstall Oracle Database and remove Oracle home + +## Introduction + +This lab walks you through the steps for removing the Oracle Database software from your host. It not only shows how to delete the database but also removes Oracle home and the database components completely. + +Estimated time: 10 minutes + +### Objectives + +Remove the Oracle Database software, delete Oracle Database, and remove *Oracle home 2* from your host system using the *deinstall* command. + +> **Note**: [](include:user-data) + +### Prerequisites + +This lab assumes you have - + + - An Oracle Cloud Account + - Completed all previous labs successfully + +You are logged in to your host as *oracle*, the user who can remove Oracle Database. + +> **Note**: [](include:example-values) + +## Task 1: Remove Oracle Database software and delete Oracle Database + +In this task, you will remove the database, *orcl1*, from Oracle home 2 using the *`deinstall`* command. + +> **Note**: The `deinstall` command deletes Oracle Database configuration files, user data, and fast recovery area (FRA) files even if they are outside the Oracle base directory. + +1. Open a terminal window and go to Oracle home 2 where the `deinstall` command resides. + In the Livelabs environment, `deinstall` resides in the following directory. + + ``` + $ cd /u01/app/oracle/product/23.4.0/dbhome_2/deinstall + ``` + + > **Caution**: Do not shut down the database or stop any processes for the database that you are removing before running `deinstall`. + +1. Run this command to start the deinstallation process. + + ``` + $ ./deinstall + ``` + + > **Note**: For every step, `deinstall` displays the values in square brackets `[ ]`. You can press **Enter** to use the default or specify a different value manually.  + + ## Output + + It returns the following. + + ``` + Checking for required files and bootstrapping ... + Please wait ... + Location of logs /u01/app/oracle/oraInventory/logs/ + + ############ ORACLE DECONFIG TOOL START ############ + + + ######################### DECONFIG CHECK OPERATION START ######################### + ## [START] Install check configuration ## + + + Checking for existence of the Oracle home location /u01/app/oracle/product/23.4.0/dbhome_2 + Oracle Home type selected for deinstall is: Oracle Single Instance Database + Oracle Base selected for deinstall is: /u01/app/oracle + Checking for existence of central inventory location /u01/app/oracle/oraInventory + + ## [END] Install check configuration ## + + + Network Configuration check config START + + Network de-configuration trace file location: /u01/app/oracle/oraInventory/logs/netdc_check20XX-06-17_10-32-43AM.log + ``` + +1. The window prompts to specify the listeners that you want to unconfigure. + + ``` + Specify all Single Instance listeners that are to be de-configured. Enter .(dot) to deselect all. + [LISTENER]: **Enter** + ``` + + For this task, press **Enter** to remove the current listener. + + It returns the following. + + ``` + Network Configuration check config END + + Database Check Configuration START + + Database de-configuration trace file location: /u01/app/oracle/oraInventory/logs/databasedc_check20XX-06-17_10-35-37AM.log + ``` + +1. The window provides an option to specify the database instances that you want to remove from the current Oracle home. + + > **Tip**: If you have multiple database instances in an Oracle home, then you can either remove a specific database instance or remove all database instances together using `deinstall`. To specify multiple databases, enter the database name followed by a comma. + + ``` + Use comma as separator when specifying list of values as input + + Specify the list of database names that are configured in this Oracle home [orcl1]: **Enter** + ``` + + For this task, press **Enter** to remove the default database instance from Oracle home 2. + + ## Output + + It returns the following. + + ``` + ###### For Database 'orcl1' ###### + + Single Instance Database + The diagnostic destination location of the database: /u01/app/oracle/diag/rdbms/orcl1 + Storage type used by the Database: FS + Database file location: /u01/app/oracle/oradata/orcl1,/opt/oracle/recovery_area/orcl1 + Fast recovery area location: /u01/app/oracle/recovery_area/orcl1 + database spfile location: /u01/app/oracle/product/23.4.0/dbhome_2/dbs/spfileorcl1.ora + ``` + +1. The `deinstall` command discovers the details of the databases automatically in the current Oracle home and asks if you want to modify them. The default option is *n*, which means no. + + ``` + The details of database(s) orcl1 have been discovered automatically. Do you still want to modify the details of orcl1 database(s)? [n]: **Enter** + ``` + + For this task, press **Enter** to continue with the default values. + + > **Note**: To verify each detail and to specify this information manually, enter `y`. You can then provide the details of your database, for example, the database name, storage type, location for diagnostic destination, fast recovery area, spfile, and so on. + + ## Output + + It returns the following. + + ``` + Database Check Configuration END + + ######################### DECONFIG CHECK OPERATION END ######################### + + + ####################### DECONFIG CHECK OPERATION SUMMARY ####################### + Oracle Home selected for deinstall is: /u01/app/oracle/product/23.4.0/dbhome_2 + Inventory Location where the Oracle home registered is: /u01/app/oracle/oraInventory + Following Single Instance listener(s) will be de-configured: LISTENER + The following databases were selected for de-configuration. The databases will be deleted and will not be useful upon de-configuration : orcl1 + Database unique name : orcl1 + Storage used : FS + ``` + +1. The window awaits for your confirmation to remove the Oracle Database instance from your host. + + ``` + Do you want to continue (y - yes, n - no)? [n]: y + ``` + + Enter ***y*** to start removing the database. + + > **Tip**: The default option is **n**, which means no. If you press Enter or type **n** here, then `deinstall` exits without removing the database. + + The deinstallation process creates log files and starts removing the database. + + ## Output + + It returns the following. + + ``` + A log of this session will be written to: '/u01/app/oracle/oraInventory/logs/deinstall_deconfig20XX-06-17_10-37-24-AM.out' + Any error messages from this session will be written to: '/opt/oracle/oraInventory/logs/deinstall_deconfig20XX-06-17_10-37-24-AM.err' + + ######################## DECONFIG CLEAN OPERATION START ######################## + Database de-configuration trace file location: /u01/app/oracle/oraInventory/logs/databasedc_clean20XX-06-17_10-37-25AM.log + Database Clean Configuration START orcl1 + This operation may take few minutes. + Database Clean Configuration END orcl1 + + Network Configuration clean config START + + Network de-configuration trace file location: /u01/app/oracle/oraInventory/logs/netdc_clean20XX-06-17_10-37-25AM.log + + De-configuring Single Instance listener(s): LISTENER + + De-configuring listener: LISTENER + Stopping listener: LISTENER + Listener stopped successfully. + Deleting listener: LISTENER + Listener deleted successfully. + Listener de-configured successfully. + + De-configuring Naming Methods configuration file... + Naming Methods configuration file de-configured successfully. + + De-configuring backup files... + Backup files de-configured successfully. + + The network configuration has been cleaned up successfully. + + Network Configuration clean config END + + + ######################### DECONFIG CLEAN OPERATION END ######################### + + + ####################### DECONFIG CLEAN OPERATION SUMMARY ####################### + Successfully de-configured the following database instances : orcl1 + Following Single Instance listener(s) were de-configured successfully: LISTENER + ####################################################################### + + + ############# ORACLE DECONFIG TOOL END ############# + + Using properties file /tmp/deinstall20XX-06-17_10-37-05AM/response/deinstall_20XX-06-17_10-37-24-AM.rsp + Location of logs /u01/app/oracle/oraInventory/logs/ + + ############ ORACLE DEINSTALL TOOL START ############ + + + + + + ####################### DEINSTALL CHECK OPERATION SUMMARY ####################### + A log of this session will be written to: '/u01/app/oracle/oraInventory/logs/deinstall_deconfig20XX-06-17_10-37-24-AM.out' + Any error messages from this session will be written to: '/u01/app/oracle/oraInventory/logs/deinstall_deconfig20XX-06-17_10-37-24-AM.err' + + ######################## DEINSTALL CLEAN OPERATION START ######################## + ## [START] Preparing for Deinstall ## + Setting LOCAL_NODE to localhost + Setting CRS_HOME to false + Setting oracle.installer.invPtrLoc to /tmp/deinstall20XX-06-17_10-37-05AM/oraInst.loc + Setting oracle.installer.local to false + + ## [END] Preparing for Deinstall ## + + Oracle Universal Installer clean START + + Detach Oracle home 'OraDB23Home2' from the central inventory on the local node : Done + + Delete directory '/u01/app/oracle/product/23.4.0/dbhome_2' on the local node : Done + + The Oracle Base directory '/u01/app/oracle' will not be removed on local node. The directory is in use by Oracle Home '/u01/app/oracle/product/23.4.0/dbhome_1'. + + You can find a log of this session at: + '/u01/app/oracle/oraInventory/logs/Cleanup20XX-06-17_10-40-22AM.log' + + Oracle Universal Installer clean END + + + ## [START] Oracle install clean ## + + + ## [END] Oracle install clean ## + + + ######################### DEINSTALL CLEAN OPERATION END ######################### + + + ####################### DEINSTALL CLEAN OPERATION SUMMARY ####################### + Successfully detached Oracle home 'OraDB23Home2' from the central inventory on the local node. + Successfully deleted directory '/u01/app/oracle/product/23.4.0/dbhome_2' on the local node. + Oracle Universal Installer cleanup was successful. + + Review the permissions and contents of '/u01/app/oracle' on nodes(s) 'localhost'. + If there are no Oracle home(s) associated with '/u01/app/oracle', manually delete '/u01/app/oracle' and its contents. + Oracle deinstall tool successfully cleaned up temporary directories. + ####################################################################### + + + ############# ORACLE DEINSTALL TOOL END ############# + ``` + + You have completed the deinstallation process and removed the database, *`orcl1`*, from your host. + +You have successfully reached the end of this workshop on *Oracle Database Deinstallation*.  + +In this workshop, you learned how to: + - Delete an Oracle Database from an Oracle home keeping the database software and Oracle home intact. + - You deleted another Oracle Database from a different Oracle home, removed the database software and the components, and also deleted the Oracle home from the host. + +## Acknowledgments + + - **Author** - Manish Garodia, Database User Assistance Development + - **Contributors** - Prakash Jashnani, Subhash Chandra, Subrahmanyam Kodavaluru, Manisha Mati + - **Last Updated By/Date** - Manish Garodia, October 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/delete-db.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/delete-db.md new file mode 100644 index 000000000..037aed61b --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/delete-db.md @@ -0,0 +1,182 @@ +# Delete an Oracle Database + +## Introduction + +This lab provides the steps for deleting an Oracle Database from your host. You will delete only the database keeping the database software, Oracle home, and the inventory intact. You will use the Oracle Database Configuration Assistant (Oracle DBCA) tool for this purpose. + +Estimated time: 10 minutes + +### Objectives + + - Check existing databases + - Delete an Oracle Database using Oracle DBCA + - Verify database removal + +> **Note**: [](include:user-data) + +### Prerequisites + +This lab assumes you have - + + - An Oracle Cloud Account + - Completed all previous labs successfully + +You are logged in to your host as *oracle*, the user who can remove Oracle Database. + +> **Note**: [](include:example-values) + +## Task 1: Check existing databases + +Before deleting a database, view the existing databases in your host. + +1. Open a terminal window and run the following command. + + ``` + $ cat /etc/oratab + ``` + + It returns information about the databases installed on your host. If you have additional databases on your host, then it display them also. + + ``` + # + + + + # This file is used by ORACLE utilities. It is created by root.sh + # and updated by either Database Configuration Assistant while creating + # a database or ASM Configuration Assistant while creating ASM instance. + + # A colon, ':', is used as the field terminator. A new line terminates + # the entry. Lines beginning with a pound sign, '#', are comments. + # + # Entries are of the form: + # $ORACLE_SID:$ORACLE_HOME:: + # + # The first and second fields are the system identifier and home + # directory of the database respectively. The third field indicates + # to the dbstart utility that the database should , "Y", or should not, + # "N", be brought up at system boot time. + # + # Multiple entries with the same $ORACLE_SID are not allowed. + # + # + orcl:/u01/app/oracle/product/23.4.0/dbhome_1:N + orcl1:/u01/app/oracle/product/23.4.0/dbhome_2:N + ``` + +1. Verify that the file displays entries for the databases and Oracle homes on your host. + For this task, the databases are *`orcl`* and *`orcl1`*. + +## Task 2: Delete a database + +In this task, you will delete the database, *orcl*, from Oracle home 1 using Oracle DBCA. + +1. In the terminal window, go to the `bin` directory in Oracle home 1, where Oracle DBCA resides. + In the Livelabs environment, Oracle DBCA resides in the following directory. + + ``` + $ cd /u01/app/oracle/product/23.4.0/dbhome_1/bin + ``` + +1. Run this command to start Oracle DBCA. + + ``` + $ ./dbca + ``` + +1. The Select Database Operation window opens and displays the operations that you can perform on the database. + For this task, select **Delete database** to start the deletion process, and click **Next**. + + ![Delete database](./images/delete-db23-01-delete-db.png " ") + +1. Oracle DBCA checks for all databases in the current Oracle home and displays them. You can select the database to delete from this list. + For this task, select the database to delete, for example *`orcl`*, if not already selected. + + ![Select database](./images/delete-db23-02-select-db.png " ") + + You must specify the database administrator user credentials for this database. + - **User name**: The field displays the administrative user, *`SYS`*, by default + - **Password**: Enter the password, for example *`We!come1`* + - **TDE Wallet Password**: For this task, leave this blank + This option is applicable only if you enable Transparent Data Encryption (TDE) for your database and create a wallet. You can then specify the wallet password in this field. + + Click **Next** to proceed. + +1. In the Management Options window, you can deregister the database from Oracle Enterprise Manager (EM). + For this lab, leave this option unselected and click **Next**. + + ![Deregister from EM](./images/delete-db23-03-deregister-em.png " ") + + > **Note**: To deregister a database with EM, you require some details, such as OMS host name, port number, and the EM administrative credentials. However, instead of specifying in this window, you can log in to the EM console using a web browser and remove the database from managed targets. + +1. Before deleting the database, the Summary window displays the database configuration for final review. You can verify the details in this window. + + ![Review Summary](./images/delete-db23-04-summary.png " ") + + Click **Finish** to continue. + +1. The Progress Page window displays a confirmation message before deleting the database. + + > **Note**: Clicking **No** will cancel the delete operation and exit Oracle DBCA. For this task, do not select this option. + + ![Confirm database deletion](./images/delete-db23-05-confirm-db-delete.png " ") + + Click **Yes** in the message window to start deleting the database. Oracle DBCA proceeds with the delete operation. + + ![Finish database deletion](./images/delete-db23-06-delete-success.png " ") + + On completion, Oracle DBCA displays the Finish window. + +You have successfully deleted Oracle Database, *`orcl`*, from Oracle home 1. Click **Close** in the Finish window to exit Oracle DBCA. + +> **Note**: You can use Oracle DBCA to create new databases but that is not a part of this workshop. + +## Task 3: Verify database removal + +After deleting the database, verify that you have removed the database from the host. + +1. Open a terminal window and run the following command. + + ``` + $ cat /etc/oratab + ``` + + It returns the following information. + + ``` + # + + + + # This file is used by ORACLE utilities. It is created by root.sh + # and updated by either Database Configuration Assistant while creating + # a database or ASM Configuration Assistant while creating ASM instance. + + # A colon, ':', is used as the field terminator. A new line terminates + # the entry. Lines beginning with a pound sign, '#', are comments. + # + # Entries are of the form: + # $ORACLE_SID:$ORACLE_HOME:: + # + # The first and second fields are the system identifier and home + # directory of the database respectively. The third field indicates + # to the dbstart utility that the database should , "Y", or should not, + # "N", be brought up at system boot time. + # + # Multiple entries with the same $ORACLE_SID are not allowed. + # + # + orcl1:/u01/app/oracle/product/23.4.0/dbhome_2:N + ``` + +1. Verify that the file no longer displays the database, *`orcl`*, that you removed. For this lab, it contains only one entry, *`orcl1`*, in Oracle home 2. + +In this lab, you checked the existing Oracle Databases on your host. You used Oracle DBCA to delete a database and also verified the removal of database from the host. + +You may now **proceed to the next lab**. + +## Acknowledgments + + - **Author** - Manish Garodia, Database User Assistance Development + - **Contributors** - Prakash Jashnani, Subhash Chandra, Subrahmanyam Kodavaluru, Manisha Mati + - **Last Updated By/Date** - Manish Garodia, October 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-01-delete-db.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-01-delete-db.png new file mode 100644 index 000000000..fb20e8507 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-01-delete-db.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-02-select-db.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-02-select-db.png new file mode 100644 index 000000000..1a413a9a4 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-02-select-db.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-03-deregister-em.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-03-deregister-em.png new file mode 100644 index 000000000..d629a71ec Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-03-deregister-em.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-04-summary.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-04-summary.png new file mode 100644 index 000000000..9e9b80964 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-04-summary.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-05-confirm-db-delete.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-05-confirm-db-delete.png new file mode 100644 index 000000000..2c6a60f18 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-05-confirm-db-delete.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-06-delete-success.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-06-delete-success.png new file mode 100644 index 000000000..a59f4595c Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/delete-db/images/delete-db23-06-delete-success.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/intro-deinstall/files/example-values.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/intro-deinstall/files/example-values.txt new file mode 100644 index 000000000..ba6609575 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/intro-deinstall/files/example-values.txt @@ -0,0 +1 @@ +This lab contains system-specific values and paths. These details might vary depending on the system you are using. \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/intro-deinstall/files/user-data.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/intro-deinstall/files/user-data.txt new file mode 100644 index 000000000..d55b1a898 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/intro-deinstall/files/user-data.txt @@ -0,0 +1 @@ +Deleting an Oracle Database also deletes any user data that you have in the Oracle base or Oracle home locations. To save your data and files, export or move them outside Oracle base and Oracle home before you remove the database. diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/intro-deinstall/intro-deinstall.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/intro-deinstall/intro-deinstall.md new file mode 100644 index 000000000..048851462 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/intro-deinstall/intro-deinstall.md @@ -0,0 +1,107 @@ +# Oracle Database deletion and deinstallation + +## About this workshop + +This workshop explains how to delete an Oracle Database, remove the database software and its components, and delete Oracle home from your host. + +Estimated workshop time: 45 mins + +### Objectives + +In this workshop, you will do the following: + - Delete an Oracle Database but retain Oracle home. + - Remove the database including the database software, its components, and Oracle home. + +### Prerequisites + +This lab assumes you have - + - An Oracle Cloud account + - Oracle Database installed on your host + +## About database removal + +Oracle provides different options to remove Oracle Database from your host. + +You can do the following: + - Delete only the database but keep the database software and its components intact. For this, you can use Oracle Database Configuration Assistant (Oracle DBCA). + - Remove the database completely along with the database software, its components, and Oracle home. For this, you can use the *deinstall* command. + +[](include:user-data) + +> **Note:** This workshop uses two Oracle homes for demonstration purpose. It is not a requirement for Oracle Database to have two homes. You can delete or deinstall an Oracle Database from a single Oracle home. + +## Oracle Database Configuration Assistant (Oracle DBCA) + +Oracle DBCA is a tool that helps you manage the databases. You can perform various operations, such as create databases, configure existing databases, delete databases, and so on. + +When you delete a database, it also deletes user data but does not remove the database software or Oracle home. You can create another database in this Oracle home and use the existing database software. + +## The deinstall command + +The `deinstall` command wipes out Oracle Database completely from your host. + +It performs various activities, such as: + + - Stops and removes the Oracle Database software + - Deletes database components, such as listener, Oracle base, and so on + - Removes the inventory location, if you have a single instance database + - Removes the database instance including the CDB and all PDBs + - Deletes user data and schemas + - Deletes Oracle home + +The `deinstall` command resides in Oracle home under the subdirectory `deinstall`. + +For example - + +``` +$ /u01/app/oracle/product/23.4.0/dbhome_1/deinstall +``` + +The path may differ depending on the system you are using. + +If the database software in Oracle home is not running for any reason (let's say, due to an unsuccessful installation), then `deinstall` cannot determine the configuration. You must provide all the configuration details either interactively or in a response file. A response file contains configuration values for Oracle home that `deinstall` uses. + +> **Note**: If you have a standalone Oracle Database on a node in a cluster, and if multiple databases have the same Global Database Name (GDN), then you cannot use `deinstall` to remove only one database. + +The location of the `deinstall` log files depends on the number of Oracle homes on the host. For a single Oracle home, `deinstall` removes the *oraInventory* folder and saves the log files in the */tmp* directory. + +### For multiple Oracle homes + +If the host contains more than one Oracle home, then the `deinstall` command functions as follows: + + - Does not delete the inventory location + - Saves the log files in the *oraInventory* folder + - Removes details of the Oracle home from where you run `deinstall`, for example *OraDB23Home1*, from the `inventory.xml` file + +If you have removed all other Oracle homes from your host, then `deinstall` deletes the inventory directory also. + +### Files that deinstall removes + +The `deinstall` command removes the following files and directory contents in the Oracle base directory of the Oracle Database installation user (oracle): + + - `admin` + - `cfgtoollogs` + - `checkpoints` + - `diag` + - `oradata` + - `fast_recovery_area` + +This is true for a single instance Oracle Database where the central inventory, `oraInventory`, contains no other registered Oracle homes besides the Oracle home that you are unconfiguring and removing. + +Oracle recommends that you configure your installations using an *Optimal Flexible Architecture (OFA)* guidelines, and that you use the Oracle base and Oracle home locations exclusively for the Oracle software. If you have any user data in the Oracle base locations for the user account who owns the database software, then `deinstall` deletes this data. + +> **Note**: The `deinstall` command deletes Oracle Database configuration files, user data, and fast recovery area (FRA) files even if they are located outside of the Oracle base directory path.  + +Click the next lab to **Get started**. + +## Learn more + + - [Removing Oracle Database Software](https://docs.oracle.com/en/database/oracle/oracle-database/23/ladbi/removing-oracle-database-software.html#GUID-5619EBF0-C89E-4349-AE6F-A8F8B3B06BD1) + + - Workshop on how to [Install Oracle Database 23ai on OCI Compute](https://livelabs.oracle.com/pls/apex/r/dbpm/livelabs/view-workshop?wid=4055) + +## Acknowledgments + + - **Author** - Manish Garodia, Database User Assistance Development + - **Contributors** - Prakash Jashnani, Subhash Chandra, Subrahmanyam Kodavaluru, Manisha Mati + - **Last Updated By/Date** - Manish Garodia, October 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/prepare-setup/prepare-setup.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/prepare-setup/prepare-setup.md new file mode 100644 index 000000000..83685684a --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/prepare-setup/prepare-setup.md @@ -0,0 +1,62 @@ +# Prepare setup + +## Introduction + +This lab will show you how to download the Oracle Resource Manager (ORM) stack zip file needed to setup the resource needed to run this workshop. This workshop requires a compute instance running a marketplace image and a Virtual Cloud Network (VCN). + +Estimated time: 10 minutes + +### Objectives + + - Download ORM stack + - Configure an existing Virtual Cloud Network (VCN) + +### Prerequisites + +This lab assumes you have - + - An Oracle Cloud account + +## Task 1: Download Oracle Resource Manager (ORM) stack zip file + +1. Click on the link below to download the Resource Manager zip file you need to build your environment: + + - [db21c-dbae-mkplc-freetier.zip](https://objectstorage.us-ashburn-1.oraclecloud.com/p/ZdyeiKou7tdfayF1zF1NmPtpUGFTvKjSY5SC46H8NBNlPAxtOWmZJUDsWoeFHQJF/n/natdsecurity/b/stack/o/db21c-dbae-mkplc-freetier.zip) + +1. Save in your downloads folder. + +We recommend using this stack to create a self-contained/dedicated VCN with your instance(s). Skip to *Task 3* to follow our recommendations. If you would rather use an existing VCN, then proceed to the next task as indicated below to update your existing VCN with the required Egress rules. + +## Task 2: Add security rules to an existing VCN + +This workshop requires a certain number of ports to be available, a requirement that can be met by using the default ORM stack execution that creates a dedicated VCN. In order to use an existing VCN, the following ports should be added to Egress rules. + +| Port | Description | +| :------------- | :------------------------------------ | +| 22 | SSH | +| 6080 | noVNC Remote Desktop | +{: title="Add ports to VCN"} + +1. Go to **Networking** > **Virtual Cloud Networks**. +1. Choose your network. +1. Under **Resources**, select **Security Lists**. +1. Click on **Default Security Lists** under the **Create Security List** button. +1. Click the **Add Ingress Rule** button. +1. Enter the following: + - Source CIDR: 0.0.0.0/0 + - Destination Port Range: *Refer to the table* +1. Click the **Add Ingress Rules** button. + +## Task 3: Setup compute + +Using the details from the previous two tasks, proceed to the lab **Setup compute instance** to setup your workshop environment using Oracle Resource Manager (ORM) and one of the following options: + + - Create Stack: **Compute + Networking** + - Create Stack: **Compute only** with an existing VCN where security lists have been updated as per *Task 2* of this lab + +You may now **proceed to the next lab**. + +## Acknowledgments + + - **Author** - Rene Fontcha, LiveLabs Platform Lead, NA Technology + - **Contributors** - Meghana Banka, Manish Garodia + - **Last Updated By/Date** - Rene Fontcha, LiveLabs Platform Lead, NA Technology, April 2022 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/desktop/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/desktop/index.html new file mode 100644 index 000000000..6acdb69d1 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/desktop/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/desktop/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/desktop/manifest.json new file mode 100644 index 000000000..d4501ab0d --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/desktop/manifest.json @@ -0,0 +1,40 @@ +{ + "workshoptitle": "DBA Essentials - Remove Oracle Database software and delete Oracle Database 23ai", + "help": "livelabs-help-db_us@oracle.com", + "include": { + "example-values": "./../../intro-deinstall/files/example-values.txt", + "user-data": "./../../intro-deinstall/files/user-data.txt" + }, + "tutorials": [ + { + "title": "Introduction", + "description": "Workshop on Oracle Database Uninstallation.", + "publisheddate": "14/10/2024", + "filename": "./../../intro-deinstall/intro-deinstall.md" + }, + { + "title": "Use noVNC remote desktop", + "description": "Use noVNC Remote Desktop", + "publisheddate": "03/22/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/remote-desktop/using-novnc-remote-desktop.md" + }, + { + "title": "Lab 1: Delete an Oracle Database", + "description": "Only delete the database from your host but retain Oracle Database software and Oracle home.", + "publisheddate": "14/10/2024", + "filename": "./../../delete-db/delete-db.md" + }, + { + "title": "Lab 2: Deinstall Oracle Database and remove Oracle home", + "description": "How to remove Oracle Database software and delete Oracle Database and its components from your host.", + "publisheddate": "14/10/2024", + "filename": "./../../deinstall-db/deinstall-db.md" + }, + { + "title": "Need help?", + "description": "Solutions to common problems and directions for receiving live help", + "publisheddate": "05/24/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-livelabs.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/sandbox/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/sandbox/index.html new file mode 100644 index 000000000..6acdb69d1 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/sandbox/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/sandbox/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/sandbox/manifest.json new file mode 100644 index 000000000..bc2a60af2 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/sandbox/manifest.json @@ -0,0 +1,40 @@ +{ + "workshoptitle": "DBA Essentials - Remove Oracle Database software and delete Oracle Database 23ai", + "help": "livelabs-help-db_us@oracle.com", + "include": { + "example-values": "./../../intro-deinstall/files/example-values.txt", + "user-data": "./../../intro-deinstall/files/user-data.txt" + }, + "tutorials": [ + { + "title": "Introduction", + "description": "Workshop on Oracle Database Uninstallation.", + "publisheddate": "14/10/2024", + "filename": "./../../intro-deinstall/intro-deinstall.md" + }, + { + "title": "Lab 1: Verify compute instance setup", + "description": "Verify Setup of compute instance", + "publisheddate": "05/06/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/verify-compute/verify-compute-novnc.md" + }, + { + "title": "Lab 2: Delete an Oracle Database", + "description": "Only delete the database from your host but retain Oracle Database software and Oracle home.", + "publisheddate": "14/10/2024", + "filename": "./../../delete-db/delete-db.md" + }, + { + "title": "Lab 3: Deinstall Oracle Database and remove Oracle home", + "description": "How to remove Oracle Database software and delete Oracle Database and its components from your host.", + "publisheddate": "14/10/2024", + "filename": "./../../deinstall-db/deinstall-db.md" + }, + { + "title": "Need help?", + "description": "Solutions to common problems and directions for receiving live help", + "publisheddate": "05/24/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-livelabs.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/tenancy/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/tenancy/index.html new file mode 100644 index 000000000..6acdb69d1 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/tenancy/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/tenancy/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/tenancy/manifest.json new file mode 100644 index 000000000..26380bf54 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws11-remove-db/workshops/tenancy/manifest.json @@ -0,0 +1,53 @@ +{ + "workshoptitle": "DBA Essentials - Remove Oracle Database software and delete Oracle Database 23ai", + "help": "livelabs-help-db_us@oracle.com", + "include": { + "example-values": "./../../intro-deinstall/files/example-values.txt", + "user-data": "./../../intro-deinstall/files/user-data.txt" + }, + "tutorials": [ + { + "title": "Introduction", + "description": "Workshop on Oracle Database Uninstallation.", + "publisheddate": "14/10/2024", + "filename": "./../../intro-deinstall/intro-deinstall.md" + }, + { + "title": "Get started", + "description": "Get a Free Trial", + "publisheddate": "03/22/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/cloud-login.md" + }, + { + "title": "Lab 1: Prepare setup", + "description": "How to download your ORM stack and update security rules for an existing VCN.", + "filename": "../../prepare-setup/prepare-setup.md", + "publisheddate": "11/24/2022", + "type": "default" + }, + { + "title": "Lab 2: Setup compute instance", + "description": "How to provision the workshop environment and connect to it", + "publisheddate": "03/22/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/setup-compute-generic/setup-compute-novnc.md" + }, + { + "title": "Lab 3: Delete an Oracle Database", + "description": "Only delete the database from your host but retain Oracle Database software and Oracle home.", + "publisheddate": "14/10/2024", + "filename": "./../../delete-db/delete-db.md" + }, + { + "title": "Lab 4: Deinstall Oracle Database and remove Oracle home", + "description": "How to remove Oracle Database software and delete Oracle Database and its components from your host.", + "publisheddate": "14/10/2024", + "filename": "./../../deinstall-db/deinstall-db.md" + }, + { + "title": "Need help?", + "description": "Solutions to common problems and directions for receiving live help", + "publisheddate": "05/24/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-freetier.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/administer-listener-ops/administer-listener-ops.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/administer-listener-ops/administer-listener-ops.md new file mode 100644 index 000000000..6d3dee8cd --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/administer-listener-ops/administer-listener-ops.md @@ -0,0 +1,368 @@ +# Administer listener operations + +## Introduction + +This lab shows how to perform listener operations, such as starting and stopping the listener, checking listener status, and so on. It also shows how to access listener control utility and view details of the listener. + +Estimated time: 10 minutes + +### Objectives + + - Set environment variables + - View listener configuration and status + - Stop the listener + - Start the listener + - Access the Listener Control utility + +> **Note**: [](include:example-values) + +### Prerequisites + +This lab assumes you have - + + - An Oracle Cloud account + - Completed all previous labs successfully + +## Task 1: Set environment variables + +[](include:set-env-var) + +> **Tip**: If you have reserved a Livelabs sandbox environment, then you can run `/usr/local/bin/.set-env-db.sh` and enter the corresponding number for the `$ORACLE_SID`. It sets the environment variables automatically. + +## Task 2: View listener configuration + +In this task, you will check whether the listener is up and running and view listener configuration.  + +1. From `$ORACLE_HOME/bin`, run `lsnrctl status`.  + + ``` + $ ./lsnrctl status + ``` + + ## Output + + This command displays listener configuration and status. + + ``` + LSNRCTL for Linux: Version 23.0.0.0.0 - Production on 07-AUG-20XX 12:09:46 + + Copyright (c) 1991, 2024, Oracle. All rights reserved. + + Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.example.com)(PORT=1523))) + STATUS of the LISTENER + ------------------------ + Alias LISTENER + Version TNSLSNR for Linux: Version 23.0.0.0.0 - Production + Start Date 07-JUL-20XX 10:38:25 + Uptime 31 days 1 hr. 31 min. 21 sec + Trace Level off + Security ON: Local OS Authentication + SNMP OFF + Listener Parameter File /u01/app/oracle/product/23.4.0/dbhome_1/network/admin/listener.ora + Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml + Listening Endpoints Summary... + (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.example.com)(PORT=1523))) + (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1523))) + Services Summary... + Service "16dbed12d9b5bd08e0631fc45e640b06.us.oracle.com" has 1 instance(s). + Instance "orcl", status READY, has 1 handler(s) for this service... + Service "1ca6f267eae900bfe0638e084664e079.us.oracle.com" has 1 instance(s). + Instance "orcl", status READY, has 1 handler(s) for this service... + Service "orcl.us.oracle.com" has 1 instance(s). + Instance "orcl", status READY, has 1 handler(s) for this service... + Service "orclXDB.us.oracle.com" has 1 instance(s). + Instance "orcl", status READY, has 1 handler(s) for this service... + Service "orclpdb.us.oracle.com" has 1 instance(s). + Instance "orcl", status READY, has 1 handler(s) for this service... + The command completed successfully + ``` + + > The listener control utility displays a summary of listener configuration settings, listening protocol addresses, and the services registered with the listener. + +If your Oracle Database contains PDBs, then the status displays a service for each PDB running on the database instance. + +## Task 3: Stop and start the listener + +The listener runs automatically when the host system starts. If a problem occurs in the system or if you manually stop the listener, then you can start the listener again from the command line.  + +In this task, you will learn how to stop and start the listener. + +1. From `$ORACLE_HOME/bin`, stop the listener first, if it is already running.  + + ``` + $ ./lsnrctl stop + ``` + + ## Output + + ``` + LSNRCTL for Linux: Version 23.0.0.0.0 - Production on 07-AUG-20XX 12:29:46 + + Copyright (c) 1991, 2024, Oracle. All rights reserved. + + Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.example.com)(PORT=1523))) + The command completed successfully + ``` + + Now that you have stopped the listener, run the following to check if you can still connect to your Oracle Database. + +1. From `$ORACLE_HOME/bin`, log in to SQL Plus as the *SYSTEM* user using the service name *orcl*. + + ``` + $ ./sqlplus system@orcl + ``` + + ## Output + + ``` + SQL*Plus: Release 23.0.0.0.0 - Production on 07-AUG-20XX 12:35:46 2024 + Version 23.4.0.24.05 + + Copyright (c) 1982, 2024, Oracle. All rights reserved. + + Enter password: + ``` + +1. When prompted for password, enter the administrative password for your Oracle Database, for example *We!come1*. + + ``` + ERROR: + ORA-12541: Cannot connect. No listener at host 0.0.0.0 port 1523. + Help: https://docs.oracle.com/error-help/db/ora-12541/ + ``` + + The error indicates that the listener is not running. + + > **Note**: If the listener is not running on the host when Oracle Enterprise Manager (Oracle EM) tries to establish connection with your Oracle Database, then it returns an I/O error indicating failure. + + Exit the prompt by pressing **Ctrl + C** followed by **Enter**.  + +1. Start the listener again from the $ORACLE_HOME/bin directory. + + ``` + $ ./lsnrctl start + ``` + + ## Output + + ``` + LSNRCTL for Linux: Version 23.0.0.0.0 - Production on 07-AUG-20XX 12:40:31 + + Copyright (c) 1991, 2024, Oracle. All rights reserved. + + Starting /u01/app/oracle/product/23.4.0/dbhome_1/bin/tnslsnr: please wait... + + TNSLSNR for Linux: Version 23.0.0.0.0 - Production + System parameter file is /u01/app/oracle/product/23.4.0/dbhome_1/network/admin/listener.ora + Log messages written to /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml + Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.example.com)(PORT=1523))) + Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1523))) + + Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.example.com)(PORT=1523))) + STATUS of the LISTENER + ------------------------ + Alias LISTENER + Version TNSLSNR for Linux: Version 23.0.0.0.0 - Production + Start Date 07-AUG-20XX 12:40:31 + Uptime 0 days 0 hr. 0 min. 0 sec + Trace Level off + Security ON: Local OS Authentication + SNMP OFF + Listener Parameter File /u01/app/oracle/product/23.4.0/dbhome_1/network/admin/listener.ora + Listener Log File /u01/app/oracle/diag/tnslsnr/localhost/listener/alert/log.xml + Listening Endpoints Summary... + (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost.example.com)(PORT=1523))) + (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1523))) + The listener supports no services + The command completed successfully + ``` + + You have started the listener on the host again. + + > **Note**: To access Oracle Database, the listener must be up and running.  + +1. View listener status as explained in the previous task. + + ``` + $ ./lsnrctl status + ``` + + The status displays that the listener service is running. + +1. Check whether you can log in to SQL Plus as *SYSTEM* using the password and service name. + For this lab, the password is *We!come1* and the service name is *orcl*. + + ``` + $ ./sqlplus system/We!come1@orcl + ``` + + ## Output + + ``` + SQL*Plus: Release 23.0.0.0.0 - Production on Wed Aug 7 12:42:33 20XX + Version 23.4.0.24.05 + + Copyright (c) 1982, 2024, Oracle. All rights reserved. + + Last Successful login time: Sun Jul 07 20XX 10:41:17 +00:00 + + Connected to: + Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - Production + Version 23.4.0.24.05 + + SQL> + ``` + + You are connected to Oracle Database. + +1. Exit from the SQL Prompt. + + ``` + SQL> exit + ``` + +You can also access the Listener Control utility and perform basic management functions on the listener. + +## Task 4: Access the Listener Control utility + +The Listener Control utility helps you to administer the listener. + +In this task, you will access the Listener Control utility and run some listener commands. + +1. From `$ORACLE_HOME/bin`, enter the `LSNRCTL` prompt. + + ``` + $ ./lsnrctl + ``` + + ``` + LSNRCTL for Linux: Version 23.0.0.0.0 - Production on 07-AUG-20XX 12:45:25 + + Copyright (c) 1991, 2024, Oracle. All rights reserved. + + Welcome to LSNRCTL, type "help" for information. + + LSNRCTL> + ``` + +1. View the commands that you can run from the `LSNRCTL` prompt. + + ``` + LSNRCTL> HELP + ``` + + ``` + The following operations are available + An asterisk (*) denotes a modifier or extended command: + + start stop status services + servacls version reload save_config + trace spawn quit exit + set* show* + ``` + + You can run these commands from the Listener Control utility to view and manage the listener settings. + +1. Enter `HELP` with a command name to view the complete syntax and additional information about the Listener Control utility command, for example *`trace`*. + + ``` + LSNRCTL> HELP trace + ``` + + ``` + trace OFF | USER | ADMIN | SUPPORT [] : set tracing to the specified level + ``` + +1. View the parameters of the listener. + + ``` + LSNRCTL> SHOW + ``` + + ``` + The following operations are available after show + An asterisk (*) denotes a modifier or extended command: + + rawmode displaymode + rules trc_file + trc_directory trc_level + log_file log_directory + log_status stats + current_listener inbound_connect_timeout + startup_waittime snmp_visible + save_config_on_stop dynamic_registration + enable_global_dynamic_endpoint oracle_home + pid connection_rate_limit + valid_node_checking_registration registration_invited_nodes + registration_excluded_nodes remote_registration_address + allow_multiple_redirects all + ``` + +1. Check the name of the current listener. + + ``` + LSNRCTL> SHOW CURRENT_LISTENER + ``` + + ``` + Current Listener is LISTENER + ``` + +1. Check the version of listener control utility. + + ``` + LSNRCTL> VERSION + ``` + + ``` + Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.example.com)(PORT=1523))) + TNSLSNR for Linux: Version 23.0.0.0.0 - Production + TNS for Linux: Version 23.0.0.0.0 - Production + Unix Domain Socket IPC NT Protocol Adaptor for Linux: Version 23.0.0.0.0 - Production + Oracle Bequeath NT Protocol Adapter for Linux: Version 23.0.0.0.0 - Production + TCP/IP NT Protocol Adapter for Linux: Version 23.0.0.0.0 - Production,, + The command completed successfully + ``` + +1. View statistics about the number of registration commands that the listener receives while handling client connection requests. + + ``` + LSNRCTL> SHOW STATS -REG + ``` + + ``` + Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost.example.com)(PORT=1523))) + ------------------------ + Global Level: + Recent + Recent Duration: 15 days 23 hr. 9 min. 13 sec + Command Instance Service ENDP Handler INF + Registration 2 10 2 4 0 + Updates 4246 0 0 6543 0 + Re-Register 0 0 0 0 0 + Un-Register 0 0 0 0 0 + Cumulative + Registration 2 10 2 4 0 + Updates 4246 0 0 6543 0 + Re-Register 0 0 0 0 0 + Un-Register 0 0 0 0 0 + The command completed successfully + ``` + +1. Exit from the Listener Control utility. + + ``` + LSNRCTL> EXIT + ``` + + > **Note**: You can use either `EXIT` or `QUIT` to exit from Listener Control utility. + +Congratulations! You have successfully completed this workshop on *Network environment configuration for Oracle Database*.  + +In this workshop, you learned how to check listener status, start and stop the listener, and view the commands of the Listener Control utility for your Oracle Database.  + +## Acknowledgments + + - **Author** - Manish Garodia, Database User Assistance Development + - **Contributors**: Binika Kumar, Bhaskar Mathur, Malai StalinSuresh Rajan, Subhash Chandra, Dharma Sirnapalli, Subrahmanyam Kodavaluru + - **Last Updated By/Date** - Manish Garodia, August 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/files/example-values.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/files/example-values.txt new file mode 100644 index 000000000..ba6609575 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/files/example-values.txt @@ -0,0 +1 @@ +This lab contains system-specific values and paths. These details might vary depending on the system you are using. \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/files/set-env-var.txt b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/files/set-env-var.txt new file mode 100644 index 000000000..0bef0a0f2 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/files/set-env-var.txt @@ -0,0 +1,33 @@ +To connect to your Oracle Database from a terminal, set the environment variables if not already set. These variables remain in the terminal until you close the terminal window. + +> Note that environment variables set in one terminal do not apply automatically to other terminals you may have. If you open a new terminal or have a terminal window already open, then you must set these variables in that terminal to connect to Oracle Database. + +In this task, you will set the following environment variables for your Oracle Database. + - *`$ORACLE_SID`* + - *`$ORACLE_HOME`* + - *`$ORACLE_BASE`* + +1. Open a terminal window and go to the `bin` directory in Oracle home. For this lab, the location of the `bin` directory is as follows. + + ``` + $ cd /u01/app/oracle/product/23.4.0/dbhome_1/bin + ``` + +1. Set the environment variables with the script, *oraenv*. + + ``` + $ ./oraenv + ``` + +1. When prompted for `$ORACLE_SID`, enter *orcl*. + + ``` + ORACLE_SID = [oracle] ? orcl + The Oracle base has been set to /u01/app/oracle + ``` + + > **Note**: Oracle SID is case-sensitive. + + This command sets the variables *`$ORACLE_SID`* and *`$ORACLE_BASE`*. It also sets the *`$ORACLE_HOME`* path, for example, *`/u01/app/oracle/product/23.4.0/dbhome_1`*. + +You have set the environment variables for your Oracle Database in the currently active terminal. You can now connect to Oracle Database and run the SQL commands. diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/images/client-server-application-connection.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/images/client-server-application-connection.png new file mode 100644 index 000000000..765465513 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/images/client-server-application-connection.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/images/listener-architecture.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/images/listener-architecture.png new file mode 100644 index 000000000..951cfd402 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/images/listener-architecture.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/intro-configure-network.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/intro-configure-network.md new file mode 100644 index 000000000..83b5c7543 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/intro-configure-network/intro-configure-network.md @@ -0,0 +1,161 @@ +# Oracle Net Listener + +## About this workshop + +This workshop focuses on network configurations for your Oracle Database. It includes listener operations and administration. + +Estimated workshop time: 1 hour + +### What is a Listener? + +**Oracle Net Listener (or Listener)** is a network service that runs on Oracle Database. + +The primary role of a listener is to: + - Manage connection requests between Oracle Database and clients + - Manage network traffic + +The default name of an Oracle listener is *LISTENER*. + +![Listener architecture](./../intro-configure-network/images/listener-architecture.png " ") **Figure: Listener architecture** + +### Objectives + +This workshop helps you learn how to perform listener operations, such as: +- view listener status and configuration +- start and stop the listener +- access listener control utility + +### Prerequisites + +This lab assumes you have - + + - An Oracle Cloud account + - Oracle Database installed + +## About Listener configuration + +After installing Oracle Database, you have a fully functional database with a client/server network environment. *Oracle Net* is a software layer that resides on the client and the database. It establishes and maintains the connection between client applications and the database over a network. + +> **Note**: Oracle Database connections use Oracle propriety SQLNet protocol that runs over industry standard TCP/IP. To view a list of all supported protocols, see [Learn more] (?lab=intro-configure-network#Learnmore). + +![Client/server application connection](./../intro-configure-network/images/client-server-application-connection.png " ") **Figure: Client/server application connection** + +**Client** +A client is an application that connects to Oracle Database to send and receive data. An Oracle Database client application resides on the host where the Oracle Database client software is installed. + +**Service** +The client application uses a *Service name* to identify an Oracle Database instance and connect to it. A service name is a logical representation of Oracle Database. A database can have one or more services associated with it. + +For example, the listener status returns a service name *orcl* which represents an Oracle Database instance. + +``` +... +Service "orcl.us.oracle.com" has 1 instance(s). + Instance "orcl", status READY, has 1 handler(s) for this service... +``` + +> **Note**: A single-instance Oracle Database can interface with a client as multiple services. + +### Listener configuration file + +The listener configuration is stored in a file, *listener.ora*, located in Oracle home under the `network/admin` subdirectory.   + +The *listener.ora* file carries configuration parameters that determine the characteristics of the listener. The parameters include: + + - Name of the listener + - Port of the listener + - Protocol addresses that the listener can accept connection requests on + - Valid nodes that can register with Oracle Database + - Oracle Database services + - Control parameters + +The following example gives a glimpse of the `listener.ora` file. Here, the listener assumes the default name, *LISTENER*. + +``` +... + +LISTENER = + (DESCRIPTION_LIST = + (DESCRIPTION = + (ADDRESS = (PROTOCOL = TCP)(HOST = localhost.us.oracle.com)(PORT = 1523)) + (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1523)) + ) + ) + +... +``` + +> **Tip**: You can configure multiple listeners, each with a unique name, in the same `listener.ora` file. However, Oracle recommends that you run only one listener for each node in a customer environment. + +*Listener Registration (LREG)* is an instance background process that performs dynamic registration of services and databases with the listener. + +### Client connections + +The elements involved in client connections to Oracle Database are: + + - **Connect descriptors**  + The client uses a connect descriptor to specify the Oracle Database to which it wants to connect. The connect descriptor contains a protocol and the Oracle Database service name. + + - **Connection requests** + Users start a connection request to Oracle Database using a connect string. The connect string contains a user name and password, and a connect identifier. The connect identifier can be the connect descriptor or a name that represents the connect descriptor. + + - **Naming methods** + While connecting to an Oracle Database service, the client application uses a resolution method, called the *naming method*. This method resolves the connect identifier to a connect descriptor. + +The following example shows a connect descriptor that enables a client to connect to Oracle Database with the service name *orcl*. + +``` +... + +DESCRIPTION= + (ADDRESS=(PROTOCOL=TCP)(HOST=localhost.us.oracle.com)(PORT=1523)) + (CONNECT_DATA= + (SERVICE_NAME=orcl)) +... +``` + +### Tools for network configuration + +Oracle Net Services provide user interface tools and command-line utilities to configure, manage, and monitor the network. + + - **Oracle Net Configuration Assistant (NETCA)** + - **Oracle Net Manager** + +Oracle Enterprise Manager (EM) combines configuration functionality across multiple file systems, along with listener administrative control to provide an integrated environment for configuring and managing Oracle Net Services. + +**About Oracle Net Configuration Assistant (NETCA)** +Oracle Net Configuration Assistant (NETCA) is a standalone tool that helps you configure listeners and naming methods.  + +While creating an Oracle Database using Oracle Database Configuration Assistant (Oracle DBCA) - + + - In typical configuration, NETCA automatically configures a listener with a TCP/IP listening protocol address for the database. + - In advanced configuration, NETCA prompts you to specify a listener name and a port number of your choice. + +Use NETCA for initial network configuration right after the database installation. Henceforth, you can use Oracle Net Manager to configure and administer your networks. + +**About Oracle Net Manager** +Oracle Net Manager provides configuration functionality for Oracle home on a local client or a server host. It offers built-in wizards and utilities to test connectivity, migrate data from one naming method to another, and create additional network components. + +### Listener Control utility + +The Listener Control utility helps you to administer listeners. You can use the Listener Control utility commands to perform basic management functions on one or more listeners. + +If you have multiple listeners running, then specify the listener name along with the command at the Listener Control utility prompt. + - If you omit the listener name in the command, then the utility uses the listener set with the command `SET CURRENT_LISTENER`. + - If you have not set the listener with this command, then the command uses the default listener, `LISTENER`. + +When you administer a listener remotely, you can run all listener commands except `START`. The Listener Control utility can start the listener on the same system where the utility runs. + +Click the next lab to **Get started**. + +## Learn more + + - [Understanding Oracle Net Services](https://docs.oracle.com/en/database/oracle/oracle-database/23/netag/part-I-understanding-oracle-net-services.html) + + - [Oracle Database Component Port Numbers and Protocols](https://docs.oracle.com/en/database/oracle/oracle-database/23/ladbi/oracle-database-component-port-numbers-and-protocols.html) + +## Acknowledgments + + - **Author** - Manish Garodia, Database User Assistance Development + - **Contributors**: Binika Kumar, Bhaskar Mathur, Malai StalinSuresh Rajan, Subhash Chandra, Dharma Sirnapalli, Subrahmanyam Kodavaluru + - **Last Updated By/Date** - Manish Garodia, August 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/prepare-setup/prepare-setup.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/prepare-setup/prepare-setup.md new file mode 100644 index 000000000..74eb7950c --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/prepare-setup/prepare-setup.md @@ -0,0 +1,62 @@ +# Prepare setup + +## Introduction + +This lab will show you how to download the Oracle Resource Manager (ORM) stack zip file needed to setup the resource needed to run this workshop. This workshop requires a compute instance running a marketplace image and a Virtual Cloud Network (VCN). + +Estimated time: 10 minutes + +### Objectives + + - Download ORM stack + - Configure an existing Virtual Cloud Network (VCN) + +### Prerequisites + +This lab assumes you have - + - An Oracle Cloud account + +## Task 1: Download Oracle Resource Manager (ORM) stack zip file + +1. Click on the link below to download the Resource Manager zip file you need to build your environment: + + - [db21c-dbae-mkplc-freetier.zip](https://objectstorage.us-ashburn-1.oraclecloud.com/p/ZdyeiKou7tdfayF1zF1NmPtpUGFTvKjSY5SC46H8NBNlPAxtOWmZJUDsWoeFHQJF/n/natdsecurity/b/stack/o/db21c-dbae-mkplc-freetier.zip) + +1. Save in your downloads folder. + +We recommend using this stack to create a self-contained/dedicated VCN with your instance(s). Skip to [Task 3](?lab=prepare-setup#Task3:Setupcompute) to follow our recommendations. If you would rather use an existing VCN, then proceed to the next task as indicated below to update your existing VCN with the required Egress rules. + +## Task 2: Add security rules to an existing VCN + +This workshop requires a certain number of ports to be available, a requirement that can be met by using the default ORM stack execution that creates a dedicated VCN. In order to use an existing VCN, the following ports should be added to Egress rules. + +| Port | Description | +| :------------- | :------------------------------------ | +| 22 | SSH | +| 6080 | noVNC Remote Desktop | +{: title="Add ports to VCN"} + +1. Go to **Networking** > **Virtual Cloud Networks**. +1. Choose your network. +1. Under **Resources**, select **Security Lists**. +1. Click on **Default Security Lists** under the **Create Security List** button. +1. Click the **Add Ingress Rule** button. +1. Enter the following: + - Source CIDR: 0.0.0.0/0 + - Destination Port Range: *Refer to the table* +1. Click the **Add Ingress Rules** button. + +## Task 3: Setup compute + +Using the details from the previous two tasks, proceed to the lab **Setup compute instance** to setup your workshop environment using Oracle Resource Manager (ORM) and one of the following options: + + - Create Stack: **Compute + Networking** + - Create Stack: **Compute only** with an existing VCN where security lists have been updated as per *Task 2* of this lab + +You may now **proceed to the next lab**. + +## Acknowledgments + + - **Author** - Rene Fontcha, LiveLabs Platform Lead, NA Technology + - **Contributors** - Manish Garodia + - **Last Updated By/Date** - Rene Fontcha, LiveLabs Platform Lead, NA Technology, April 2022 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/desktop/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/desktop/index.html new file mode 100644 index 000000000..6acdb69d1 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/desktop/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/desktop/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/desktop/manifest.json new file mode 100644 index 000000000..cac2017ec --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/desktop/manifest.json @@ -0,0 +1,34 @@ +{ + "workshoptitle": "DBA Essentials - Configure network environment for Oracle Database 23ai", + "help": "livelabs-help-db_us@oracle.com", + "include": { + "example-values": "./../../intro-configure-network/files/example-values.txt", + "set-env-var": "./../../intro-configure-network/files/set-env-var.txt" + }, + "tutorials": [ + { + "title": "Introduction", + "description": "The workshop on network environment for Oracle Database which includes listener operation and administration.", + "publisheddate": "04/14/2023", + "filename": "./../../intro-configure-network/intro-configure-network.md" + }, + { + "title": "Use noVNC remote desktop", + "description": "Use noVNC Remote Desktop", + "publisheddate": "03/22/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/remote-desktop/using-novnc-remote-desktop.md" + }, + { + "title": "Lab 1: Administer listener operations", + "description": "How to perform listener operations, such as starting and stopping the listener, checking the listener status, and so on, using the listener control utility.", + "publisheddate": "04/14/2023", + "filename": "./../../administer-listener-ops/administer-listener-ops.md" + }, + { + "title": "Need help?", + "description": "Solutions to common problems and directions for receiving live help", + "publisheddate": "05/24/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-livelabs.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/sandbox/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/sandbox/index.html new file mode 100644 index 000000000..6acdb69d1 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/sandbox/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/sandbox/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/sandbox/manifest.json new file mode 100644 index 000000000..b1a4e8fee --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/sandbox/manifest.json @@ -0,0 +1,34 @@ +{ + "workshoptitle": "DBA Essentials - Configure network environment for Oracle Database 23ai", + "help": "livelabs-help-db_us@oracle.com", + "include": { + "example-values": "./../../intro-configure-network/files/example-values.txt", + "set-env-var": "./../../intro-configure-network/files/set-env-var.txt" + }, + "tutorials": [ + { + "title": "Introduction", + "description": "The workshop on network environment for Oracle Database which includes listener operation and administration.", + "publisheddate": "04/14/2023", + "filename": "./../../intro-configure-network/intro-configure-network.md" + }, + { + "title": "Lab 1: Verify compute instance setup", + "description": "Verify Setup of compute instance", + "publisheddate": "05/06/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/verify-compute/verify-compute-novnc.md" + }, + { + "title": "Lab 2: Administer listener operations", + "description": "How to perform listener operations, such as starting and stopping the listener, checking the listener status, and so on, using the listener control utility.", + "publisheddate": "04/14/2023", + "filename": "./../../administer-listener-ops/administer-listener-ops.md" + }, + { + "title": "Need help?", + "description": "Solutions to common problems and directions for receiving live help", + "publisheddate": "05/24/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-livelabs.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/tenancy/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/tenancy/index.html new file mode 100644 index 000000000..6acdb69d1 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/tenancy/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/tenancy/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/tenancy/manifest.json new file mode 100644 index 000000000..4aa4f740a --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws3-configure-network-env/workshops/tenancy/manifest.json @@ -0,0 +1,47 @@ +{ + "workshoptitle": "DBA Essentials - Configure network environment for Oracle Database 23ai", + "help": "livelabs-help-db_us@oracle.com", + "include": { + "example-values": "./../../intro-configure-network/files/example-values.txt", + "set-env-var": "./../../intro-configure-network/files/set-env-var.txt" + }, + "tutorials": [ + { + "title": "Introduction", + "description": "The workshop on network environment for Oracle Database which includes listener operation and administration.", + "publisheddate": "04/14/2023", + "filename": "./../../intro-configure-network/intro-configure-network.md" + }, + { + "title": "Get started", + "description": "Get a Free Trial", + "publisheddate": "03/22/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/cloud-login.md" + }, + { + "title": "Lab 1: Prepare setup", + "description": "How to download your ORM stack and update security rules for an existing VCN.", + "publisheddate": "10/31/2021", + "filename": "./../../prepare-setup/prepare-setup.md", + "type": "default" + }, + { + "title": "Lab 2: Setup compute instance", + "description": "How to provision the workshop environment and connect to it", + "publisheddate": "06/30/2020", + "filename": "https://oracle-livelabs.github.io/common/labs/setup-compute-generic/setup-compute-novnc.md" + }, + { + "title": "Lab 3: Administer listener operations", + "description": "How to perform listener operations, such as starting and stopping the listener, checking the listener status, and so on, using the listener control utility.", + "publisheddate": "04/14/2023", + "filename": "./../../administer-listener-ops/administer-listener-ops.md" + }, + { + "title": "Need help?", + "description": "Solutions to common problems and directions for receiving live help", + "publisheddate": "05/24/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-freetier.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/create-indexes-and-views.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/create-indexes-and-views.md new file mode 100644 index 000000000..553166d5a --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/create-indexes-and-views.md @@ -0,0 +1,243 @@ +# Create Indexes and Views + +## Introduction + +This lab walks you through the steps to view and create schema objects such as indexes and views using Database Actions. + +Estimated time: 20 minutes + +### Objectives + +Perform these tasks in your Oracle Database to manage schema objects from Oracle Database Actions: + +- View an existing index +- Create a new index +- Analysis of SQL Query performance with Indexing +- View an existing view +- Create a new view + +### Prerequisites + +This lab assumes you have- + +- An Oracle Cloud account +- Completed all previous labs successfully +- ORDS installed and configured +- *HR* schema enabled to access Database Actions +- Logged in to Oracle Database Actions in a web browser as *HR* + +## Task 1: View indexes using Oracle Database Actions + +You can view indexes for *HR* schema. + +1. Log in to Database Actions as *HR* if you are not logged in. + +2. Click the **SQL** card. This opens the SQL page in Database Actions. + ![Launchpad](../create-indexes-and-views/images/new-launchpad.png) + +3. In the Navigator tab, verify *HR* schema is selected from the first drop-down and select *Indexes* from the second drop-down list. The navigator pane displays the list of indexes of the selected schema HR. + ![Indexes List](../create-indexes-and-views/images/indexes-list.png) + +4. Select an index in the left pane. For this task, right-click *COUNTRY\_ C\_ ID\_PK* and select **Open** to view details about the index. The Columns page opens and it is to view the properties of each column in the index. + ![Columns pane](../create-indexes-and-views/images/columns.png) + + The Columns page displays the following fields: + + - INDEX_OWNER + - INDEX_NAME + - TABLE_OWNER + - TABLE_NAME + - COLUMN_NAME + - COLUMN_POSITION + - DESCEND + +5. Click the **Details** tab to view additional information about the index. + ![Details pane](../create-indexes-and-views/images/details.png) + + The Details page displays the fields. Some of them have been mentioned below: + + - CREATED + - LAST_DDL\_TIME + - OWNER + - INDEX_NAME + - INDEX_TYPE + - TABLE_OWNER + - TABLE_TYPE + - UNIQUENESS + - COMPRESSION + - PREFIX_LENGTH + - TABLESPACE_NAME + +6. Click the **Statistics** tab. + ![Statistics pane](../create-indexes-and-views/images/statistics-tab.png) + You can view statistical information about the index. + The values may differ depending on the system you are using. + +7. Click the **Partition** tab. + ![Partitions pane](../create-indexes-and-views/images/partitions-pane.png) + + This page indicates whether the index is partitioned or not. You will view *No items to display* in the Partitions tab if an index is not partitioned. + +Click **Close** at the bottom right to close the properties dialog box. + +## Task 2: Create an index using Oracle Database Actions + +In this task, you will create an index for *HR* schema. + +1. In the Navigator tab, click the three dots next to the search field and select **Create Object** from the submenu. + ![Create object button](../create-indexes-and-views/images/create-object.png) + + This opens the Index Properties dialog box. + +2. In the Definition page of the Index Properties dialog box specify the following fields. + + - **Schema:** *HR*. This is the database schema that owns the table associated with the index. + - **Table:** *COUNTRIES*. This is the table associated with the index.  + - **Tablespace:** *SYSTEM*. This is the tablespace for the index. + - **Name:** *COUNTRY_IX*. This is the name of the index. + - **Type:** *Non-Unique*. This is the type of index which can consist of multiple identical values. + + ![Definitions pane](../create-indexes-and-views/images/definition-pane.png) + + In the Columns tab, click the Columns you wish to select for the index from the list of columns available in the table. For this task, select all the columns. + You can specify a column expression in the Expression tab of the Definition page. + +3. Click the **DDL** tab of the Index Properties dialog box to review the SQL statements generated while creating the index. Navigate to the Definition tab to make changes to the properties of the index. + ![DDL pane](../create-indexes-and-views/images/ddl-pane.png) + +4. Click **Create**. + The Output page displays the generated DDL commands. + ![Output pane](../create-indexes-and-views/images/output-pane.png)  + +5. Click **Close**.  + ![New Index created](../create-indexes-and-views/images/new-index.png) + + The Database Actions tool creates a new index named *NEW_INDEX* that appears in the list of indexes for the *HR* schema. + +> **Note:** To edit an Index, navigate to the Index Properties dialog box. Make the changes in the Definition page and in the DDL page, the UPDATE tab is to view the generated ALTER statements. Click **Apply**. + +## Task 3: Analyze SQL query performance with indexing + +This task will give information on how a SQL Query performs before and after creating an index based on Elapsed time. This task will also guide you on how to view the Execution plan after creating an index + +An execution plan is basically the sequence of operations that the database performs to run a SQL statement. + +1. In the Navigator tab, verify the **HR** schema is selected and then select **Tables** from the second drop-down list. + +2. First, verify the Elapsed time before creating an index using the following code. + + ``` + + SELECT e.last_name, d.department_name, e.salary + FROM employees e, departments d + WHERE salary < 3000 + AND e.department_id = d.department_id + ORDER BY salary DESC; + + ``` + It displays the following output. + ![Elapsed time before index](../create-indexes-and-views/images/elapsed-time-bi.png) + +3. Second, to check the plan output, click the Explain Plan icon ![Explain Plan](../create-indexes-and-views/images/explain-plan-icon.png) + + It displays the following output. + ![Explain Plan before](../create-indexes-and-views/images/explain-plan-before.png) + +4. Next, create an index. Select **Indexes** from the second drop-down list. Select **Create Object** from the submenu. Then, select **DEPARTMENTS** from the Table drop-down. Change the name of the index to DEPARTMENT\_IX. Next is to select columns **DEPARTMENT\_NAME** and **DEPARTMENT\_ID**. Click **Create**. + ![Create a new index](../create-indexes-and-views/images/index-new.png) + You will be able to view a message "Index HR.DEPARTEMENT\_IX created." in the Output tab. + +5. From the Navigator tab, select **Tables** from the second drop-down list. Run the below code in the editor. + + ``` + + SELECT e.last_name, d.department_name, e.salary + FROM employees e, departments d + WHERE salary < 3000 + AND e.department_id = d.department_id + ORDER BY salary DESC; + + ``` + + It displays the following output. + ![Elapsed time after index](../create-indexes-and-views/images/elapsed-time-ai.png) + You can see the Elapsed time had marginally decreased after creating an index. + +6. Next, check the plan output by clicking the Explain Plan icon ![Explain Plan](../create-indexes-and-views/images/explain-plan-icon.png). To view the expanded version, click Expand All icon ![Expand All Icon](../create-indexes-and-views/images/expand-all.png) + + It displays the following output. + ![Explain Plan Output](../create-indexes-and-views/images/explain-plan-after.png) + +As you can see after creating an index, the SQL Query performs better by fetching the script output in less amount of time. + +## Task 4: See a view + +You can see all the existing views in your database. In this lab, you will use the *HR* schema to achieve this task. + +1. In the Navigator tab, verify the **HR** schema is selected and then select **Views** from the second drop-down list. + + This displays the list of views of the selected schema HR. + +2. To open and view the properties of the existing view, right-click a view object and select **Open**.  + ![Open existing view](../create-indexes-and-views/images/existing-view.png) + +3. Check the details of the view in the dialog box. + ![Columns pane](../create-indexes-and-views/images/columns-pane-details-view.png) + + The different tabs in the dialog are as follows:   + + - **Columns:** ~You can view all the columns of the view~ This displays the columns in the view. + - **Data:** This displays the data in the view. You can insert a new row in this page. Double click a cell to fill in the values of the row you insert. + - **Grants:** This displays the roles you grant for the selected view. + - **Dependencies:** This displays the dependency information of all the tables used in the selected view. + - **Details:** This displays information like the Creation date, owner of the view, Name of the view, the SQL statement you use to create the view. + - **Triggers:** This displays the trigger actions you used to update the tables underlying the view. + - **Errors:** This displays the errors if there are any.  + +Click **Close** at the bottom right to close the properties dialog box. + +## Task 5: Create a View + +You can create a view for the *HR* Schema. + +1. In the Navigator tab, select **HR** schema from the first drop-down and select **Views** from the second drop-down list if not already selected. + +2. Click the Object submenu (three vertical dots next to Search field) and select **Create Object**. + + > Note: To create a view from an existing template for a selected schema, in the Navigator tab, select the view to create from, right-click and select **Use as Template**. + + ![Create View](../create-indexes-and-views/images/create-view.png) + A View Properties dialog box opens. + +3. Specify the following field values: + + **Schema:** *HR*. This is the schema where you create your view. + **Name:** *MGR\_100\_EMPS*. This is the name of the view. + + In the SQL Query pane, enter the following: + ``` + + SELECT * FROM hr.employees WHERE manager_id = 100 + + ``` + +4. Click the **Create** button to create a view. + ![Create button](../create-indexes-and-views/images/create-button.png) + + You will see a successful creation of view message. + ![New Index created](../create-indexes-and-views/images/index-created.png) + +5. Click **Close**. + ![List after creating new index](../create-indexes-and-views/images/new-index-list.png) + + The Database Actions tool creates a new view named *MGR_100_EMPS* that appears in the list of views for the *HR* schema. + +> **Note:** To edit a View, navigate to the View Properties dialog box. Make the changes in the SQL Query page and in the DDL page, the UPDATE tab is to view the generated ALTER statements. Click **Apply**. + +You may now **proceed to the next lab**. + +## Acknowledgments + +- **Author** - Aayushi Arora, Database User Assistance Development Team +- **Contributors** - Jeff Smith, Manish Garodia, Manisha Mati +- **Last Updated By/Date** - Aayushi Arora, October 2024 \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/columns-pane-details-view.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/columns-pane-details-view.png new file mode 100644 index 000000000..e41af88dd Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/columns-pane-details-view.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/columns.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/columns.png new file mode 100644 index 000000000..5b9576c01 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/columns.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/create-button.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/create-button.png new file mode 100644 index 000000000..85c542369 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/create-button.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/create-object.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/create-object.png new file mode 100644 index 000000000..3a2bd92f0 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/create-object.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/create-view.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/create-view.png new file mode 100644 index 000000000..624681e91 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/create-view.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/ddl-pane.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/ddl-pane.png new file mode 100644 index 000000000..cbbd2b5af Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/ddl-pane.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/definition-pane.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/definition-pane.png new file mode 100644 index 000000000..0a39e2e14 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/definition-pane.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/details.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/details.png new file mode 100644 index 000000000..4b8267557 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/details.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/elapsed-time-ai.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/elapsed-time-ai.png new file mode 100644 index 000000000..2ac784f70 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/elapsed-time-ai.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/elapsed-time-bi.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/elapsed-time-bi.png new file mode 100644 index 000000000..be7e9cc38 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/elapsed-time-bi.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/existing-view.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/existing-view.png new file mode 100644 index 000000000..9c06cf725 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/existing-view.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/expand-all.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/expand-all.png new file mode 100644 index 000000000..e8906d5a2 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/expand-all.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/explain-plan-after.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/explain-plan-after.png new file mode 100644 index 000000000..653f65d61 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/explain-plan-after.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/explain-plan-before.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/explain-plan-before.png new file mode 100644 index 000000000..beb6f55d4 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/explain-plan-before.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/explain-plan-icon.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/explain-plan-icon.png new file mode 100644 index 000000000..34953b942 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/explain-plan-icon.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/index-created.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/index-created.png new file mode 100644 index 000000000..eafb65a5d Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/index-created.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/index-new.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/index-new.png new file mode 100644 index 000000000..d4ce9ab74 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/index-new.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/indexes-list.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/indexes-list.png new file mode 100644 index 000000000..683a23d60 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/indexes-list.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/new-index-list.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/new-index-list.png new file mode 100644 index 000000000..e9fd22062 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/new-index-list.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/new-index.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/new-index.png new file mode 100644 index 000000000..904f67425 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/new-index.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/new-launchpad copy.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/new-launchpad copy.png new file mode 100644 index 000000000..09830c51e Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/new-launchpad copy.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/new-launchpad.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/new-launchpad.png new file mode 100644 index 000000000..09830c51e Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/new-launchpad.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/output-pane.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/output-pane.png new file mode 100644 index 000000000..a852c3f54 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/output-pane.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/partitions-pane.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/partitions-pane.png new file mode 100644 index 000000000..2e3c0a964 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/partitions-pane.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/plan-output-ai.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/plan-output-ai.png new file mode 100644 index 000000000..e7a63a922 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/plan-output-ai.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/plan-output-bi.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/plan-output-bi.png new file mode 100644 index 000000000..0d319cb8e Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/plan-output-bi.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/sql-card.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/sql-card.png new file mode 100644 index 000000000..51a75540a Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/sql-card.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/statistics-tab.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/statistics-tab.png new file mode 100644 index 000000000..62c6eea72 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/create-indexes-and-views/images/statistics-tab.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/db-service-status.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/db-service-status.png new file mode 100644 index 000000000..1aa5a96e3 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/db-service-status.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/db-service-status2.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/db-service-status2.png new file mode 100644 index 000000000..00d6596d6 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/db-service-status2.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/em-landing.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/em-landing.png new file mode 100644 index 000000000..87dfb57ed Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/em-landing.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/em-login.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/em-login.png new file mode 100644 index 000000000..e0d6cad75 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/em-login.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/em-service-status.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/em-service-status.png new file mode 100644 index 000000000..637644954 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/em-service-status.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/listener-service-status.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/listener-service-status.png new file mode 100644 index 000000000..8c1ff33e0 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/listener-service-status.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/login-em-external-1.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/login-em-external-1.png new file mode 100644 index 000000000..0577b94d2 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/login-em-external-1.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/login-em-external-2.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/login-em-external-2.png new file mode 100644 index 000000000..0d41d938a Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/login-em-external-2.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/named-creds-job-submit.jpg b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/named-creds-job-submit.jpg new file mode 100644 index 000000000..338c5f9a7 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/named-creds-job-submit.jpg differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/named-creds-job-succeeded.jpg b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/named-creds-job-succeeded.jpg new file mode 100644 index 000000000..1048b3fd5 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/named-creds-job-succeeded.jpg differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/named-creds-job.jpg b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/named-creds-job.jpg new file mode 100644 index 000000000..8e7b1f4ec Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/named-creds-job.jpg differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/ords-login.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/ords-login.png new file mode 100644 index 000000000..1c22decee Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/ords-login.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/ords-service-status.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/ords-service-status.png new file mode 100644 index 000000000..6cecec93b Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/ords-service-status.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/ssh-key-gen.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/ssh-key-gen.png new file mode 100644 index 000000000..496c71293 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/ssh-key-gen.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/submitted.jpg b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/submitted.jpg new file mode 100644 index 000000000..1b804a6f4 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/submitted.jpg differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-0.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-0.png new file mode 100644 index 000000000..d1d5de2e8 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-0.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-1.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-1.png new file mode 100644 index 000000000..37630286e Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-1.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-2.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-2.png new file mode 100644 index 000000000..f5e32e9ea Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-2.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-3.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-3.png new file mode 100644 index 000000000..3a8e5ebe7 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-3.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-4.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-4.png new file mode 100644 index 000000000..0aae77809 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/images/update-ssh-creds-4.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/initialize-environment.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/initialize-environment.md new file mode 100644 index 000000000..42260b167 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/initialize-environment.md @@ -0,0 +1,211 @@ +# Initialize environment + +## Introduction + +This lab helps you start and administer the components and services required for this workshop. + +**Background** +When you establish a remote desktop session, check the environment and verify that the dependent processes are up and running. After instance provisioning, it takes around 15 minutes for all processes and services to start. If a component is not running, you can start it manually as explained in this lab. + +Estimated time: 10 minutes + +### Objectives + + - Ensure that the following are running: + - Database Listener - *LISTENER_ORCL* + - Oracle Database Instance - *orcl* + - Oracle REST Data Services (ORDS) - *ords* + - Log in to Oracle Database Actions in a web browser. + +### Prerequisites + +This lab assumes you have - + - An Oracle Cloud account + - Oracle Database and ORDS installed on your system + +## Task 1: Verify that the dependent components are running + +In this task, you will verify that the required components, such as Listener, Oracle Database, and ORDS, are running on the host. + +1. Verify that the listener service, *oracle-db-listener*, is running. + + ``` + $ sudo systemctl status oracle-db-listener + ``` + + ![Listener Service Status](./images/listener-service-status.png " ") + + The status *active* indicates that the listener service is running. If the listener service is not running, you can restart it with the following command. + + ``` + $ sudo systemctl restart oracle-db-listener + ``` + +1. Verify that the Oracle Database service, *oracle-database*, is running. + + ``` + $ sudo systemctl status oracle-database + ``` + + ![Oracle Database services status](./images/db-service-status.png " ") + + The status *active* indicates that the database service is running. If the database service is not running, you can restart it with the following command. + + ``` + $ sudo systemctl restart oracle-database + ``` + +1. Verify that the ORDS service, *ords*, is running. + + ``` + $ sudo systemctl status ords + ``` + + ![ORDS Service Status](./images/ords-service-status.png " ") + + > **Note**: You can access the Database Actions login page in a web browser only if ORDS is running. + + The status *active* indicates that the ords service is running. If the ords service is not running, you can restart it with the following command. + + ``` + $ sudo systemctl restart ords + ``` + + If still unsuccessful, then run the following script to start ORDS. + + ``` + $ source ~/run_ords.sh + ``` + +Your environment is now ready. You can access the Oracle Database Actions login page in a web browser. + +## Task 2: Log in to Oracle Database Actions + +In this task, you will log in to the Oracle Database Actions console using a web browser. + +If you have reserved a Livelabs environment, then the remote desktop session will have a web browser open and display the *Oracle Database Actions* login page. If it does not display the Database Actions login page, you can access it as follows. + +1. Open a web browser and go to the Database Actions login URL. + For this lab, the login URL is: + + ``` + http://oms1:8080/ords/sql-developer + ``` + + ![ORDS login](./images/ords-login.png " ") + +1. Specify the user credentials for Oracle Database Actions. For this lab, the credentials are: + + - **Username**: *HR* + - **Password**: *oracle* + + Click **Sign in** to log in to the Oracle Database Actions console. + +On successful login, you can perform the tasks using Database Actions. + +## Appendix 1: Manage startup services + +You can manage the startup services using various options, for example, start, stop, restart, and status. + +1. Database services (All databases and Standard Listener) + + - Start + + ``` + $ sudo systemctl start oracle-database + ``` + + - Stop + + ``` + $ sudo systemctl stop oracle-database + ``` + + - Restart + + ``` + $ sudo systemctl restart oracle-database + ``` + + - Status + + ``` + $ systemctl status oracle-database + ``` + +1. Listener Service (Non-Standard Listener) + + - Start + + ``` + $ sudo systemctl start oracle-db-listener + ``` + + - Stop + + ``` + $ sudo systemctl stop oracle-db-listener + ``` + + - Restart + + ``` + $ sudo systemctl restart oracle-db-listener + ``` + + - Status + + ``` + $ systemctl status oracle-db-listener + ``` + +1. Oracle REST Data Services (ORDS) + + - Start + + ``` + $ sudo systemctl start ords + ``` + + - Stop + + ``` + $ sudo systemctl stop ords + ``` + + - Restart + + ``` + $ sudo systemctl restart ords + ``` + + - Status + + ``` + $ systemctl status ords + ``` + +## Appendix 2: External web access + +You have an option to log in to Database Actions from a location outside your remote desktop session, for example, a workstation or laptop. + +1. Open a web browser and go to the Database Actions login page. A Database Actions login URL contains the following: + + ``` + http://[Your instance public IP]:8080/ords/sql-developer + ``` + +1. Specify the user credentials for Oracle Database Actions. For this lab, the credentials are: + + - **Username**: *HR* + - **Password**: *oracle* + + Click **Sign in** to log in to the Oracle Database Actions console. + +You may now **proceed to the next lab**. + +## Acknowledgments + + - **Author**: Manish Garodia, Database User Assistance Development + - **Contributors**: Aayushi Arora, Manisha Mati + - **Last Updated By/Date**: Manish Garodia, September 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/initialize-environment_old.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/initialize-environment_old.md new file mode 100644 index 000000000..c9c5c04b4 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/initialize-environment/initialize-environment_old.md @@ -0,0 +1,309 @@ +# Initialize environment + +## Introduction + +This lab helps you start and administer the components and services required for this workshop. + +**Background** +When you establish a remote desktop session, check the environment and verify that the dependent processes are up and running. After instance provisioning, it takes around 15 minutes for all processes and services to start. If a component is not running, you can start it manually as explained in this lab. + +Estimated time: 10 minutes + +### Objectives + + - Ensure that the following are running: + - Database Listener + - *LISTENER* + - *LISTENER_1522* + - Oracle Database Instance + - *emrep* + - *db19c* + - *orcl* + - Oracle Enterprise Manager (EM) - Management server (OMS) + - Oracle Enterprise Manager - Management Agent (emagent) + + - Log in to Oracle Enterprise Manager in a web browser. + +### Prerequisites + +This lab assumes you have - + - An Oracle Cloud account + - Oracle Enterprise Manager installed on your system + +## Task 1: Verify that the dependent components are running + +In this task, you will verify that the required components, such as Listeners, Oracle Databases, and Oracle Enterprise Manager, are running on the host. + +1. Verify that the listener service, *oracle-db-listener*, is running. + + ``` + $ sudo systemctl status oracle-db-listener + ``` + + ![Listener Service Status](./images/listener-service-status.png " ") + + The status *active* indicates that the listener service is running. If the listener service is not running, you can restart it with the following command. + + ``` + $ sudo systemctl restart oracle-db-listener + ``` + +1. Verify that the Oracle Database service, *oracle-database*, is running. + + ``` + $ sudo systemctl status oracle-database + ``` + + ![Oracle Database services status 1](./images/db-service-status.png " ") + + ![Oracle Database services status 2](./images/db-service-status2.png " ") + + The status *active* indicates that the database service is running. If the database service is not running, you can restart it with the following command. + + ``` + $ sudo systemctl restart oracle-database + ``` + +1. Verify that EM services, *OMS* and *emagent*, are running. + + ``` + $ sudo systemctl status oracle-emcc + ``` + + ![EM Service Status](./images/em-service-status.png " ") + + > **Note**: You can access the Oracle Enterprise Manager login page in a web browser only if OMS and emagent services are running. + + The status *active* indicates that these services are running. If the services are not running, you can restart them with the following command. + + ``` + $ sudo systemctl restart oracle-emcc + ``` + +1. Validate *emcli* connectivity. From the terminal session on your remote desktop, run as user *oracle*. + + ``` + + . ~/.occ_oms.sh + emcli login -username=sysman -password=welcome1 + + ``` + +If the dependent components are running, you can access the Oracle Enterprise Manager login page in a web browser. + +## Task 2: Log in to Oracle Enterprise Manager + +In this task, you will log in to the Oracle Enterprise Manager using a web browser. + +If you have reserved a Livelabs environment, then the remote desktop session will have a web browser open and display the *Oracle Enterprise Manager* login page. If it does not display the EM login page, you can access it as follows. + +1. Open a web browser and go to the Oracle Enterprise Manager login URL. + For this lab, the login URL is: + + ``` + http://oms1:7803/em + ``` + +1. Specify the user credentials for Oracle Enterprise Manager. + + ![EM login](./images/em-login.png " ") + + For this lab, the credentials are: + + - **Username**: *sysman* + - **Password**: *welcome1* + + Click **Login** to sign into the Oracle Enterprise Manager console. + + ![EM landing page](./images/em-landing.png " ") + +On successful login, the browser displays the EM landing page. Your environment is now ready. + +## Task 3: Generate SSH keys + +In this task, you will generate a public-private key pair required for system authentication. + +1. From your remote desktop session, open a terminal window and run the following to generate the key pair. + + ``` + + cd ~ + ssh-keygen -b 2048 -t rsa + + ``` + +1. Accept defaults for file and passphrase by pressing *Enter* three times to create a key with no passphrase. + + ![Generate SSH Keys](./images/ssh-key-gen.png " ") + +1. Update *`~/.ssh/authorized_keys`* and copy the *private key* to */tmp*. + + ``` + + cd .ssh + cat id_rsa >/tmp/rsa_priv + cat id_rsa.pub >>authorized_keys + + ``` + + ![Update SSH Credentials](./images/update-ssh-creds-0.png " ") + +You can use the keys to setup Named Credentials in Oracle Enterprise Manager. + +## Task 4: Set up Named Credentials with the new SSH Keys + +In this task, you will use the SSH keys to set up Named Credentials in Oracle Enterprise Manager. + +1. From the EM Console as *SYSMAN*, navigate to **Setup menu** > **Security** > **Named Credentials**. Select the *ROOT* credential and click **Edit**. + + ![Update Named Credentials](images/update-ssh-creds-1.png " ") + +1. Keep the General Properties unchanged and update the **Credential Properties** section as follows: + + - **User name**: *oracle* + - Delete any content from the **SSH Public Key** textbox + - Click **Choose File** to select the *Public Key* `id_rsa.pub`. If you cannot see the *.ssh* directory, you can click *.livelabs* and then go to *oracle* to access the *.ssh* folder. + + ![Edit Credentials Properties](images/update-ssh-creds-2.png " ") + +1. For **SSH Private Key**, on the file browser navigate to **+Other Locations** > **tmp** and select the file *rsa_priv*. + + ![Save Credentials](images/update-ssh-creds-3.png " ") + +1. Click *Test and Save* + + ![Credential Operation Successful](images/update-ssh-creds-4.png " ") + +1. Setup Oracle Named Credentials using Job System. This will set up the user oracle password on the host and update the Named Credentials used in this workshop. + Navigate to **Enterprise** > **Job** > **Library**, select *SETUP ORACLE CREDENTIALS*, and click **Submit**. + + ![Job Library](images/named-creds-job.jpg " ") + +1. Click **Submit** again on the Job submission Page. + + ![Job Submission](images/named-creds-job-submit.jpg " ") + +1. The job will be submitted successfully. Click on *SETUP ORACLE CREDENTIALS* job link to view the job. + + ![Setup Oracle Credentials](images/submitted.jpg " ") + +1. The Job should show Status **Succeeded**. + + ![Job Status](images/named-creds-job-succeeded.jpg " ") + +You can use the Named Credentials to log in to your host. + +## Appendix 1: Managing startup services + +You can manage the startup services using various options, for example, start, stop, restart, and status. + +1. Database services (All databases and Standard Listener) + + - Start + + ``` + sudo systemctl start oracle-database + ``` + + - Stop + + ``` + sudo systemctl stop oracle-database + ``` + + - Restart + + ``` + sudo systemctl restart oracle-database + ``` + + - Status + + ``` + sudo systemctl status oracle-database + ``` + +1. Listener Service (Non-Standard Listener) + + - Start + + ``` + sudo systemctl start oracle-db-listener + ``` + + - Stop + + ``` + sudo systemctl stop oracle-db-listener + ``` + + - Restart + + ``` + sudo systemctl restart oracle-db-listener + ``` + + - Status + + ``` + sudo systemctl status oracle-db-listener + ``` + +1. Enterprise Manager Services (OMS and emagent) + + - Start + + ``` + sudo systemctl start oracle-emcc + ``` + + - Stop + + ``` + sudo systemctl stop oracle-emcc + ``` + + - Restart + + ``` + sudo systemctl restart oracle-emcc + ``` + + - Status + + ``` + sudo systemctl status oracle-emcc + ``` + +## Appendix 2: External Web Access + +You have an option to log in to Oracle Enterprise Manager from a location outside your remote desktop session, for example, a workstation or laptop. + +1. Open a web browser and go to the Oracle Enterprise Manager login page. An EM login URL contains the following: + + ``` + http://[Your instance public IP]:7803/em + ``` + +1. Specify the user credentials for Oracle Enterprise Manager. For this lab, the credentials are: + + - **Username**: *sysman* + - **Password**: *welcome1* + + Click **Login** to sign in to the Oracle Enterprise Manager console. + + > **Note**: You may see an error on the browser while accessing the web console - “*Your connection is not private*”. + + ![Privacy Error](images/login-em-external-1.png " ") + + You can ignore the warning and add the exception to proceed. + + ![EM Login](images/login-em-external-2.png " ") + +You may now **proceed to the next lab**. + +## Acknowledgments + + - **Author**: Manish Garodia, Database User Assistance Development + - **Contributors**: Aayushi Arora, Manisha Mati, Rene Fontcha + - **Last Updated By/Date**: Manish Garodia, October 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/intro-schema-objects/intro-schema-objects.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/intro-schema-objects/intro-schema-objects.md new file mode 100644 index 000000000..7147ca783 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/intro-schema-objects/intro-schema-objects.md @@ -0,0 +1,90 @@ +# Introduction + +## About this workshop + +This workshop is about creating and managing schema objects in Oracle Database, such as tables, indexes, and views. You will use Database Actions to perform various operations, view existing schema objects, create new objects, and so on.  + +You will also learn how to create a new PL/SQL procedure and revalidate schema objects that are invalid. + +Estimated workshop time: 1 hour 20 minutes + +### Objective + +In this workshop you will learn how to perform the following tasks in Oracle Database using Oracle Database Actions: + +- View existing tables, create tables, and load data into tables from files +- View and create an index and view +- Create a PL/SQL procedure and validate the invalid schema objects referenced in the procedure + +### Prerequisites + +This lab assumes you have - + +- An Oracle Cloud account + +## About Oracle Database Actions + +Oracle Database Actions is a web-based interface for on-premises Oracle Database that uses Oracle REST Data Services to provide many of the database development, management and administration features of desktop-based Oracle SQL Developer in Autonomous Databases. The main features include running SQL statements and scripts in the worksheet, exporting data, creating RESTful web services, managing JSON collections, monitoring databases, and creating Data Modeler diagrams. You can use it without downloading or installing additional software on your system. Database Actions was earlier known as SQL Developer Web.Database Actions was earlier known as SQL Developer Web. + +## About schema Objects + +A schema is a collection of database objects. A database user owns the schema and the shares the same name as that of the user. Some objects, such as tables or indexes, hold data whereas other objects, such as views or synonyms, consist of a definition only. + +Each object in the database has a specific name and belongs to a single schema. If the objects are in separate schemas, then it is possible to have different database objects with the same name. + +### Know about Tables + +The table is the basic unit of data storage in an Oracle Database. It holds all user-accessible data. Each table is made up of columns and rows. In the `employees` table, for example, there are columns called `last_name` and `employee_id`. Each row in the table represents a different employee and contains a value for `last_name` and `employee_id`. + +### What are Indexes? + +Indexes are optional schema objects that are associated with tables. You create indexes on tables to improve query performance. Like the index in a book helps you to quickly locate specific information, an Oracle Database index provides quick access to table data. You can create as many indexes on a table as you need.  + +### What are Views? + +Views are customized presentations of data in one or more tables or other views. You can think of them as stored queries. Views do not actually contain data, but instead derive their data from the tables upon which they are based. These tables are referred to as the base tables of the view. + +Similar to tables, you can query on views, update them, insert into them, and delete from them, with some restrictions. All operations performed on a view actually affect the base tables of the view. Views can provide an additional level of security by restricting access to a predetermined set of rows and columns of a table. They can also hide data complexity and store complex queries. + +### Program code stored in Oracle Database + +Oracle Database offers the ability to store program code in the database. Developers write program code in PL/SQL or Java and store the code in schema objects. You can use SQL Developer to manage program code objects such as: + +- PL/SQL packages, procedures, functions, and triggers +- Java source code (Java sources) and compiled Java classes + +The actions that you can perform include creating, compiling, creating synonyms for, granting privileges on, and showing dependencies for these code objects. You can also edit and debug PL/SQL code objects using Database Actions. You access administration pages for these objects by clicking links in the Programs section of the Schema subpage. + +Note that creating and managing program code objects is primarily the responsibility of application developers. However, as a database administrator you might have to assist in managing these objects. One of the major tasks for program code objects might be to revalidate (compile) them, because they can become invalidated if the schema objects on which they depend change or are deleted. + +**Note:** Besides program code objects, other schema objects can also become invalid. For example, if you delete a table, then any views that reference that table become invalid. + +### About Invalid Schema Objects + +There are specific types of schema objects that relate to other items. A dependent object is one that references another object, while a referred object is one that is being referenced. The compiler creates these references at compile time, and if it is unable to resolve them, the dependent object is designated as invalid.For instance, a view can contain a query that refers to tables or other views, and a PL/SQL subprogram may call other subprograms or refer to tables or views using static SQL. + +**Note:** Due to the impact invalidation has on applications using the database, it is crucial to be aware of changes that could cause schema objects to become invalid. + +Use the following query to display the set of invalid objects in the database:`SELECT object_name, object_type FROM dba_objects WHERE status = 'INVALID';` + +### Validate Invalid Schema Objects + +Schema objects (such as triggers, procedures, or views) become invalid when objects on which they depend change. For example, if a PL/SQL procedure contains a query on a table and you modify table columns that are referenced in the query, then the PL/SQL procedure becomes invalid. You revalidate schema objects by compiling them. + +You can use an ALTER statement to manually recompile a single schema object. For example, to recompile package body Pkg1, you would run the following DDL statement:`ALTER PACKAGE pkg1 COMPILE REUSE SETTINGS;` + +You can also manually recompile invalid objects with `RECOMP_SERIAL` procedure. The RECOMP_SERIAL procedure recompiles all invalid objects in a specified schema.  + +After your application upgrades, it is a good practice to revalidate invalid objects to avoid application latencies. Oracle provides the UTL_RECOMP package to assist in object revalidation. + +Click on the next lab to **Get started**.  + +## Learn More + +- [Database Administrator’s Guide](https://docs.oracle.com/en/database/oracle/oracle-database/23/admin/index.html) + +## Acknowledgments + +- **Author** - Aayushi Arora, Database User Assistance Development Team +- **Contributors** - Jeff Smith, Manish Garodia, Manisha Mati +- **Last Updated By/Date** - Aayushi Arora, October 2024 \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/columns-tab.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/columns-tab.png new file mode 100644 index 000000000..8387bb728 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/columns-tab.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/compile-icon.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/compile-icon.png new file mode 100644 index 000000000..3b7e747d7 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/compile-icon.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/compile-procedure.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/compile-procedure.png new file mode 100644 index 000000000..f1dd2850e Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/compile-procedure.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/edit-option.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/edit-option.png new file mode 100644 index 000000000..0c00c701b Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/edit-option.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/invalid-objects.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/invalid-objects.png new file mode 100644 index 000000000..ba6cd9ba6 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/invalid-objects.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/invalid-script-output.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/invalid-script-output.png new file mode 100644 index 000000000..d9e120f1a Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/invalid-script-output.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/new-procedure.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/new-procedure.png new file mode 100644 index 000000000..5828f82f4 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/new-procedure.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/open-procedure.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/open-procedure.png new file mode 100644 index 000000000..3b621f709 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/open-procedure.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/output-tab.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/output-tab.png new file mode 100644 index 000000000..f46947a36 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/output-tab.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/overview.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/overview.png new file mode 100644 index 000000000..1df5b3bcc Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/overview.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/plsql-editor.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/plsql-editor.png new file mode 100644 index 000000000..7c2c51bb9 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/plsql-editor.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/procedure-hr.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/procedure-hr.png new file mode 100644 index 000000000..23e005535 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/procedure-hr.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/procedure-name.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/procedure-name.png new file mode 100644 index 000000000..3a4bd730f Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/procedure-name.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/rename-column-balance.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/rename-column-balance.png new file mode 100644 index 000000000..0eb55ebd5 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/rename-column-balance.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/rename-column.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/rename-column.png new file mode 100644 index 000000000..15875651a Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/rename-column.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/script-output.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/script-output.png new file mode 100644 index 000000000..e1b36bfd7 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/script-output.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/selectoricon-menu.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/selectoricon-menu.png new file mode 100644 index 000000000..2bc673b99 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/images/selectoricon-menu.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/manage-program-code.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/manage-program-code.md new file mode 100644 index 000000000..ffa888555 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-program-code/manage-program-code.md @@ -0,0 +1,143 @@ +# Manage Program code stored in Oracle Database + +## Introduction + +In this lab you will use Database Actions to validate invalid Schema objects. You will create a new PL/SQL procedure and change the table referenced in the procedure. As a database administrator (DBA), you may be asked to revalidate schema objects that have become invalid. Schema objects (such as triggers, procedures, or views) can be invalidated when changes are made to objects on which they depend. For example, if a PL/SQL procedure contains a query on a table and you modify table columns that are referenced in the query, then the PL/SQL procedure becomes invalid. You revalidate schema objects by compiling them. + +Estimated time: 30 minutes + +### Objectives + +- Create a new PL/SQL procedure +- Make the object invalid manually fix the invalid schema objects + +### Prerequisites + +This lab assumes you have- + +- An Oracle Cloud account +- Completed all previous labs successfully +- ORDS installed and configured +- *HR* schema enabled to access Database Actions +- Logged in to Oracle Database Actions in a web browser as *HR* + +## Task 1: Create a PL/SQL procedure  + +You can create a new procedure in your Oracle Database using Database Actions.  + +1. In the Navigator tab, verify **HR** schema from the first drop-down is selected and then select Procedures from the second drop-down list. + ![HR Schema](../manage-program-code/images/procedure-hr.png) + +2. Open the PL/SQL editor. + ![PL/SQL editor](../manage-program-code/images/plsql-editor.png) + +3. Execute the following script to create a new procedure named *`ADD_AC`*. This procedure creates a new procedure named *`ADD_AC`*.  + + ``` + + CREATE OR REPLACE PROCEDURE ADD_AC + ( p_id account.id%type + , p_account_no account.account_no%type + , p_customer_id account.customer_id%type + , p_open_date account.open_date%type + , p_balance account.balance%type + ) + IS + BEGIN + INSERT INTO account (id, account_no, customer_id, open_date, balance) VALUES(p_id, p_account_no, p_customer_id, p_open_date, p_balance); + END add_ac; + / + + ``` + +4. Click the compile icon in the SQL toolbar to compile the procedure. + ![Compile Icon](../manage-program-code/images/compile-icon.png) + +5. The Script Output of the output pane displays the following result. + + ``` + Procedure ADD_AC compiled + Elapsed: 00:00:00.037 + ``` + + You can view the newly compiled procedure in the list of procedures in the navigator tab for HR schema. + ![New procedure](../manage-program-code/images/new-procedure.png) + +## Task 2: Validate invalid schema objects in the procedure + +To understand more about procedures, you will now remove a column from the table ACOUNT referenced in the ADD_AC procedure. + +In the Navigator tab of the **HR** schema, select **Tables** from the second drop-down list. You can view a list of tables associated with the HR schema. + +1. Select *ACCOUNT* table and right click to select **Edit**. + ![Edit option](../manage-program-code/images/edit-option.png) + This opens the Table properties dialog box of the *`ACCOUNT`* table. + +2. Verify the Columns tab is selected in the dialog box. + ![Column Tab](../manage-program-code/images/columns-tab.png) + +3. Click the **`BALANCE`** column and rename it to **`LEFTOVER`**. + ![Rename Column](../manage-program-code/images/rename-column.png) + +4. Click **Apply**. + + You will view an alter table message in the Output page of the dialog box after the BALANCE column is renamed. + ![Output Tab](../manage-program-code/images/output-tab.png)  + + You now have ADD_AC procedure in your database that is invalid. + + You will now check for invalid objects and perform the following steps to validate the invalid procedure *`ADD_AC`*. + +5. Click the **Selector Icon** to go to the Overview page and then select **Overview**. + ![Overview](../manage-program-code/images/overview.png) + +6. Verify the Invalid Objects widget displays the *`ADD_AC`* procedure. + ![Invalid Objects](../manage-program-code/images/invalid-objects.png) + + The status of the procedure is shown as INVALID. + +7. Click the **Selector Icon** and select **SQL** under Development. + +8. In Navigator tab, verify **HR** schema is selected from the drop-down and select **Procedures** from the Object type drop-down list. + + You can view a list of procedures associated with the HR schema. + +9. Click the *`ADD_AC`* procedure.  + ![Procedure name](../manage-program-code/images/procedure-name.png) + + > **Note**: The red cross on the procedure indicates that the SQL statement did not compile due to some error. + +10. Right-click the procedure and select **Open**.  + ![Open the procedure](../manage-program-code/images/open-procedure.png) + You can view the SQL statements of the procedure in SQL editor. + +11. Click the **Compile** icon in the SQL toolbar to compile the procedure. + ![Compile the procedure](../manage-program-code/images/compile-procedure.png) + +12. The Script Output displays the following result. + ![Invalid Script Output](../manage-program-code/images/invalid-script-output.png) + The result clearly means that the component BALANCE must be declared to validate the *`ADD_AC`* procedure. + +13. From the Navigator tab of the *HR* schema, select **Tables** from the second drop-down list. + +14. Select *`ACCOUNT`* table and right-click to select **Edit**. + ![Edit option](../manage-program-code/images/edit-option.png) + This opens the Table properties dialog box of the *`ACCOUNT`* table. + +15. Verify the Columns tab of the dialog box is selected and rename the column name *`LEFTOVER`* back to *`BALANCE`*. + ![Rename column back to Balance](../manage-program-code/images/rename-column-balance.png) + +16. Select **Procedures** from the Object type drop-down list. Then execute the script used to create new procedure ADD_AC again. Refresh the page and the status is back to VALID and red cross mark has disappeared. + + > **Note:** It is not always possible to make an object valid by recompiling it. You may have to take remedial actions first. For example, if a view becomes invalid because a table that it references is deleted, then compiling the view produces an error message that indicates that the table does not exist. You cannot validate the view until you re-create the table. + +Congratulations! You have successfully completed this workshop on *Schema Objects management in Oracle Database*. + +In this workshop, you not only learned ways to create tables, views and indexes but also how to load data into the new table. You also created a new PL/SQL procedure. You invalidated the procedure by removing a column from a table referenced in the procedure. You validated the procedure by adding the removed column back into the table and checked for its status.  + + +## Acknowledgments + +- **Author** - Aayushi Arora, Database User Assistance Development team +- **Contributors** - Jeff Smith, Manish Garodia, Manisha Mati +- **Last Updated By/Date** - Aayushi Arora, October 2024 \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/add-files.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/add-files.png new file mode 100644 index 000000000..def4be7b5 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/add-files.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/clear-icon.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/clear-icon.png new file mode 100644 index 000000000..03be705e2 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/clear-icon.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/columns-tab.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/columns-tab.png new file mode 100644 index 000000000..05028cfc2 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/columns-tab.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/commit-button.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/commit-button.png new file mode 100644 index 000000000..86bdf5b5e Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/commit-button.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/constraints-tab.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/constraints-tab.png new file mode 100644 index 000000000..dbb3ebee9 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/constraints-tab.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/create-object.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/create-object.png new file mode 100644 index 000000000..0e284059c Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/create-object.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/create-table.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/create-table.png new file mode 100644 index 000000000..11ae879d0 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/create-table.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/data-history.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/data-history.png new file mode 100644 index 000000000..4baf1b0d3 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/data-history.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/data-loading.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/data-loading.png new file mode 100644 index 000000000..3cac67129 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/data-loading.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/data-tab.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/data-tab.png new file mode 100644 index 000000000..795651c7c Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/data-tab.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/details.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/details.png new file mode 100644 index 000000000..8f7045cd3 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/details.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/insert-data.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/insert-data.png new file mode 100644 index 000000000..74afbc28b Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/insert-data.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/new-data-tab.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/new-data-tab.png new file mode 100644 index 000000000..e5ef70703 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/new-data-tab.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/new-launchpad.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/new-launchpad.png new file mode 100644 index 000000000..09830c51e Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/new-launchpad.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/new-table-created.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/new-table-created.png new file mode 100644 index 000000000..64142a874 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/new-table-created.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/new-table.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/new-table.png new file mode 100644 index 000000000..a131ddcbe Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/new-table.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/notification.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/notification.png new file mode 100644 index 000000000..862c6f343 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/notification.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/open-button.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/open-button.png new file mode 100644 index 000000000..1f73e4f76 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/open-button.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/open-history.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/open-history.png new file mode 100644 index 000000000..202d5b590 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/open-history.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/open-object.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/open-object.png new file mode 100644 index 000000000..1d59ac626 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/open-object.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/open-table.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/open-table.png new file mode 100644 index 000000000..a04d07cad Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/open-table.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/output.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/output.png new file mode 100644 index 000000000..9c78c83eb Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/output.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/primary-key.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/primary-key.png new file mode 100644 index 000000000..74feda429 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/primary-key.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/run-script.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/run-script.png new file mode 100644 index 000000000..5799efaa6 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/run-script.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/selector-icon.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/selector-icon.png new file mode 100644 index 000000000..e07d5af0f Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/selector-icon.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/sql-card.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/sql-card.png new file mode 100644 index 000000000..51a75540a Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/sql-card.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/sql-page.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/sql-page.png new file mode 100644 index 000000000..83566ca38 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/sql-page.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/table-list.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/table-list.png new file mode 100644 index 000000000..64259443b Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/table-list.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/table-properties.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/table-properties.png new file mode 100644 index 000000000..1d59ac626 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/table-properties.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/target-tab.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/target-tab.png new file mode 100644 index 000000000..e8f29b405 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/target-tab.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/upload-data.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/upload-data.png new file mode 100644 index 000000000..ab1cab6a0 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/upload-data.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/upload-file.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/upload-file.png new file mode 100644 index 000000000..3cac67129 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/upload-file.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/uploaded.png b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/uploaded.png new file mode 100644 index 000000000..3d984f2b6 Binary files /dev/null and b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/images/uploaded.png differ diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/manage-tables.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/manage-tables.md new file mode 100644 index 000000000..997f51ea4 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/manage-tables/manage-tables.md @@ -0,0 +1,188 @@ +# Manage Tables + +## Introduction + +In this lab, you will use Database Actions to view table definitions and table data in Oracle Database. You will also learn to create a new table and load data into the new table. + +Estimated time: 20 minutes + +### Objective + +Perform these tasks in your Oracle Database from Oracle Database Actions: + +- View an existing table +- Create a new table +- Load data into the table + +### Prerequisites + +This lab assumes you have- + +- An Oracle Cloud account +- Completed all previous labs successfully +- ORDS installed and configured +- *HR* schema enabled to access Database Actions +- Logged in to Oracle Database Actions in a web browser as *HR* + +## Task 1: View existing table in your schema + +In this task, you will view the existing tables in the HR schema in your Autonomous Database using Oracle Database Actions. + +1. Log in to Database Actions as *HR* if you are not logged in. + +2. Click the **SQL** card under Development. This opens the SQL page in Database Action. + ![SQL Card](../manage-tables/images/new-launchpad.png) + + Alternatively, click the **Selector Icon** ![Selector Icon](../manage-tables/images/selector-icon.png) and under Development section click **SQL**. The SQL page appears. ![SQL Page](../manage-tables/images/sql-page.png) + + > **Note:** If this is your first time accessing the SQL Worksheet, click the binocular icon at the top-right to access hopscotch tour. Click the "**X**" in the tour window to quit the tour. + +3. In the Navigator tab, verify schema selected is *HR* from the first drop-down list and *Tables* from the second drop-down list. + ![Table List](../manage-tables/images/table-list.png) + The navigator pane displays the list of tables of the selected schema HR. + +4. Right-click one of the tables, for this task, *COUNTRIES* and select **OPEN**. + ![Tables](../manage-tables/images/open-table.png) + + This option opens a window that displays the properties of the selected table. The properties window displays information for the following properties of the table: + + - Columns + - Data + - Constraints + - Grants + - Statistics + - Triggers + - Dependencies + - Details + - Partitions + - Indexes + +5. Look at the Columns tab from the properties window to view the column names and their definitions. + ![Columns Tab](../manage-tables/images/columns-tab.png) + The values may differ depending on the system you are using. + +6. Select the **Data** tab from the properties window to view the data stored in COUNTRIES. + ![Data Tab](../manage-tables/images/data-tab.png) + The values may differ depending on the system you are using. + +Click **Close** at the bottom-right to close the properties dialog box. + +## Task 2: Create a new table + +You can create a new table and insert data in your Oracle Database using the SQL card in the Database Actions. The GUI enables you to create, insert and update data in few clicks. + +1. In the Navigator tab, click the three dots next to the search field and select **Create Object** from the submenu. + ![Create Object](../manage-tables/images/create-object.png) + This opens a dialog box. + ![Open dialog box](../manage-tables/images/open-object.png) + +2. Enter the name of the table in the *Name* field. Click on the **Add Column** icon to add a new column. + ![Create New table](../manage-tables/images/new-table.png) + + - Name - *Account* + - Column 1 - *id* + - Column 2 - *account_no* + - Column 3 - *customer_id* + - Column 4 - *open_date* + - Column 5 - *balance* + + Also add the corresponding datatype from the dropdown for all the columns. + +3. Click the **Constraints** tab. Tick the checkbox in front of the *id* column. + ![Constraints tab](../manage-tables/images/constraints-tab.png) + +4. Click the Primary Key tab, enter Name as ACCOUNT_PK. Move the id column to the Selected Columns. + ![Peimary Key](../manage-tables/images/primary-key.png) + Keep the other details as it is. + +5. Click **Create**. Next, click **Apply**. + ![Create table](../manage-tables/images/create-table.png) + +6. Refresh the page. You can see the new table in the Navigator tab. + ![Create table](../manage-tables/images/new-table-created.png) + +7. To insert data in the new table, right-click on the ACCOUNT table. Click **Open**. + ![Open Button](../manage-tables/images/open-button.png) + +8. Click the **Data** tab. Click **Insert**. + ![Tab for New Data](../manage-tables/images/new-data-tab.png) + +9. Insert data as follows: + + - ID: *201* + - ACCOUNT_NO: *xxx-yyy-201* + - CUSTOMER_ID: *101* + - OPEN_DATE: *2023-11-25* + - BALANCE: *1500* + ![Insert Data](../manage-tables/images/insert-data.png) + +10. Click **Commit**. + ![Commit Button](../manage-tables/images/commit-button.png) + +11. You will get the below notification on your screen. + ![New Notification](../manage-tables/images/notification.png) + +12. Run the select statement and check the Query Result. + ![Output Data](../manage-tables/images/output.png) + +## Task 3: Load data from a file to an existing table + +You can load data from a file to an existing table named *ACCOUNT*. + +1. In the Navigator tab, right-click the ACCOUNT table. + +2. Click **Data Loading** and select **Upload Data**. + ![Upload Data](../manage-tables/images/upload-data.png) + An Upload Data into HR.ACCOUNT dialog box appears. + +3. Drag and drop the file that contains data, which you want to load into the table. You can also click **Add File** to browse for the file in your system and upload it.  + ![Add Files](../manage-tables/images/add-files.png) + + > **Note:** The file formats that you can load are CSV, XLS, XLSX, TSV, TXT, XML, JSON, and AVRO.  + +4. Verify the file name after adding the file in the Upload Data Into HR.ACCOUNT dialog box. + ![Data Loaidng](../manage-tables/images/data-loading.png) + + > **Note**: This lab provides a CSV file with dummy data to upload into your database for learning purpose. + +5.  Click the file name to open the Details page. + - **Column names:** Select **Get from file** to display column headers in the first row. + - **Encoding:** You can view the *UTF-8* value from the drop-down. This is the default value.  + - **Text enclosure** and **Field delimiter**: Enter " (single quote) in the Text enclosure field and ","(comma) in the Field delimiter field. These options are visible only when the selected file is in plain text format (CSV, TSV, or TXT). + - **Rows to skip:** Select the number of rows to skip. For example, *0*. + - **Preview size:** Select the number of rows to preview. For example, *100*. + - **Limit rows to upload:** This check box is to specify the number of rows to load. For this task, do not select this check box. + ![Details of the file](../manage-tables/images/details.png) + +6. Click **Next** to progress to the Target tab of the dialog box. For each Source column, select the value from the drop-down in the Target column. + For this task, select the following values from Target column. + - COL1: Select *ID* + - COL2: Select *ACCOUNT_NO* + - COL3: Select *CUSTOMER_ID* + - COL4: Select *OPEN_DATE* + - COL5: Select *BALANCE* + ![Target Tab](../manage-tables/images/target-tab.png) + The values differ depending on the file you have uploaded. + +7. Click **Upload File** to load the selected data. It will direct you back to the Upload Data Into HR.ACCOUNT dialog box. + ![Upload File](../manage-tables/images/upload-file.png) + +8. When the status changes from PENDING to UPLOADED the data file has been uploaded successfully. + ![File Uploaded](../manage-tables/images/uploaded.png) + After the data upload process is complete, an entry is added to the log with the status. + +9. To view the log status, click the **Open History** button present in the bottom-left corner of the dialog box. + ![Open History](../manage-tables/images/open-history.png) + The subsequent table is displayed. + ![Data History](../manage-tables/images/data-history.png) + The values may differ depending on the system you are using. + +You can also view the summary of the data uploaded from the SQL main window. Right-click the ACCOUNT table in the Navigator tab, click **Data Loading** and select **History** to view the summary of the data upload. You can view the total number of rows that fail if the data file fails to upload. + +You may now **proceed to the next lab**. + +## Acknowledgments + +- **Author** - Aayushi Arora, Database User Assistance Development Team +- **Contributors** - Jeff Smith, Manish Garodia, Manisha Mati +- **Last Updated By/Date** - Aayushi Arora, October 2024 \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/prepare-setup/prepare-setup.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/prepare-setup/prepare-setup.md new file mode 100644 index 000000000..30e97ad03 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/prepare-setup/prepare-setup.md @@ -0,0 +1,62 @@ +# Prepare setup + +## Introduction + +This lab will show you how to download the Oracle Resource Manager (ORM) stack zip file needed to setup the resource needed to run this workshop. This workshop requires a compute instance running a marketplace image and a Virtual Cloud Network (VCN). + +Estimated time: 10 minutes + +### Objectives + + - Download ORM stack + - Configure an existing Virtual Cloud Network (VCN) + +### Prerequisites + +This lab assumes you have - + - An Oracle Cloud account + +## Task 1: Download Oracle Resource Manager (ORM) stack zip file + +1. Click on the link below to download the Resource Manager zip file you need to build your environment: + + - [db21c-dbae-mkplc-freetier.zip](https://objectstorage.us-ashburn-1.oraclecloud.com/p/ZdyeiKou7tdfayF1zF1NmPtpUGFTvKjSY5SC46H8NBNlPAxtOWmZJUDsWoeFHQJF/n/natdsecurity/b/stack/o/db21c-dbae-mkplc-freetier.zip) + +1. Save in your downloads folder. + +We recommend using this stack to create a self-contained/dedicated VCN with your instance(s). Skip to [Task 3](?lab=prepare-setup#Task3:Setupcompute) to follow our recommendations. If you would rather use an existing VCN, then proceed to the next task as indicated below to update your existing VCN with the required Egress rules. + +## Task 2: Add security rules to an existing VCN + +This workshop requires a certain number of ports to be available, a requirement that can be met by using the default ORM stack execution that creates a dedicated VCN. In order to use an existing VCN, the following ports should be added to Egress rules. + +| Port | Description | +| :------------- | :------------------------------------ | +| 22 | SSH | +| 6080 | noVNC Remote Desktop | +{: title="Add ports to VCN"} + +1. Go to **Networking** > **Virtual Cloud Networks**. +1. Choose your network. +1. Under **Resources**, select **Security Lists**. +1. Click on **Default Security Lists** under the **Create Security List** button. +1. Click the **Add Ingress Rule** button. +1. Enter the following: + - Source CIDR: 0.0.0.0/0 + - Destination Port Range: *Refer to the table* +1. Click the **Add Ingress Rules** button. + +## Task 3: Setup compute + +Using the details from the previous two tasks, proceed to the lab **Setup compute instance** to setup your workshop environment using Oracle Resource Manager (ORM) and one of the following options: + + - Create Stack: **Compute + Networking** + - Create Stack: **Compute only** with an existing VCN where security lists have been updated as per *Task 2* of this lab + +You may now **proceed to the next lab**. + +## Acknowledgments + + - **Author** - Rene Fontcha, LiveLabs Platform Lead, NA Technology + - **Contributors** - Manish Garodia + - **Last Updated By/Date** - Rene Fontcha, LiveLabs Platform Lead, NA Technology, April 2022 \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/desktop/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/desktop/index.html new file mode 100644 index 000000000..79e335f5e --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/desktop/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/desktop/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/desktop/manifest.json new file mode 100644 index 000000000..36b943dff --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/desktop/manifest.json @@ -0,0 +1,43 @@ +{ + "workshoptitle": "Manage schema objects in Oracle Database 23ai using Database Actions", + "help": "livelabs-help-db_us@oracle.com", + "tutorials": [ + { + "title": "Introduction", + "description": "Introduction.", + "filename": "./../../intro-schema-objects/intro-schema-objects.md", + "type": "em-dba" + }, + { + "title": "Using noVNC Remote Desktop", + "description": "Using noVNC Remote Desktop", + "filename": "https://oracle-livelabs.github.io/common/labs/remote-desktop/using-novnc-remote-desktop.md" + }, + { + "title": "Lab 1: Initialize Environment", + "description": "How to initialize and start all the workshop components.", + "publisheddate": "12/21/2021", + "filename": "./../../initialize-environment/initialize-environment.md" + }, + { + "title": "Lab 2: Manage Tables", + "description": "How to manage tables in Oracle Database 23ai using Database Actions.", + "filename": "./../../manage-tables/manage-tables.md" + }, + { + "title": "Lab 3: Create Indexes and Views", + "description": "How to create indexes and views in Oracle Database 23ai using Database Actions.", + "filename": "./../../create-indexes-and-views/create-indexes-and-views.md" + }, + { + "title": "Lab 4: Manage Program code stored in Oracle Database", + "description": "How to manage program code stored in Oracle Database 23ai using Database Actions.", + "filename": "./../../manage-program-code/manage-program-code.md" + }, + { + "title": "Need Help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-livelabs.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/sandbox/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/sandbox/index.html new file mode 100644 index 000000000..79e335f5e --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/sandbox/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/sandbox/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/sandbox/manifest.json new file mode 100644 index 000000000..c5fdf3bd4 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/sandbox/manifest.json @@ -0,0 +1,42 @@ +{ + "workshoptitle": "Manage schema objects in Oracle Database 23ai using Database Actions", + "help": "livelabs-help-db_us@oracle.com", + "tutorials": [ + { + "title": "Introduction", + "description": "Introduction.", + "filename": "./../../intro-schema-objects/intro-schema-objects.md" + }, + { + "title": "Lab 1: Environment Setup", + "description": "Verify Setup of compute instance", + "filename": "https://oracle-livelabs.github.io/common/labs/verify-compute/verify-compute-ssh-and-novnc.md" + }, + { + "title": "Lab 2: Initialize Environment", + "description": "How to initialize and start all the workshop components.", + "publisheddate": "12/21/2021", + "filename": "./../../initialize-environment/initialize-environment.md" + }, + { + "title": "Lab 3: Manage Tables", + "description": "How to manage tables in Oracle Database 23ai using Database Actions.", + "filename": "./../../manage-tables/manage-tables.md" + }, + { + "title": "Lab 4: Create Indexes and Views", + "description": "How to create indexes and views in Oracle Database 23ai using Database Actions.", + "filename": "./../../create-indexes-and-views/create-indexes-and-views.md" + }, + { + "title": "Lab 5: Manage Program code stored in Oracle Database", + "description": "How to manage program code stored in Oracle Database 23ai using Database Actions.", + "filename": "./../../manage-program-code/manage-program-code.md" + }, + { + "title": "Need Help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-livelabs.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/tenancy/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/tenancy/index.html new file mode 100644 index 000000000..79e335f5e --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/tenancy/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/tenancy/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/tenancy/manifest.json new file mode 100644 index 000000000..2f873125a --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws7-manage-schema-objects/workshops/tenancy/manifest.json @@ -0,0 +1,55 @@ +{ + "workshoptitle": "Manage schema objects in Oracle Database 23ai using Database Actions", + "help": "livelabs-help-db_us@oracle.com", + "tutorials": [ + { + "title": "Introduction", + "description": "Introduction.", + "filename": "./../../intro-schema-objects/intro-schema-objects.md", + "type": "em-dba" + }, + { + "title": "Get Started", + "description": "Get a Free Trial", + "filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/cloud-login.md" + }, + { + "title": "Lab 1: Prepare Setup", + "description": "How to download your ORM stack and update security rules for an existing VCN.", + "publisheddate": "12/21/2021", + "filename": "./../../prepare-setup/prepare-setup.md" + }, + { + "title": "Lab 2: Setup Compute Instance", + "description": "How to provision the workshop environment and connect to it", + "publisheddate": "08/31/2021", + "filename": "https://oracle-livelabs.github.io/common/labs/setup-compute-generic/setup-compute-novnc-ssh.md" + }, + { + "title": "Lab 3: Initialize Environment", + "description": "How to initialize and start all the workshop components.", + "publisheddate": "10/13/2021", + "filename": "./../../initialize-environment/initialize-environment.md" + }, + { + "title": "Lab 4: Manage Tables", + "description": "How to manage tables in Oracle Database 23ai using Database Actions.", + "filename": "./../../manage-tables/manage-tables.md" + }, + { + "title": "Lab 5: Create Indexes and Views", + "description": "How to create indexes and views in Oracle Database 23ai using Database Actions.", + "filename": "./../../create-indexes-and-views/create-indexes-and-views.md" + }, + { + "title": "Lab 6: Manage Program code stored in Oracle Database", + "description": "How to manage program code stored in Oracle Database 23ai using Database Actions.", + "filename": "./../../manage-program-code/manage-program-code.md" + }, + { + "title": "Need Help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-freetier.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/configure-backup-settings/configure-backup-settings.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/configure-backup-settings/configure-backup-settings.md new file mode 100644 index 000000000..330ec7b87 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/configure-backup-settings/configure-backup-settings.md @@ -0,0 +1,233 @@ +# Configure backup settings + +## Introduction + +This lab shows you how to configure the Oracle Database for several backup-related settings and policies. + +Estimated Time: 20 minutes + +### Objectives + +- View backup settings +- Configure backup device settings +- Configure retention policy settings +- Configure control file and server parameter file automatic backups +- Enable block change tracking + +### Prerequisites + +This lab assumes you have: +- An Oracle Cloud account +- Completed all previous labs successfully + + +## Task 1: View backup settings + +1. Start the RMAN prompt. + + ``` + $ ./rman + ``` + + Output: + ``` + Recovery Manager: Release 23.0.0.0.0 - Production on Thu Oct 3 13:32:25 2024 + Version 23.4.0.24.05 + + Copyright (c) 1982, 2024, Oracle and/or its affiliates. All rights reserved. + ``` + +2. Connect to the target Oracle Database. + + ``` + RMAN> connect target; + ``` + + Output: + ``` + connected to target database: CDB1 (DBID=1701812036) + ``` + +3. Use the following command to view the RMAN configuration settings, including backup settings. + + ``` + RMAN> show all; + ``` + + Output: + ``` + using target database control file instead of recovery catalog + RMAN configuration parameters for database with db_unique_name CDB1 are: + CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default + CONFIGURE BACKUP OPTIMIZATION OFF; # default + CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default + CONFIGURE CONTROLFILE AUTOBACKUP ON; # default + CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO '%F'; # default + CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default + CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default + CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default + CONFIGURE MAXSETSIZE TO UNLIMITED; # default + CONFIGURE ENCRYPTION FOR DATABASE OFF; # default + CONFIGURE ENCRYPTION ALGORITHM 'AES256'; # default + CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default + CONFIGURE RMAN OUTPUT TO KEEP FOR 7 DAYS; # default + CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default + CONFIGURE SNAPSHOT CONTROLFILE NAME TO '/opt/oracle/product/23.4.0/dbhome_1/dbs/snapcf_cdb1.f'; # default + ``` + + +## Task 2: Configure backup optimization settings + +Configure backup optimization to save space in the fast recovery area. Optimization excludes unchanged files, such as read-only files and offline data files, that were previously backed up. + +1. Switch on backup optimization. + + ``` + RMAN> configure backup optimization on; + ``` + + Output: + ``` + new RMAN configuration parameters: + CONFIGURE BACKUP OPTIMIZATION ON; + new RMAN configuration parameters are successfully stored + ``` + +2. Verify if the backup optimization parameter setting has been updated. + + ``` + RMAN> show backup optimization; + ``` + + Output: + ``` + RMAN configuration parameters for database with db_unique_name CDB1 are: + CONFIGURE BACKUP OPTIMIZATION ON; + ``` + +## Task 3: Configure retention policy settings + +Configure the retention policy to specify how long the backups and archived redo logs must be retained for media recovery. + +1. Set the recovery window in the retention policy. The recovery window specifies the number of days the backups and archived redo logs must be retained. For this lab, it is set to `31 days`. + + ``` + RMAN> configure retention policy to recovery window of 31 days; + ``` + + Output: + ``` + new RMAN configuration parameters: + CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 31 DAYS; + new RMAN configuration parameters are successfully stored + ``` + +2. Verify if the recovery window setting has been updated. + + ``` + RMAN> show retention policy; + ``` + + Output: + ``` + RMAN configuration parameters for database with db_unique_name CDB1 are: + CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 31 DAYS; + ``` + +## Task 4: Configure control file and server parameter file automatic backups + +You can configure RMAN to automatically back up the control file and server parameter file with every backup. This is referred to as autobackup. The control and server parameter files are critical to the Oracle Database and RMAN. Creating automatic backups of the control file enables RMAN to recover the Oracle Database even if the current control file and server parameter file are lost. The control and server parameter files are relatively small compared to typical data files, and, therefore, backing them up frequently results in relatively little storage overhead. + +If the Oracle Database runs in `ARCHIVELOG` mode, an automatic backup is also taken whenever the Oracle Database structure metadata in the control file changes. + +1. Switch on autobackup to set automatic backups of the control file and server parameter file. + + ``` + RMAN> configure controlfile autobackup on; + ``` + + Output: + ``` + new RMAN configuration parameters: + CONFIGURE CONTROLFILE AUTOBACKUP ON; + new RMAN configuration parameters are successfully stored + ``` + +2. Verify if the autobackup setting has been updated. + + ``` + RMAN> show controlfile autobackup; + ``` + + Output: + ``` + RMAN configuration parameters for database with db_unique_name CDB1 are: + CONFIGURE CONTROLFILE AUTOBACKUP ON; + ``` + +3. Exit the RMAN prompt. + + ``` + RMAN> exit; + ``` + +## Task 5: Enable block change tracking + +Block change tracking improves the performance of incremental backups by recording changed blocks in the block change tracking file. During an incremental backup, instead of scanning all data blocks to identify which blocks have changed, RMAN uses this file to identify the changed blocks that need to be backed up. + +You can enable block change tracking when the Oracle Database is either open or mounted. This section assumes that you intend to create the block change tracking file as an Oracle-managed file in the database area, where the Oracle Database maintains active database files such as data files, control files, and online redo log files. + +1. Start the SQL\*Plus prompt. + + ``` + $ ./sqlplus / as sysdba + ``` + +2. Set the location of the block change tracking file in the `db_create_file_dest` parameter. The `db_create_file_dest` specifies the default location for Oracle-managed files. For this lab, it is set to `/opt/oracle/oradata/CDB1`. + + ``` + SQL> alter system set db_create_file_dest = '/opt/oracle/oradata/CDB1'; + ``` + + Output: + ``` + System altered. + ``` + +3. Enable block change tracking. + + ``` + SQL> alter database enable block change tracking; + ``` + + Output: + ``` + Database altered. + ``` + +4. Query `v$block_change_tracking` to verify that block change tracking is enabled and to view the name of the block change tracking file. In the following output, you can see that block change tracking is `ENABLED`. + + ``` + SQL> select status, filename from v$block_change_tracking; + ``` + + Output: + ``` + STATUS FILENAME + -------- ----------------------------------------------------------------- + ENABLED /opt/oracle/oradata/CDB1/CDB1/changetracking/o1_mf_mhx7ftyw_.chg + ``` + +5. Exit the SQL\*Plus prompt. + + ``` + SQL> exit; + ``` + +You may now **proceed to the next lab**. + + +## Acknowledgements +- **Author**: Suresh Mohan, Database User Assistance Development Team +- **Contributors**: Suresh Rajan, Manish Garodia, Subhash Chandra, Ramya P +- **Last Updated By & Date**: Suresh Mohan, October 2024 \ No newline at end of file diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/configure-recovery-settings/configure-recovery-settings.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/configure-recovery-settings/configure-recovery-settings.md new file mode 100644 index 000000000..2d57a671f --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/configure-recovery-settings/configure-recovery-settings.md @@ -0,0 +1,316 @@ +# Configure recovery settings + +## Introduction +This lab shows you how to configure the Oracle Database for several recovery settings. + +Estimated Time: 20 minutes + +### Objectives +- Configure the Fast Recovery Area +- Enable archiving of redo log files +- Enable Flashback Database + +### Prerequisites +This lab assumes you have: +- An Oracle Cloud account +- Completed all previous labs successfully + + +## Task 1: Configure the fast recovery area +The fast recovery area is an Oracle-managed directory on a file system or disk group on Oracle Automatic Storage Management (Oracle ASM) that provides a centralized storage location for backup and recovery files. Oracle creates archived logs and flashback logs in the fast recovery area. Oracle automatically manages the fast recovery area, deleting files that are no longer needed. + +RMAN can store its backup sets and image copies in the fast recovery area and use them when restoring files during media recovery. If the fast recovery area is configured, RMAN automatically backs up to the fast recovery area when you issue the RMAN `backup` command without specifying a backup destination. + +1. Start the SQL\*Plus prompt and connect as the `sysdba` user. + ``` + $ ./sqlplus / as sysdba + ``` + +2. View the settings for all initialization parameters containing "recovery" in the name. + ``` + SQL> show parameter recovery; + ``` + Output: + ``` + NAME TYPE VALUE + -------------------------------- -------------- ----------- + db_recovery_auto_rekey string ON + db_recovery_file_dest string + db_recovery_file_dest_size big integer 0 + recovery_parallelism integer 0 + remote_recovery_file_dest string + transaction_recovery string ENABLED + ``` + + >**Note:** The `db_recovery_file_dest` parameter sets the location of the fast recovery area. Oracle recommends placing the fast recovery area on a separate storage device from the Oracle Database files. The `db_recovery_file_dest_size` parameter shows the size of your fast recovery area. The size of your fast recovery area may differ from what is shown in this example. Generally, the default size present for the fast recovery area might not be sufficient for your files. + +3. Set the fast recovery area size to a larger size to store the Oracle Database files sufficiently. For this lab, it is set to `50GB`. + ``` + SQL> alter system set db_recovery_file_dest_size=50G; + ``` + + Output: + ``` + System altered. + ``` + +4. Set the recovery file destination location in the `db_recovery_file_dest` parameter. For this lab, it is set to `/opt/oracle/recovery_area`. + ``` + SQL> alter system set db_recovery_file_dest="/opt/oracle/recovery_area"; + ``` + + Output: + ``` + System altered. + ``` + +5. View the altered settings again to confirm the changes. You can see that the `db_recovery_file_dest_size` and `db_recovery_file_dest parameters` are set. + ``` + SQL> show parameter recovery; + ``` + + Output: + ``` + NAME TYPE VALUE + -------------------------------- -------------- ----------- + db_recovery_auto_rekey string ON + db_recovery_file_dest string /opt/oracle/recovery_area + db_recovery_file_dest_size big integer 50G + recovery_parallelism integer 0 + remote_recovery_file_dest string + transaction_recovery string ENABLED + ``` + + + +## Task 2: Enable archiving of redo log files +You must enable the archiving of redo log files to back up the Oracle Database while it is open or perform complete or point-in-time media recovery. To do so, you start the Oracle Database in `ARCHIVELOG` mode. + +1. Determine whether your Oracle Database is in `ARCHIVELOG` mode. In the following output, you can see that the database log mode is in `No Archive Mode`. + ``` + SQL> archive log list; + ``` + Output: + ``` + Database log mode No Archive Mode + Automatic archival Disabled + Archive destination USE_DB_RECOVERY_FILE_DEST + Oldest online log sequence 304 + Current log sequence 303 + ``` + +2. Exit the SQL\*Plus prompt. + ``` + SQL> exit; + ``` + +3. Start the RMAN prompt. + ``` + $ ./rman + ``` + Output: + ``` + Recovery Manager: Release 23.0.0.0.0 - Production on Thu Oct 3 13:25:05 2024 + Version 23.4.0.24.05 + + Copyright (c) 1982, 2024, Oracle and/or its affiliates. All rights reserved. + ``` + +4. Connect to the target Oracle Database. + ``` + RMAN> connect target; + ``` + Output: + ``` + connected to target database: CDB1 (DBID=1701812036) + ``` + +5. Shut down the Oracle Database instance. + ``` + RMAN> shutdown immediate; + ``` + Output: + ``` + using target database control file instead of recovery catalog + database closed + database dismounted + Oracle instance shut down + ``` + +6. Start and mount the Oracle Database instance. To enable archiving, you must mount the Oracle Database but not open it. + ``` + RMAN> startup mount; + ``` + Output: + ``` + connected to target database (not started) + Oracle instance started + database mounted + + Total System Global Area 10013446704 bytes + + Fixed Size 5370416 bytes + Variable Size 2181038080 bytes + Database Buffers 7818182656 bytes + Redo Buffers 8855552 bytes + ``` + +7. Create a backup of the Oracle Database before you enable the `ARCHIVELOG` mode. Oracle recommends that you always back up the Oracle Database before making any significant changes to it. + ``` + RMAN> backup database; + ``` + Output: + ``` + Starting backup at 03-OCT-24 + allocated channel: ORA_DISK_1 + channel ORA_DISK_1: SID=144 device type=DISK + channel ORA_DISK_1: starting full datafile backup set + channel ORA_DISK_1: specifying datafile(s) in backup set + input datafile file number=00003 name=/opt/oracle/oradata/CDB1/sysaux01.dbf + input datafile file number=00001 name=/opt/oracle/oradata/CDB1/system01.dbf + input datafile file number=00011 name=/opt/oracle/oradata/CDB1/undotbs01.dbf + input datafile file number=00007 name=/opt/oracle/oradata/CDB1/users01.dbf + channel ORA_DISK_1: starting piece 1 at 03-OCT-24 + channel ORA_DISK_1: finished piece 1 at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132656_mhx6x38g_.bkp tag=TAG20241003T132656 comment=NONE + channel ORA_DISK_1: backup set complete, elapsed time: 00:01:16 + channel ORA_DISK_1: starting full datafile backup set + channel ORA_DISK_1: specifying datafile(s) in backup set + input datafile file number=00013 name=/opt/oracle/oradata/CDB1/PDB1/sysaux01.dbf + input datafile file number=00012 name=/opt/oracle/oradata/CDB1/PDB1/system01.dbf + input datafile file number=00014 name=/opt/oracle/oradata/CDB1/PDB1/undotbs01.dbf + input datafile file number=00016 name=/opt/oracle/product/23.4.0/dbhome_1/dbs/octs.dbf + input datafile file number=00015 name=/opt/oracle/oradata/CDB1/PDB1/users01.dbf + channel ORA_DISK_1: starting piece 1 at 03-OCT-24 + channel ORA_DISK_1: finished piece 1 at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/1CF500B83D440585E0634B0E4664AA19/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132656_mhx6zh2f_.bkp tag=TAG20241003T132656 comment=NONE + channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25 + channel ORA_DISK_1: starting full datafile backup set + channel ORA_DISK_1: specifying datafile(s) in backup set + input datafile file number=00004 name=/opt/oracle/oradata/CDB1/pdbseed/sysaux01.dbf + input datafile file number=00002 name=/opt/oracle/oradata/CDB1/pdbseed/system01.dbf + input datafile file number=00009 name=/opt/oracle/oradata/CDB1/pdbseed/undotbs01.dbf + channel ORA_DISK_1: starting piece 1 at 03-OCT-24 + channel ORA_DISK_1: finished piece 1 at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/16DBED12D9B6BD08E0631FC45E640B06/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132656_mhx7088w_.bkp tag=TAG20241003T132656 comment=NONE + channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 + Finished backup at 03-OCT-24 + + Starting Control File and SPFILE Autobackup at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/autobackup/2024_10_03/o1_mf_s_1181395543_mhx70hmj_.bkp comment=NONE + Finished Control File and SPFILE Autobackup at 03-OCT-24 + ``` + +8. Enable the `ARCHIVELOG` mode. + ``` + RMAN> alter database archivelog; + ``` + Output: + ``` + Statement processed + ``` + +9. Open the Oracle Database. + ``` + RMAN> alter database open; + ``` + Output: + ``` + Statement processed + ``` + +10. Back up the Oracle Database. As the Oracle Database is now in `ARCHIVELOG` mode, you can back up the Oracle Database while it is open. + ``` + RMAN> backup database plus archivelog; + ``` + Output: + ``` + Starting backup at 03-OCT-24 + current log archived + using channel ORA_DISK_1 + channel ORA_DISK_1: starting archived log backup set + channel ORA_DISK_1: specifying archived log(s) in backup set + input archived log thread=1 sequence=304 RECID=1 STAMP=1181395789 + channel ORA_DISK_1: starting piece 1 at 03-OCT-24 + channel ORA_DISK_1: finished piece 1 at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_annnn_TAG20241003T132949_mhx72fr0_.bkp tag=TAG20241003T132949 comment=NONE + channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 + Finished backup at 03-OCT-24 + + Starting backup at 03-OCT-24 + using channel ORA_DISK_1 + channel ORA_DISK_1: starting full datafile backup set + channel ORA_DISK_1: specifying datafile(s) in backup set + input datafile file number=00003 name=/opt/oracle/oradata/CDB1/sysaux01.dbf + input datafile file number=00001 name=/opt/oracle/oradata/CDB1/system01.dbf + input datafile file number=00011 name=/opt/oracle/oradata/CDB1/undotbs01.dbf + input datafile file number=00007 name=/opt/oracle/oradata/CDB1/users01.dbf + channel ORA_DISK_1: starting piece 1 at 03-OCT-24 + channel ORA_DISK_1: finished piece 1 at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132951_mhx72jpg_.bkp tag=TAG20241003T132951 comment=NONE + channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45 + channel ORA_DISK_1: starting full datafile backup set + channel ORA_DISK_1: specifying datafile(s) in backup set + input datafile file number=00013 name=/opt/oracle/oradata/CDB1/PDB1/sysaux01.dbf + input datafile file number=00012 name=/opt/oracle/oradata/CDB1/PDB1/system01.dbf + input datafile file number=00014 name=/opt/oracle/oradata/CDB1/PDB1/undotbs01.dbf + input datafile file number=00016 name=/opt/oracle/product/23.4.0/dbhome_1/dbs/octs.dbf + input datafile file number=00015 name=/opt/oracle/oradata/CDB1/PDB1/users01.dbf + channel ORA_DISK_1: starting piece 1 at 03-OCT-24 + channel ORA_DISK_1: finished piece 1 at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/1CF500B83D440585E0634B0E4664AA19/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132951_mhx73xwo_.bkp tag=TAG20241003T132951 comment=NONE + channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25 + channel ORA_DISK_1: starting full datafile backup set + channel ORA_DISK_1: specifying datafile(s) in backup set + input datafile file number=00004 name=/opt/oracle/oradata/CDB1/pdbseed/sysaux01.dbf + input datafile file number=00002 name=/opt/oracle/oradata/CDB1/pdbseed/system01.dbf + input datafile file number=00009 name=/opt/oracle/oradata/CDB1/pdbseed/undotbs01.dbf + channel ORA_DISK_1: starting piece 1 at 03-OCT-24 + channel ORA_DISK_1: finished piece 1 at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/16DBED12D9B6BD08E0631FC45E640B06/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132951_mhx74q4h_.bkp tag=TAG20241003T132951 comment=NONE + channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07 + Finished backup at 03-OCT-24 + + Starting backup at 03-OCT-24 + current log archived + using channel ORA_DISK_1 + channel ORA_DISK_1: starting archived log backup set + channel ORA_DISK_1: specifying archived log(s) in backup set + input archived log thread=1 sequence=305 RECID=2 STAMP=1181395870 + channel ORA_DISK_1: starting piece 1 at 03-OCT-24 + channel ORA_DISK_1: finished piece 1 at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_annnn_TAG20241003T133110_mhx74yky_.bkp tag=TAG20241003T133110 comment=NONE + channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 + Finished backup at 03-OCT-24 + + Starting Control File and SPFILE Autobackup at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/autobackup/2024_10_03/o1_mf_s_1181395871_mhx74zx1_.bkp comment=NONE + Finished Control File and SPFILE Autobackup at 03-OCT-24 + ``` + + +## Task 3: Enable flashback database +You can revert the whole Oracle Database to a prior point in time using the following methods: either revert the whole Oracle Database to a prior point in time by restoring a backup and performing a point-in-time recovery, or enable flashback database. When you enable flashback database, the Oracle Database generates flashback logs in the fast recovery area. These logs are used to flashback the Oracle Database to a specified time. The Oracle Database automatically creates, deletes, and resizes flashback logs. + +1. Enable flashback database for the whole Oracle Database. + ``` + RMAN> alter database flashback on; + ``` + Output: + ``` + Statement processed + ``` + +2. Exit the RMAN prompt. + + ``` + RMAN> exit; + ``` + +You may now **proceed to the next lab**. + + +## Acknowledgements +- **Author**: Suresh Mohan, Database User Assistance Development Team +- **Contributors**: Suresh Rajan, Manish Garodia, Subhash Chandra, Ramya P +- **Last Updated By & Date**: Suresh Mohan, October 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/initialize-environment/initialize-environment.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/initialize-environment/initialize-environment.md new file mode 100644 index 000000000..ab566316b --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/initialize-environment/initialize-environment.md @@ -0,0 +1,112 @@ +# Initialize environment + +## Introduction +In this lab, we will review and startup all components required to run this workshop successfully. + +Estimated Time: 5 minutes + +### Objectives +- Set up the components required for performing this workshop + +### Prerequisites +This lab assumes you have: +- An Oracle Cloud account +- Completed all previous labs successfully + + +## Task 1: Set the environment +You must first set the environment to connect to the Oracle Database and run SQL commands. + +1. Log in to your host as `oracle`, the user who can perform database administration. + +2. Open a terminal window and change the current working directory to `$ORACLE_HOME/bin`. + ``` + $ cd /opt/oracle/product/23.4.0/dbhome_1/bin + ``` + +3. Run the command `oraenv` to set the environment variables. + ``` + $ . oraenv + ``` + +4. Enter the Oracle SID. For this lab, it is set to `CDB1`. + ``` + ORACLE_SID = [oracle] ? CDB1 + + The Oracle base has been set to /opt/oracle + ``` + This command also sets the Oracle home path to `/opt/oracle/product/23.4.0/dbhome_1`. + + >**Note:** Oracle SID is case sensitive. + +You have set the environment variables for the active terminal session. You can now connect to Oracle Database and run the commands. + +>**Note:** Every time you open a new terminal window, you need to set the environment variables to connect to Oracle Database from that terminal. Environment variables from one terminal do not apply automatically to other terminals.  + +Alternatively, you may run the script file `.set-env-db.sh` from the home location and enter the number for `ORACLE_SID`, for example, `3` for `CDB1`. It sets the environment variables automatically. + +## Task 2: Download and execute the SQL script file + +In this task, you download and execute the SQL script file using the following steps. + +1. Download and save the [backup-and-recovery-operations-prerequisities.zip](https://c4u04.objectstorage.us-ashburn-1.oci.customer-oci.com/p/EcTjWk2IuZPZeNnD_fYMcgUhdNDIDA6rt9gaFj_WZMiL7VvxPBNMY60837hu5hga/n/c4u04/b/livelabsfiles/o/labfiles/backup-and-recovery-operations-prerequisities.zip) file in `/opt/oracle/product/23.4.0/dbhome_1/bin` location. + +2. Extract the contents from the zip file using the following command. + ``` + $ unzip backup-and-recovery-operations-prerequisities.zip + ``` + +3. The `backup-and-recovery-operations-prerequisities.sql` script file contains the following code: + ``` + alter session set container = ; + CREATE user appuser IDENTIFIED BY container=current; + grant all privileges to appuser; + connect appuser/@//: + create tablespace oc datafile 'octs.dbf' size 32m; + create table regions (id number(2), name varchar2(20)) tablespace oc; + insert into regions values (1,'America'); + insert into regions values (2,'Europe'); + insert into regions values (3,'Asia'); + commit; + ! + mkdir /opt/oracle/oradata/CDB1 + exit; + ``` + +4. Open the `backup-and-recovery-operations-prerequisities.sql` script file, update the following details, and save. + * pdbname - Provide the name of the PDB you want to connect to. For this lab, it is set to pdb1. + * password - Provide your password. + * hostname - Provide the host name of the machine where the database is installed. + * port - Provide the port name. Usually port number is 1521. + +5. Start the SQL\*Plus prompt and connect as the `sysdba` user. + ``` + $ ./sqlplus / as sysdba + ``` + Output: + ``` + SQL*Plus: Release 23.0.0.0.0 - Production on Thu Oct 3 13:07:20 2024 + Version 23.4.0.24.05 + + Copyright (c) 1982, 2024, Oracle. All rights reserved. + + Connected to: + Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - Production + Version 23.4.0.24.05 + ``` + +6. Run the SQL script file. + ``` + SQL> START backup-and-recovery-operations-prerequisities.sql + ``` + +7. Exit the SQL\*Plus prompt. + + +You may now **proceed to the next lab**. + + +## Acknowledgements +- **Author**: Suresh Mohan, Database User Assistance Development Team +- **Contributors**: Suresh Rajan, Manish Garodia, Subhash Chandra, Ramya P +- **Last Updated By & Date**: Suresh Mohan, October 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/intro-backup-recovery/intro-backup-recovery.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/intro-backup-recovery/intro-backup-recovery.md new file mode 100644 index 000000000..461366d11 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/intro-backup-recovery/intro-backup-recovery.md @@ -0,0 +1,45 @@ +# Introduction + +## About this workshop +This workshop introduces you to Oracle Database backup and recovery with the Recovery Manager (RMAN). After completing this workshop, you will be familiar with the basic concepts of Oracle Database backup and recovery operations, know how to implement a disk-based backup strategy, and recover database. + +Estimated Workshop Time: 2 hours + +### Objectives +In this workshop, you will learn to perform the following Oracle Database activities: +- Configure recovery settings +- Configure backup settings +- Perform and schedule backups +- Manage backups +- Restore database +- Rewind a table using the Flashback Table +- Recover a dropped table using Flashback Drop + +### Prerequisites +This lab assumes you have: +- An Oracle Cloud account +- Installed Oracle Database + + +## Appendix 1: Overview of Oracle database backup and recovery +Oracle Database backup and recovery operations focus on the physical backup of database files, which permits you to reconstruct your Oracle Database in case of a failure or corruption. + +Oracle recommends Recovery Manager (RMAN), a command-line tool, to back up and recover your Oracle Database efficiently. The RMAN backup and recovery feature protects data files, control files, server parameter files, and archived redo log files. With these files, you can reconstruct your Oracle Database. RMAN communicates with the server to detect block-level corruption during backup and restore. RMAN optimizes performance and space consumption during backup with file multiplexing and backup set compression and integrates with leading storage devices. The backup mechanisms work at the physical level to protect against file damage, such as the accidental deletion of a data file or the failure of a storage device. RMAN can also be used to perform point-in-time recovery to recover from logical failures when other techniques, such as flashback, cannot be used. + +The Oracle Flashback feature provides a range of physical and logical data recovery tools as efficient, easy-to-use alternatives to physical and logical backups. The Oracle Flashback features enable you to reverse the effects of unwanted database changes without restoring data files from backup. + + +Click on the next lab to **Get Started**. + + +## Learn More + +[Oracle Database Documentation](https://docs.oracle.com/en/database/oracle/oracle-database/index.html) + +[Oracle Cloud Infrastructure Documentation](https://docs.oracle.com/en-us/iaas/Content/Identity/Concepts/overview.htm) + + +## Acknowledgements +- **Author**: Suresh Mohan, Database User Assistance Development Team +- **Contributors**: Suresh Rajan, Manish Garodia, Subhash Chandra, Ramya P +- **Last Updated By & Date**: Suresh Mohan, October 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/manage-backups/manage-backups.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/manage-backups/manage-backups.md new file mode 100644 index 000000000..ad0940ed3 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/manage-backups/manage-backups.md @@ -0,0 +1,214 @@ +# Manage backups + +## Introduction +This lab shows you how to manage backups after you create them. + +Estimated time: 20 minutes + +### About managing backups +An essential part of a backup and recovery strategy is managing backups after they are created. Backup management includes performing periodic checks to ensure that backups are available and usable, as well as deleting obsolete backups. In a multi-tenant environment, you can manage backups for the whole multi-tenant container database (CDB) or one or more pluggable databases (PDBs). + + +### Objectives +- Display backup information +- Cross-check backups +- Delete expired backups +- Monitor fast recovery area space usage + +### Prerequisites +This lab assumes you have: +- An Oracle Cloud account +- Completed all previous labs successfully + + +## Task 1: Display backup information +Backup reports contain summary and detailed information about past backup jobs run by RMAN. The `v$rman_backup_job_details` view includes information on backup jobs run by RMAN, such as the time taken for the backup, start and finish times, type of backup performed, and backup job status. + +1. Start the RMAN prompt. + ``` + $ ./rman + ``` + Output: + ``` + Recovery Manager: Release 23.0.0.0.0 - Production on Thu Oct 3 13:41:23 2024 + Version 23.4.0.24.05 + + Copyright (c) 1982, 2024, Oracle and/or its affiliates. All rights reserved. + ``` + +2. Use the following command to connect to the target Oracle Database. + ``` + RMAN> connect target; + ``` + Output: + ``` + connected to target database: CDB1 (DBID=1701812036) + ``` + +3. Query the `v$rman_backup_job_details` view to display backup job history. You can see the status, start time, and end time of all the backups performed in the output. + ``` + RMAN> select session_key, input_type, status, start_time, end_time, elapsed_seconds/3600 hrs from v$rman_backup_job_details; + ``` + Output: + ``` + SESSION_KEY INPUT_TYPE STATUS START_TIM END_TIME HRS + ----------- ------------- ----------------------- --------- --------- ---------- + 2 DB FULL COMPLETED 03-OCT-24 03-OCT-24 .071666666 + 10 DB FULL COMPLETED 03-OCT-24 03-OCT-24 .010833333 + ``` + + >**Note:** `SESSION_KEY` is the unique key for the RMAN session in which the backup job occurred.   + + +## Task 2: Cross-check backups +Cross-checking a backup synchronizes the physical reality of backups with their logical records in the RMAN repository. For example, if a backup was deleted with an operating system command, a cross-check would detect this condition. After the cross-check, the RMAN repository correctly reflects the state of the backups. + +Backups are listed as available if they are still present in the storage listed in the RMAN repository and if there is no corruption in the file header. Backups that are missing or corrupt are listed as expired. + +1. View a list of all backup sets to determine which backup you want to cross-check. + ``` + RMAN> list backup summary; + ``` + Output: + ``` + using target database control file instead of recovery catalog + + List of Backups + =============== + Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag + ------- -- -- - ----------- --------------- ------- ------- ---------- --- + 1 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132656 + 2 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132656 + 3 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132656 + 4 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132847 + 5 B A A DISK 03-OCT-24 1 1 NO TAG20241003T132949 + 6 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132951 + 7 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132951 + 8 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132951 + 9 B A A DISK 03-OCT-24 1 1 NO TAG20241003T133110 + 10 B F A DISK 03-OCT-24 1 1 NO TAG20241003T133111 + 11 B A A DISK 03-OCT-24 1 1 NO TAG20241003T133716 + 12 B F A DISK 03-OCT-24 1 1 NO TAG20241003T133717 + 13 B A A DISK 03-OCT-24 1 1 NO TAG20241003T133753 + 14 B F A DISK 03-OCT-24 1 1 NO TAG20241003T133754 + ``` + +2. Cross-check all backup sets. + ``` + RMAN> crosscheck backup; + ``` + Output: + ``` + allocated channel: ORA_DISK_1 + channel ORA_DISK_1: SID=148 device type=DISK + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132656_mhx6x38g_.bkp RECID=1 STAMP=1181395619 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/1CF500B83D440585E0634B0E4664AA19/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132656_mhx6zh2f_.bkp RECID=2 STAMP=1181395695 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/16DBED12D9B6BD08E0631FC45E640B06/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132656_mhx7088w_.bkp RECID=3 STAMP=1181395720 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/autobackup/2024_10_03/o1_mf_s_1181395543_mhx70hmj_.bkp RECID=4 STAMP=1181395727 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_annnn_TAG20241003T132949_mhx72fr0_.bkp RECID=5 STAMP=1181395789 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132951_mhx72jpg_.bkp RECID=6 STAMP=1181395792 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/1CF500B83D440585E0634B0E4664AA19/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132951_mhx73xwo_.bkp RECID=7 STAMP=1181395837 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/16DBED12D9B6BD08E0631FC45E640B06/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132951_mhx74q4h_.bkp RECID=8 STAMP=1181395863 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_annnn_TAG20241003T133110_mhx74yky_.bkp RECID=9 STAMP=1181395870 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/autobackup/2024_10_03/o1_mf_s_1181395871_mhx74zx1_.bkp RECID=10 STAMP=1181395871 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_annnn_TAG20241003T133716_mhx7jdbw_.bkp RECID=11 STAMP=1181396236 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T133717_mhx7jg87_.bkp RECID=12 STAMP=1181396238 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_annnn_TAG20241003T133753_mhx7kkoz_.bkp RECID=13 STAMP=1181396273 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/autobackup/2024_10_03/o1_mf_s_1181396274_mhx7km17_.bkp RECID=14 STAMP=1181396275 + Crosschecked 14 objects + ``` + +3. Cross-check a specified backup set. You can identify the backup you want to cross-check from the output of the `LIST` command. For this lab, it is `1`. + + ``` + RMAN> crosscheck backupset 1; + ``` + Output: + ``` + using channel ORA_DISK_1 + crosschecked backup piece: found to be 'AVAILABLE' + backup piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132656_mhx6x38g_.bkp RECID=1 STAMP=1181395619 + Crosschecked 1 objects + ``` + + +## Task 3: Delete expired backups +The delete expired backup command will remove the expired backups from the RMAN repository. Those backups that are inaccessible during a cross-check are called expired backups. This command updates only the RMAN repository. It will not attempt to delete the backup files from the storage. + +1. Delete expired backups from the RMAN repository. + + ``` + RMAN> delete expired backup; + ``` + Output: + ``` + using channel ORA_DISK_1 + specification does not match any backup in the repository + ``` + + +## Task 4: Monitor fast recovery area space usage +You should monitor the fast recovery area to ensure that it is large enough to contain backups and other recovery-related files. The space usage in your Oracle Database may vary from what is shown in this lab. + +Oracle Database provides two views to monitor fast recovery area space usage: `v$recovery_file_dest` and `v$recovery_area_usage`. + +In this task, you monitor the space usage of fast recovery area using the following steps. + +1. Query the `v$recovery_file_dest` view to obtain the following information about the fast recovery area: total number of files, current location, disk quota, space in use, and space reclaimable by deleting files. The space details are in bytes. + ``` + RMAN> select * from v$recovery_file_dest; + ``` + Output: + ``` + NAME SPACE_LIMIT SPACE_USED SPACE_RECLAIMABLE NUMBER_OF_FILES CON_ID + ------------------------- ----------- ---------- ----------------- --------------- ------ + /opt/oracle/recovery_area 53687091200 1224258150 40629248 20 0 + ``` + +2. Query the `v$recovery_area_usage` view to obtain additional information about the fast recovery area. It contains the percentage of disk quota used by different types of files and the percentage of space that can be reclaimed by deleting files that are obsolete, redundant, or backed up to tape. + ``` + RMAN> select file_type, percent_space_used PCT_USED, percent_space_reclaimable PCT_RECLAIM, number_of_files NO_FILES from v$recovery_area_usage; + ``` + Output: + ``` + FILE_TYPE PCT_USED PCT_RECLAIM NO_FILES + ----------------------- ---------- ----------- ---------- + CONTROL FILE 0 0 0 + REDO LOG 0 0 0 + ARCHIVED LOG .08 .08 4 + BACKUP PIECE 21.95 0 14 + IMAGE COPY 0 0 0 + FLASHBACK LOG .78 0 2 + FOREIGN ARCHIVED LOG 0 0 0 + AUXILIARY DATAFILE COPY 0 0 0 + + 8 rows selected + ``` + +3. Exit the RMAN prompt. + ``` + RMAN> exit; + ``` + +You may now **proceed to the next lab**. + + +## Acknowledgements +- **Author**: Suresh Mohan, Database User Assistance Development Team +- **Contributors**: Suresh Rajan, Manish Garodia, Subhash Chandra, Ramya P +- **Last Updated By & Date**: Suresh Mohan, October 2024 + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/perform-backups/perform-backups.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/perform-backups/perform-backups.md new file mode 100644 index 000000000..21b0bfc19 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/perform-backups/perform-backups.md @@ -0,0 +1,233 @@ +# Perform backups + +## Introduction +This lab shows you how to perform a whole backup of your Oracle Database and then perform a complete recovery with the files from a whole backup using RMAN. A whole backup includes the control file, server parameter file, all data files, and archived redo log files. + +Estimated Time: 20 minutes + +### Objectives +- Perform a whole Oracle Database backup +- Display backup information stored in the RMAN repository +- Validate backups + +### Prerequisites +This lab assumes you have: +- An Oracle Cloud account +- Completed all previous labs successfully + + +## Task 1: Perform a whole Oracle database backup + +1. Start the RMAN prompt. + ``` + $ ./rman + ``` + Output: + ``` + Recovery Manager: Release 23.0.0.0.0 - Production on Thu Oct 3 13:37:01 2024 + Version 23.4.0.24.05 + + Copyright (c) 1982, 2024, Oracle and/or its affiliates. All rights reserved. + ``` + +2. Connect to the target Oracle Database. + ``` + RMAN> connect target; + ``` + Output: + ``` + connected to target database: CDB1 (DBID=1701812036) + ``` + +3. Back up the Oracle Database files, including the archive redo log files. + ``` + RMAN> backup database plus archivelog; + ``` + Output: + ``` + Starting backup at 03-OCT-24 + current log archived + using target database control file instead of recovery catalog + allocated channel: ORA_DISK_1 + channel ORA_DISK_1: SID=280 device type=DISK + skipping archived logs of thread 1 from sequence 304 to 305; already backed up + channel ORA_DISK_1: starting archived log backup set + channel ORA_DISK_1: specifying archived log(s) in backup set + input archived log thread=1 sequence=306 RECID=3 STAMP=1181396235 + channel ORA_DISK_1: starting piece 1 at 03-OCT-24 + channel ORA_DISK_1: finished piece 1 at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_annnn_TAG20241003T133716_mhx7jdbw_.bkp tag=TAG20241003T133716 comment=NONE + channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 + Finished backup at 03-OCT-24 + + Starting backup at 03-OCT-24 + using channel ORA_DISK_1 + skipping datafile 2; already backed up 2 time(s) + skipping datafile 4; already backed up 2 time(s) + skipping datafile 9; already backed up 2 time(s) + skipping datafile 12; already backed up 2 time(s) + skipping datafile 13; already backed up 2 time(s) + skipping datafile 14; already backed up 2 time(s) + skipping datafile 15; already backed up 2 time(s) + skipping datafile 16; already backed up 2 time(s) + channel ORA_DISK_1: starting full datafile backup set + channel ORA_DISK_1: specifying datafile(s) in backup set + input datafile file number=00003 name=/opt/oracle/oradata/CDB1/sysaux01.dbf + input datafile file number=00001 name=/opt/oracle/oradata/CDB1/system01.dbf + input datafile file number=00011 name=/opt/oracle/oradata/CDB1/undotbs01.dbf + input datafile file number=00007 name=/opt/oracle/oradata/CDB1/users01.dbf + channel ORA_DISK_1: starting piece 1 at 03-OCT-24 + channel ORA_DISK_1: finished piece 1 at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T133717_mhx7jg87_.bkp tag=TAG20241003T133717 comment=NONE + channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35 + Finished backup at 03-OCT-24 + + Starting backup at 03-OCT-24 + current log archived + using channel ORA_DISK_1 + channel ORA_DISK_1: starting archived log backup set + channel ORA_DISK_1: specifying archived log(s) in backup set + input archived log thread=1 sequence=307 RECID=4 STAMP=1181396273 + channel ORA_DISK_1: starting piece 1 at 03-OCT-24 + channel ORA_DISK_1: finished piece 1 at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_annnn_TAG20241003T133753_mhx7kkoz_.bkp tag=TAG20241003T133753 comment=NONE + channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 + Finished backup at 03-OCT-24 + + Starting Control File and SPFILE Autobackup at 03-OCT-24 + piece handle=/opt/oracle/recovery_area/CDB1/autobackup/2024_10_03/o1_mf_s_1181396274_mhx7km17_.bkp comment=NONE + Finished Control File and SPFILE Autobackup at 03-OCT-24 + ``` + + +## Task 2: Display backup information stored in the RMAN repository +Use the `LIST` command to view information about backups stored in the RMAN repository. The information includes backups of data files, individual tablespaces, archived redo log files, and control files. You can also use this command to display information about expired and obsolete backups. + +1. View the summary of all the backups, both backup sets and image copies. + ``` + RMAN> list backup summary; + ``` + Output: + ``` + List of Backups + =============== + Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag + ------- -- -- - ----------- --------------- ------- ------- ---------- --- + 1 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132656 + 2 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132656 + 3 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132656 + 4 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132847 + 5 B A A DISK 03-OCT-24 1 1 NO TAG20241003T132949 + 6 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132951 + 7 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132951 + 8 B F A DISK 03-OCT-24 1 1 NO TAG20241003T132951 + 9 B A A DISK 03-OCT-24 1 1 NO TAG20241003T133110 + 10 B F A DISK 03-OCT-24 1 1 NO TAG20241003T133111 + 11 B A A DISK 03-OCT-24 1 1 NO TAG20241003T133716 + 12 B F A DISK 03-OCT-24 1 1 NO TAG20241003T133717 + 13 B A A DISK 03-OCT-24 1 1 NO TAG20241003T133753 + 14 B F A DISK 03-OCT-24 1 1 NO TAG20241003T133754 + ``` + +2. View the summary of a specific backup using the `datafile` parameter. + ``` + RMAN> list backup of datafile 3; + ``` + Output: + ``` + List of Backup Sets + =================== + + + BS Key Type LV Size Device Type Elapsed Time Completion Time + ------- ---- -- ---------- ----------- ------------ --------------- + 1 Full 2.40G DISK 00:01:08 03-OCT-24 + BP Key: 1 Status: AVAILABLE Compressed: NO Tag: TAG20241003T132656 + Piece Name: /opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132656_mhx6x38g_.bkp + List of Datafiles in backup set 1 + File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name + ---- -- ---- ---------- --------- ----------- ------ ---- + 3 Full 21280192 03-OCT-24 NO /opt/oracle/oradata/CDB1/sysaux01.dbf + + BS Key Type LV Size Device Type Elapsed Time Completion Time + ------- ---- -- ---------- ----------- ------------ --------------- + 6 Full 2.40G DISK 00:00:35 03-OCT-24 + BP Key: 6 Status: AVAILABLE Compressed: NO Tag: TAG20241003T132951 + Piece Name: /opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132951_mhx72jpg_.bkp + List of Datafiles in backup set 6 + File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name + ---- -- ---- ---------- --------- ----------- ------ ---- + 3 Full 21281313 03-OCT-24 NO /opt/oracle/oradata/CDB1/sysaux01.dbf + + BS Key Type LV Size Device Type Elapsed Time Completion Time + ------- ---- -- ---------- ----------- ------------ --------------- + 12 Full 2.40G DISK 00:00:31 03-OCT-24 + BP Key: 12 Status: AVAILABLE Compressed: NO Tag: TAG20241003T133717 + Piece Name: /opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T133717_mhx7jg87_.bkp + List of Datafiles in backup set 12 + File LV Type Ckp SCN Ckp Time Abs Fuz SCN Sparse Name + ---- -- ---- ---------- --------- ----------- ------ ---- + 3 Full 21281717 03-OCT-24 NO /opt/oracle/oradata/CDB1/sysaux01.dbf + ``` + + +## Task 3: Validate backups +Validating specific backups checks whether these backups exist and can be restored. It does not check whether the set of available backups meets your recoverability goals. For example, image copies of data files for several tablespaces from your Oracle Database may exist, each of which can be validated. If there are some tablespaces for which no valid backups exist, however, then you cannot restore and recover the Oracle Database. + +1. Validate the backup for a specific data file and determine whether the backup exists.. + ``` + RMAN> validate datafile 3; + ``` + Output: + ``` + Starting validate at 03-OCT-24 + using channel ORA_DISK_1 + channel ORA_DISK_1: starting validation of datafile + channel ORA_DISK_1: specifying datafile(s) for validation + input datafile file number=00003 name=/opt/oracle/oradata/CDB1/sysaux01.dbf + channel ORA_DISK_1: validation complete, elapsed time: 00:00:15 + List of Datafiles + ================= + File Status Marked Corrupt Empty Blocks Blocks Examined High SCN + ---- ------ -------------- ------------ --------------- ---------- + 3 OK 0 28488 221449 21281827 + File Name: /opt/oracle/oradata/CDB1/sysaux01.dbf + Block Type Blocks Failing Blocks Processed + ---------- -------------- ---------------- + Data 0 55782 + Index 0 69123 + Other 0 68047 + + Finished validate at 03-OCT-24 + ``` + +2. Restore the tablespace. The `restore` command will first validate if you can restore the data files for a specified tablespace and then restore the tablespace. The following command restores the `users` tablespace. + ``` + RMAN> restore tablespace users validate; + ``` + Output: + ``` + Starting restore at 03-OCT-24 + using channel ORA_DISK_1 + + channel ORA_DISK_1: starting validation of datafile backup set + channel ORA_DISK_1: reading from backup piece /opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T133717_mhx7jg87_.bkp + channel ORA_DISK_1: piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T133717_mhx7jg87_.bkp tag=TAG20241003T133717 + channel ORA_DISK_1: restored backup piece 1 + channel ORA_DISK_1: validation complete, elapsed time: 00:00:15 + Finished restore at 03-OCT-24 + ``` + +3. Exit the RMAN prompt. + + ``` + RMAN> exit; + ``` + +You may now **proceed to the next lab**. + + +## Acknowledgements +- **Author**: Suresh Mohan, Database User Assistance Development Team +- **Contributors**: Suresh Rajan, Manish Garodia, Subhash Chandra, Ramya P +- **Last Updated By & Date**: Suresh Mohan, October 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/prepare-setup/prepare-setup.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/prepare-setup/prepare-setup.md new file mode 100644 index 000000000..74eb7950c --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/prepare-setup/prepare-setup.md @@ -0,0 +1,62 @@ +# Prepare setup + +## Introduction + +This lab will show you how to download the Oracle Resource Manager (ORM) stack zip file needed to setup the resource needed to run this workshop. This workshop requires a compute instance running a marketplace image and a Virtual Cloud Network (VCN). + +Estimated time: 10 minutes + +### Objectives + + - Download ORM stack + - Configure an existing Virtual Cloud Network (VCN) + +### Prerequisites + +This lab assumes you have - + - An Oracle Cloud account + +## Task 1: Download Oracle Resource Manager (ORM) stack zip file + +1. Click on the link below to download the Resource Manager zip file you need to build your environment: + + - [db21c-dbae-mkplc-freetier.zip](https://objectstorage.us-ashburn-1.oraclecloud.com/p/ZdyeiKou7tdfayF1zF1NmPtpUGFTvKjSY5SC46H8NBNlPAxtOWmZJUDsWoeFHQJF/n/natdsecurity/b/stack/o/db21c-dbae-mkplc-freetier.zip) + +1. Save in your downloads folder. + +We recommend using this stack to create a self-contained/dedicated VCN with your instance(s). Skip to [Task 3](?lab=prepare-setup#Task3:Setupcompute) to follow our recommendations. If you would rather use an existing VCN, then proceed to the next task as indicated below to update your existing VCN with the required Egress rules. + +## Task 2: Add security rules to an existing VCN + +This workshop requires a certain number of ports to be available, a requirement that can be met by using the default ORM stack execution that creates a dedicated VCN. In order to use an existing VCN, the following ports should be added to Egress rules. + +| Port | Description | +| :------------- | :------------------------------------ | +| 22 | SSH | +| 6080 | noVNC Remote Desktop | +{: title="Add ports to VCN"} + +1. Go to **Networking** > **Virtual Cloud Networks**. +1. Choose your network. +1. Under **Resources**, select **Security Lists**. +1. Click on **Default Security Lists** under the **Create Security List** button. +1. Click the **Add Ingress Rule** button. +1. Enter the following: + - Source CIDR: 0.0.0.0/0 + - Destination Port Range: *Refer to the table* +1. Click the **Add Ingress Rules** button. + +## Task 3: Setup compute + +Using the details from the previous two tasks, proceed to the lab **Setup compute instance** to setup your workshop environment using Oracle Resource Manager (ORM) and one of the following options: + + - Create Stack: **Compute + Networking** + - Create Stack: **Compute only** with an existing VCN where security lists have been updated as per *Task 2* of this lab + +You may now **proceed to the next lab**. + +## Acknowledgments + + - **Author** - Rene Fontcha, LiveLabs Platform Lead, NA Technology + - **Contributors** - Manish Garodia + - **Last Updated By/Date** - Rene Fontcha, LiveLabs Platform Lead, NA Technology, April 2022 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/recover-dropped-table-using-flashback-drop/recover-dropped-table-using-flashback-drop.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/recover-dropped-table-using-flashback-drop/recover-dropped-table-using-flashback-drop.md new file mode 100644 index 000000000..206310f57 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/recover-dropped-table-using-flashback-drop/recover-dropped-table-using-flashback-drop.md @@ -0,0 +1,109 @@ +# Recover a dropped table using flashback drop + +## Introduction +This lab shows you how to perform Flashback Drop on a dropped table in an Oracle Database. + +Estimated Time: 10 minutes + +### About flashback drop +Oracle Database's Flashback Drop enables you to reverse the effects of dropping (deleting) a table, restoring the dropped table to the Oracle Database along with dependent objects such as indexes and triggers. This feature stores dropped objects in a recycle bin, from which you can retrieve them until the recycle bin is purged, either explicitly or because space is needed. + +As with Flashback Table, you can use Flashback Drop while the Oracle Database is open. Also, you can perform the flashback without undoing changes to objects not affected by the Flashback Drop operation. Flashback Table is more convenient than forms of media recovery that require taking the Oracle Database offline and restoring files from backup. + +>**Note:** A table must reside in a locally managed tablespace so that you can recover the table using Flashback Drop. Also, you cannot recover tables in the SYSTEM tablespaces with Flashback Drop, regardless of the tablespace type. + +### Objectives +- Drop a table +- Recover the dropped table + +### Prerequisites +This lab assumes you have: +- An Oracle Cloud account +- Completed all previous labs successfully + + +## Task 1: Drop a table +The Oracle Database moves the dropped table to the recycle bin. Such tables can be retrieved using the Flashback Drop feature. + +1. Start the SQL\*Plus prompt and connect as `sysdba` user; + ``` + $ ./sqlplus / as sysdba + ``` + +2. Switch to the PDB container. For this lab, `pdb1` is used. + + ``` + SQL> alter session set container=pdb1; + ``` + Output: + ``` + Session altered. + ``` + +3. Delete the table. + + ``` + SQL> drop table appuser.regions; + ``` + Output: + ``` + Table dropped. + ``` + +4. Query the table. You can see that you got an error because the table was deleted. + + ``` + SQL> select * from appuser.regions; + ``` + Output: + ``` + select * from appuser.regions + ERROR at line 1: + ORA-00942: table or view "APPUSER"."REGIONS" does not exist + Help: https://docs.oracle.com/error-help/db/ora-00942/ + ``` + + +## Task 2: Recover the dropped table + +1. Recover the deleted table. + ``` + SQL> flashback table appuser.regions to before drop; + ``` + Output: + ``` + Flashback complete. + ``` + +2. Query the table to verify that the data has been restored. + ``` + SQL> select * from appuser.regions; + ``` + Output: + ``` + ID NAME + ---------- -------------------- + 1 America + 2 Europe + 3 Asia + ``` + +3. Exit the SQL\*Plus prompt. + + ``` + SQL> exit; + ``` + Output: + ``` + Disconnected from Oracle Database 23ai Enterprise Edition Release 23.0.0.0.0 - Production + Version 23.4.0.24.05 + ``` + +**Congratulations!** You have successfully completed this workshop on **Backup and Recovery Operations for Oracle Database 23ai**. + + +## Acknowledgements +- **Author**: Suresh Mohan, Database User Assistance Development Team +- **Contributors**: Suresh Rajan, Manish Garodia, Subhash Chandra, Ramya P +- **Last Updated By & Date**: Suresh Mohan, October 2024 + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/restore-database/restore-database.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/restore-database/restore-database.md new file mode 100644 index 000000000..69356829b --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/restore-database/restore-database.md @@ -0,0 +1,296 @@ +# Restore Database + +## Introduction +This lab shows you how to restore files and recover from failures. + +Estimated Time: 20 minutes + +### Objectives +- Perform restore and recovery + +### Prerequisites +This lab assumes you have: +- An Oracle Cloud account +- Completed all previous labs successfully + + +## Task 1: Perform Recovery +The recovery process begins when you either suspect or discover a failure. You can discover failures in many ways, including error messages, alerts, trace files, and health checks. + +1. Start the SQL\*Plus prompt and connect as `sysdba` user; + ``` + $ ./sqlplus / as sysdba + ``` + +2. Open the PDB. In this lab, it is `pdb1`. + ``` + SQL> alter pluggable database pdb1 open; + ``` + Output: + ``` + Pluggable database altered. + ``` + +3. Switch to the PDB container. + ``` + SQL> alter session set container = pdb1; + ``` + Output: + ``` + Session altered. + ``` + +4. Query the `appuser.regions` table. + ``` + SQL> select * from appuser.regions; + ``` + Output: + ``` + ID NAME + ---------- -------------------- + 1 America + 2 Europe + 3 Asia + ``` + +5. Query `v$datafile` view to determine the file name of the datafile that belongs to `appuser`. The `appuser.regions` table belonging to `appuser` user is stored in the `octs` tablespace. + ``` + SQL> select name from v$datafile; + ``` + Output: + ``` + NAME + -------------------------------------------------------------------------------- + /opt/oracle/oradata/CDB1/pdb1/system01.dbf + /opt/oracle/oradata/CDB1/pdb1/sysaux01.dbf + /opt/oracle/oradata/CDB1/pdb1/undotbs01.dbf + /opt/oracle/oradata/CDB1/pdb1/users01.dbf + /opt/oracle/product/23.4.0/dbhome_1/dbs/octs.dbf + ``` + +6. Close the PDB. + ``` + SQL> alter pluggable database pdb1 close; + ``` + Output: + ``` + Pluggable database altered. + ``` + +7. Obtain an operating system prompt. + ``` + SQL> host; + ``` + +8. Delete the data file belonging to `appuser``.` + ``` + $ rm /opt/oracle/product/23.4.0/dbhome_1/dbs/octs.dbf + ``` + +9. Return to SQL\*Plus prompt. + ``` + $ exit + + SQL> + ``` + +10. Open the PDB again. You can see that the PDB cannot be opened because of a missing file. Perform the rest of the steps in this task to fix this failure and open the PDB. + ``` + SQL> alter pluggable database pdb1 open; + ``` + Output: + ``` + alter pluggable database pdb1 open + * + ERROR at line 1: + ORA-01157: cannot identify/lock data file 16 - see DBWR trace file + ORA-01110: data file 16: + '/opt/oracle/product/23.4.0/dbhome_1/dbs/octs.dbf' + Help: https://docs.oracle.com/error-help/db/ora-01157/f' + ``` + +11. Exit the SQL\*Plus prompt. + ``` + SQL> exit; + ``` + +12. Start the RMAN prompt. + ``` + $ ./rman + ``` + +13. Connect to the target Oracle Database. + ``` + RMAN> connect target; + ``` + Output: + ``` + connected to target database: CDB1 (DBID=1701812036) + ``` + + +14. Shutdown the database. + ``` + RMAN> shutdown immediate; + ``` + Output: + ``` + shutdown immediate; + using target database control file instead of recovery catalog + database closed + database dismounted + Oracle instance shut down + ``` + +15. Mount the database. + ``` + RMAN> startup mount; + ``` + Output: + ``` + startup mount; + connected to target database (not started) + Oracle instance started + database mounted + + Total System Global Area 10013446704 bytes + + Fixed Size 5370416 bytes + Variable Size 2181038080 bytes + Database Buffers 7818182656 bytes + Redo Buffers 8855552 bytes + ``` + +16. Restore the database. In the following output, you can see that the datafile has been restored. + ``` + RMAN> restore database; + ``` + Output: + ``` + Starting restore at 04-OCT-24 + allocated channel: ORA_DISK_1 + channel ORA_DISK_1: SID=2 device type=DISK + + skipping datafile 2; already restored to file /opt/oracle/oradata/CDB1/pdbseed/system01.dbf + skipping datafile 4; already restored to file /opt/oracle/oradata/CDB1/pdbseed/sysaux01.dbf + skipping datafile 9; already restored to file /opt/oracle/oradata/CDB1/pdbseed/undotbs01.dbf + channel ORA_DISK_1: starting datafile backup set restore + channel ORA_DISK_1: specifying datafile(s) to restore from backup set + channel ORA_DISK_1: restoring datafile 00012 to /opt/oracle/oradata/CDB1/pdb1/system01.dbf + channel ORA_DISK_1: restoring datafile 00013 to /opt/oracle/oradata/CDB1/pdb1/sysaux01.dbf + channel ORA_DISK_1: restoring datafile 00014 to /opt/oracle/oradata/CDB1/pdb1/undotbs01.dbf + channel ORA_DISK_1: restoring datafile 00015 to /opt/oracle/oradata/CDB1/pdb1/users01.dbf + channel ORA_DISK_1: restoring datafile 00016 to /opt/oracle/product/23.4.0/dbhome_1/dbs/octs.dbf + channel ORA_DISK_1: reading from backup piece /opt/oracle/recovery_area/CDB1/1CF500B83D440585E0634B0E4664AA19/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132951_mhx73xwo_.bkp + channel ORA_DISK_1: piece handle=/opt/oracle/recovery_area/CDB1/1CF500B83D440585E0634B0E4664AA19/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T132951_mhx73xwo_.bkp tag=TAG20241003T132951 + channel ORA_DISK_1: restored backup piece 1 + channel ORA_DISK_1: restore complete, elapsed time: 00:00:25 + channel ORA_DISK_1: starting datafile backup set restore + channel ORA_DISK_1: specifying datafile(s) to restore from backup set + channel ORA_DISK_1: restoring datafile 00001 to /opt/oracle/oradata/CDB1/system01.dbf + channel ORA_DISK_1: restoring datafile 00003 to /opt/oracle/oradata/CDB1/sysaux01.dbf + channel ORA_DISK_1: restoring datafile 00007 to /opt/oracle/oradata/CDB1/users01.dbf + channel ORA_DISK_1: restoring datafile 00011 to /opt/oracle/oradata/CDB1/undotbs01.dbf + channel ORA_DISK_1: reading from backup piece /opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T133717_mhx7jg87_.bkp + channel ORA_DISK_1: piece handle=/opt/oracle/recovery_area/CDB1/backupset/2024_10_03/o1_mf_nnndf_TAG20241003T133717_mhx7jg87_.bkp tag=TAG20241003T133717 + channel ORA_DISK_1: restored backup piece 1 + channel ORA_DISK_1: restore complete, elapsed time: 00:00:35 + Finished restore at 04-OCT-24 + ``` + +17. Recover the database. In the following output, you can see the recovery completed successfully. + ``` + RMAN> recover database; + ``` + Output: + ``` + Starting recover at 04-OCT-24 + using channel ORA_DISK_1 + applied offline range to datafile 00012 + offline range RECID=23 STAMP=1181398744 + applied offline range to datafile 00013 + offline range RECID=22 STAMP=1181398744 + applied offline range to datafile 00014 + offline range RECID=21 STAMP=1181398744 + applied offline range to datafile 00015 + offline range RECID=20 STAMP=1181398744 + applied offline range to datafile 00016 + offline range RECID=19 STAMP=1181398744 + + starting media recovery + + archived log for thread 1 with sequence 307 is already on disk as file /opt/oracle/recovery_area/CDB1/archivelog/2024_10_03/o1_mf_1_307_mhx7kk9p_.arc + archived log for thread 1 with sequence 308 is already on disk as file /opt/oracle/recovery_area/CDB1/archivelog/2024_10_03/o1_mf_1_308_mhy4yolg_.arc + archived log for thread 1 with sequence 309 is already on disk as file /opt/oracle/recovery_area/CDB1/archivelog/2024_10_04/o1_mf_1_309_mhyhgjcc_.arc + archived log for thread 1 with sequence 310 is already on disk as file /opt/oracle/recovery_area/CDB1/archivelog/2024_10_04/o1_mf_1_310_mhyxr7fn_.arc + archived log file name=/opt/oracle/recovery_area/CDB1/archivelog/2024_10_03/o1_mf_1_307_mhx7kk9p_.arc thread=1 sequence=307 + archived log file name=/opt/oracle/recovery_area/CDB1/archivelog/2024_10_03/o1_mf_1_308_mhy4yolg_.arc thread=1 sequence=308 + media recovery complete, elapsed time: 00:00:20 + Finished recover at 04-OCT-24 + ``` +18. Open the database. + ``` + RMAN> alter database open; + ``` + Output: + ``` + alter database open; + Statement processed + ``` + +19. Exit the RMAN prompt. + ``` + RMAN> exit; + ``` + +20. Start the SQL\*Plus prompt and connect as `sysdba` user; + ``` + $ ./sqlplus / as sysdba + ``` + +21. Open the PDB. You can see that the PDB can be opened now that the failure is fixed. + ``` + SQL> alter pluggable database pdb1 open; + ``` + Output: + ``` + Pluggable database altered. + ``` + +22. Switch to the PDB container. + ``` + SQL> alter session set container = pdb1; + ``` + Output: + ``` + Session altered. + ``` + +23. Query the `appuser.regions` table. + ``` + SQL> select * from appuser.regions; + ``` + Output: + ``` + ID NAME + ---------- -------------------- + 1 America + 2 Europe + 3 Asia + ``` + +24. Exit the SQL\*Plus prompt. + + ``` + SQL> exit; + ``` + + +You may now **proceed to the next lab**. + + +## Acknowledgements +- **Author**: Suresh Mohan, Database User Assistance Development Team +- **Contributors**: Suresh Rajan, Manish Garodia, Subhash Chandra, Ramya P +- **Last Updated By & Date**: Suresh Mohan, October 2024 + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/rewind-table-using-flashback-table/rewind-table-using-flashback-table.md b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/rewind-table-using-flashback-table/rewind-table-using-flashback-table.md new file mode 100644 index 000000000..3d9e64f7a --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/rewind-table-using-flashback-table/rewind-table-using-flashback-table.md @@ -0,0 +1,146 @@ +# Rewind a table using Flashback Table + +## Introduction +This lab shows you how to perform Flashback Table on a table in an Oracle Database. + +Estimated Time: 10 minutes + +### About Flashback Table +Oracle Database's Flashback Table enables you to rewind one or more tables to their contents at a previous time without affecting other Oracle Database objects. Thus, you can recover from logical data corruptions such as table rows added or deleted accidentally. Unlike point-in-time recovery, the Oracle Database remains available during the flashback operation. + +### Objectives +- Enable row movement on a table +- Simulate user error +- Perform Flashback Table operation + +### Prerequisites +This lab assumes you have: +- An Oracle Cloud account +- Completed all previous labs successfully + + +## Task 1: Enable row movement on a table +Before using Flashback Table, you must ensure that row movement is enabled on the table to be flashed back or returned to a previous state. Row movement indicates that row IDs will change after the flashback occurs. This restriction exists because if an application stores row IDs before the flashback, there is no guarantee that the row IDs will correspond to the same rows after the flashback. + +1. Start the SQL\*Plus prompt and connect as `sysdba` user; + ``` + $ ./sqlplus / as sysdba + ``` + +2. Switch to the PDB container. For this lab, `pdb1` is used. + ``` + SQL> alter session set container = pdb1; + ``` + Output: + ``` + Session altered. + ``` + +3. Enable row movement on the table. For this lab, `appuser.regions` table is used. + + ``` + SQL> alter table appuser.regions enable row movement; + ``` + Output: + ``` + Table altered. + ``` + + +## Task 2: Simulate user error + +1. Query the table. + ``` + SQL> select * from appuser.regions; + ``` + Output: + ``` + ID NAME + ---------- -------------------- + 1 America + 2 Europe + 3 Asia + ``` + +2. Get the current timestamp. You can use this timestamp value to flashback the Oracle Database to this time. + ``` + SQL> select to_char(current_timestamp,'YYYY-MM-DD HH:MI:SS') from dual; + ``` + Output: + ``` + TO_CHAR(CURRENT_TIM + ------------------- + 2024-10-03 02:21:40 + ``` + +3. Simulate an user error. The following command will change the value in the `name` column to 'ORACLE' in all the rows of the table. + ``` + SQL> update appuser.regions set name = 'ORACLE'; + ``` + Output: + ``` + 3 rows updated. + ``` + +4. Commit. + ``` + SQL> commit; + ``` + Output: + ``` + Commit complete. + ``` + +5. Query the table again to verify that the `name` column for all the rows is updated to 'ORACLE'. + + ``` + SQL> select * from appuser.regions; + ``` + Output: + ``` + ID NAME + ---------- -------------------- + 1 ORACLE + 2 ORACLE + 3 ORACLE + ``` + + +## Task 3: Perform Flashback Table operation +In this task, you rewind the table to a point before you performed the update to simulate a user error. + +1. Flashback the table to a time before you performed the update to the table. + ``` + SQL> flashback table appuser.regions to timestamp to_timestamp('2024-10-03 02:21:40','YYYY-MM-DD HH:MI:SS'); + ``` + Output: + ``` + Flashback complete. + ``` + +2. Query the table to verify that the values in the name column have been restored. + ``` + SQL> select * from appuser.regions; + ``` + Output: + ``` + ID NAME + ---------- -------------------- + 1 America + 2 Europe + 3 Asia + ``` + +3. Exit the SQL\*Plus prompt. + + ``` + SQL> exit; + ``` + +You may now **proceed to the next lab**. + + +## Acknowledgements +- **Author**: Suresh Mohan, Database User Assistance Development Team +- **Contributors**: Suresh Rajan, Manish Garodia, Subhash Chandra, Ramya P +- **Last Updated By & Date**: Suresh Mohan, October 2024 diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/desktop/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/desktop/index.html new file mode 100644 index 000000000..6acdb69d1 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/desktop/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/desktop/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/desktop/manifest.json new file mode 100644 index 000000000..e03a23814 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/desktop/manifest.json @@ -0,0 +1,63 @@ +{ + "workshoptitle": "DBA Essentials - Backup and recovery operations for Oracle Database 23ai", + "help": "livelabs-help-db_us@oracle.com", + "tutorials": [ + { + "title": "Introduction", + "description": "Introduction to performing backup and recovery operations in Oracle Database 23ai.", + "filename": "../../intro-backup-recovery/intro-backup-recovery.md" + }, + { + "title": "Use noVNC remote desktop", + "description": "Use noVNC Remote Desktop", + "publisheddate": "03/22/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/remote-desktop/using-novnc-remote-desktop.md" + }, + { + "title": "Lab 1: Initialize environment", + "description": "How to initialize and setup the workshop components.", + "filename": "./../../initialize-environment/initialize-environment.md" + }, + { + "title": "Lab 2: Configure recovery settings", + "description": "How to configure the Oracle Database for several recovery settings.", + "filename": "../../configure-recovery-settings/configure-recovery-settings.md" + }, + { + "title": "Lab 3: Configure backup settings", + "description": "How to configure the database for several backup-related settings and policies.", + "filename": "../../configure-backup-settings/configure-backup-settings.md" + }, + { + "title": "Lab 4: Perform backups", + "description": "How to use RMAN to perfrom backups.", + "filename": "../../perform-backups/perform-backups.md" + }, + { + "title": "Lab 5: Manage backups", + "description": "How to manage backups after you create them.", + "filename": "../../manage-backups/manage-backups.md" + }, + { + "title": "Lab 6: Restore Database", + "description": "How to use RMAN commands to restore database.", + "filename": "../../restore-database/restore-database.md" + }, + { + "title": "Lab 7: Rewind a table using Oracle Flashback Table", + "description": "How to rewind one or more tables to their contents at a previous time without affecting other database objects.", + "filename": "../../rewind-table-using-flashback-table/rewind-table-using-flashback-table.md" + }, + { + "title": "Lab 8: Recover a dropped table using Oracle Flashback Drop", + "description": "How to reverse the effects of dropping (deleting) a table, returning the dropped table to the database along with dependent objects such as indexes and triggers.", + "filename": "../../recover-dropped-table-using-flashback-drop/recover-dropped-table-using-flashback-drop.md" + }, + { + "title": "Need help?", + "description": "Solutions to Common Problems and Directions for Receiving Live Help", + "publisheddate": "05/24/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-livelabs.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/sandbox/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/sandbox/index.html new file mode 100644 index 000000000..6acdb69d1 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/sandbox/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/sandbox/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/sandbox/manifest.json new file mode 100644 index 000000000..b99470fd2 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/sandbox/manifest.json @@ -0,0 +1,63 @@ +{ + "workshoptitle": "DBA Essentials - Backup and recovery operations for Oracle Database 23ai", + "help": "livelabs-help-db_us@oracle.com", + "tutorials": [ + { + "title": "Introduction", + "description": "Introduction to performing backup and recovery operations in Oracle Database 23ai.", + "filename": "../../intro-backup-recovery/intro-backup-recovery.md" + }, + { + "title": "Lab 1: Verify compute instance setup", + "description": "Verify Setup of compute instance", + "publisheddate": "05/06/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/verify-compute/verify-compute-novnc.md" + }, + { + "title": "Lab 2: Initialize environment", + "description": "How to initialize and setup the workshop components.", + "filename": "./../../initialize-environment/initialize-environment.md" + }, + { + "title": "Lab 3: Configure recovery settings", + "description": "How to configure the Oracle Database for several recovery settings.", + "filename": "../../configure-recovery-settings/configure-recovery-settings.md" + }, + { + "title": "Lab 4: Configure backup settings", + "description": "How to configure the database for several backup-related settings and policies.", + "filename": "../../configure-backup-settings/configure-backup-settings.md" + }, + { + "title": "Lab 5: Perform backups", + "description": "How to use RMAN to perfrom backups.", + "filename": "../../perform-backups/perform-backups.md" + }, + { + "title": "Lab 6: Manage backups", + "description": "How to manage backups after you create them.", + "filename": "../../manage-backups/manage-backups.md" + }, + { + "title": "Lab 7: Restore Database", + "description": "How to use RMAN commands to restore database.", + "filename": "../../restore-database/restore-database.md" + }, + { + "title": "Lab 8: Rewind a table using Oracle Flashback Table", + "description": "How to rewind one or more tables to their contents at a previous time without affecting other database objects.", + "filename": "../../rewind-table-using-flashback-table/rewind-table-using-flashback-table.md" + }, + { + "title": "Lab 9: Recover a dropped table using Oracle Flashback Drop", + "description": "How to reverse the effects of dropping (deleting) a table, returning the dropped table to the database along with dependent objects such as indexes and triggers.", + "filename": "../../recover-dropped-table-using-flashback-drop/recover-dropped-table-using-flashback-drop.md" + }, + { + "title": "Need help?", + "description": "Solutions to common problems and directions for receiving live help", + "publisheddate": "05/24/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-livelabs.md" + } + ] +} diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/tenancy/index.html b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/tenancy/index.html new file mode 100644 index 000000000..6acdb69d1 --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/tenancy/index.html @@ -0,0 +1,62 @@ + + + + + + + + + Oracle LiveLabs + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + diff --git a/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/tenancy/manifest.json b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/tenancy/manifest.json new file mode 100644 index 000000000..87ff7435b --- /dev/null +++ b/odb-23ai/dba-essentials-series-23ai/23ai-ws8-backup-recovery/workshops/tenancy/manifest.json @@ -0,0 +1,76 @@ +{ + "workshoptitle": "DBA Essentials - Backup and recovery operations for Oracle Database 23ai", + "help": "livelabs-help-db_us@oracle.com", + "tutorials": [ + { + "title": "Introduction", + "description": "Introduction to performing backup and recovery operations in Oracle Database 23ai.", + "filename": "../../intro-backup-recovery/intro-backup-recovery.md" + }, + { + "title": "Get started", + "description": "Get a Free Trial", + "publisheddate": "03/22/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/cloud-login/cloud-login.md" + }, + { + "title": "Lab 1: Prepare setup", + "description": "How to download your ORM stack and update security rules for an existing VCN.", + "publisheddate": "10/31/2021", + "filename": "./../../prepare-setup/prepare-setup.md", + "type": "default" + }, + { + "title": "Lab 2: Setup compute instance", + "description": "How to provision the workshop environment and connect to it", + "publisheddate": "06/30/2020", + "filename": "https://oracle-livelabs.github.io/common/labs/setup-compute-generic/setup-compute-novnc.md" + }, + { + "title": "Lab 3: Initialize environment", + "description": "How to initialize and setup the workshop components.", + "filename": "./../../initialize-environment/initialize-environment.md" + }, + { + "title": "Lab 4: Configure recovery settings", + "description": "How to configure the Oracle Database for several recovery settings.", + "filename": "../../configure-recovery-settings/configure-recovery-settings.md" + }, + { + "title": "Lab 5: Configure backup settings", + "description": "How to configure the database for several backup-related settings and policies.", + "filename": "../../configure-backup-settings/configure-backup-settings.md" + }, + { + "title": "Lab 6: Perform backups", + "description": "How to use RMAN to perfrom backups.", + "filename": "../../perform-backups/perform-backups.md" + }, + { + "title": "Lab 7: Manage backups", + "description": "How to manage backups after you create them.", + "filename": "../../manage-backups/manage-backups.md" + }, + { + "title": "Lab 8: Restore Database", + "description": "How to use RMAN commands to restore database.", + "filename": "../../restore-database/restore-database.md" + }, + { + "title": "Lab 9: Rewind a table using Oracle Flashback Table", + "description": "How to rewind one or more tables to their contents at a previous time without affecting other database objects.", + "filename": "../../rewind-table-using-flashback-table/rewind-table-using-flashback-table.md" + }, + { + "title": "Lab 10: Recover a dropped table using Oracle Flashback Drop", + "description": "How to reverse the effects of dropping (deleting) a table, returning the dropped table to the database along with dependent objects such as indexes and triggers.", + "filename": "../../recover-dropped-table-using-flashback-drop/recover-dropped-table-using-flashback-drop.md" + }, + { + "title": "Need help?", + "description": "Solutions to common problems and directions for receiving live help", + "publisheddate": "05/24/2024", + "filename": "https://oracle-livelabs.github.io/common/labs/need-help/need-help-freetier.md" + } + ] +}
User
" . $user ."