Skip to content

Commit

Permalink
Update Lab 11385 Database In-Memory Advanced Features (#490)
Browse files Browse the repository at this point in the history
* Updated workshops to match standard naming

Updated workshops to match standard naming

* Fixed files for QA checklist

Updated last lab to remove "proceed" message
Updated email address in manifest files

* Changed descriptions and initial task messages.
There were some cut and paste errors with text from
different labs.

---------

Co-authored-by: Andy Rivenes <[email protected]>
  • Loading branch information
TheInMemoryGuy and AndyRivenes authored Mar 11, 2024
1 parent 6008255 commit b000819
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 67 deletions.
11 changes: 3 additions & 8 deletions in-memory-21c/ado/ado.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ Watch the video below for a walk through of the Automatic Data Optimization lab:

### Objectives

- Learn how to enable In-Memory on the Oracle Database
- Perform various queries on the In-Memory Column Store
- Learn how to enable Automatic Data Optimization with Database In-Memory and how to create policies to manage IM column store objects.

### Prerequisites

Expand All @@ -28,16 +27,12 @@ This lab assumes you have:

**NOTE:** *When doing Copy/Paste using the convenient* **Copy** *function used throughout the guide, you must hit the* **ENTER** *key after pasting. Otherwise the last line will remain in the buffer until you hit* **ENTER!**

### Background
## Task 1: Automatic Data Optimization

In Oracle Database 12.1 Automatic Data Optimization (ADO) was introduced. ADO was part of the Advanced Compression Option and provided a Heat Map feature that could be used in conjunction with policies to manage the compression and data movement based on usage and time. ADO provided an automated way to implement Information Lifecycle Management within Oracle Database. In Oracle Database 12.2 Database In-Memory support was added to ADO. New policies were added to allow enabling and disabling objects for in-memory.

This lab will show you how ADO works with Database In-Memory.

## Task 1: Verify Directory Definitions

In this Lab we will be populating external data from a local directory and we will need to define a database directory to use in our external table definitions to point the database to our external data.

Let's switch to the ado folder and log back in to the PDB:

```
Expand Down Expand Up @@ -1193,4 +1188,4 @@ You may now **proceed to the next lab**.
- **Author** - Andy Rivenes, Product Manager, Database In-Memory
- **Contributors** -
- **Last Updated By/Date** - Andy Rivenes, August 2022
- **Last Updated By/Date** - Andy Rivenes, March 2024
7 changes: 2 additions & 5 deletions in-memory-21c/aim-high/aim-high.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,12 @@ This lab assumes you have:

**NOTE:** *When doing Copy/Paste using the convenient* **Copy** *function used throughout the guide, you must hit the* **ENTER** *key after pasting. Otherwise the last line will remain in the buffer until you hit* **ENTER!**

### Background
## Task 1: AIM Level High

In Oracle Database 18c a feature called Automatic In-Memory (AIM) was added. The goal of AIM is to manage the contents of the IM column store based on usage. AIM initially had two levels, LOW and MEDIUM, that enabled automatic management of IM column store contents once the IM column store became full. In Oracle Database 21c a third level was added that automatically manages all non-system segments without having to first enable the objects for in-memory.

This Lab will explore the new AIM level HIGH and how it works. A new schema will be used, the AIM schema with small, medium and large tables. This will make it easier to show how AIM works as the column store experiences "memory pressure" (i.e. gets full). The LINEORDER table in the SSB schema will be used to help "fill up" the IM column store and then the AIM tables will be used to show how AIM can manage the total number of objects for maximum benefit.


## Task 1: AIM Level High

Reload the environment variables for **CDB1** if you exited the terminal after the previous lab

```
Expand Down Expand Up @@ -1300,4 +1297,4 @@ You may now **proceed to the next lab**.
- **Author** - Andy Rivenes, Product Manager, Database In-Memory
- **Contributors** -
- **Last Updated By/Date** - Andy Rivenes, August 2022
- **Last Updated By/Date** - Andy Rivenes, March 2024
9 changes: 2 additions & 7 deletions in-memory-21c/aim/aim.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,12 @@ This lab assumes you have:

**NOTE:** *When doing Copy/Paste using the convenient* **Copy** *function used throughout the guide, you must hit the* **ENTER** *key after pasting. Otherwise the last line will remain in the buffer until you hit* **ENTER!**

### Background
## Task 1: Verify Directory Definitions

In Oracle Database 18c a feature called Automatic In-Memory (AIM) was added. The goal of AIM is to manage the contents of the IM column store based on usage. AIM initially had two levels, LOW and MEDIUM, that enabled automatic management of IM column store contents once the IM column store became full. In Oracle Database 21c a third level was added that automatically manages all non-system segments without having to first enable the objects for INMEMORY.

This Lab will explore AIM level LOW MEDIUM and they work. A new schema will be used, the AIM schema with small, medium and large tables. This will make it easier to show how AIM works as the column store experiences "memory pressure" (i.e. gets full). The LINEORDER table in the SSB schema will be used to help "fill up" the IM column store and then the AIM tables will be used to show how AIM can manage the total number of objects for maximum benefit.


## Task 1: Verify Directory Definitions

In this Lab we will be populating external data from a local directory and we will need to define a database directory to use in our external table definitions to point the database to our external data.

Let's switch to the aim folder and log back in to the PDB:

```
Expand Down Expand Up @@ -1423,4 +1418,4 @@ You may now **proceed to the next lab**.
- **Author** - Andy Rivenes, Product Manager, Database In-Memory
- **Contributors** -
- **Last Updated By/Date** - Andy Rivenes, August 2022
- **Last Updated By/Date** - Andy Rivenes, March 2024
12 changes: 4 additions & 8 deletions in-memory-21c/ext-tab/exttab.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ Watch the video below for a walk through of the In-Memory External Tables lab:

### Objectives

- Learn how to enable In-Memory on the Oracle Database
- Perform various queries on the In-Memory Column Store
- Learn how to populate external tables with Database In-Memory.
- See how Database In-Memory can optimize the access of external data, and support both external tables, partitioned external tables and hybrid partitioned tables.

### Prerequisites

Expand All @@ -29,16 +29,12 @@ This lab assumes you have:

**NOTE:** *When doing Copy/Paste using the convenient* **Copy** *function used throughout the guide, you must hit the* **ENTER** *key after pasting. Otherwise the last line will remain in the buffer until you hit* **ENTER!**

### Background
## Task 1: In-Memory External Tables

Oracle Database introduced support for populating external tables in the IM column store in Oracle Database Release 18c. Enhancements were made in Oracle Database 21c to support partitioned external tables and hybrid partitioned tables. If you missed what a hybrid partitioned table is, they were introduced in Oracle Database 19c, it is a table that has both internal and external partitions. With external table support Database In-Memory can populate data without first having to load it into Oracle Database. For many customers this is a great benefit because they only need to run analytics on some external data and they don't need that data to reside permanently in Oracle Database. It also allows them to combine analytic queries with other internal database data using all of the tools available with Oracle Database.

In this lab you will see how external tables, partitioned external tables and hybrid partitioned tables work with Database In-Memory.

## Task 1: Verify Directory Definitions

In this Lab we will be populating external data from a local directory and we will need to define a database directory to use in our external table definitions to point the database to our external data.

Let's switch to the ext-tab folder and log back in to the PDB:

```
Expand Down Expand Up @@ -1455,4 +1451,4 @@ You may now **proceed to the next lab**.

- **Author** - Andy Rivenes, Product Manager, Database In-Memory
- **Contributors** -
- **Last Updated By/Date** - Andy Rivenes, August 2022
- **Last Updated By/Date** - Andy Rivenes, March 2024
11 changes: 3 additions & 8 deletions in-memory-21c/hybrid-scans/im-hybrid-scans.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ Watch the video below for a walk through of the In-Memory Spatial lab:

### Objectives

- Learn how to enable In-Memory on the Oracle Database
- Perform various queries on the In-Memory Column Store
- Learn how Database In-Memory can now enable in-memory scans even if not all columns of a table are populated in the IM column store.

### Prerequisites

Expand All @@ -28,18 +27,14 @@ This lab assumes you have:

**NOTE:** *When doing Copy/Paste using the convenient* **Copy** *function used throughout the guide, you must hit the* **ENTER** *key after pasting. Otherwise the last line will remain in the buffer until you hit* **ENTER!**

### Background
## Task 1: In-Memory Hybrid Scans

Oracle Database 21c introduced a new feature called In-Memory Hybrid Scans. Prior to 21c if a table was populated and certain columns were excluded (i.e. not Populated), and those excluded columns were accessed in a query then the whole query ran from the row store. You might be asking why anyone would exclude columns from being populated? The answer is to save space. By excluding columns that are not part of analytic queries, or reporting, it is possible to save a lot of memory in the IM column store, especially if those columns are large (i.e. consume a lot of space).

With the In-Memory Hybrid Scans feature in 21c Oracle Database will run the query in-memory and then go get the projection columns, if they were excluded from being populated, from the row store. You get the best of both worlds and better performance in most cases than if you had to run the query accessing only the row store. The catch is the columns must be projection columns, that is ones that appear in the SELECT list. If the excluded columns appear in the WHERE clause then the query will have to access the row store.

In this lab you will see how In-Memory Hybrid Scans work and how to tell if your queries are using them.

## Task 1: Verify Directory Definitions

In this Lab we will be populating external data from a local directory and we will need to define a database directory to use in our external table definitions to point the database to our external data.

Let's switch to the hybrid-scans folder and log back in to the PDB:

```
Expand Down Expand Up @@ -602,4 +597,4 @@ You may now **proceed to the next lab**.
- **Author** - Andy Rivenes, Product Manager, Database In-Memory
- **Contributors** -
- **Last Updated By/Date** - Andy Rivenes, August 2022
- **Last Updated By/Date** - Andy Rivenes, March 2024
6 changes: 3 additions & 3 deletions in-memory-21c/im-arith/im-arith.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Watch the video below for a walk through of the In-Memory Arithmetic lab:

### Objectives

- Learn how to enable In-Memory Aritmetic
- Learn how to enable In-Memory Arithmetic

### Prerequisites
This lab assumes you have:
Expand Down Expand Up @@ -530,12 +530,12 @@ SQL>
## Conclusion
This lab demonstrated how In-Memory Optimized Arithmetic works. It showed you how to create them and how to determine their benefit.
This lab demonstrated how In-Memory Optimized Arithmetic works. It showed you how to create enable the feature and how to determine it's benefit.
You may now **proceed to the next lab**.
## Acknowledgements
- **Author** - Andy Rivenes, Product Manager, Database In-Memory
- **Contributors** -
- **Last Updated By/Date** - Andy Rivenes, August 2022
- **Last Updated By/Date** - Andy Rivenes, March 2024
16 changes: 7 additions & 9 deletions in-memory-21c/im-parallel/parallel.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,14 @@ This lab assumes you have:

**NOTE:** *When doing Copy/Paste using the convenient* **Copy** *function used throughout the guide, you must hit the* **ENTER** *key after pasting. Otherwise the last line will remain in the buffer until you hit* **ENTER!**

### Background
## Task 1: In-Memory Parallel Execution

Database In-Memory has always supported parallel execution, or parallel query. In fact, parallel query is needed when distributing data in a RAC system across different RAC instances. This is how you can use Database In-Memory to scale out the IM column store. In addition to Parallel Query, a feature called In-Memory Dynamic Scans (IMDS) was introduced in Oracle Database Release 12.2 to enable in-memory scans to be dynamically parallelized at the IMCU level based on the Resource Manager. When there is additional CPU capacity special IMDS scan processors can be used to further improve in-memory scan performance.

Why, you might ask, do I need parallelization if I am using Database In-Memory? Even though Database In-Memory makes queries fast, ultimately an in-memory query is limited by CPU and memory speed since no I/O is occurring. The only way to make the query faster is to use less CPU (i.e. execute fewer instructions) or parallelize (i.e. do more things at once). Other than for RAC scale-out mentioned above, parallel query and IMDS can make queries run faster by doing multiple things at once.

In this lab you will see how these two parallelization features can be used to improve Database In-Memory performance.

## Task 1: Verify Directory Definitions

In this Lab we will be populating external data from a local directory and we will need to define a database directory to use in our external table definitions to point the database to our external data.

Let's switch to the parallel folder and log back in to the PDB:

```
Expand Down Expand Up @@ -732,7 +728,7 @@ SQL>
SQL>
```
Now we see quite a bit more complicated execution plan, but the bottom line is that even with parallel query enabled we still see all of the in-memory optimizations used. Specifically the use of three Bloom filters to optimize the hash joins allowing them to be effectively turned in to scan and filter operations. Except no it can be done in parallel!
Now we see quite a bit more complicated execution plan, but the bottom line is that even with parallel query enabled we still see all of the in-memory optimizations used. Specifically the use of three Bloom filters to optimize the hash joins allowing them to be effectively turned into scan and filter operations. Except now it can be done in parallel!
8. The same applies to In-Memory Aggregation, or Vector Group By. First we will run a serial vector group by query.
Expand Down Expand Up @@ -1241,14 +1237,16 @@ SQL>
SQL>
```
In the statistics section at the bottom you will see two statistics that start with "IM scan (dynamic)". This tells you that IMDS was used. The nice thing with IMDS is that is does not preclude the use of other features, including parallel query.
In the statistics section above you will see two statistics that start with "IM scan (dynamic)". This tells you that IMDS was used. The nice thing with IMDS is that is does not preclude the use of other features, including parallel query.
## Conclusion
This lab demonstrated how Database In-Memory can optimize the access of external data, and support both external and hybrid partitioned tables.
This lab demonstrated how Database In-Memory can use both Parallel Query and In-Memory Dynamic Scans to parallelize access to in-memory data. This can provide a substantial performance increase for in-memory queries by enabling multiple parallel processes to process the in-memory data.
You may now **proceed to the next lab**.
## Acknowledgements
- **Author** - Andy Rivenes, Product Manager, Database In-Memory
- **Contributors** -
- **Last Updated By/Date** - Andy Rivenes, August 2022
- **Last Updated By/Date** - Andy Rivenes, March 2024
11 changes: 3 additions & 8 deletions in-memory-21c/im-spatial/im-spatial.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ Watch the video below for a walk through of the In-Memory Spatial lab:

### Objectives

- Learn how to enable In-Memory on the Oracle Database
- Perform various queries on the In-Memory Column Store
- Learn how to enable In-Memory Spatial and see how it can increase Spatial query performance.

### Prerequisites

Expand All @@ -28,16 +27,12 @@ This lab assumes you have:

**NOTE:** *When doing Copy/Paste using the convenient* **Copy** *function used throughout the guide, you must hit the* **ENTER** *key after pasting. Otherwise the last line will remain in the buffer until you hit* **ENTER!**

### Background
## Task 1: In-Memory Spatial

Oracle Database 21c introduced a new feature called In-Memory Spatial. Database In-Memory now supports a spatial summary column for each spatial column in a table. Spatial summaries are stored in In-Memory formats and filter values can use SIMD vector scans and replace R-Tree Indexes for searches. This means that by using operators such as SDO_FILTER to query a table a spatial index in not required. More information is available in the Spatial Developer's Guide.

In this lab you will see how In-Memory Spatial can be enabled and how to make use of it to further increase Spatial performance.

## Task 1: Verify Directory Definitions

In this Lab we will be populating external data from a local directory and we will need to define a database directory to use in our external table definitions to point the database to our external data.

Let's switch to the spatial folder and log back in to the PDB:

```
Expand Down Expand Up @@ -993,4 +988,4 @@ You may now **proceed to the next lab**.
- **Author** - Andy Rivenes, Product Manager, Database In-Memory
- **Contributors** -
- **Last Updated By/Date** - Andy Rivenes, August 2022
- **Last Updated By/Date** - Andy Rivenes, March 2024
13 changes: 4 additions & 9 deletions in-memory-21c/im-text/full-text-col.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ Watch the video below for a walk through of the In-Memory Full Text Columns lab:

### Objectives

- Learn how to enable In-Memory on the Oracle Database
- Perform various queries on the In-Memory Column Store
- Learn how In-Memory Full Text Columns are set up and how to make use of them.

### Prerequisites

Expand All @@ -29,7 +28,7 @@ This lab assumes you have:

**NOTE:** *When doing Copy/Paste using the convenient* **Copy** *function used throughout the guide, you must hit the* **ENTER** *key after pasting. Otherwise the last line will remain in the buffer until you hit* **ENTER!**

### Background
## Task 1: In-Memory Spatial

Oracle Database 21c introduced a new feature called In-Memory Full Text Columns. Prior to 21c Database In-Memory didn't support predicates for non-scalar documents. In other words, if you were using domain indexes for an Oracle full text index, XML Search Index, or JSON Search Index then we didn't populate those in the IM column store. This limited the speed with which you could search on non-scalar type data. Now in Oracle Database 21c Database In-Memory supports the ability to store, or populate, these types of domain-specific indexes. The In-Memory Full Text feature supports the following data types:

Expand All @@ -43,10 +42,6 @@ This means that for queries that use CONTAINS() and JSON_TEXTCONTAINS(), Databas

In this lab you will see how In-Memory Full Text Columns are setup and how to make use of them.

## Task 1: Verify Directory Definitions

In this Lab we will be populating external data from a local directory and we will need to define a database directory to use in our external table definitions to point the database to our external data.

Let's switch to the text folder and log back in to the PDB:

```
Expand Down Expand Up @@ -791,12 +786,12 @@ SQL>
## Conclusion
This lab demonstrated how Database In-Memory can optimize the access of external data, and support both external and hybrid partitioned tables.
This lab demonstrated how In-Memory Full Text Columns are setup and how to make use of them.
You may now **proceed to the next lab**.
## Acknowledgements
- **Author** - Andy Rivenes, Product Manager, Database In-Memory
- **Contributors** -
- **Last Updated By/Date** - Andy Rivenes, August 2022
- **Last Updated By/Date** - Andy Rivenes, March 2024
2 changes: 1 addition & 1 deletion in-memory-21c/workshops/desktop/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"filename": "../../initialize-environment/initialize-environment.md"
},
{
"title": "Lab 2: Setting up the In-Memory Column Store",
"title": "Lab 2: Set up the In-Memory Column Store",
"description": "Populating and administering the In-Memory column store",
"filename": "../../setup/setup.md"
},
Expand Down
2 changes: 1 addition & 1 deletion in-memory-21c/workshops/tenancy/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"filename": "../../initialize-environment/initialize-environment.md"
},
{
"title": "Lab 4: Setting up the In-Memory Column Store",
"title": "Lab 4: Set up the In-Memory Column Store",
"description": "Populating and administering the In-Memory column store",
"filename": "../../setup/setup.md"
},
Expand Down

0 comments on commit b000819

Please sign in to comment.