Skip to content

Commit

Permalink
Exascale lab (#60)
Browse files Browse the repository at this point in the history
* add exascale clone lab

* exascale clone lab updates

* exascale lab changes

* move exascale lab code into scripts

* exascale lab script changes

* exascale lab script changes

* add set verify off to each exascale clone script

* exascale lab changes

* exascale lab instructions updates

* add exascale lab to ocw-tenancy

* remove unused workshops

* rename ocw workshop folder and update for ocw24

* remove unused introduction files

* introduction lab update

* update help lab

---------

Co-authored-by: Seth-Miller <[email protected]>
  • Loading branch information
Seth-Miller-Oracle and Seth-Miller authored Aug 13, 2024
1 parent 0703fd0 commit 454ed55
Show file tree
Hide file tree
Showing 18 changed files with 223 additions and 272 deletions.
90 changes: 90 additions & 0 deletions exadata-features/exascale_clone/exascale_clone.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# Exascale Database Clones Lab

## Introduction

In this practice, you are introduced to pluggable database clones and snapshots on Exadata Exascale storage.

Estimated Time: 15 minutes

Watch the video below for a quick walk-through of the lab.
[Placeholder]()

### Objectives

In this lab, you will:
* Create a full and snapshot clone of a pluggable databases and see the efficiency of thin clones in Exascale storage

### Prerequisites

This lab assumes:
* Your current working directory includes all of the lab scripts
* You are connected to an Exadata container database **(CDB$ROOT)** with sqlplus as the user **C##SH as SYSDBA**
* This lab will not work if the pluggable databases **(database\_name)\_FULL\_CLONE** or **(database\_name)\_THIN\_CLONE** have already been created – if either PDB exists, run the `lab_exascale_clone_cleanup.sql` script and wait 30 seconds before starting the lab
* This lab requires your sqlplus session to stay connected through all of the steps – if your session is disconnected at any point, run the `lab_exascale_clone_cleanup.sql` script and wait 30 seconds before starting the lab

## Task 1:

1. Execute the SQL script `lab_exascale_clone_01.sql` to show the total space used by the data and temporary files of the source pluggable database.

```text
<copy>
@lab_exascale_clone_01.sql
</copy>
```
2. Execute the SQL script `lab_exascale_clone_02.sql` to create a full-size copy of the source pluggable database.
```text
<copy>
@lab_exascale_clone_02.sql
</copy>
```
3. Execute the SQL script `lab_exascale_clone_03.sql` to show the total space used by the data and temporary files grouped by pluggable database.
```text
<copy>
@lab_exascale_clone_03.sql
</copy>
```
4. Execute the SQL script `lab_exascale_clone_04.sql` to show the increase in space used in the Exascale vault. The first value is the total increased raw space used. The second value is the increased space used after accounting for data redundancy. Since this vault is set up for normal redundancy, the second value shows half of the raw space used, which should closely match the space used by the full clone PDB created in the previous step.
```text
<copy>
@lab_exascale_clone_04.sql
</copy>
```
5. Execute the SQL script `lab_exascale_clone_05.sql` to create a thin clone of the same source pluggable database.
```text
<copy>
@lab_exascale_clone_05.sql
</copy>
```
6. Execute the SQL script `lab_exascale_clone_06.sql` to show the total space used by data and temporary files grouped by pluggable database. The first column shows the total space used as it is represented in the database. The second column shows actual space used as it is represented on Exascale storage, which should give us an idea of the actual space used by the snapshot files of a thin clone.
```text
<copy>
@lab_exascale_clone_06.sql
</copy>
```
7. Execute the SQL script `lab_exascale_clone_07.sql` to show the increase in space used in the Exascale vault. The space used by the thin clone should be significantly smaller than the full clone. The small amount of space that is being used is from two sources:
* When creating thin clones of pluggable databases, each cloned datafile will consume 10% of its original size.
* When creating full or thin clones of pluggable databases, temporary tablespace files are never cloned. If the source pluggable database contains temporary tablespaces, these temp files will be newly created in the clone PDB and will consume space equal to the original file size.
```text
<copy>
@lab_exascale_clone_07.sql
</copy>
```
You may now **proceed to the next lab**.
## Acknowledgements
* **Author** - Seth Miller, Principal Product Manager, Exadata Product Management
* **Contributors** - Natarajan Shankar, Exadata Product Management
* **Last Updated By/Date** - Seth Miller, August 2024
17 changes: 17 additions & 0 deletions exadata-features/files/lab_exascale_clone_01.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SET VERIFY OFF
COLUMN pdb NEW_VALUE pdbvar NOPRINT
TTITLE LEFT 'PDB: ' pdbvar SKIP 2
BREAK ON pdb SKIP PAGE
COLUMN filename FORMAT A25
COMPUTE SUM OF gb ON pdb
SELECT p.name pdb, SUBSTR(v.name, INSTR(v.name, '/', -1)+1) filename, ROUND(gb) gb
FROM (SELECT name, bytes/1024/1024/1024 gb, con_id FROM v$datafile
UNION SELECT name, bytes/1024/1024/1024 gb, con_id FROM v$tempfile) v
JOIN v$pdbs p ON (v.con_id = p.con_id)
WHERE p.name LIKE (SELECT UPPER(name) FROM v$database) || '%'
ORDER BY (CASE pdb
WHEN (SELECT UPPER(name) FROM v$database) || '_PDBA' THEN 1
WHEN (SELECT UPPER(name) FROM v$database) || '_FULL_CLONE' THEN 2
WHEN (SELECT UPPER(name) FROM v$database) || '_THIN_CLONE' THEN 3
END), filename;
TTITLE OFF
12 changes: 12 additions & 0 deletions exadata-features/files/lab_exascale_clone_02.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
SET VERIFY OFF
COLUMN space_used_gb NEW_VALUE hcsu_a NOPRINT
SELECT ROUND(hc_space_used/1073741824) space_used_gb
FROM v$exa_vault
WHERE LOWER(vault_name) = (SELECT LOWER(name) || 'vault' FROM v$database);

COLUMN source_pdb NEW_VALUE source_pdb
COLUMN thick_pdb NEW_VALUE thick_pdb
SELECT LOWER(name) || '_pdba' source_pdb,
LOWER(name) || '_full_clone' thick_pdb
FROM v$database;
CREATE PLUGGABLE DATABASE &thick_pdb FROM &source_pdb;
17 changes: 17 additions & 0 deletions exadata-features/files/lab_exascale_clone_03.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
SET VERIFY OFF
COLUMN pdb NEW_VALUE pdbvar NOPRINT
TTITLE LEFT 'PDB: ' pdbvar SKIP 2
BREAK ON pdb SKIP PAGE
COLUMN filename FORMAT A25
COMPUTE SUM OF gb ON pdb
SELECT p.name pdb, SUBSTR(v.name, INSTR(v.name, '/', -1)+1) filename, ROUND(gb) gb
FROM (SELECT name, bytes/1024/1024/1024 gb, con_id FROM v$datafile
UNION SELECT name, bytes/1024/1024/1024 gb, con_id FROM v$tempfile) v
JOIN v$pdbs p ON (v.con_id = p.con_id)
WHERE p.name LIKE (SELECT UPPER(name) FROM v$database) || '%'
ORDER BY (CASE pdb
WHEN (SELECT UPPER(name) FROM v$database) || '_PDBA' THEN 1
WHEN (SELECT UPPER(name) FROM v$database) || '_FULL_CLONE' THEN 2
WHEN (SELECT UPPER(name) FROM v$database) || '_THIN_CLONE' THEN 3
END), filename;
TTITLE OFF
18 changes: 18 additions & 0 deletions exadata-features/files/lab_exascale_clone_04.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
SET FEEDBACK OFF
SET VERIFY OFF
COLUMN space_used_gb NEW_VALUE hcsu_b NOPRINT
SELECT ROUND(hc_space_used/1073741824) space_used_gb
FROM v$exa_vault
WHERE LOWER(vault_name) = (SELECT LOWER(name) || 'vault' FROM v$database);

SET SERVEROUTPUT ON
BEGIN
IF &hcsu_a = &hcsu_b THEN
DBMS_OUTPUT.PUT_LINE('The Exascale vault has not updated yet. Please wait 10 seconds and run this script again.');
ELSE
DBMS_OUTPUT.PUT_LINE(RPAD('TYPE', 12) || RPAD('SPACE_USED_RAW', 16) || RPAD('SPACE_USED_ACTUAL', 19));
DBMS_OUTPUT.PUT_LINE(RPAD('-', 10, '-') || ' ' || RPAD('-', 14, '-') || ' ' || RPAD('-', 17, '-'));
DBMS_OUTPUT.PUT_LINE(LPAD('FULL CLONE', 12) || LPAD(&hcsu_b - &hcsu_a, 16) || LPAD(ROUND((&hcsu_b - &hcsu_a) / 2), 19));
END IF;
END;
/
7 changes: 7 additions & 0 deletions exadata-features/files/lab_exascale_clone_05.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
SET VERIFY OFF
COLUMN source_pdb NEW_VALUE source_pdb
COLUMN thin_pdb NEW_VALUE thin_pdb
SELECT LOWER(name) || '_pdba' source_pdb,
LOWER(name) || '_thin_clone' thin_pdb
FROM v$database;
CREATE PLUGGABLE DATABASE &thin_pdb FROM &source_pdb SNAPSHOT COPY;
24 changes: 24 additions & 0 deletions exadata-features/files/lab_exascale_clone_06.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
SET VERIFY OFF
COLUMN pdb NEW_VALUE pdbvar NOPRINT
TTITLE LEFT 'PDB: ' pdbvar SKIP 2
BREAK ON pdb SKIP PAGE
COLUMN filename FORMAT A25
COMPUTE SUM OF gb gb_actual ON pdb
SELECT p.name pdb, SUBSTR(v.name, INSTR(v.name, '/', -1)+1) filename, ROUND(gb) gb,
CASE WHEN p.name = (SELECT UPPER(name) FROM v$database) || '_THIN_CLONE'
AND v.filetype = 'DATAFILE'
THEN ROUND(gb * 0.1, 1)
WHEN p.name = (SELECT UPPER(name) FROM v$database) || '_THIN_CLONE'
AND v.filetype = 'TEMPFILE'
THEN ROUND(gb, 1)
ELSE ROUND(gb) END gb_actual
FROM (SELECT 'DATAFILE' filetype, name, bytes/1024/1024/1024 gb, con_id FROM v$datafile
UNION SELECT 'TEMPFILE' filetype, name, bytes/1024/1024/1024 gb, con_id FROM v$tempfile) v
JOIN v$pdbs p ON (v.con_id = p.con_id)
WHERE p.name LIKE (SELECT UPPER(name) FROM v$database) || '%'
ORDER BY (CASE pdb
WHEN (SELECT UPPER(name) FROM v$database) || '_PDBA' THEN 1
WHEN (SELECT UPPER(name) FROM v$database) || '_FULL_CLONE' THEN 2
WHEN (SELECT UPPER(name) FROM v$database) || '_THIN_CLONE' THEN 3
END), filename;
TTITLE OFF
19 changes: 19 additions & 0 deletions exadata-features/files/lab_exascale_clone_07.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
SET FEEDBACK OFF
SET VERIFY OFF
COLUMN space_used_gb NEW_VALUE hcsu_c NOPRINT
SELECT ROUND(hc_space_used/1073741824) space_used_gb
FROM v$exa_vault
WHERE LOWER(vault_name) = (SELECT LOWER(name) || 'vault' FROM v$database);

SET SERVEROUTPUT ON
BEGIN
IF &hcsu_b = &hcsu_c THEN
DBMS_OUTPUT.PUT_LINE('The Exascale vault has not updated yet. Please wait 10 seconds and run this script again.');
ELSE
DBMS_OUTPUT.PUT_LINE(RPAD('TYPE', 12) || RPAD('SPACE_USED_RAW', 16) || RPAD('SPACE_USED_ACTUAL', 19));
DBMS_OUTPUT.PUT_LINE(RPAD('-', 10, '-') || ' ' || RPAD('-', 14, '-') || ' ' || RPAD('-', 17, '-'));
DBMS_OUTPUT.PUT_LINE(LPAD('FULL CLONE', 12) || LPAD(&hcsu_b - &hcsu_a, 16) || LPAD(ROUND((&hcsu_b - &hcsu_a) / 2), 19));
DBMS_OUTPUT.PUT_LINE(LPAD('THIN CLONE', 12) || LPAD(&hcsu_c - &hcsu_b, 16) || LPAD(ROUND((&hcsu_c - &hcsu_b) / 2, 1), 19));
END IF;
END;
/
10 changes: 10 additions & 0 deletions exadata-features/files/lab_exascale_clone_cleanup.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SET VERIFY OFF
COLUMN source_pdb NEW_VALUE source_pdb
COLUMN thick_pdb NEW_VALUE thick_pdb
COLUMN thin_pdb NEW_VALUE thin_pdb
SELECT LOWER(name) || '_pdba' source_pdb,
LOWER(name) || '_full_clone' thick_pdb,
LOWER(name) || '_thin_clone' thin_pdb
FROM v$database;
DROP PLUGGABLE DATABASE &thick_pdb INCLUDING DATAFILES;
DROP PLUGGABLE DATABASE &thin_pdb INCLUDING DATAFILES;
33 changes: 0 additions & 33 deletions exadata-features/introduction/introduction.md

This file was deleted.

34 changes: 0 additions & 34 deletions exadata-features/introduction/introduction_sandbox.md

This file was deleted.

7 changes: 3 additions & 4 deletions exadata-features/introduction/introduction_tenancy.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Estimated Workshop Time: 60 minutes
### Objectives

In this workshop, you will learn about:
* Storage server features through CellCLI
* Exascale Database Clones
* Smart Scan
* Hybrid Columnar Compression
* Flash Cache
Expand All @@ -18,7 +18,6 @@ In this workshop, you will learn about:
### Prerequisites

This lab assumes you have:
* Access to cellcli on an Exadata storage server or a cellcli simulator
* Sqlplus access to a database running on an Exadata

## Learn More
Expand All @@ -29,5 +28,5 @@ This lab assumes you have:

## Acknowledgements
* **Author** - Seth Miller, Principal Product Manager, Exadata Product Management
* **Contributors** - Alex Blythe, Exadata Product Management
* **Last Updated By/Date** - Seth Miller, March 2023
* **Contributors** - Alex Blythe & Natarajan Shankar, Exadata Product Management
* **Last Updated By/Date** - Seth Miller, August 2024
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"workshoptitle": "Experiment with Oracle Exadata Platform performance features",
"workshoptitle": "Hands-on for High Database Performance with Exadata Exascale and Exadata 24.1",
"help": "[email protected]",
"tutorials": [
{
"title": "Introduction",
"filename": "../../introduction/introduction_tenancy.md"
},
{
"title": "Lab 1: Explore Exadata Storage",
"filename": "../../cell/cell.md"
"title": "Lab 1: Exascale Database Clones",
"filename": "../../exascale_clone/exascale_clone.md"
},
{
"title": "Lab 2: Smart Scan",
Expand All @@ -27,8 +27,9 @@
"filename": "../../storage_indexes/storage_indexes.md"
},
{
"title": "Oracle CloudWorld 2023 - Need Help",
"filename": "https://oracle-livelabs.github.io/common/support/ocwsupportlab/ocwsupportlab.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"
}
]
}
38 changes: 0 additions & 38 deletions exadata-features/workshops/ocw23-sandbox/manifest.json

This file was deleted.

Loading

0 comments on commit 454ed55

Please sign in to comment.