Skip to content

Commit 150a7e4

Browse files
Merge pull request #337 from oracle-devrel/ulrike-hybrid
Ulrike hybrid
2 parents 957297b + b0a49ff commit 150a7e4

File tree

6 files changed

+58
-3
lines changed

6 files changed

+58
-3
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
REM Script: 2-add-external-attribute.sql
2+
REM Use ALTER TABLE
3+
4+
-- enter directory name
5+
ALTER TABLE hr.employees_hybrid
6+
ADD EXTERNAL PARTITION ATTRIBUTES
7+
( TYPE oracle_datapump
8+
DEFAULT DIRECTORY &directoryname
9+
REJECT LIMIT UNLIMITED );
10+
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
REM Script: 3-create-external-data.sql
2+
REM Create external helper table with ORACLE_DATAPUMP
3+
4+
-- enter directory name
5+
-- create file salaryless3000.dmp
6+
7+
CREATE TABLE ext_help
8+
ORGANIZATION EXTERNAL
9+
(
10+
TYPE oracle_datapump
11+
DEFAULT DIRECTORY &directoryname
12+
LOCATION ('salaryless3000.dmp')
13+
)
14+
REJECT LIMIT UNLIMITED
15+
AS
16+
SELECT employee_id, salary, job_title
17+
FROM hr.employees_hybrid partition(SALARY_4000);
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
REM Script: 4-add-external-partition-data.sql
2+
REM Use EXCHANGE PARTITION
3+
4+
-- swap data segments to add (external) data to the partition
5+
ALTER TABLE hr.employees_hybrid
6+
EXCHANGE PARTITION(salary_4000) WITH TABLE ext_help;
7+
8+
-- you can drop the external helper table EXT_HELP now

data-platform/core-converged-db/hybrid-partitioned/scripts/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ This folder provides step by step instruction to create a hybrid partitioned tab
66

77
- 1-create-partitioned-table.sql: create a partitioned table and add rows
88

9-
- 2-add-external-attribute.sql: Use ALTER TABLE command to add external partition attribute
9+
- 2-add-external-attribute.sql: Use ALTER TABLE to add external partition attribute
1010

11-
- 3-create-external-data.sql: Create external helper table with ORACLE_DATAPUMP
11+
- 3-create-external-data.sql: Create external (helper) table with ORACLE_DATAPUMP
1212

1313
- 4-add-external-partition-data.sql: Use EXCHANGE PARTITION to provide data for the external partition
1414

15-
- monitor-external-part-tables.sql: Use ALL_EXTERNAL_TAB_PARTITIONS
15+
- monitor-external-part-tables.sql: Use ALL_XTERNAL_TAB_PARTITIONS
1616

1717
- monitor-hybrid-tables.sql. Use ALL_TABLES with column hybrid
1818

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
REM Script: monitor-external-partitions.sql
2+
REM Use ALL_XTERNAL_TAB_PARTITIONS
3+
4+
5+
col table_owner format a15
6+
col table_name format a20
7+
col partition_name format a20
8+
9+
SELECT table_owner, table_name, partition_name
10+
FROM all_xternal_tab_partitions;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
REM Script: monitor-hybrid-tables.sql
2+
REM Use ALL_TABLES
3+
4+
col table_name format a20
5+
col owner format a20
6+
col hybrid format a6
7+
8+
SELECT table_name, owner, hybrid
9+
FROM all_tables
10+
where hybrid='YES';

0 commit comments

Comments
 (0)