SlideShare ist ein Scribd-Unternehmen logo
1 von 43
ORACLE Deutschland B.V. & Co. KG
@ Ulrike.Schwinn@oracle.com
uschwinn
https://www.linkedin.com/in/ulrikeschwinn/
https://blogs.oracle.com/coretec
Ulrike Schwinn
External Tables und
Hybrid Partitioned Tables in 19c
The following is intended to outline our general product direction. It is intended for information purposes only,
and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or
functionality, and should not be relied upon in making purchasing decisions.The development, release,
timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the
sole discretion of Oracle Corporation.
Statements in this presentation relating to Oracle’s future plans, expectations, beliefs, intentions and prospects
are “forward-looking statements” and are subject to material risks and uncertainties.A detailed discussion of
these factors and other risks that affect our business is contained in Oracle’s Securities and Exchange Commission
(SEC) filings, including our most recent reports on Form 10-K and Form 10-Q under the heading “Risk Factors.”
These filings are available on the SEC’s website or on Oracle’s website at http://www.oracle.com/investor. All
information in this presentation is current as of September 2019 and Oracle undertakes no duty to update any
statement in light of new information or future events.
Safe harbor statement
• Oracle ExternalTables - Funktionen und Features
• ExternalTables in der Cloud
• Verwendung von Cloud Object Stores
• Hybride Speicherung
Agenda
3 Copyright © 2021, Oracle and/or its affiliates
Wie war das noch mal mit
External Tables?
Innerhalb der Datenbank
• Standard Datentypen wie z.B.
- VARCHAR2 (< 4000B, < 32767B mit MAX_STRING_SIZE = EXTENDED)
- LOB (ca 4PB)
- NUMBER, DATE, JSON etc.
• Spezielle Datentypen XML, Spatial, URI
• User-DefinedTypes
Außerhalb der Datenbank?
• Oracle ExternalTableTechnologie
• Oracle REST Data Service
=> Integration in APEX und sogar mit
REST Synchronization (DOAGVortrag)
Datenmanagement – extern, intern oder hybrid?
5 Copyright © 2021, Oracle and/or its affiliates
• Zum Laden und Entladen von Daten
 Lesender Zugriff über SQL*Loader Syntax mit Access Treiber ORACLE_LOADER
auch mit Big Data Access Treibern wie ORACLE_HIVE und ORACLE_HDFS
 Entladen von Daten (Resultat eines beliebigen SELECT-Statements) mit Access Treiber ORACLE_DATAPUMP
• Datenaufbereitung mit Preprocessing möglich
• Zugriff auf heterogene Daten: XML, JSON, Daten in Hadoop, CSV, Object Stores etc.
• Funktionserweitungen über die Zeit
 Partitionierung
 In-Memory
 Inline
 Parameter Änderung zur Laufzeit
Extern: ExternalTables - Steckbrief
6 Copyright © 2021, Oracle and/or its affiliates
• Verwendung von ORACLE_DATAPUMP und Nutzung eines logischen Directories
• Daten werden aus der Datenbank in einer binäre Datei geschrieben
• Verwendung für weitere ExternalTables oder
• für Partitionen im Hybrid Partitioned Umfeld
Tipp: Data Pump auch zum Entladen von Daten
create table scott.ext_emp_dept
organization external
(
type oracle_datapump
default directory data_dir
location ('emp_dept.exp')
)
reject limit unlimited
as
SELECT e.ename, d.dname FROM scott.dept d
JOIN scott.emp e USING (deptno);
create table scott.ext_emp_dept_prod
(ename VARCHAR2(10),
dname VARCHAR2(14))
organization external
(
type oracle_datapump
default directory data_dir
location ('emp_dept.exp')
)
reject limit unlimited;
7 Copyright © 2021, Oracle and/or its affiliates
• Ohne Anlegen eines Datenbank-Objekts
Inline ExternalTables
select * from external (
(first_name varchar2(30),
last_name varchar2(30),
hiredate date,
department_name varchar2(30),
city varchar2(30),
street_address varchar2(30))
type oracle_loader
default directory data_dir
access parameters ( RECORDS DELIMITED BY NEWLINE nobadfile nologfile
fields date_format date mask "dd.mm.yy")
location ('employees.csv') reject limit unlimited
) employees_external
where first_name='Nancy';
18c: Inline External Tables
8 Copyright © 2021, Oracle and/or its affiliates
Flexibilität mit ExternalTables
• Ohne Festlegung von DEFAULT DIRECTORY, LOCATION,ACCESS PARAMETERS wie BADFILE, LOGFILE,
DISCARDFILE und REJECT LIMIT
SQL> select count(*) from ext_flex
external modify (LOCATION(dir_w:'cust_f.csv'));
COUNT(*)
----------
18325
SQL> select count(*) from ext_flex;
no rows selected
SQL> select count(*) FROM ext_flex
external modify (LOCATION(dir_m:'cust_m.csv'));
COUNT(*)
----------
37175
create table ext_flex
(last_name varchar2(25),
gender varchar2(1),
city varchar2(50),
birth_year number)
organization external
(type ORACLE_LOADER default directory home
access parameter(
records delimited by newline
nologfile nobadfile
fields terminated by ';'
optionally enclosed BY '“'
missing field values are null))
reject limit unlimited;
9 Copyright © 2021, Oracle and/or its affiliates
Ausgangssituation
• JSON Daten liegen außerhalb der Datenbank im üblichen Format vor
• Beispiel: https://github.com/oracle/db-sample schemas/blob/master/order_entry/PurchaseOrders.dmp
Vorgehensweise
• Zugriff über logisches Directory
• ExternalTable mit Spalte für die JSON Daten in der Datenbank
Zugriff auf JSON Daten
create directory json_dir as '/home/oracle/db-sample-schemas-12.2.0.1/order_entry';
create table json_contents (json_document CLOB)
organization external
(type oracle_loader default directory json_dir
access parameters
(records delimited by 0x'0A'
fields (json_document CHAR(5000)))
location ('PurchaseOrders.dmp')) reject limit unlimited;
10 Copyright © 2021, Oracle and/or its affiliates
• Mit Klausel XMLTAG sind auchTeildokumente eines XML Dokuments im Zugriff
Zugriff auf XML Daten
create table ext_xml (xml_text VARCHAR2(2000))
organization external
(type oracle_loader
default directory home
access parameters
(records XMLTAG ("DepartmentName", "employeeName")
readsize 1024 skip 0 fields notrim
missing field values are null)
location ('emp.xml'))
reject limit unlimited;
SQL> select * from ext_xml;
XML_TEXT
-------------------------------------------
<DepartmentName>ACCOUNTING</DepartmentName>
<employeeName>CLARK</employeeName>
<employeeName>MILLER</employeeName>
<employeeName>KING</employeeName>
<DepartmentName>RESEARCH</DepartmentName>
<employeeName>JONES</employeeName>
<employeeName>SCOTT</employeeName>
<employeeName>SMITH</employeeName>
<employeeName>ADAMS</employeeName>
<employeeName>FORD</employeeName>
<DepartmentName>SALES</DepartmentName>
<employeeName>WARD</employeeName>
<employeeName>MARTIN</employeeName>
<employeeName>BLAKE</employeeName>
<employeeName>JAMES</employeeName>
<employeeName>ALLEN</employeeName>
<employeeName>TURNER</employeeName>
<DepartmentName>OPERATIONS</DepartmentName>
11 Copyright © 2021, Oracle and/or its affiliates
ExternalTable für große Datenmengen und für Performance
• Partitionierung von ExternalTables über Range, List, Composite Range und Composite List
 MöglicheAccessTreiber sind ORACLE_LOADER, ORACLE_HIVE und ORACLE_HDFS
• Location-Klausel mitWildcards
 Beispiel:
LOCATION (home:'cust_m*.csv')
• Beim Entladen von Daten mit ORACLE_DATAPUMP die Daten jetzt auch komprimiert
 Beispiel:
ACCESS PARAMETERS (COMPRESSION ENABLED HIGH)
• In-Memory Column Store Support
12 Copyright © 2021, Oracle and/or its affiliates
Beispiel mit List Partitionierung
create table ext_part
(last_name varchar2(25),
gender varchar2(1),
city varchar2(50),
birth_year number)
organization external
(
type ORACLE_LOADER
default directory home
access parameters ( records delimited by NEWLINE
fields terminated by ';' optionally enclosed BY '“’
missing field values are null)
)
reject limit unlimited
PARTITION BY LIST (gender)
(
PARTITION part_f VALUES ('F')
location (home:'cust_f.csv'),
PARTITION part_m VALUES ('M')
location (home:'cust_m.csv'));
13 Copyright © 2021, Oracle and/or its affiliates
• Verwendung in EE möglich ab 19.12
• https://docs.oracle.com/en/database/oracle/oracle-database/19/dblic/Licensing-Information.html#GUID-
0F9EB85D-4610-4EDF-89C2-4916A0E7AC87
• 18c: In-Memory External Tables
In-Memory Column Store Support
14 Copyright © 2021, Oracle and/or its affiliates
In-Memory Column Store Support
create table sales_ext_inmem
( first_name varchar2(30),
last_name varchar2(30),
hiredate date,
department_name varchar2(30),
city varchar2(30),
street_address varchar2(30))
organization external
( type ORACLE_LOADER
default directory home_dir
access parameters ( records delimited by newline nobadfile nologfile
fields date_format date mask "dd.mm.yy")
location ('employees.csv')) reject limit unlimited
INMEMORY;
SQL> alter system set QUERY_REWRITE_INTEGRITY=stale_tolerated;
SQL> exec dbms_inmemory.populate('SCOTT', 'SALES_EXT_INMEM');
• 18c: In-Memory ExternalTables
• Restrictions for In-Memory ExternalTables
15 Copyright © 2021, Oracle and/or its affiliates
External Tables in der
Cloud
• Was benötigt man:
• DBMS_CLOUD Package
• Zugriff auf Object Store und URI
 UnterstützteObject Stores sindOCI Object Store, Azure Blob Storage, Amazon S3, Amazon S3-Compatible (Oracle Cloud
Infrastructure Object Storage, Google Cloud Storage undWasabi Hot Cloud Storage
• Cloud Credential
ExternalTables und Autonomous Database
17 Copyright © 2021, Oracle and/or its affiliates
18
• Autonomous Database: External Tables
Beispiel: ExternalTable
begin
dbms_cloud.create_external_table(
table_name =>'CHANNELS',
credential_name =>'OBJ_STORE_CRED',
file_uri_list =>'https://objectstorage.eu-frankfurt-1.oraclecloud.com/…/chan_v3.dat',
format => json_object('ignoremissingcolumns' value 'true', 'removequotes' value 'true'),
column_list => 'CHANNEL_ID NUMBER,
CHANNEL_DESC VARCHAR2(100),
CHANNEL_CLASS VARCHAR2(100),
CHANNEL_CLASS_ID NUMBER,
CHANNEL_TOTAL VARCHAR2(100),
CHANNEL_TOTAL_ID NUMBER'
);
end;
/
3|"Direct Sales"|"Direct"|12|"Channel total"|1|
9|"Tele Sales"|"Direct"|12|"Channel total"|1|
5|"Catalog"|"Indirect"|13|"Channel total"|1|
4|"Internet"|"Indirect"|13|"Channel total"|1|
2|"Partners"|"Others"|14|"Channel total"|1|
Copyright © 2021, Oracle and/or its affiliates
• Validierung mit dbms_cloud.validate_external_table mit ausführliche Fehlermeldung in LogTabelle
• Zusätzliche Formate wie CSV, JSON, komprimierte Formate wie gzip, zlib und bzip2 und Avro, ORC oder
Parquet
• Siehe DBMS_CLOUD Package Format Options
• Oracle Autonomous Data Warehouse - Access Parquet Files in Object Stores
ExternalTables und Autonomous Database – gut zu wissen
format => '{"type":"parquet", "schema": "first"}'
begin
dbms_cloud.create_external_table (
table_name =>'sales_extended_ext',
credential_name =>'OBJ_STORE_CRED',
file_uri_list =>'https://../sales_extended.parquet',
format =>'{"type":"parquet", "schema": "first"}'
);
end;
/
19 Copyright © 2021, Oracle and/or its affiliates
Generelle Verwendung von
Cloud Object Stores
• Realisierung über PL/SQL Package DBMS_CLOUD
• Beispiele für die Nutzung:
 CREATE_EXTERNAL_TABLE zum Erzeugen von External Tables
 CREATE_HYBRID_PART_TABLE zum Erstellen eines Hybrid PartitionTables
 COPY_DATA zum Datenladen aus dem Object Storage inTabellen
 PUT_OBJECT zumVerlagern von Daten in einen Object Storage
 LIST_OBJECTS|LIST_FILEs zum Auflisten der Objekte bzw. Dateien
 DELETE_OBJECT|DELETE_FILE zum Löschen der Objekte bzw. Dateien
• Ab 19c auch in Non-Autonomous und On-Premises! - ABER nicht vorinstalliert
• Manuelle Installation von DBMS_CLOUD-Package und Zugriffs-Konfiguration
• Siehe MOS Note mit Doc ID 2748362.1 und
Patch 32527621: DBMS_CLOUD SUPPORT FOR NON-CDB ANDWRAPPED PLSQL CODE
• Oracle Object Storage für alle Oracle Datenbanken mit DBMS_CLOUD
Integration von Cloud Ressourcen
21 Copyright © 2021, Oracle and/or its affiliates
22
Beispiel 1: Auflisten
select object_name, bytes from dbms_cloud.list_objects('TESTCRED','https://…/b/USBUCKET/o/');
OBJECT_NAME BYTES
-------------------------------------------------- ----------
CHANNELS.gz 109
CHANNELS_test.txt 79
countries01-13_25_43.DMP 57344
cwallet.sso 6661
emp.csv 703
emp_dept_20.csv 114
emp_dept_20.exp 12288
emp_dept_30.csv 121
emp_dept_30.exp 12288
Copyright © 2021, Oracle and/or its affiliates
Beispiel 2: Daten kopieren
23
SQL> begin
dbms_cloud.copy_data(
table_name => 'CHANNELS’,
credential_name => 'TESTCRED’,
file_uri_list => 'https://…/CHANNELS_test.txt',
schema_name => 'SCOTT',
format => json_object('delimiter' value '|'));
end;
/
SQL> create table channels
( channel_id CHAR(1),
channel_desc VARCHAR2(20),
channel_class VARCHAR2(20));
SQL> select * from channels;
C CHANNEL_DESC CHANNEL_CLASS
- -------------------- --------------------
T Tele Sales Direct
…
Copyright © 2021, Oracle and/or its affiliates
Beispiel 3: ExternalTables
SQL> begin
dbms_cloud.create_external_table(
table_name => 'CHANNELS_EXT’,
credential_name => 'TESTCRED',
file_uri_list => 'https://…/CHANNELS.gz',
format => json_object('compression' value 'auto','delimiter' value '|'),
column_list => 'channel_short varchar2(1),
channel_long varchar2(20),
channel_class varchar2(20)');
end;
/
SQL> select * from channels_ext;
C CHANNEL_LONG CHANNEL_CLASS
- -------------------- --------------------
S Direct Sales Direct
T Tele Sales Direct
…
• DBMS_CLOUD: Zugriff auf Object Storage aus der Oracle Datenbank - Praktische Anwendungsfälle
24 Copyright © 2021, Oracle and/or its affiliates
Und jetzt hybrid
26
Datenhaltung und Organisation – „Inside, outside und Outside In”
Partition
Partition
2016,04,02 2016,04, 03
2016,04,01
DB Partition
• Nicht nur Datenbank Tabellen oder External Tables
sondern auch Hybrid Partitioned Tables
 Kombination aus internen (Datenbank) und
externen Partitionen
 Externe Ressourcen sind Files auf Filesystem, im
Hadoop Distributed File System (HDFS), im Oracle
Objectstore, AWS S3 oder Azure
 Use Cases:
 Verschieben von nicht aktiven Partitionen in externe
Dateien
 Verwenden günstiger Speicheroptionen
 Keine Verlagerung der Daten nötig
 Big Data Queries
Copyright © 2021, Oracle and/or its affiliates
• Ausgehend von partitionierterTabelle
• External Partition Attribute hinzufügen
• Externe Partition hinzufügen
Beispiel 1: PartitionierteTabelle umwandeln
27
create table int_ext_table
( ename varchar2(10),
dname varchar2(14),
deptno number)
PARTITION BY LIST (deptno) (PARTITION deptno_10 VALUES (10));
alter table int_ext_table
add external partition attributes
( type oracle_loader
default directory ext_pl
access parameters(records delimited by newline fields terminated by ';')
reject limit unlimited);
alter table int_ext_table
add partition deptno_20 values (20)
external location ('emp_dept_20.csv');
"JONES";"RESEARCH";20
"SCOTT";"RESEARCH";20
"FORD";"RESEARCH";20
"SMITH";"RESEARCH";20
"ADAMS";"RESEARCH";20
Copyright © 2021, Oracle and/or its affiliates
• Mit CREATE TABLE
• Hybrid Partitioned Tables - Lifecycle Management leicht gemacht
Beispiel 2: Hybrid PartitionierteTabelle anlegen
create table scott.ext_emp_dept_hybrid_1
( ename varchar2(10),
dname varchar2(14),
deptno number)
external partition attributes
( type oracle_loader
default directory ext_pl
reject limit unlimited
)
PARTITION BY LIST (deptno)
( PARTITION deptno_10 VALUES (10) , -- intern
PARTITION deptno_20 VALUES (20) external location ('emp_dept_20.csv')) -- extern
28 Copyright © 2021, Oracle and/or its affiliates
• Mit DBMS_CLOUD.CREATE_HYBRID_PART_TABLE werden externe partitionierte Dateien in den
unterstützten Cloud-Objektspeicherdiensten unterstützt
• Oracle Cloud Infrastructure Objektspeicher
• Azure Blob-Speicher
• Amazon S3
- Hinweis: externe Dateien müssen im demselben Objektspeicher sein
Zugriff auf Cloud-Objektspeicher
BEGIN
dbms_cloud.create_hybrid_part_table(
table_name => 'EXT_EMP_DEPT_HYBRID_AUTO',
credential_name => 'CREDENTIAL_US1',
format => json_object('type' value 'CSV'),
column_list => 'ename varchar2(10), dname varchar2(14), deptno number',
partitioning_clause => 'partition by list (deptno)
(partition deptno_30 values (30) external location (''https://…/emp_dept_30.csv''),
partition deptno_20 values (20) external location (''https://…/emp_dept_20.csv''),
partition deptno_10 values (10) )' -- intern
);
END;
29 Copyright © 2021, Oracle and/or its affiliates
Oracle Global Leaders Webcast: Managing 1 PB of data with Oracle
Autonomous DW
30 Copyright © 2021, Oracle and/or its affiliates
• Situation: PartitionierteTabelle
• Ziel:Auslagern der Partition DEPTNO_10
• Daten einfügen
Beispiel 3: Wie kann man Partitionen auslagern?
create table int_ext_table
( ename varchar2(10),
dname varchar2(14),
deptno number(2))
PARTITION BY LIST (deptno)
(PARTITION deptno_10 values (10),
PARTITION deptno_20 values (20));
insert into int_ext_table select e.ename, d.dname, deptno FROM scott.dept d
JOIN scott.emp e USING (deptno) where deptno in (10,20);
31 Copyright © 2021, Oracle and/or its affiliates
• Hilfstabelle anlegen um externe Datei(en) zu erzeugen =>TYPE oracle_datapump
Trick: Helper ExternalTable
drop table ext_emp_dept_help;
create table ext_emp_dept_help
organization external
(
type oracle_datapump
default directory ext_pl
location ('emp_dept_10.exp')
)
reject limit unlimited
as select ename, dname, deptno
from int_ext_table PARTITION (deptno_10);
• Hybrid Partitioned Tables und Lifecycle Management
32 Copyright © 2021, Oracle and/or its affiliates
• External Partition Attribute hinzufügen
• Jetzt nur noch PARTITION EXCHANGE verwenden, um die Partition auszulagern
Auslagern von Partitionen
alter table int_ext_table
exchange partition(deptno_10) with table ext_emp_dept_help;
33
alter table int_ext_table
add external partition attributes
( type oracle_datapump
default directory ext_pl
reject limit unlimited);
Copyright © 2021, Oracle and/or its affiliates
Mit Cloud-Objektspeicher
BEGIN
DBMS_CLOUD.CREATE_HYBRID_PART_TABLE (
table_name => 'EXT_EMP_DEPT_HYBRID_DP',
credential_name => 'CREDENTIAL_US1',
format => json_object('type' value DBMS_CLOUD.FORMAT_TYPE_DATAPUMP),
column_list => 'ename varchar2(10), dname varchar2(14), deptno number',
partitioning_clause => 'partition by list (deptno)
( partition deptno_30 values (30) external location
( ''https://…/emp_dept_30.exp''),
partition deptno_20 values (20) external location
( ''https://…/emp_dept_20.exp''),
partition deptno_10 values (10) )'
);
END;
/
• Verwendung von Treiber ORACLE_DATAPUMP über eine spezielle FORMAT- Angabe
=> Konstante DBMS_CLOUD.FORMAT_TYPE_DATAPUMP
34 Copyright © 2021, Oracle and/or its affiliates
35
Monitoring mit Data Dictionary Views
SQL> select table_name, type_name from user_external_tables;
TABLE_NAME TYPE_NAME
------------------------------ -------------------------
INT_EXT_TABLE ORACLE_DATAPUMP
SQL> select table_name, hybrid from user_tables where hybrid='YES';
TABLE_NAME HYB
------------------------------ ---
INT_EXT_TABLE YES
SQL> select table_name, type_name, default_directory_name directory, reject_limit, access_parameters
from user_xternal_part_tables;
TABLE_NAME TYPE_NAME DIRECTORY REJECT_LIM ACCESS_PAR
------------------------------ ------------------------- ---------- ---------- ----------
INT_EXT_TABLE ORACLE_DATAPUMP EXT_PL UNLIMITED
Copyright © 2021, Oracle and/or its affiliates
Restrictions that apply to external tables also apply to hybrid partitioned tables unless explicitly noted
• No support for REFERENCE and SYSTEM partitioning methods
• Only single level LIST and RANGE partitioning are supported.
• No unique indexes or global unique indexes. Only partial indexes are allowed and unique indexes cannot be partial.
• Only single level list partitioning is supported for HIVE.
• Attribute clustering (CLUSTERING clause) is not allowed.
• DML operations only on internal partitions of a hybrid partitioned table (external partitions are treated as read-only
partitions)
• In-memory defined on the table level only has an effect on internal partitions of the hybrid partitioned table.
• No column default value
• Invisible columns are not allowed.
• The CELLMEMORY clause is not allowed.
• SPLIT, MERGE, and MOVE maintenance operations are not allowed on external partitions.
• LOB, LONG, and ADT types are not allowed.
Einschränkungen – aus dem Handbuch VLDB and Partitioning Guide
36
Copyright © 2021, Oracle and/or its affiliates
• Fragestellung: Massives Datenwachstum, aber alte Daten dürfen NICHT gelöscht werden
• Lösung 1: Hybrid Partitioned Tables
• Lösung 2: Partitionierte Tabellen mit gleicher Struktur verwenden –
eine mit den aktuellen Daten und eine mit einer External Table zum Archivieren der Daten
Idee
1) Partitionen auslagern mit External Table (Helper Tabellen) und TYPE oracle_datapump
2) External Partitionierte Tabelle (archiviert) aus den Ergebnis Dateien
Kundenanforderung: Lifecycle Management
37
Copyright © 2021, Oracle and/or its affiliates
• Ausgangslage: Partitionierte Tabelle
• Partition P2018 und P2019 sollen ausgelagert werden
1. Schritt: PartitionierteTabelle
create table MESSAGE_INTERNAL
(id number,
datum date,
text clob)
lob (text) store as securefile
(disable storage in row)
partition by range (datum) (
partition P2018 values less than(to_date('01.01.2019', 'dd.mm.yyyy')),
partition P2019 values less than(to_date('01.01.2020', 'dd.mm.yyyy')),
partition P2020 values less than(to_date('01.01.2021', 'dd.mm.yyyy'))
)
/
38
Copyright © 2021, Oracle and/or its affiliates
• Entladen der alten Informationen im DATAPUMP Format
• Für 2018 und 2019 durchführen
2. Schritt: Auslagerung
create table MESSAGE_EXTERNAL_2018
(id, datum, text)
organization external
(
type oracle_datapump
default directory my_exp
location ('message_external_2018.dmp')
)
reject limit unlimited
as select * from message_internal partition (p2018)
/
select * from message_external_2018;
39
Copyright © 2021, Oracle and/or its affiliates
• Mit Dateien aus Schritt 2
3. Schritt: External PartitionierteTabelle für ausgelagerte Daten
create table MESSAGE_EXTERNAL
(id number,
datum date,
text clob)
organization external
(
type oracle_datapump
default directory my_exp
)
partition by range(datum)
(
partition P2018 values less than(to_date('01.01.2019', 'dd.mm.yyyy’) )
location ('message_external_2018.dmp'),
partition P2019 values less than(to_date('01.01.2020', 'dd.mm.yyyy’))
location ('message_external_2019.dmp')
);
select * from message_external;
40
Copyright © 2021, Oracle and/or its affiliates
Fazit
Copyright © 2021, Oracle and/or its affiliates
41
ExternalTableTechnology bietet
• Hohe Flexibilität
• performante Zugriffe auf heterogene Daten
• Lifecycle-Management
verwendbar in Kombination mit Partitionierung und
Cloud-Objektspeichern
• Aktuelles im Oracle Datenbank Umfeld in deutscher Sprache
 Gegliedert nach ... Neuigkeiten,Termine, Release-Stand und Patchsets, Aus dem Web
• Erscheinungsdatum: Letzter Freitag im Monat – nächsterTermin am 30. April
• Dauer: ca 15 Minuten
• Video und PDF
• https://blog.oracle.com/coretec
• Youtube Monthly News
• Redaktion
 Frank Schneede
 Detlef E. Schröder
 Marcus Schröder
 Ulrike Schwinn
 Wolfgang Thiem
 Sinan PetrusToma
In eigener Sache ... Neuigkeiten mit Monthly News
42
Copyright © 2021, Oracle and/or its affiliates
Zum Nachlesen
• Grundlagen zu External Tables
• External Table in 12c
• 18c: In-Memory External Tables
• 18c: In-Memory External Tables
• Autonomous Database Services: External Tables
• Hybrid Partitioned Tables - Lifecycle Management leicht gemacht
• Hybrid Partitioned Tables und Lifecycle Management
• Oracle Object Storage für alle Oracle Datenbanken mit DBMS_CLOUD
• DBMS_CLOUD: Zugriff auf Object Storage aus der Oracle Datenbank - Praktische
Anwendungsfälle
• Oracle Autonomous Data Warehouse - Access Parquet Files in Object Stores
Weitere Links:
• https://blogs.oracle.com/coretec/
• Oracle Datenbanken Monthly News
Kontakt: Ulrike.Schwinn@oracle.com @uschwinn

Weitere ähnliche Inhalte

Was ist angesagt?

Die Datenbank ist nicht immer Schuld - Gründe warum Datenbank-Migration schei...
Die Datenbank ist nicht immer Schuld - Gründe warum Datenbank-Migration schei...Die Datenbank ist nicht immer Schuld - Gründe warum Datenbank-Migration schei...
Die Datenbank ist nicht immer Schuld - Gründe warum Datenbank-Migration schei...Markus Flechtner
 
Überblick zu Oracle Database 12c Release 2
Überblick zu Oracle Database 12c Release 2Überblick zu Oracle Database 12c Release 2
Überblick zu Oracle Database 12c Release 2Ulrike Schwinn
 
AOUG 2019 Oracle Centrally Managed Users 18c / 19c
AOUG 2019 Oracle Centrally Managed Users 18c / 19cAOUG 2019 Oracle Centrally Managed Users 18c / 19c
AOUG 2019 Oracle Centrally Managed Users 18c / 19cStefan Oehrli
 
18c: private temporary tables
18c: private temporary tables18c: private temporary tables
18c: private temporary tablesUlrike Schwinn
 
DOAG Webinar Oracle und Docker
DOAG Webinar Oracle und DockerDOAG Webinar Oracle und Docker
DOAG Webinar Oracle und DockerStefan Oehrli
 
Trivadis triCast Oracle Centrally Managed Users 18/19c
Trivadis triCast Oracle Centrally Managed Users 18/19cTrivadis triCast Oracle Centrally Managed Users 18/19c
Trivadis triCast Oracle Centrally Managed Users 18/19cStefan Oehrli
 
Oracle Database In-Memory Advisor (Deutsch)
Oracle Database In-Memory Advisor (Deutsch)Oracle Database In-Memory Advisor (Deutsch)
Oracle Database In-Memory Advisor (Deutsch)Ileana Somesan
 
Oracle Database Appliance X5-2
Oracle Database Appliance X5-2Oracle Database Appliance X5-2
Oracle Database Appliance X5-2Ileana Somesan
 
Die Oracle Datenbank als Service in der Oracle Cloud, November 2012
Die Oracle Datenbank als Service in der Oracle Cloud, November 2012Die Oracle Datenbank als Service in der Oracle Cloud, November 2012
Die Oracle Datenbank als Service in der Oracle Cloud, November 2012Ileana Somesan
 
Oracle Database Appliance, Partnerwebcast, November 2011
Oracle Database Appliance, Partnerwebcast, November 2011Oracle Database Appliance, Partnerwebcast, November 2011
Oracle Database Appliance, Partnerwebcast, November 2011Ileana Somesan
 
Oracle Database 12c In-Memory Option
Oracle Database 12c In-Memory Option Oracle Database 12c In-Memory Option
Oracle Database 12c In-Memory Option Ileana Somesan
 
Oracle Database Appliance X4-2
Oracle Database Appliance X4-2Oracle Database Appliance X4-2
Oracle Database Appliance X4-2Ileana Somesan
 
Überblick Oracle Datenbank Hochverfügbarkeit
Überblick Oracle Datenbank HochverfügbarkeitÜberblick Oracle Datenbank Hochverfügbarkeit
Überblick Oracle Datenbank HochverfügbarkeitIleana Somesan
 
20181210_ITTage2018_OracleNoSQLDB_KPatenge
20181210_ITTage2018_OracleNoSQLDB_KPatenge20181210_ITTage2018_OracleNoSQLDB_KPatenge
20181210_ITTage2018_OracleNoSQLDB_KPatengeKarin Patenge
 
20160310_ModernApplicationDevelopment_NoSQL_KPatenge
20160310_ModernApplicationDevelopment_NoSQL_KPatenge20160310_ModernApplicationDevelopment_NoSQL_KPatenge
20160310_ModernApplicationDevelopment_NoSQL_KPatengeKarin Patenge
 
Datenbank Migration - Oracle 11gR2 Erfahrungen 2011 - OPITZ CONSULTING - Chri...
Datenbank Migration - Oracle 11gR2 Erfahrungen 2011 - OPITZ CONSULTING - Chri...Datenbank Migration - Oracle 11gR2 Erfahrungen 2011 - OPITZ CONSULTING - Chri...
Datenbank Migration - Oracle 11gR2 Erfahrungen 2011 - OPITZ CONSULTING - Chri...OPITZ CONSULTING Deutschland
 
Oracle Database In-Memory Option auf einen Blick
Oracle Database In-Memory Option auf einen BlickOracle Database In-Memory Option auf einen Blick
Oracle Database In-Memory Option auf einen BlickIleana Somesan
 
Automatisiertes disaster recovery testing mit der oracle cloud
Automatisiertes disaster recovery testing mit der oracle cloudAutomatisiertes disaster recovery testing mit der oracle cloud
Automatisiertes disaster recovery testing mit der oracle cloudTrivadis
 
Marek Adar – IT-Tage 2015 – Oracle Recovery Manager unter 12c
Marek Adar – IT-Tage 2015 – Oracle Recovery Manager unter 12cMarek Adar – IT-Tage 2015 – Oracle Recovery Manager unter 12c
Marek Adar – IT-Tage 2015 – Oracle Recovery Manager unter 12cInformatik Aktuell
 

Was ist angesagt? (20)

Die Datenbank ist nicht immer Schuld - Gründe warum Datenbank-Migration schei...
Die Datenbank ist nicht immer Schuld - Gründe warum Datenbank-Migration schei...Die Datenbank ist nicht immer Schuld - Gründe warum Datenbank-Migration schei...
Die Datenbank ist nicht immer Schuld - Gründe warum Datenbank-Migration schei...
 
Überblick zu Oracle Database 12c Release 2
Überblick zu Oracle Database 12c Release 2Überblick zu Oracle Database 12c Release 2
Überblick zu Oracle Database 12c Release 2
 
AOUG 2019 Oracle Centrally Managed Users 18c / 19c
AOUG 2019 Oracle Centrally Managed Users 18c / 19cAOUG 2019 Oracle Centrally Managed Users 18c / 19c
AOUG 2019 Oracle Centrally Managed Users 18c / 19c
 
18c: private temporary tables
18c: private temporary tables18c: private temporary tables
18c: private temporary tables
 
DOAG Webinar Oracle und Docker
DOAG Webinar Oracle und DockerDOAG Webinar Oracle und Docker
DOAG Webinar Oracle und Docker
 
Trivadis triCast Oracle Centrally Managed Users 18/19c
Trivadis triCast Oracle Centrally Managed Users 18/19cTrivadis triCast Oracle Centrally Managed Users 18/19c
Trivadis triCast Oracle Centrally Managed Users 18/19c
 
Oracle und Docker
Oracle und DockerOracle und Docker
Oracle und Docker
 
Oracle Database In-Memory Advisor (Deutsch)
Oracle Database In-Memory Advisor (Deutsch)Oracle Database In-Memory Advisor (Deutsch)
Oracle Database In-Memory Advisor (Deutsch)
 
Oracle Database Appliance X5-2
Oracle Database Appliance X5-2Oracle Database Appliance X5-2
Oracle Database Appliance X5-2
 
Die Oracle Datenbank als Service in der Oracle Cloud, November 2012
Die Oracle Datenbank als Service in der Oracle Cloud, November 2012Die Oracle Datenbank als Service in der Oracle Cloud, November 2012
Die Oracle Datenbank als Service in der Oracle Cloud, November 2012
 
Oracle Database Appliance, Partnerwebcast, November 2011
Oracle Database Appliance, Partnerwebcast, November 2011Oracle Database Appliance, Partnerwebcast, November 2011
Oracle Database Appliance, Partnerwebcast, November 2011
 
Oracle Database 12c In-Memory Option
Oracle Database 12c In-Memory Option Oracle Database 12c In-Memory Option
Oracle Database 12c In-Memory Option
 
Oracle Database Appliance X4-2
Oracle Database Appliance X4-2Oracle Database Appliance X4-2
Oracle Database Appliance X4-2
 
Überblick Oracle Datenbank Hochverfügbarkeit
Überblick Oracle Datenbank HochverfügbarkeitÜberblick Oracle Datenbank Hochverfügbarkeit
Überblick Oracle Datenbank Hochverfügbarkeit
 
20181210_ITTage2018_OracleNoSQLDB_KPatenge
20181210_ITTage2018_OracleNoSQLDB_KPatenge20181210_ITTage2018_OracleNoSQLDB_KPatenge
20181210_ITTage2018_OracleNoSQLDB_KPatenge
 
20160310_ModernApplicationDevelopment_NoSQL_KPatenge
20160310_ModernApplicationDevelopment_NoSQL_KPatenge20160310_ModernApplicationDevelopment_NoSQL_KPatenge
20160310_ModernApplicationDevelopment_NoSQL_KPatenge
 
Datenbank Migration - Oracle 11gR2 Erfahrungen 2011 - OPITZ CONSULTING - Chri...
Datenbank Migration - Oracle 11gR2 Erfahrungen 2011 - OPITZ CONSULTING - Chri...Datenbank Migration - Oracle 11gR2 Erfahrungen 2011 - OPITZ CONSULTING - Chri...
Datenbank Migration - Oracle 11gR2 Erfahrungen 2011 - OPITZ CONSULTING - Chri...
 
Oracle Database In-Memory Option auf einen Blick
Oracle Database In-Memory Option auf einen BlickOracle Database In-Memory Option auf einen Blick
Oracle Database In-Memory Option auf einen Blick
 
Automatisiertes disaster recovery testing mit der oracle cloud
Automatisiertes disaster recovery testing mit der oracle cloudAutomatisiertes disaster recovery testing mit der oracle cloud
Automatisiertes disaster recovery testing mit der oracle cloud
 
Marek Adar – IT-Tage 2015 – Oracle Recovery Manager unter 12c
Marek Adar – IT-Tage 2015 – Oracle Recovery Manager unter 12cMarek Adar – IT-Tage 2015 – Oracle Recovery Manager unter 12c
Marek Adar – IT-Tage 2015 – Oracle Recovery Manager unter 12c
 

Ähnlich wie Hybrid Partitioned Tables in Oracle Database 19c

Oracle Text 12c New Features
Oracle Text 12c New FeaturesOracle Text 12c New Features
Oracle Text 12c New FeaturesUlrike Schwinn
 
Oracle Database 12c Release 2
Oracle Database 12c Release 2 Oracle Database 12c Release 2
Oracle Database 12c Release 2 oraclebudb
 
Ausgewählte PL/SQL Packages (3)
Ausgewählte PL/SQL Packages (3)Ausgewählte PL/SQL Packages (3)
Ausgewählte PL/SQL Packages (3)Ulrike Schwinn
 
Ausgewählte PL/SQL Packages (2)
Ausgewählte PL/SQL Packages (2)Ausgewählte PL/SQL Packages (2)
Ausgewählte PL/SQL Packages (2)Ulrike Schwinn
 
Heterogene Daten(-strukturen) in der Oracle Datenbank
Heterogene Daten(-strukturen) in der Oracle DatenbankHeterogene Daten(-strukturen) in der Oracle Datenbank
Heterogene Daten(-strukturen) in der Oracle DatenbankUlrike Schwinn
 
APEX 5.1 - Architektur, Installation & Betrieb
APEX 5.1 - Architektur, Installation & BetriebAPEX 5.1 - Architektur, Installation & Betrieb
APEX 5.1 - Architektur, Installation & BetriebNiels de Bruijn
 
Oracle12c für Entwickler
Oracle12c für EntwicklerOracle12c für Entwickler
Oracle12c für EntwicklerCarsten Czarski
 
Oracle12c für Entwickler
Oracle12c für EntwicklerOracle12c für Entwickler
Oracle12c für Entwickleroraclebudb
 
SQL Tuning Sets: Generieren, Verwenden, Transferieren, Szenarios
SQL Tuning Sets: Generieren, Verwenden, Transferieren, Szenarios SQL Tuning Sets: Generieren, Verwenden, Transferieren, Szenarios
SQL Tuning Sets: Generieren, Verwenden, Transferieren, Szenarios Ulrike Schwinn
 
SAP Datashpere - von Bits und Bites zu Widgets und Charts
SAP Datashpere - von Bits und Bites zu Widgets und ChartsSAP Datashpere - von Bits und Bites zu Widgets und Charts
SAP Datashpere - von Bits und Bites zu Widgets und ChartsIBsolution GmbH
 
Migration auf die OBIEE - OPITZ CONSULTING - Till Sander
Migration auf die OBIEE - OPITZ CONSULTING - Till SanderMigration auf die OBIEE - OPITZ CONSULTING - Till Sander
Migration auf die OBIEE - OPITZ CONSULTING - Till SanderOPITZ CONSULTING Deutschland
 
Sensitive Daten in der Oracle Datenbank
Sensitive Daten in der Oracle DatenbankSensitive Daten in der Oracle Datenbank
Sensitive Daten in der Oracle DatenbankUlrike Schwinn
 
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAsKarin Patenge
 
Geodatenmanagement und -Visualisierung mit Oracle Spatial Technologies
Geodatenmanagement und -Visualisierung mit Oracle Spatial TechnologiesGeodatenmanagement und -Visualisierung mit Oracle Spatial Technologies
Geodatenmanagement und -Visualisierung mit Oracle Spatial TechnologiesKarin Patenge
 
Big Data Konnektivität
Big Data KonnektivitätBig Data Konnektivität
Big Data KonnektivitätTrivadis
 
JSON in der Oracle12c Database
JSON in der Oracle12c DatabaseJSON in der Oracle12c Database
JSON in der Oracle12c DatabaseCarsten Czarski
 
Logical Data Warehouse - SQL mit Oracle DB und Hadoop
Logical Data Warehouse - SQL mit Oracle DB und HadoopLogical Data Warehouse - SQL mit Oracle DB und Hadoop
Logical Data Warehouse - SQL mit Oracle DB und HadoopOPITZ CONSULTING Deutschland
 
Schlaglichter Oracle DB 11gR2 - DOAG Regio-Treffen 2010 - OPITZ CONSULTING - ...
Schlaglichter Oracle DB 11gR2 - DOAG Regio-Treffen 2010 - OPITZ CONSULTING - ...Schlaglichter Oracle DB 11gR2 - DOAG Regio-Treffen 2010 - OPITZ CONSULTING - ...
Schlaglichter Oracle DB 11gR2 - DOAG Regio-Treffen 2010 - OPITZ CONSULTING - ...OPITZ CONSULTING Deutschland
 
Oracle Technology Monthly Oktober 2017
Oracle Technology Monthly Oktober 2017Oracle Technology Monthly Oktober 2017
Oracle Technology Monthly Oktober 2017oraclebudb
 

Ähnlich wie Hybrid Partitioned Tables in Oracle Database 19c (20)

Oracle Text 12c New Features
Oracle Text 12c New FeaturesOracle Text 12c New Features
Oracle Text 12c New Features
 
Oracle Database 12c Release 2
Oracle Database 12c Release 2 Oracle Database 12c Release 2
Oracle Database 12c Release 2
 
Ausgewählte PL/SQL Packages (3)
Ausgewählte PL/SQL Packages (3)Ausgewählte PL/SQL Packages (3)
Ausgewählte PL/SQL Packages (3)
 
Ausgewählte PL/SQL Packages (2)
Ausgewählte PL/SQL Packages (2)Ausgewählte PL/SQL Packages (2)
Ausgewählte PL/SQL Packages (2)
 
Heterogene Daten(-strukturen) in der Oracle Datenbank
Heterogene Daten(-strukturen) in der Oracle DatenbankHeterogene Daten(-strukturen) in der Oracle Datenbank
Heterogene Daten(-strukturen) in der Oracle Datenbank
 
APEX 5.1 - Architektur, Installation & Betrieb
APEX 5.1 - Architektur, Installation & BetriebAPEX 5.1 - Architektur, Installation & Betrieb
APEX 5.1 - Architektur, Installation & Betrieb
 
Oracle12c für Entwickler
Oracle12c für EntwicklerOracle12c für Entwickler
Oracle12c für Entwickler
 
Oracle12c für Entwickler
Oracle12c für EntwicklerOracle12c für Entwickler
Oracle12c für Entwickler
 
SQL Tuning Sets: Generieren, Verwenden, Transferieren, Szenarios
SQL Tuning Sets: Generieren, Verwenden, Transferieren, Szenarios SQL Tuning Sets: Generieren, Verwenden, Transferieren, Szenarios
SQL Tuning Sets: Generieren, Verwenden, Transferieren, Szenarios
 
SAP Datashpere - von Bits und Bites zu Widgets und Charts
SAP Datashpere - von Bits und Bites zu Widgets und ChartsSAP Datashpere - von Bits und Bites zu Widgets und Charts
SAP Datashpere - von Bits und Bites zu Widgets und Charts
 
Oracle TEXT
Oracle TEXTOracle TEXT
Oracle TEXT
 
Migration auf die OBIEE - OPITZ CONSULTING - Till Sander
Migration auf die OBIEE - OPITZ CONSULTING - Till SanderMigration auf die OBIEE - OPITZ CONSULTING - Till Sander
Migration auf die OBIEE - OPITZ CONSULTING - Till Sander
 
Sensitive Daten in der Oracle Datenbank
Sensitive Daten in der Oracle DatenbankSensitive Daten in der Oracle Datenbank
Sensitive Daten in der Oracle Datenbank
 
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs
 
Geodatenmanagement und -Visualisierung mit Oracle Spatial Technologies
Geodatenmanagement und -Visualisierung mit Oracle Spatial TechnologiesGeodatenmanagement und -Visualisierung mit Oracle Spatial Technologies
Geodatenmanagement und -Visualisierung mit Oracle Spatial Technologies
 
Big Data Konnektivität
Big Data KonnektivitätBig Data Konnektivität
Big Data Konnektivität
 
JSON in der Oracle12c Database
JSON in der Oracle12c DatabaseJSON in der Oracle12c Database
JSON in der Oracle12c Database
 
Logical Data Warehouse - SQL mit Oracle DB und Hadoop
Logical Data Warehouse - SQL mit Oracle DB und HadoopLogical Data Warehouse - SQL mit Oracle DB und Hadoop
Logical Data Warehouse - SQL mit Oracle DB und Hadoop
 
Schlaglichter Oracle DB 11gR2 - DOAG Regio-Treffen 2010 - OPITZ CONSULTING - ...
Schlaglichter Oracle DB 11gR2 - DOAG Regio-Treffen 2010 - OPITZ CONSULTING - ...Schlaglichter Oracle DB 11gR2 - DOAG Regio-Treffen 2010 - OPITZ CONSULTING - ...
Schlaglichter Oracle DB 11gR2 - DOAG Regio-Treffen 2010 - OPITZ CONSULTING - ...
 
Oracle Technology Monthly Oktober 2017
Oracle Technology Monthly Oktober 2017Oracle Technology Monthly Oktober 2017
Oracle Technology Monthly Oktober 2017
 

Hybrid Partitioned Tables in Oracle Database 19c

  • 1. ORACLE Deutschland B.V. & Co. KG @ Ulrike.Schwinn@oracle.com uschwinn https://www.linkedin.com/in/ulrikeschwinn/ https://blogs.oracle.com/coretec Ulrike Schwinn External Tables und Hybrid Partitioned Tables in 19c
  • 2. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions.The development, release, timing, and pricing of any features or functionality described for Oracle’s products may change and remains at the sole discretion of Oracle Corporation. Statements in this presentation relating to Oracle’s future plans, expectations, beliefs, intentions and prospects are “forward-looking statements” and are subject to material risks and uncertainties.A detailed discussion of these factors and other risks that affect our business is contained in Oracle’s Securities and Exchange Commission (SEC) filings, including our most recent reports on Form 10-K and Form 10-Q under the heading “Risk Factors.” These filings are available on the SEC’s website or on Oracle’s website at http://www.oracle.com/investor. All information in this presentation is current as of September 2019 and Oracle undertakes no duty to update any statement in light of new information or future events. Safe harbor statement
  • 3. • Oracle ExternalTables - Funktionen und Features • ExternalTables in der Cloud • Verwendung von Cloud Object Stores • Hybride Speicherung Agenda 3 Copyright © 2021, Oracle and/or its affiliates
  • 4. Wie war das noch mal mit External Tables?
  • 5. Innerhalb der Datenbank • Standard Datentypen wie z.B. - VARCHAR2 (< 4000B, < 32767B mit MAX_STRING_SIZE = EXTENDED) - LOB (ca 4PB) - NUMBER, DATE, JSON etc. • Spezielle Datentypen XML, Spatial, URI • User-DefinedTypes Außerhalb der Datenbank? • Oracle ExternalTableTechnologie • Oracle REST Data Service => Integration in APEX und sogar mit REST Synchronization (DOAGVortrag) Datenmanagement – extern, intern oder hybrid? 5 Copyright © 2021, Oracle and/or its affiliates
  • 6. • Zum Laden und Entladen von Daten  Lesender Zugriff über SQL*Loader Syntax mit Access Treiber ORACLE_LOADER auch mit Big Data Access Treibern wie ORACLE_HIVE und ORACLE_HDFS  Entladen von Daten (Resultat eines beliebigen SELECT-Statements) mit Access Treiber ORACLE_DATAPUMP • Datenaufbereitung mit Preprocessing möglich • Zugriff auf heterogene Daten: XML, JSON, Daten in Hadoop, CSV, Object Stores etc. • Funktionserweitungen über die Zeit  Partitionierung  In-Memory  Inline  Parameter Änderung zur Laufzeit Extern: ExternalTables - Steckbrief 6 Copyright © 2021, Oracle and/or its affiliates
  • 7. • Verwendung von ORACLE_DATAPUMP und Nutzung eines logischen Directories • Daten werden aus der Datenbank in einer binäre Datei geschrieben • Verwendung für weitere ExternalTables oder • für Partitionen im Hybrid Partitioned Umfeld Tipp: Data Pump auch zum Entladen von Daten create table scott.ext_emp_dept organization external ( type oracle_datapump default directory data_dir location ('emp_dept.exp') ) reject limit unlimited as SELECT e.ename, d.dname FROM scott.dept d JOIN scott.emp e USING (deptno); create table scott.ext_emp_dept_prod (ename VARCHAR2(10), dname VARCHAR2(14)) organization external ( type oracle_datapump default directory data_dir location ('emp_dept.exp') ) reject limit unlimited; 7 Copyright © 2021, Oracle and/or its affiliates
  • 8. • Ohne Anlegen eines Datenbank-Objekts Inline ExternalTables select * from external ( (first_name varchar2(30), last_name varchar2(30), hiredate date, department_name varchar2(30), city varchar2(30), street_address varchar2(30)) type oracle_loader default directory data_dir access parameters ( RECORDS DELIMITED BY NEWLINE nobadfile nologfile fields date_format date mask "dd.mm.yy") location ('employees.csv') reject limit unlimited ) employees_external where first_name='Nancy'; 18c: Inline External Tables 8 Copyright © 2021, Oracle and/or its affiliates
  • 9. Flexibilität mit ExternalTables • Ohne Festlegung von DEFAULT DIRECTORY, LOCATION,ACCESS PARAMETERS wie BADFILE, LOGFILE, DISCARDFILE und REJECT LIMIT SQL> select count(*) from ext_flex external modify (LOCATION(dir_w:'cust_f.csv')); COUNT(*) ---------- 18325 SQL> select count(*) from ext_flex; no rows selected SQL> select count(*) FROM ext_flex external modify (LOCATION(dir_m:'cust_m.csv')); COUNT(*) ---------- 37175 create table ext_flex (last_name varchar2(25), gender varchar2(1), city varchar2(50), birth_year number) organization external (type ORACLE_LOADER default directory home access parameter( records delimited by newline nologfile nobadfile fields terminated by ';' optionally enclosed BY '“' missing field values are null)) reject limit unlimited; 9 Copyright © 2021, Oracle and/or its affiliates
  • 10. Ausgangssituation • JSON Daten liegen außerhalb der Datenbank im üblichen Format vor • Beispiel: https://github.com/oracle/db-sample schemas/blob/master/order_entry/PurchaseOrders.dmp Vorgehensweise • Zugriff über logisches Directory • ExternalTable mit Spalte für die JSON Daten in der Datenbank Zugriff auf JSON Daten create directory json_dir as '/home/oracle/db-sample-schemas-12.2.0.1/order_entry'; create table json_contents (json_document CLOB) organization external (type oracle_loader default directory json_dir access parameters (records delimited by 0x'0A' fields (json_document CHAR(5000))) location ('PurchaseOrders.dmp')) reject limit unlimited; 10 Copyright © 2021, Oracle and/or its affiliates
  • 11. • Mit Klausel XMLTAG sind auchTeildokumente eines XML Dokuments im Zugriff Zugriff auf XML Daten create table ext_xml (xml_text VARCHAR2(2000)) organization external (type oracle_loader default directory home access parameters (records XMLTAG ("DepartmentName", "employeeName") readsize 1024 skip 0 fields notrim missing field values are null) location ('emp.xml')) reject limit unlimited; SQL> select * from ext_xml; XML_TEXT ------------------------------------------- <DepartmentName>ACCOUNTING</DepartmentName> <employeeName>CLARK</employeeName> <employeeName>MILLER</employeeName> <employeeName>KING</employeeName> <DepartmentName>RESEARCH</DepartmentName> <employeeName>JONES</employeeName> <employeeName>SCOTT</employeeName> <employeeName>SMITH</employeeName> <employeeName>ADAMS</employeeName> <employeeName>FORD</employeeName> <DepartmentName>SALES</DepartmentName> <employeeName>WARD</employeeName> <employeeName>MARTIN</employeeName> <employeeName>BLAKE</employeeName> <employeeName>JAMES</employeeName> <employeeName>ALLEN</employeeName> <employeeName>TURNER</employeeName> <DepartmentName>OPERATIONS</DepartmentName> 11 Copyright © 2021, Oracle and/or its affiliates
  • 12. ExternalTable für große Datenmengen und für Performance • Partitionierung von ExternalTables über Range, List, Composite Range und Composite List  MöglicheAccessTreiber sind ORACLE_LOADER, ORACLE_HIVE und ORACLE_HDFS • Location-Klausel mitWildcards  Beispiel: LOCATION (home:'cust_m*.csv') • Beim Entladen von Daten mit ORACLE_DATAPUMP die Daten jetzt auch komprimiert  Beispiel: ACCESS PARAMETERS (COMPRESSION ENABLED HIGH) • In-Memory Column Store Support 12 Copyright © 2021, Oracle and/or its affiliates
  • 13. Beispiel mit List Partitionierung create table ext_part (last_name varchar2(25), gender varchar2(1), city varchar2(50), birth_year number) organization external ( type ORACLE_LOADER default directory home access parameters ( records delimited by NEWLINE fields terminated by ';' optionally enclosed BY '“’ missing field values are null) ) reject limit unlimited PARTITION BY LIST (gender) ( PARTITION part_f VALUES ('F') location (home:'cust_f.csv'), PARTITION part_m VALUES ('M') location (home:'cust_m.csv')); 13 Copyright © 2021, Oracle and/or its affiliates
  • 14. • Verwendung in EE möglich ab 19.12 • https://docs.oracle.com/en/database/oracle/oracle-database/19/dblic/Licensing-Information.html#GUID- 0F9EB85D-4610-4EDF-89C2-4916A0E7AC87 • 18c: In-Memory External Tables In-Memory Column Store Support 14 Copyright © 2021, Oracle and/or its affiliates
  • 15. In-Memory Column Store Support create table sales_ext_inmem ( first_name varchar2(30), last_name varchar2(30), hiredate date, department_name varchar2(30), city varchar2(30), street_address varchar2(30)) organization external ( type ORACLE_LOADER default directory home_dir access parameters ( records delimited by newline nobadfile nologfile fields date_format date mask "dd.mm.yy") location ('employees.csv')) reject limit unlimited INMEMORY; SQL> alter system set QUERY_REWRITE_INTEGRITY=stale_tolerated; SQL> exec dbms_inmemory.populate('SCOTT', 'SALES_EXT_INMEM'); • 18c: In-Memory ExternalTables • Restrictions for In-Memory ExternalTables 15 Copyright © 2021, Oracle and/or its affiliates
  • 16. External Tables in der Cloud
  • 17. • Was benötigt man: • DBMS_CLOUD Package • Zugriff auf Object Store und URI  UnterstützteObject Stores sindOCI Object Store, Azure Blob Storage, Amazon S3, Amazon S3-Compatible (Oracle Cloud Infrastructure Object Storage, Google Cloud Storage undWasabi Hot Cloud Storage • Cloud Credential ExternalTables und Autonomous Database 17 Copyright © 2021, Oracle and/or its affiliates
  • 18. 18 • Autonomous Database: External Tables Beispiel: ExternalTable begin dbms_cloud.create_external_table( table_name =>'CHANNELS', credential_name =>'OBJ_STORE_CRED', file_uri_list =>'https://objectstorage.eu-frankfurt-1.oraclecloud.com/…/chan_v3.dat', format => json_object('ignoremissingcolumns' value 'true', 'removequotes' value 'true'), column_list => 'CHANNEL_ID NUMBER, CHANNEL_DESC VARCHAR2(100), CHANNEL_CLASS VARCHAR2(100), CHANNEL_CLASS_ID NUMBER, CHANNEL_TOTAL VARCHAR2(100), CHANNEL_TOTAL_ID NUMBER' ); end; / 3|"Direct Sales"|"Direct"|12|"Channel total"|1| 9|"Tele Sales"|"Direct"|12|"Channel total"|1| 5|"Catalog"|"Indirect"|13|"Channel total"|1| 4|"Internet"|"Indirect"|13|"Channel total"|1| 2|"Partners"|"Others"|14|"Channel total"|1| Copyright © 2021, Oracle and/or its affiliates
  • 19. • Validierung mit dbms_cloud.validate_external_table mit ausführliche Fehlermeldung in LogTabelle • Zusätzliche Formate wie CSV, JSON, komprimierte Formate wie gzip, zlib und bzip2 und Avro, ORC oder Parquet • Siehe DBMS_CLOUD Package Format Options • Oracle Autonomous Data Warehouse - Access Parquet Files in Object Stores ExternalTables und Autonomous Database – gut zu wissen format => '{"type":"parquet", "schema": "first"}' begin dbms_cloud.create_external_table ( table_name =>'sales_extended_ext', credential_name =>'OBJ_STORE_CRED', file_uri_list =>'https://../sales_extended.parquet', format =>'{"type":"parquet", "schema": "first"}' ); end; / 19 Copyright © 2021, Oracle and/or its affiliates
  • 21. • Realisierung über PL/SQL Package DBMS_CLOUD • Beispiele für die Nutzung:  CREATE_EXTERNAL_TABLE zum Erzeugen von External Tables  CREATE_HYBRID_PART_TABLE zum Erstellen eines Hybrid PartitionTables  COPY_DATA zum Datenladen aus dem Object Storage inTabellen  PUT_OBJECT zumVerlagern von Daten in einen Object Storage  LIST_OBJECTS|LIST_FILEs zum Auflisten der Objekte bzw. Dateien  DELETE_OBJECT|DELETE_FILE zum Löschen der Objekte bzw. Dateien • Ab 19c auch in Non-Autonomous und On-Premises! - ABER nicht vorinstalliert • Manuelle Installation von DBMS_CLOUD-Package und Zugriffs-Konfiguration • Siehe MOS Note mit Doc ID 2748362.1 und Patch 32527621: DBMS_CLOUD SUPPORT FOR NON-CDB ANDWRAPPED PLSQL CODE • Oracle Object Storage für alle Oracle Datenbanken mit DBMS_CLOUD Integration von Cloud Ressourcen 21 Copyright © 2021, Oracle and/or its affiliates
  • 22. 22 Beispiel 1: Auflisten select object_name, bytes from dbms_cloud.list_objects('TESTCRED','https://…/b/USBUCKET/o/'); OBJECT_NAME BYTES -------------------------------------------------- ---------- CHANNELS.gz 109 CHANNELS_test.txt 79 countries01-13_25_43.DMP 57344 cwallet.sso 6661 emp.csv 703 emp_dept_20.csv 114 emp_dept_20.exp 12288 emp_dept_30.csv 121 emp_dept_30.exp 12288 Copyright © 2021, Oracle and/or its affiliates
  • 23. Beispiel 2: Daten kopieren 23 SQL> begin dbms_cloud.copy_data( table_name => 'CHANNELS’, credential_name => 'TESTCRED’, file_uri_list => 'https://…/CHANNELS_test.txt', schema_name => 'SCOTT', format => json_object('delimiter' value '|')); end; / SQL> create table channels ( channel_id CHAR(1), channel_desc VARCHAR2(20), channel_class VARCHAR2(20)); SQL> select * from channels; C CHANNEL_DESC CHANNEL_CLASS - -------------------- -------------------- T Tele Sales Direct … Copyright © 2021, Oracle and/or its affiliates
  • 24. Beispiel 3: ExternalTables SQL> begin dbms_cloud.create_external_table( table_name => 'CHANNELS_EXT’, credential_name => 'TESTCRED', file_uri_list => 'https://…/CHANNELS.gz', format => json_object('compression' value 'auto','delimiter' value '|'), column_list => 'channel_short varchar2(1), channel_long varchar2(20), channel_class varchar2(20)'); end; / SQL> select * from channels_ext; C CHANNEL_LONG CHANNEL_CLASS - -------------------- -------------------- S Direct Sales Direct T Tele Sales Direct … • DBMS_CLOUD: Zugriff auf Object Storage aus der Oracle Datenbank - Praktische Anwendungsfälle 24 Copyright © 2021, Oracle and/or its affiliates
  • 26. 26 Datenhaltung und Organisation – „Inside, outside und Outside In” Partition Partition 2016,04,02 2016,04, 03 2016,04,01 DB Partition • Nicht nur Datenbank Tabellen oder External Tables sondern auch Hybrid Partitioned Tables  Kombination aus internen (Datenbank) und externen Partitionen  Externe Ressourcen sind Files auf Filesystem, im Hadoop Distributed File System (HDFS), im Oracle Objectstore, AWS S3 oder Azure  Use Cases:  Verschieben von nicht aktiven Partitionen in externe Dateien  Verwenden günstiger Speicheroptionen  Keine Verlagerung der Daten nötig  Big Data Queries Copyright © 2021, Oracle and/or its affiliates
  • 27. • Ausgehend von partitionierterTabelle • External Partition Attribute hinzufügen • Externe Partition hinzufügen Beispiel 1: PartitionierteTabelle umwandeln 27 create table int_ext_table ( ename varchar2(10), dname varchar2(14), deptno number) PARTITION BY LIST (deptno) (PARTITION deptno_10 VALUES (10)); alter table int_ext_table add external partition attributes ( type oracle_loader default directory ext_pl access parameters(records delimited by newline fields terminated by ';') reject limit unlimited); alter table int_ext_table add partition deptno_20 values (20) external location ('emp_dept_20.csv'); "JONES";"RESEARCH";20 "SCOTT";"RESEARCH";20 "FORD";"RESEARCH";20 "SMITH";"RESEARCH";20 "ADAMS";"RESEARCH";20 Copyright © 2021, Oracle and/or its affiliates
  • 28. • Mit CREATE TABLE • Hybrid Partitioned Tables - Lifecycle Management leicht gemacht Beispiel 2: Hybrid PartitionierteTabelle anlegen create table scott.ext_emp_dept_hybrid_1 ( ename varchar2(10), dname varchar2(14), deptno number) external partition attributes ( type oracle_loader default directory ext_pl reject limit unlimited ) PARTITION BY LIST (deptno) ( PARTITION deptno_10 VALUES (10) , -- intern PARTITION deptno_20 VALUES (20) external location ('emp_dept_20.csv')) -- extern 28 Copyright © 2021, Oracle and/or its affiliates
  • 29. • Mit DBMS_CLOUD.CREATE_HYBRID_PART_TABLE werden externe partitionierte Dateien in den unterstützten Cloud-Objektspeicherdiensten unterstützt • Oracle Cloud Infrastructure Objektspeicher • Azure Blob-Speicher • Amazon S3 - Hinweis: externe Dateien müssen im demselben Objektspeicher sein Zugriff auf Cloud-Objektspeicher BEGIN dbms_cloud.create_hybrid_part_table( table_name => 'EXT_EMP_DEPT_HYBRID_AUTO', credential_name => 'CREDENTIAL_US1', format => json_object('type' value 'CSV'), column_list => 'ename varchar2(10), dname varchar2(14), deptno number', partitioning_clause => 'partition by list (deptno) (partition deptno_30 values (30) external location (''https://…/emp_dept_30.csv''), partition deptno_20 values (20) external location (''https://…/emp_dept_20.csv''), partition deptno_10 values (10) )' -- intern ); END; 29 Copyright © 2021, Oracle and/or its affiliates
  • 30. Oracle Global Leaders Webcast: Managing 1 PB of data with Oracle Autonomous DW 30 Copyright © 2021, Oracle and/or its affiliates
  • 31. • Situation: PartitionierteTabelle • Ziel:Auslagern der Partition DEPTNO_10 • Daten einfügen Beispiel 3: Wie kann man Partitionen auslagern? create table int_ext_table ( ename varchar2(10), dname varchar2(14), deptno number(2)) PARTITION BY LIST (deptno) (PARTITION deptno_10 values (10), PARTITION deptno_20 values (20)); insert into int_ext_table select e.ename, d.dname, deptno FROM scott.dept d JOIN scott.emp e USING (deptno) where deptno in (10,20); 31 Copyright © 2021, Oracle and/or its affiliates
  • 32. • Hilfstabelle anlegen um externe Datei(en) zu erzeugen =>TYPE oracle_datapump Trick: Helper ExternalTable drop table ext_emp_dept_help; create table ext_emp_dept_help organization external ( type oracle_datapump default directory ext_pl location ('emp_dept_10.exp') ) reject limit unlimited as select ename, dname, deptno from int_ext_table PARTITION (deptno_10); • Hybrid Partitioned Tables und Lifecycle Management 32 Copyright © 2021, Oracle and/or its affiliates
  • 33. • External Partition Attribute hinzufügen • Jetzt nur noch PARTITION EXCHANGE verwenden, um die Partition auszulagern Auslagern von Partitionen alter table int_ext_table exchange partition(deptno_10) with table ext_emp_dept_help; 33 alter table int_ext_table add external partition attributes ( type oracle_datapump default directory ext_pl reject limit unlimited); Copyright © 2021, Oracle and/or its affiliates
  • 34. Mit Cloud-Objektspeicher BEGIN DBMS_CLOUD.CREATE_HYBRID_PART_TABLE ( table_name => 'EXT_EMP_DEPT_HYBRID_DP', credential_name => 'CREDENTIAL_US1', format => json_object('type' value DBMS_CLOUD.FORMAT_TYPE_DATAPUMP), column_list => 'ename varchar2(10), dname varchar2(14), deptno number', partitioning_clause => 'partition by list (deptno) ( partition deptno_30 values (30) external location ( ''https://…/emp_dept_30.exp''), partition deptno_20 values (20) external location ( ''https://…/emp_dept_20.exp''), partition deptno_10 values (10) )' ); END; / • Verwendung von Treiber ORACLE_DATAPUMP über eine spezielle FORMAT- Angabe => Konstante DBMS_CLOUD.FORMAT_TYPE_DATAPUMP 34 Copyright © 2021, Oracle and/or its affiliates
  • 35. 35 Monitoring mit Data Dictionary Views SQL> select table_name, type_name from user_external_tables; TABLE_NAME TYPE_NAME ------------------------------ ------------------------- INT_EXT_TABLE ORACLE_DATAPUMP SQL> select table_name, hybrid from user_tables where hybrid='YES'; TABLE_NAME HYB ------------------------------ --- INT_EXT_TABLE YES SQL> select table_name, type_name, default_directory_name directory, reject_limit, access_parameters from user_xternal_part_tables; TABLE_NAME TYPE_NAME DIRECTORY REJECT_LIM ACCESS_PAR ------------------------------ ------------------------- ---------- ---------- ---------- INT_EXT_TABLE ORACLE_DATAPUMP EXT_PL UNLIMITED Copyright © 2021, Oracle and/or its affiliates
  • 36. Restrictions that apply to external tables also apply to hybrid partitioned tables unless explicitly noted • No support for REFERENCE and SYSTEM partitioning methods • Only single level LIST and RANGE partitioning are supported. • No unique indexes or global unique indexes. Only partial indexes are allowed and unique indexes cannot be partial. • Only single level list partitioning is supported for HIVE. • Attribute clustering (CLUSTERING clause) is not allowed. • DML operations only on internal partitions of a hybrid partitioned table (external partitions are treated as read-only partitions) • In-memory defined on the table level only has an effect on internal partitions of the hybrid partitioned table. • No column default value • Invisible columns are not allowed. • The CELLMEMORY clause is not allowed. • SPLIT, MERGE, and MOVE maintenance operations are not allowed on external partitions. • LOB, LONG, and ADT types are not allowed. Einschränkungen – aus dem Handbuch VLDB and Partitioning Guide 36 Copyright © 2021, Oracle and/or its affiliates
  • 37. • Fragestellung: Massives Datenwachstum, aber alte Daten dürfen NICHT gelöscht werden • Lösung 1: Hybrid Partitioned Tables • Lösung 2: Partitionierte Tabellen mit gleicher Struktur verwenden – eine mit den aktuellen Daten und eine mit einer External Table zum Archivieren der Daten Idee 1) Partitionen auslagern mit External Table (Helper Tabellen) und TYPE oracle_datapump 2) External Partitionierte Tabelle (archiviert) aus den Ergebnis Dateien Kundenanforderung: Lifecycle Management 37 Copyright © 2021, Oracle and/or its affiliates
  • 38. • Ausgangslage: Partitionierte Tabelle • Partition P2018 und P2019 sollen ausgelagert werden 1. Schritt: PartitionierteTabelle create table MESSAGE_INTERNAL (id number, datum date, text clob) lob (text) store as securefile (disable storage in row) partition by range (datum) ( partition P2018 values less than(to_date('01.01.2019', 'dd.mm.yyyy')), partition P2019 values less than(to_date('01.01.2020', 'dd.mm.yyyy')), partition P2020 values less than(to_date('01.01.2021', 'dd.mm.yyyy')) ) / 38 Copyright © 2021, Oracle and/or its affiliates
  • 39. • Entladen der alten Informationen im DATAPUMP Format • Für 2018 und 2019 durchführen 2. Schritt: Auslagerung create table MESSAGE_EXTERNAL_2018 (id, datum, text) organization external ( type oracle_datapump default directory my_exp location ('message_external_2018.dmp') ) reject limit unlimited as select * from message_internal partition (p2018) / select * from message_external_2018; 39 Copyright © 2021, Oracle and/or its affiliates
  • 40. • Mit Dateien aus Schritt 2 3. Schritt: External PartitionierteTabelle für ausgelagerte Daten create table MESSAGE_EXTERNAL (id number, datum date, text clob) organization external ( type oracle_datapump default directory my_exp ) partition by range(datum) ( partition P2018 values less than(to_date('01.01.2019', 'dd.mm.yyyy’) ) location ('message_external_2018.dmp'), partition P2019 values less than(to_date('01.01.2020', 'dd.mm.yyyy’)) location ('message_external_2019.dmp') ); select * from message_external; 40 Copyright © 2021, Oracle and/or its affiliates
  • 41. Fazit Copyright © 2021, Oracle and/or its affiliates 41 ExternalTableTechnology bietet • Hohe Flexibilität • performante Zugriffe auf heterogene Daten • Lifecycle-Management verwendbar in Kombination mit Partitionierung und Cloud-Objektspeichern
  • 42. • Aktuelles im Oracle Datenbank Umfeld in deutscher Sprache  Gegliedert nach ... Neuigkeiten,Termine, Release-Stand und Patchsets, Aus dem Web • Erscheinungsdatum: Letzter Freitag im Monat – nächsterTermin am 30. April • Dauer: ca 15 Minuten • Video und PDF • https://blog.oracle.com/coretec • Youtube Monthly News • Redaktion  Frank Schneede  Detlef E. Schröder  Marcus Schröder  Ulrike Schwinn  Wolfgang Thiem  Sinan PetrusToma In eigener Sache ... Neuigkeiten mit Monthly News 42 Copyright © 2021, Oracle and/or its affiliates
  • 43. Zum Nachlesen • Grundlagen zu External Tables • External Table in 12c • 18c: In-Memory External Tables • 18c: In-Memory External Tables • Autonomous Database Services: External Tables • Hybrid Partitioned Tables - Lifecycle Management leicht gemacht • Hybrid Partitioned Tables und Lifecycle Management • Oracle Object Storage für alle Oracle Datenbanken mit DBMS_CLOUD • DBMS_CLOUD: Zugriff auf Object Storage aus der Oracle Datenbank - Praktische Anwendungsfälle • Oracle Autonomous Data Warehouse - Access Parquet Files in Object Stores Weitere Links: • https://blogs.oracle.com/coretec/ • Oracle Datenbanken Monthly News Kontakt: Ulrike.Schwinn@oracle.com @uschwinn