Skip to content

Commit c5048d4

Browse files
Merge pull request #336 from oracle-devrel/Ulrike-assets-hybridpartitioned
Ulrike assets hybridpartitioned
2 parents 0050bcd + d756b71 commit c5048d4

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
REM Script: 1-create-partitioned-table.sql
2+
REM Use data from HR table EMPLOYEES
3+
4+
-- prereq EMPLOYEES table from HR schema
5+
-- HR schema available in https://github.com/oracle-samples/db-sample-schemas/blob/main/human_resources/hr_create.sql
6+
7+
8+
DROP TABLE hr.employees_hybrid;
9+
10+
CREATE TABLE hr.employees_hybrid
11+
( EMPLOYEE_ID varchar2(10),
12+
SALARY number,
13+
JOB_TITLE varchar2 (35))
14+
PARTITION BY RANGE (salary)
15+
( PARTITION salary_4000 VALUES less than (4000), -- internal partition
16+
PARTITION salary_10000 VALUES less than (10000), -- internal partition
17+
PARTITION salary_30000 VALUES less than (30000), -- intern partition
18+
PARTITION salary_max values less than (MAXVALUE))
19+
/
20+
21+
-- insert rows
22+
23+
INSERT INTO hr.employees_hybrid
24+
SELECT e.employee_id, e.salary, j.job_title
25+
FROM hr.employees e JOIN hr.jobs j ON e.job_id=j.job_id;
26+
27+
COMMIT;
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
## Scripts for hybrid partitioned tables
2+
3+
## Step by step instructions
4+
5+
This folder provides step by step instruction to create a hybrid partitioned table. the example uses table EMPLOYEES from schema HR.
6+
7+
- 1-create-partitioned-table.sql: create a partitioned table and add rows
8+
9+
- 2-add-external-attribute.sql: Use ALTER TABLE command to add external partition attribute
10+
11+
- 3-create-external-data.sql: Create external helper table with ORACLE_DATAPUMP
12+
13+
- 4-add-external-partition-data.sql: Use EXCHANGE PARTITION to provide data for the external partition
14+
15+
- monitor-external-part-tables.sql: Use ALL_EXTERNAL_TAB_PARTITIONS
16+
17+
- monitor-hybrid-tables.sql. Use ALL_TABLES with column hybrid
18+
19+
# License
20+
21+
Copyright (c) 2023 Oracle and/or its affiliates.
22+
23+
Licensed under the Universal Permissive License (UPL), Version 1.0.
24+
25+
See LICENSE for more details.

0 commit comments

Comments
 (0)