SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Downloaden Sie, um offline zu lesen
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Oracle12c für Entwickler 
Carsten Czarski Business Unit Database Oracle Deutschland B.V. & Co KG
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Oracle12c für Entwickler 
•Standardaufgaben schneller und einfacher: SQL und PL/SQL 32k VARCHAR2, PL/SQL WITH-Klausel, Identity Columns, OFFSET-Klausel ... 
•Neue Analysemöglichkeiten mit SQL: SQL Pattern Matching 
•Native JSON-Unterstützung in der Datenbank SQL/JSON, JSON-Indizierung und mehr 
•Unstrukturierte Daten: XML, Texte und mehr ... 
•Sichere Anwendungen mit SQL und PL/SQL Rollen für PL/SQL, Code-Based Access-Control 
•Werkzeuge und Umgebungen SQL Developer, Application Express, Oracle REST Data Services 
2
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Identity Columns 
create table tab_kunden ( id number(10) primary key name varchar2(200) : ); create sequence seq_kunden start with 1 increment by 1; 
create or replace trigger tr_pk_kunden before insert on tab_kunden for each row begin :new.id := seq_kunden.nextval; end; 
Bisher 
create table kunden_tab( id number(10) primary key generated always as identity start with 1 increment by 1, name varchar2(200) : ); 
Oracle12c
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
SQL "Row Limit" Klausel 
•Sortiere nach "SAL" aufsteigend und gib die ersten 5 Zeilen zurück 
•Sortiere nach "SAL" absteigend, überspringe 3 Zeilen und gib dann die nächsten drei Zeilen zurück 
SELECT empno, ename, sal FROM emp ORDER BY sal ASC FETCH FIRST 5 ROWS ONLY; 
SELECT empno, ename, sal FROM emp ORDER BY sal DESC OFFSET 3 ROWS FETCH FIRST 3 ROWS ONLY; 
( SELECT rownum zeile, empno, ename, sal FROM ( SELECT empno, ename, sal FROM emp ORDER BY sal DESC ) ) WHERE zeile BETWEEN 4 AND 6; 
( SELECT empno, ename, sal FROM emp ORDER BY sal DESC ) WHERE rownum <= 5;
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
VARCHAR-Spalten nun bis 32K 
•Grenze damit analog zu PL/SQL 
•Verwendung aller SQL-Funktionen möglich 
•Einmaliger Setup der Datenbank erforderlich (mit dem DBA) 
create table TAB_KUNDEN ( 
id number generated as identity, 
first_name varchar2(30), 
last_name varchar2(30), 
first_order date, kommentare varchar2(32767) );
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
PL/SQL WITH Klausel 
WITH FUNCTION get_domain(url VARCHAR2) RETURN VARCHAR2 IS pos BINARY_INTEGER; len BINARY_INTEGER; BEGIN pos := INSTR(url, 'www.'); len := INSTR(SUBSTR(url, pos + 4), '.') - 1; RETURN SUBSTR(url, pos + 4, len); END; SELECT DISTINCT get_domain(catalog_url) FROM orders; 
•Die Funktion existiert nur für diese SQL-Abfrage 
•Keine Persistenz im Data Dictionary
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Oracle12c für den Entwickler 
Neue Analysemöglichkeiten: SQL Pattern Matching 
7
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
SQL Pattern Matching 
•Finde "Double Bottoms" im Kursverlauf einer Aktie 
•Wann beginnt das Muster? 
•Wann endet das Muster? 
•Welcher Aktienkurs? 
•Muster innerhalb einer Woche? 
Tage 
Aktienkurs 
X 
Y 
W 
Z 
SELECT first_x, last_z 
FROM ticker MATCH_RECOGNIZE ( 
PARTITION BY name ORDER BY time 
MEASURES FIRST(x.time) AS first_x 
LAST(z.time) AS last_z 
ONE ROW PER MATCH 
PATTERN (X+ Y+ W+ Z+) 
DEFINE X AS (price < PREV(price)) 
Y AS (price > PREV(price)) 
W AS (price < PREV(price)) 
Z AS (price > PREV(price)) 
FIRST_X 
LAST_Z 
1 
9 
13 
19
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
SQL Pattern Matching 
•Ein weiteres Beispiel: Apache-Logdatei als externe Tabelle:w 
select * from exttab_webserver_log; 
CLIENT_IP ZEITSTEMPEL REQUEST HTTP_CODE 
--------------- -------------------- -------------------- --------- 
10.165.251.50 2011-04-20 14:30:10 POST /pls/htmld ... 200 
129.157.43.110 2011-04-20 14:30:34 POST /pls/htmld ... 200 
10.175.6.99 2011-04-20 14:30:46 GET /pls/htmldb ... 301 
10.175.6.99 2011-04-20 14:30:46 GET /pls/htmldb ... 200 
10.165.251.50 2011-04-20 14:30:59 GET /pls/htmldb ... 301 
10.165.251.50 2011-04-20 14:30:59 GET /pls/htmldb ... 200 
: : : : 
Skript zum Erzeugen: https://apex.oracle.com/pls/apex/GERMAN_COMMUNITIES.SHOW_TIPP?P_ID=941#patternmatch
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
SQL Pattern Matching: Ein Beispiel 
CLIENT_IP ZEITSTEMPEL HTTP_CODE CONTENT_LENGTH REQUEST -------------------- ---------------------------------------- ---------- -------------- ----------------------------------------------------------------------------------- 10.165.251.50 20.04.11 15:16:57,000000 +02:00 200 286 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.175.6.99 20.04.11 15:17:00,000000 +02:00 301 383 GET /pls/htmldb/ical HTTP/1.1 ... 10.165.251.50 20.04.11 15:17:00,000000 +02:00 200 17277 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.175.6.99 20.04.11 15:17:00,000000 +02:00 200 43293 GET /pls/htmldb/ical HTTP/1.1 ... 10.165.251.50 20.04.11 15:17:11,000000 +02:00 200 27166 GET /pls/htmldb/f?p=4350:22:859015072291276::NO::: HTTP/1.1 ... 10.165.251.50 20.04.11 15:17:15,000000 +02:00 200 32520 GET /pls/htmldb/f?p=4350:26:859015072291276::NO:RP:: HTTP/1.1 ... 10.165.251.50 20.04.11 15:17:17,000000 +02:00 200 41997 GET /pls/htmldb/f?p=4350:29:859015072291276::NO:RIR:IR_FLOW_ID:180 HTTP/1.1 ... 10.165.251.50 20.04.11 15:17:19,000000 +02:00 200 2622 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:17:23,000000 +02:00 200 2622 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.175.15.142 20.04.11 15:17:23,000000 +02:00 301 383 GET /pls/htmldb/ical HTTP/1.1 ... 10.165.253.101 20.04.11 15:17:23,000000 +02:00 200 867 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.175.15.142 20.04.11 15:17:24,000000 +02:00 200 43293 GET /pls/htmldb/ical HTTP/1.1 ... 10.175.26.93 20.04.11 15:17:46,000000 +02:00 200 867 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:06,000000 +02:00 200 17292 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:12,000000 +02:00 200 22509 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.174.237.145 20.04.11 15:18:12,000000 +02:00 200 43293 GET /pls/htmldb/ical HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:22,000000 +02:00 302 43 POST /pls/htmldb/wwv_flow.accept HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:22,000000 +02:00 200 42002 GET /pls/htmldb/f?p=4350:29:859015072291276::NO::: HTTP/1.1 ... 10.165.253.101 20.04.11 15:18:23,000000 +02:00 200 867 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:25,000000 +02:00 200 2622 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:33,000000 +02:00 200 12233 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:41,000000 +02:00 302 43 POST /pls/htmldb/wwv_flow.accept HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:41,000000 +02:00 200 31726 GET /pls/htmldb/f?p=4350:29:859015072291276::NO::: HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:44,000000 +02:00 200 11623 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:46,000000 +02:00 200 2622 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.175.26.93 20.04.11 15:18:46,000000 +02:00 200 867 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:48,000000 +02:00 200 23122 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:56,000000 +02:00 301 368 GET / HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:56,000000 +02:00 301 400 GET / HTTP/1.1 ... 10.165.251.50 20.04.11 15:19:09,000000 +02:00 301 389 GET /kalender HTTP/1.1 ... 10.165.251.50 20.04.11 15:19:09,000000 +02:00 200 869 GET /pls/htmldb/f?p=180:3 HTTP/1.1 ... 10.165.251.50 20.04.11 15:19:19,000000 +02:00 200 34224 GET /pls/htmldb/f?p=180:3:3267683042998608 HTTP/1.1 ... 10.165.253.101 20.04.11 15:19:23,000000 +02:00 200 867 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ...
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
SQL Pattern Matching: Ein Beispiel 
select p.client_ip, p.session_id, p.start_tstamp, p.cnt_clicks 
from exttab_webserver_log 
MATCH_RECOGNIZE ( 
PARTITION BY client_ip 
ORDER BY zeitstempel asc 
MEASURES 
strt.zeitstempel AS start_tstamp, 
MATCH_NUMBER() AS session_id, 
FINAL COUNT(zeitstempel) AS cnt_clicks 
ONE ROW PER MATCH 
AFTER MATCH SKIP PAST LAST ROW 
PATTERN (strt nxt+) 
DEFINE 
nxt AS nxt.zeitstempel < (PREV(nxt.zeitstempel) + interval '300' second) 
) p 
order by client_ip, start_tstamp;
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Oracle12c für den Entwickler 
Native JSON Unterstützung in der Datenbank 
12
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
JSON: JavaScript Object Notation 
•Sehr einfaches Datenaustauschformat 
•Einfachere Konzepte als XML 
•Basiert auf JavaScript-Code 
•Javascript auch auf Server wichtig: node.js 
•Breite Unterstützung durch Web-APIs 
–Google, Twitter, Facebook & Co 
•Setzt sich mehr und mehr durch 
{ "PONumber" : 1600, "Reference" : "ABULL-20140421“, "Requestor" : "Alexis Bull“, "User" : "ABULL“, "CostCenter" : "A50“, "ShippingInstructions" : { "name" : "Alexis Bull“, "Address" : { ... }, "Phone" : [ ... ] }, "Special Instructions" : null, "AllowPartialShipment" : true, "LineItems" : [{ "ItemNumber" : 1, "Part" : { "Description" : "One Magic Christmas“, "UnitPrice" : 19.95, "UPCCode" : 13131092899 }, "Quantity" : 9 }, {…} ] }
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Flexible Entwicklung mit JSON 
•Agilität und "Continous Delivery" 
–Änderungen an Datenstrukturen immer häufiger und flexibler 
–Lange Zyklen für Schema-Änderungen werden immer weniger akzeptiert 
•Ansatz: Ablage als JSON und Parsing zur Query Zeit 
–Einfache Ablage der JSON-Dokumente in einem 'Document Store' 
–Parsing zur Abfragezeit – fehlende Attribute "fehlen dann einfach" 
–NoSQL-Datenbanken, Hadoop Cluster 
Security ...? IT Betrieb ...? Replikation ...? Funktionsbibliothek ...? Relationale Applikationen ...?
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Relationale Tabellen bleiben wichtig. Auf das Zusammenspiel kommt es an. 
15
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
JSON and SQL Duality 
JSON 
Datenzugriff per REST oder Native API 
JSON wird in der Datenbank gespeichert 
Analysen / Queries per SQL 
Oracle Database 12c 
SQL
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Native JSON Unterstützung in der Oracle Datenbank 
JSON Dokumente speichern und verwalten 
•JSON als Text speichern (VARCHAR2, CLOB, BLOB)  Ohne Schema - volle Flexibilität 
•Kein eigener Datentyp: Nutzung der Standard-Datentypen für Zeichenketten bzw. Binärdaten 
•Indizierung mit einem 'JSON aware' Index 
API Zugriff auf JSON 
•REST Services 
•Java API (weitere Programmiersprachen in Planung) 
SQL Abfragen direkt auf JSON-Dokumente 
Reporting, Analyse und relationaler Zugriff direkt auf JSON-Dokumente 
'JSON and SQL duality' 
17 
JSON ermöglicht schemalose Datenhaltung 
in der Oracle-Datenbank ... 
... aber komplett integriert mit der relationalen Welt!
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
SQL Queries auf JSON-Dokumente: JSON Table 
18
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
SQL Beispiel: JSON_TABLE 
19 
select reference, requestor, costcenter from po_json, json_table( json, '$.PurchaseOrder' columns ( reference varchar2(30) path '$.Reference', requestor varchar2(25) path '$.Requestor', costcenter varchar2(4) path '$.CostCenter' ) ) /
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
JSON_TABLE für relationale Sichten auf JSON 
20 
REFERENCE REQUESTOR COST 
--------------------------- ------------------ ---- 
FORD-20021009123336872PDT Gerry B. Ford R20 
JONES-20011127121050471PST Richard J Jones R20 
MARTIN-20011127121050401PST Thomas D. Martin S30 
CLARK-20021009123337764PDT Edward K. Clark A10 
JONES-20011127121042590PST Richard J Jones R20 
MARTIN-20011127121040547PST Thomas D. Martin S30 
JONES-20021009123336602PDT Richard J Jones R20 
WARD-20011127121050511PST Stephen B. Ward S30 
BLAKE-20011127121055689PST David E. Blake S30 
MARTIN-20011127121048889PST Thomas D. Martin S30 
: : :
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Oracle12c für den Entwickler 
Unstrukturierte Daten: Dokumente, XML und mehr ... 
21
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Dokumente, XML und unstrukturierte Daten 
• XML DB ist nun integraler Bestandteil der Datenbank 
• Unterstützung der jüngsten Standards 
XQuery-Update, XQuery-Fulltext 
• Performance-Optimierungen 
XDB Performance, Oracle TEXT Near Real Time Indexing 
• Oracle TEXT im Detail 
Automatische Spracherkennung, Pattern Stopclass, 
NEAR und "Mild Not" Operator und mehr ..
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
XQuery Fulltext: Setup 
•Es ist nach wie vor ein Oracle TEXT Index nötig 
•Erstellen mit PATH_SECTION_GROUP und XML_ENABLE=TRUE 
begin ctx_ddl.create_section_group('my_sg_xquery', 'PATH_SECTION_GROUP'); ctx_ddl.set_sec_grp_attr('my_sg_xquery', 'xml_enable', 'true'); end; / sho err create index ft_tabxml on tab_xml (docs) indextype is ctxsys.context parameters ('section group my_sg_xquery') /
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
XQuery Fulltext: Abfragen 
•Nutzung von XMLExists und XQuery-Syntax 
•Oracle TEXT CONTAINS wird hier nicht genutzt 
•XMLExists ist eine Funktion der XMLDB 
•Kombination mit anderen XQuery-Konstrukten möglich 
SELECT id 
FROM tab_xml 
WHERE XMLExists('declare namespace ns="http://mynamespaces.com/ns2"; 
//ns:tag[. contains text "text"]' 
PASSING docs)
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Oracle12c für den Entwickler 
Sichere Anwendungen mit SQL und PL/SQL 
25
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Zugriff auf PL/SQL Objekte in Oracle12c 
•Einem PL/SQL-Objekt können nun Rollen zugewiesen werden 
–Erlaubt wesentlich bessere Rechte / Rollenkonzepte 
•ACCESSIBLE BY-Klausel verhindert direkten Aufruf eines Objektes 
–Verhindern des direkten Aufrufs von "Helper Packages" 
grant {role} to function meine_funktion; 
create or replace package pkg_helper accessible by {other plsql object} is : end pkg_helper;
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Daten maskieren: Data Redaction 
•Maskierung der Ergebnisse(!) einer SQL-Abfrage 
–Abfragen formulieren wie gewohnt 
–Alle WHERE-Bedingungen sind möglich – Indizes werden genutzt 
–Ergebnisausgabe teilweise oder vollständig maskiert 
•Hilfreich für den Anwendungsentwickler 
–Maskierung sensibler Daten in der Anwendungsmasken Kreditkartennummern, Geburtsdatum, etc. 
–Sicherstellung einheitlicher Maskierungen durch Hinterlegen in der Datenbank  Bspw. "Immer die letzten 4 Stellen" 
•Lizenz der Advanced Security Option erforderlich
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Data Redaction 
SQL> select * from emp where ename like 'M%' ; 
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO 
----- ---------- --------- ----- ------------------- ----- ----- ------ 
7654 ***TIN SALESMAN 7698 28.09.1981 00:00:00 1250 1400 30 
7934 ***LER CLERK 7782 23.01.1982 00:00:00 1300 10 
2 Zeilen ausgewählt.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Data Redaction: So geht's 
BEGIN 
DBMS_REDACT.ADD_POLICY( 
object_schema => 'SCOTT', 
object_name => 'EMP', 
column_name => 'ENAME', 
policy_name => 'redact_ename', 
function_type => DBMS_REDACT.REGEXP, 
expression => '1=1', 
regexp_pattern => '(...)(.*)', 
regexp_replace_string => '***2', 
regexp_position => DBMS_REDACT.RE_BEGINNING, 
regexp_occurrence => 0, 
regexp_match_parameter => 'i'); 
END; 
/
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Flashback Data Archives für alle 
•Erweiterung der Flashback Query 
–Eingeführt mit Oracle11g als Total Recall Option 
–Capture der UNDO-Informationen in Flashback Data Archives 
–Abfragen "in die Vergangenheit" nahezu unbegrenzt möglich 
•Ab Oracle12.1 und 11.2.0.4 
–Flashback Data Archives ohne Data Optimization: Alle Editionen 
–Flashback Data Archives mit Data Optimization: Adv. Compression Option (Partitionierung, Komprimierung)
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Flashback Data Archives für alle! 
•Klausel NO OPTIMIZE DATA stellt lizenzfreie Nutzung sicher 
•Ab 12.1 und 11.2.0.4 (Patchset) 
create flashback archive FDBA_MYDATA_1Y_USERS tablespace users quota 100G retention 1 year no optimize data; alter table EMP flashback archive FDBA_MYDATA_1Y_USERS; 
Data Optimization besonders bei großen Archiven (Transaktionslast) sehr empfehlenswert. Advanced Compression Option
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Oracle12c für den Entwickler 
Werkzeuge und Umgebungen 
32
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Oracle12c für Entwickler Die Datenbank für alle wichtigen Plattformen 
JSON 
Ruby 
Oracle ADF 
Oracle APEX 
Oracle RDS
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Oracle REST Data Services (aka 'APEX Listener') 
•Datenbankzugriffe ohne SQL: RESTful Services 
–Standardprotokoll: HTTP GET, POST, PUT, DELETE 
–Anwendungsentwicklung ohne SQL – und ohne spezielle Treiber 
•Sehr nah an JavaScript 
–Austauschformat typischerweise JSON
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Oracle REST Data Services: Architektur 
35 
URI 
Oracle REST Data Services 
{JSON} 
Pass Back 
Auto Generated SQL 
{JSON} 
Transform to JSON 
SQL 
SQL Result Set 
PassBack 
Key Value Lookup 
{JSON} 
Map & Bind 
JSON Collection API 
NoSQL API 
HTTP(S) client 
JSON Document Store 
Relationale Tabellen 
NoSQL-Daten
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Application Express 5.0 
•Derzeit in der Early Adopter Phase (EA2) 
•Page Designer  http://new.livestream.com/ODTUG/APEXPageDesigner 
•Universal Theme, Theme Styles and Options, Font Awesome 
•Verbessertes File-Handling 
•Neue PL/SQL-Pakete: APEX_ZIP, APEX_JSON 
•Viele kleinere Verbesserungen im Detail
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
APEX 5.0 Page Designer
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
APEX 5.0 – Universal Theme 
•HTML5, CSS3, Responsive Design 
•Template Options: UI-Features ein-und ausschalten 
•Theme Styles: Ein Theme – mehrere Ausprägungen 
•Eigene Theme Styles möglich 
–Selbst erstellte CSS-Dateien oder 
–ThemeRoller (Ankündigung KScope14)
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
APEX 5.0 – PL/SQL-Paket APEX_ZIP
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Oracle SQL Developer 
40
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Informationen in deutscher Sprache 
•Communities 
–APEX Community 
–DBA Community 
–Linux und Virtualisierung 
–Exadata Community 
•Veranstaltungen 
–http://tinyurl.com/odd12c
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Nutzen Sie Ihre Datenbank voll aus ...? 
Analytic SQL XML Verarbeitung Mobile Applications (APEX) Java in the Database Fuzzy Search Location Data Flashback Query Linguistische Funktionen Native Webservices Image Processing (MultiMedia) PL/SQL Volltextsuche Pipelined Functions
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Carsten.Czarski@oracle.com 
http://tinyurl.com/apexcommunity 
http://sql-plsql-de.blogspot.com 
http://plsqlexecoscomm.sourceforge.net http://plsqlmailclient.sourceforge.net Twitter: @cczarski @oraclebudb

Weitere ähnliche Inhalte

Was ist angesagt?

Streaming Plattformen und die Qual der Wahl
Streaming Plattformen und die Qual der WahlStreaming Plattformen und die Qual der Wahl
Streaming Plattformen und die Qual der WahlMatthias Niehoff
 
Oracle Text 12c New Features
Oracle Text 12c New FeaturesOracle Text 12c New Features
Oracle Text 12c New FeaturesUlrike 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
 
Webinar DynamoDB deutsch
Webinar DynamoDB deutschWebinar DynamoDB deutsch
Webinar DynamoDB deutschAWS Germany
 
PureSQL APEX Connect
PureSQL APEX ConnectPureSQL APEX Connect
PureSQL APEX ConnectTrivadis
 
Sesam (APEX) Öffne Dich
Sesam (APEX) Öffne DichSesam (APEX) Öffne Dich
Sesam (APEX) Öffne DichOliver Lemm
 
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
 
DOAG Webinar Oracle und Docker
DOAG Webinar Oracle und DockerDOAG Webinar Oracle und Docker
DOAG Webinar Oracle und DockerStefan Oehrli
 
Oracle workshop sessiontracing
Oracle workshop sessiontracingOracle workshop sessiontracing
Oracle workshop sessiontracingciganek
 
Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)
Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)
Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)Ulrike Schwinn
 

Was ist angesagt? (12)

Streaming Plattformen und die Qual der Wahl
Streaming Plattformen und die Qual der WahlStreaming Plattformen und die Qual der Wahl
Streaming Plattformen und die Qual der Wahl
 
Oracle TEXT
Oracle TEXTOracle TEXT
Oracle TEXT
 
Oracle Text 12c New Features
Oracle Text 12c New FeaturesOracle Text 12c New Features
Oracle Text 12c New Features
 
Ausgewählte PL/SQL Packages (2)
Ausgewählte PL/SQL Packages (2)Ausgewählte PL/SQL Packages (2)
Ausgewählte PL/SQL Packages (2)
 
Oracle und Docker
Oracle und DockerOracle und Docker
Oracle und Docker
 
Webinar DynamoDB deutsch
Webinar DynamoDB deutschWebinar DynamoDB deutsch
Webinar DynamoDB deutsch
 
PureSQL APEX Connect
PureSQL APEX ConnectPureSQL APEX Connect
PureSQL APEX Connect
 
Sesam (APEX) Öffne Dich
Sesam (APEX) Öffne DichSesam (APEX) Öffne Dich
Sesam (APEX) Öffne Dich
 
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
 
DOAG Webinar Oracle und Docker
DOAG Webinar Oracle und DockerDOAG Webinar Oracle und Docker
DOAG Webinar Oracle und Docker
 
Oracle workshop sessiontracing
Oracle workshop sessiontracingOracle workshop sessiontracing
Oracle workshop sessiontracing
 
Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)
Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)
Überblick: 18c und Autonomous Data Warehouse Cloud (ADWC)
 

Andere mochten auch

Cs ppt it 140210116041
Cs ppt it 140210116041Cs ppt it 140210116041
Cs ppt it 140210116041Jay Usdadiya
 
CS PPT 140210116051-54
CS PPT 140210116051-54CS PPT 140210116051-54
CS PPT 140210116051-54Jay Usdadiya
 
interview of a contributor
interview of a contributorinterview of a contributor
interview of a contributorJay Usdadiya
 
Probne zno 2015_jpeg
Probne zno 2015_jpegProbne zno 2015_jpeg
Probne zno 2015_jpegstepenevag
 
Probne zno 2015_jpeg
Probne zno 2015_jpegProbne zno 2015_jpeg
Probne zno 2015_jpegstepenevag
 
The Basis of Biblical Parenting
 The Basis of Biblical Parenting The Basis of Biblical Parenting
The Basis of Biblical Parentingkikiks
 
CS PPT 140210116026-30
CS PPT 140210116026-30CS PPT 140210116026-30
CS PPT 140210116026-30Jay Usdadiya
 
Definition and Nature of Family
Definition and Nature of FamilyDefinition and Nature of Family
Definition and Nature of Familykikiks
 
Coca cola Brand Management
Coca cola Brand ManagementCoca cola Brand Management
Coca cola Brand ManagementC1K012043
 

Andere mochten auch (14)

Cs ppt it 140210116041
Cs ppt it 140210116041Cs ppt it 140210116041
Cs ppt it 140210116041
 
Coke cases
Coke casesCoke cases
Coke cases
 
CS PPT 140210116051-54
CS PPT 140210116051-54CS PPT 140210116051-54
CS PPT 140210116051-54
 
interview of a contributor
interview of a contributorinterview of a contributor
interview of a contributor
 
interview cpd
interview cpdinterview cpd
interview cpd
 
(interviewCPD)
(interviewCPD)(interviewCPD)
(interviewCPD)
 
מצגת לארגון
מצגת לארגוןמצגת לארגון
מצגת לארגון
 
Probne zno 2015_jpeg
Probne zno 2015_jpegProbne zno 2015_jpeg
Probne zno 2015_jpeg
 
Probne zno 2015_jpeg
Probne zno 2015_jpegProbne zno 2015_jpeg
Probne zno 2015_jpeg
 
The Basis of Biblical Parenting
 The Basis of Biblical Parenting The Basis of Biblical Parenting
The Basis of Biblical Parenting
 
CS PPT 140210116026-30
CS PPT 140210116026-30CS PPT 140210116026-30
CS PPT 140210116026-30
 
Definition and Nature of Family
Definition and Nature of FamilyDefinition and Nature of Family
Definition and Nature of Family
 
GTDMC Company Profile
GTDMC Company ProfileGTDMC Company Profile
GTDMC Company Profile
 
Coca cola Brand Management
Coca cola Brand ManagementCoca cola Brand Management
Coca cola Brand Management
 

Ähnlich wie Oracle12c für Entwickler

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
 
REST mit APEX 18.1
REST mit APEX 18.1REST mit APEX 18.1
REST mit APEX 18.1Oliver Lemm
 
Datenbank-Hausputz für Einsteiger
Datenbank-Hausputz für EinsteigerDatenbank-Hausputz für Einsteiger
Datenbank-Hausputz für EinsteigerMarkus Flechtner
 
Pure SQL for batch processing
Pure SQL for batch processingPure SQL for batch processing
Pure SQL for batch processingAndrej Pashchenko
 
20160310_ModernApplicationDevelopment_NoSQL_KPatenge
20160310_ModernApplicationDevelopment_NoSQL_KPatenge20160310_ModernApplicationDevelopment_NoSQL_KPatenge
20160310_ModernApplicationDevelopment_NoSQL_KPatengeKarin Patenge
 
Ist GraphQL das bessere REST
Ist GraphQL das bessere RESTIst GraphQL das bessere REST
Ist GraphQL das bessere RESTMartin Abraham
 
Oracle Performance-Analyse mit frei verfügbaren Mitteln
Oracle Performance-Analyse mit frei verfügbaren Mitteln Oracle Performance-Analyse mit frei verfügbaren Mitteln
Oracle Performance-Analyse mit frei verfügbaren Mitteln OPITZ CONSULTING Deutschland
 
Big Data Community Webinar vom 16. Mai 2019: Oracle NoSQL DB im Überblick
Big Data Community Webinar vom 16. Mai 2019: Oracle NoSQL DB im ÜberblickBig Data Community Webinar vom 16. Mai 2019: Oracle NoSQL DB im Überblick
Big Data Community Webinar vom 16. Mai 2019: Oracle NoSQL DB im ÜberblickKarin Patenge
 
Tipps & Tricks zum Aufbau einer Unternehmenscloud mit CC13
Tipps & Tricks zum Aufbau einer Unternehmenscloud mit CC13Tipps & Tricks zum Aufbau einer Unternehmenscloud mit CC13
Tipps & Tricks zum Aufbau einer Unternehmenscloud mit CC13OPITZ CONSULTING Deutschland
 
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
 
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAsKarin Patenge
 
What's new in SQL und PL/SQL in 12.2
What's new in SQL und PL/SQL in 12.2What's new in SQL und PL/SQL in 12.2
What's new in SQL und PL/SQL in 12.2Ulrike Schwinn
 
Oracle12c threaded execution - Ressourcen sparen zum Nulltarif?!?
Oracle12c threaded execution - Ressourcen sparen zum Nulltarif?!?Oracle12c threaded execution - Ressourcen sparen zum Nulltarif?!?
Oracle12c threaded execution - Ressourcen sparen zum Nulltarif?!?Trivadis
 
DWX 2016 -Build and Release Management
DWX 2016 -Build and Release ManagementDWX 2016 -Build and Release Management
DWX 2016 -Build and Release ManagementMarc Müller
 
Oracle Database 12c Release 2
Oracle Database 12c Release 2 Oracle Database 12c Release 2
Oracle Database 12c Release 2 oraclebudb
 
Ü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
 
Best Practices SharePoint and SQL Installation
Best Practices SharePoint and SQL InstallationBest Practices SharePoint and SQL Installation
Best Practices SharePoint and SQL InstallationSamuel Zürcher
 
SCA und SDO: Konzepte und Design - OPITZ CONSULTING - Maier - Winterberg
SCA und SDO: Konzepte und Design - OPITZ CONSULTING - Maier - WinterbergSCA und SDO: Konzepte und Design - OPITZ CONSULTING - Maier - Winterberg
SCA und SDO: Konzepte und Design - OPITZ CONSULTING - Maier - WinterbergOPITZ CONSULTING Deutschland
 

Ähnlich wie Oracle12c für Entwickler (20)

APEX 5.1 - Architektur, Installation & Betrieb
APEX 5.1 - Architektur, Installation & BetriebAPEX 5.1 - Architektur, Installation & Betrieb
APEX 5.1 - Architektur, Installation & Betrieb
 
REST mit APEX 18.1
REST mit APEX 18.1REST mit APEX 18.1
REST mit APEX 18.1
 
Datenbank-Hausputz für Einsteiger
Datenbank-Hausputz für EinsteigerDatenbank-Hausputz für Einsteiger
Datenbank-Hausputz für Einsteiger
 
Pure SQL for batch processing
Pure SQL for batch processingPure SQL for batch processing
Pure SQL for batch processing
 
20160310_ModernApplicationDevelopment_NoSQL_KPatenge
20160310_ModernApplicationDevelopment_NoSQL_KPatenge20160310_ModernApplicationDevelopment_NoSQL_KPatenge
20160310_ModernApplicationDevelopment_NoSQL_KPatenge
 
Ist GraphQL das bessere REST
Ist GraphQL das bessere RESTIst GraphQL das bessere REST
Ist GraphQL das bessere REST
 
Oracle Performance-Analyse mit frei verfügbaren Mitteln
Oracle Performance-Analyse mit frei verfügbaren Mitteln Oracle Performance-Analyse mit frei verfügbaren Mitteln
Oracle Performance-Analyse mit frei verfügbaren Mitteln
 
Big Data Community Webinar vom 16. Mai 2019: Oracle NoSQL DB im Überblick
Big Data Community Webinar vom 16. Mai 2019: Oracle NoSQL DB im ÜberblickBig Data Community Webinar vom 16. Mai 2019: Oracle NoSQL DB im Überblick
Big Data Community Webinar vom 16. Mai 2019: Oracle NoSQL DB im Überblick
 
Tipps & Tricks zum Aufbau einer Unternehmenscloud mit CC13
Tipps & Tricks zum Aufbau einer Unternehmenscloud mit CC13Tipps & Tricks zum Aufbau einer Unternehmenscloud mit CC13
Tipps & Tricks zum Aufbau einer Unternehmenscloud mit CC13
 
Ausgewählte PL/SQL Packages (3)
Ausgewählte PL/SQL Packages (3)Ausgewählte PL/SQL Packages (3)
Ausgewählte PL/SQL Packages (3)
 
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs
20190604_DOAGDatabase2019_OracleNoSQLDB_for_DBAs
 
What's new in SQL und PL/SQL in 12.2
What's new in SQL und PL/SQL in 12.2What's new in SQL und PL/SQL in 12.2
What's new in SQL und PL/SQL in 12.2
 
Performance-Analyse mit Bordmitteln
Performance-Analyse mit BordmittelnPerformance-Analyse mit Bordmitteln
Performance-Analyse mit Bordmitteln
 
Oracle12c threaded execution - Ressourcen sparen zum Nulltarif?!?
Oracle12c threaded execution - Ressourcen sparen zum Nulltarif?!?Oracle12c threaded execution - Ressourcen sparen zum Nulltarif?!?
Oracle12c threaded execution - Ressourcen sparen zum Nulltarif?!?
 
DWX 2016 -Build and Release Management
DWX 2016 -Build and Release ManagementDWX 2016 -Build and Release Management
DWX 2016 -Build and Release Management
 
Oracle Database 12c Release 2
Oracle Database 12c Release 2 Oracle Database 12c Release 2
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
Überblick zu Oracle Database 12c Release 2
 
Best Practices SharePoint and SQL Installation
Best Practices SharePoint and SQL InstallationBest Practices SharePoint and SQL Installation
Best Practices SharePoint and SQL Installation
 
Vorlesung SOA - DIS AG.pptx
Vorlesung SOA - DIS AG.pptxVorlesung SOA - DIS AG.pptx
Vorlesung SOA - DIS AG.pptx
 
SCA und SDO: Konzepte und Design - OPITZ CONSULTING - Maier - Winterberg
SCA und SDO: Konzepte und Design - OPITZ CONSULTING - Maier - WinterbergSCA und SDO: Konzepte und Design - OPITZ CONSULTING - Maier - Winterberg
SCA und SDO: Konzepte und Design - OPITZ CONSULTING - Maier - Winterberg
 

Mehr von oraclebudb

Oracle Technology Monthly Oktober 2017
Oracle Technology Monthly Oktober 2017Oracle Technology Monthly Oktober 2017
Oracle Technology Monthly Oktober 2017oraclebudb
 
Oracle Datenbank Manageability
Oracle Datenbank ManageabilityOracle Datenbank Manageability
Oracle Datenbank Manageabilityoraclebudb
 
Zeros Data Loss Recovery Appliance (ZDLRA) - Neue Wege für Backup und Recovery
Zeros Data Loss Recovery Appliance (ZDLRA) - Neue Wege für Backup und RecoveryZeros Data Loss Recovery Appliance (ZDLRA) - Neue Wege für Backup und Recovery
Zeros Data Loss Recovery Appliance (ZDLRA) - Neue Wege für Backup und Recoveryoraclebudb
 
Oracle Private & Public Database-as-a-Service
Oracle Private & Public Database-as-a-ServiceOracle Private & Public Database-as-a-Service
Oracle Private & Public Database-as-a-Serviceoraclebudb
 
Oracle Security Übersicht
Oracle Security ÜbersichtOracle Security Übersicht
Oracle Security Übersichtoraclebudb
 
Ausgewählte Performance Technologien
Ausgewählte Performance TechnologienAusgewählte Performance Technologien
Ausgewählte Performance Technologienoraclebudb
 

Mehr von oraclebudb (6)

Oracle Technology Monthly Oktober 2017
Oracle Technology Monthly Oktober 2017Oracle Technology Monthly Oktober 2017
Oracle Technology Monthly Oktober 2017
 
Oracle Datenbank Manageability
Oracle Datenbank ManageabilityOracle Datenbank Manageability
Oracle Datenbank Manageability
 
Zeros Data Loss Recovery Appliance (ZDLRA) - Neue Wege für Backup und Recovery
Zeros Data Loss Recovery Appliance (ZDLRA) - Neue Wege für Backup und RecoveryZeros Data Loss Recovery Appliance (ZDLRA) - Neue Wege für Backup und Recovery
Zeros Data Loss Recovery Appliance (ZDLRA) - Neue Wege für Backup und Recovery
 
Oracle Private & Public Database-as-a-Service
Oracle Private & Public Database-as-a-ServiceOracle Private & Public Database-as-a-Service
Oracle Private & Public Database-as-a-Service
 
Oracle Security Übersicht
Oracle Security ÜbersichtOracle Security Übersicht
Oracle Security Übersicht
 
Ausgewählte Performance Technologien
Ausgewählte Performance TechnologienAusgewählte Performance Technologien
Ausgewählte Performance Technologien
 

Oracle12c für Entwickler

  • 1. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle12c für Entwickler Carsten Czarski Business Unit Database Oracle Deutschland B.V. & Co KG
  • 2. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle12c für Entwickler •Standardaufgaben schneller und einfacher: SQL und PL/SQL 32k VARCHAR2, PL/SQL WITH-Klausel, Identity Columns, OFFSET-Klausel ... •Neue Analysemöglichkeiten mit SQL: SQL Pattern Matching •Native JSON-Unterstützung in der Datenbank SQL/JSON, JSON-Indizierung und mehr •Unstrukturierte Daten: XML, Texte und mehr ... •Sichere Anwendungen mit SQL und PL/SQL Rollen für PL/SQL, Code-Based Access-Control •Werkzeuge und Umgebungen SQL Developer, Application Express, Oracle REST Data Services 2
  • 3. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Identity Columns create table tab_kunden ( id number(10) primary key name varchar2(200) : ); create sequence seq_kunden start with 1 increment by 1; create or replace trigger tr_pk_kunden before insert on tab_kunden for each row begin :new.id := seq_kunden.nextval; end; Bisher create table kunden_tab( id number(10) primary key generated always as identity start with 1 increment by 1, name varchar2(200) : ); Oracle12c
  • 4. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | SQL "Row Limit" Klausel •Sortiere nach "SAL" aufsteigend und gib die ersten 5 Zeilen zurück •Sortiere nach "SAL" absteigend, überspringe 3 Zeilen und gib dann die nächsten drei Zeilen zurück SELECT empno, ename, sal FROM emp ORDER BY sal ASC FETCH FIRST 5 ROWS ONLY; SELECT empno, ename, sal FROM emp ORDER BY sal DESC OFFSET 3 ROWS FETCH FIRST 3 ROWS ONLY; ( SELECT rownum zeile, empno, ename, sal FROM ( SELECT empno, ename, sal FROM emp ORDER BY sal DESC ) ) WHERE zeile BETWEEN 4 AND 6; ( SELECT empno, ename, sal FROM emp ORDER BY sal DESC ) WHERE rownum <= 5;
  • 5. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | VARCHAR-Spalten nun bis 32K •Grenze damit analog zu PL/SQL •Verwendung aller SQL-Funktionen möglich •Einmaliger Setup der Datenbank erforderlich (mit dem DBA) create table TAB_KUNDEN ( id number generated as identity, first_name varchar2(30), last_name varchar2(30), first_order date, kommentare varchar2(32767) );
  • 6. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | PL/SQL WITH Klausel WITH FUNCTION get_domain(url VARCHAR2) RETURN VARCHAR2 IS pos BINARY_INTEGER; len BINARY_INTEGER; BEGIN pos := INSTR(url, 'www.'); len := INSTR(SUBSTR(url, pos + 4), '.') - 1; RETURN SUBSTR(url, pos + 4, len); END; SELECT DISTINCT get_domain(catalog_url) FROM orders; •Die Funktion existiert nur für diese SQL-Abfrage •Keine Persistenz im Data Dictionary
  • 7. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle12c für den Entwickler Neue Analysemöglichkeiten: SQL Pattern Matching 7
  • 8. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | SQL Pattern Matching •Finde "Double Bottoms" im Kursverlauf einer Aktie •Wann beginnt das Muster? •Wann endet das Muster? •Welcher Aktienkurs? •Muster innerhalb einer Woche? Tage Aktienkurs X Y W Z SELECT first_x, last_z FROM ticker MATCH_RECOGNIZE ( PARTITION BY name ORDER BY time MEASURES FIRST(x.time) AS first_x LAST(z.time) AS last_z ONE ROW PER MATCH PATTERN (X+ Y+ W+ Z+) DEFINE X AS (price < PREV(price)) Y AS (price > PREV(price)) W AS (price < PREV(price)) Z AS (price > PREV(price)) FIRST_X LAST_Z 1 9 13 19
  • 9. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | SQL Pattern Matching •Ein weiteres Beispiel: Apache-Logdatei als externe Tabelle:w select * from exttab_webserver_log; CLIENT_IP ZEITSTEMPEL REQUEST HTTP_CODE --------------- -------------------- -------------------- --------- 10.165.251.50 2011-04-20 14:30:10 POST /pls/htmld ... 200 129.157.43.110 2011-04-20 14:30:34 POST /pls/htmld ... 200 10.175.6.99 2011-04-20 14:30:46 GET /pls/htmldb ... 301 10.175.6.99 2011-04-20 14:30:46 GET /pls/htmldb ... 200 10.165.251.50 2011-04-20 14:30:59 GET /pls/htmldb ... 301 10.165.251.50 2011-04-20 14:30:59 GET /pls/htmldb ... 200 : : : : Skript zum Erzeugen: https://apex.oracle.com/pls/apex/GERMAN_COMMUNITIES.SHOW_TIPP?P_ID=941#patternmatch
  • 10. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | SQL Pattern Matching: Ein Beispiel CLIENT_IP ZEITSTEMPEL HTTP_CODE CONTENT_LENGTH REQUEST -------------------- ---------------------------------------- ---------- -------------- ----------------------------------------------------------------------------------- 10.165.251.50 20.04.11 15:16:57,000000 +02:00 200 286 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.175.6.99 20.04.11 15:17:00,000000 +02:00 301 383 GET /pls/htmldb/ical HTTP/1.1 ... 10.165.251.50 20.04.11 15:17:00,000000 +02:00 200 17277 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.175.6.99 20.04.11 15:17:00,000000 +02:00 200 43293 GET /pls/htmldb/ical HTTP/1.1 ... 10.165.251.50 20.04.11 15:17:11,000000 +02:00 200 27166 GET /pls/htmldb/f?p=4350:22:859015072291276::NO::: HTTP/1.1 ... 10.165.251.50 20.04.11 15:17:15,000000 +02:00 200 32520 GET /pls/htmldb/f?p=4350:26:859015072291276::NO:RP:: HTTP/1.1 ... 10.165.251.50 20.04.11 15:17:17,000000 +02:00 200 41997 GET /pls/htmldb/f?p=4350:29:859015072291276::NO:RIR:IR_FLOW_ID:180 HTTP/1.1 ... 10.165.251.50 20.04.11 15:17:19,000000 +02:00 200 2622 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:17:23,000000 +02:00 200 2622 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.175.15.142 20.04.11 15:17:23,000000 +02:00 301 383 GET /pls/htmldb/ical HTTP/1.1 ... 10.165.253.101 20.04.11 15:17:23,000000 +02:00 200 867 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.175.15.142 20.04.11 15:17:24,000000 +02:00 200 43293 GET /pls/htmldb/ical HTTP/1.1 ... 10.175.26.93 20.04.11 15:17:46,000000 +02:00 200 867 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:06,000000 +02:00 200 17292 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:12,000000 +02:00 200 22509 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.174.237.145 20.04.11 15:18:12,000000 +02:00 200 43293 GET /pls/htmldb/ical HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:22,000000 +02:00 302 43 POST /pls/htmldb/wwv_flow.accept HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:22,000000 +02:00 200 42002 GET /pls/htmldb/f?p=4350:29:859015072291276::NO::: HTTP/1.1 ... 10.165.253.101 20.04.11 15:18:23,000000 +02:00 200 867 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:25,000000 +02:00 200 2622 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:33,000000 +02:00 200 12233 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:41,000000 +02:00 302 43 POST /pls/htmldb/wwv_flow.accept HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:41,000000 +02:00 200 31726 GET /pls/htmldb/f?p=4350:29:859015072291276::NO::: HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:44,000000 +02:00 200 11623 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:46,000000 +02:00 200 2622 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.175.26.93 20.04.11 15:18:46,000000 +02:00 200 867 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:48,000000 +02:00 200 23122 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:56,000000 +02:00 301 368 GET / HTTP/1.1 ... 10.165.251.50 20.04.11 15:18:56,000000 +02:00 301 400 GET / HTTP/1.1 ... 10.165.251.50 20.04.11 15:19:09,000000 +02:00 301 389 GET /kalender HTTP/1.1 ... 10.165.251.50 20.04.11 15:19:09,000000 +02:00 200 869 GET /pls/htmldb/f?p=180:3 HTTP/1.1 ... 10.165.251.50 20.04.11 15:19:19,000000 +02:00 200 34224 GET /pls/htmldb/f?p=180:3:3267683042998608 HTTP/1.1 ... 10.165.253.101 20.04.11 15:19:23,000000 +02:00 200 867 POST /pls/htmldb/wwv_flow.show HTTP/1.1 ...
  • 11. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | SQL Pattern Matching: Ein Beispiel select p.client_ip, p.session_id, p.start_tstamp, p.cnt_clicks from exttab_webserver_log MATCH_RECOGNIZE ( PARTITION BY client_ip ORDER BY zeitstempel asc MEASURES strt.zeitstempel AS start_tstamp, MATCH_NUMBER() AS session_id, FINAL COUNT(zeitstempel) AS cnt_clicks ONE ROW PER MATCH AFTER MATCH SKIP PAST LAST ROW PATTERN (strt nxt+) DEFINE nxt AS nxt.zeitstempel < (PREV(nxt.zeitstempel) + interval '300' second) ) p order by client_ip, start_tstamp;
  • 12. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle12c für den Entwickler Native JSON Unterstützung in der Datenbank 12
  • 13. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | JSON: JavaScript Object Notation •Sehr einfaches Datenaustauschformat •Einfachere Konzepte als XML •Basiert auf JavaScript-Code •Javascript auch auf Server wichtig: node.js •Breite Unterstützung durch Web-APIs –Google, Twitter, Facebook & Co •Setzt sich mehr und mehr durch { "PONumber" : 1600, "Reference" : "ABULL-20140421“, "Requestor" : "Alexis Bull“, "User" : "ABULL“, "CostCenter" : "A50“, "ShippingInstructions" : { "name" : "Alexis Bull“, "Address" : { ... }, "Phone" : [ ... ] }, "Special Instructions" : null, "AllowPartialShipment" : true, "LineItems" : [{ "ItemNumber" : 1, "Part" : { "Description" : "One Magic Christmas“, "UnitPrice" : 19.95, "UPCCode" : 13131092899 }, "Quantity" : 9 }, {…} ] }
  • 14. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Flexible Entwicklung mit JSON •Agilität und "Continous Delivery" –Änderungen an Datenstrukturen immer häufiger und flexibler –Lange Zyklen für Schema-Änderungen werden immer weniger akzeptiert •Ansatz: Ablage als JSON und Parsing zur Query Zeit –Einfache Ablage der JSON-Dokumente in einem 'Document Store' –Parsing zur Abfragezeit – fehlende Attribute "fehlen dann einfach" –NoSQL-Datenbanken, Hadoop Cluster Security ...? IT Betrieb ...? Replikation ...? Funktionsbibliothek ...? Relationale Applikationen ...?
  • 15. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Relationale Tabellen bleiben wichtig. Auf das Zusammenspiel kommt es an. 15
  • 16. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | JSON and SQL Duality JSON Datenzugriff per REST oder Native API JSON wird in der Datenbank gespeichert Analysen / Queries per SQL Oracle Database 12c SQL
  • 17. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Native JSON Unterstützung in der Oracle Datenbank JSON Dokumente speichern und verwalten •JSON als Text speichern (VARCHAR2, CLOB, BLOB)  Ohne Schema - volle Flexibilität •Kein eigener Datentyp: Nutzung der Standard-Datentypen für Zeichenketten bzw. Binärdaten •Indizierung mit einem 'JSON aware' Index API Zugriff auf JSON •REST Services •Java API (weitere Programmiersprachen in Planung) SQL Abfragen direkt auf JSON-Dokumente Reporting, Analyse und relationaler Zugriff direkt auf JSON-Dokumente 'JSON and SQL duality' 17 JSON ermöglicht schemalose Datenhaltung in der Oracle-Datenbank ... ... aber komplett integriert mit der relationalen Welt!
  • 18. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | SQL Queries auf JSON-Dokumente: JSON Table 18
  • 19. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | SQL Beispiel: JSON_TABLE 19 select reference, requestor, costcenter from po_json, json_table( json, '$.PurchaseOrder' columns ( reference varchar2(30) path '$.Reference', requestor varchar2(25) path '$.Requestor', costcenter varchar2(4) path '$.CostCenter' ) ) /
  • 20. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | JSON_TABLE für relationale Sichten auf JSON 20 REFERENCE REQUESTOR COST --------------------------- ------------------ ---- FORD-20021009123336872PDT Gerry B. Ford R20 JONES-20011127121050471PST Richard J Jones R20 MARTIN-20011127121050401PST Thomas D. Martin S30 CLARK-20021009123337764PDT Edward K. Clark A10 JONES-20011127121042590PST Richard J Jones R20 MARTIN-20011127121040547PST Thomas D. Martin S30 JONES-20021009123336602PDT Richard J Jones R20 WARD-20011127121050511PST Stephen B. Ward S30 BLAKE-20011127121055689PST David E. Blake S30 MARTIN-20011127121048889PST Thomas D. Martin S30 : : :
  • 21. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle12c für den Entwickler Unstrukturierte Daten: Dokumente, XML und mehr ... 21
  • 22. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Dokumente, XML und unstrukturierte Daten • XML DB ist nun integraler Bestandteil der Datenbank • Unterstützung der jüngsten Standards XQuery-Update, XQuery-Fulltext • Performance-Optimierungen XDB Performance, Oracle TEXT Near Real Time Indexing • Oracle TEXT im Detail Automatische Spracherkennung, Pattern Stopclass, NEAR und "Mild Not" Operator und mehr ..
  • 23. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | XQuery Fulltext: Setup •Es ist nach wie vor ein Oracle TEXT Index nötig •Erstellen mit PATH_SECTION_GROUP und XML_ENABLE=TRUE begin ctx_ddl.create_section_group('my_sg_xquery', 'PATH_SECTION_GROUP'); ctx_ddl.set_sec_grp_attr('my_sg_xquery', 'xml_enable', 'true'); end; / sho err create index ft_tabxml on tab_xml (docs) indextype is ctxsys.context parameters ('section group my_sg_xquery') /
  • 24. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | XQuery Fulltext: Abfragen •Nutzung von XMLExists und XQuery-Syntax •Oracle TEXT CONTAINS wird hier nicht genutzt •XMLExists ist eine Funktion der XMLDB •Kombination mit anderen XQuery-Konstrukten möglich SELECT id FROM tab_xml WHERE XMLExists('declare namespace ns="http://mynamespaces.com/ns2"; //ns:tag[. contains text "text"]' PASSING docs)
  • 25. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle12c für den Entwickler Sichere Anwendungen mit SQL und PL/SQL 25
  • 26. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Zugriff auf PL/SQL Objekte in Oracle12c •Einem PL/SQL-Objekt können nun Rollen zugewiesen werden –Erlaubt wesentlich bessere Rechte / Rollenkonzepte •ACCESSIBLE BY-Klausel verhindert direkten Aufruf eines Objektes –Verhindern des direkten Aufrufs von "Helper Packages" grant {role} to function meine_funktion; create or replace package pkg_helper accessible by {other plsql object} is : end pkg_helper;
  • 27. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Daten maskieren: Data Redaction •Maskierung der Ergebnisse(!) einer SQL-Abfrage –Abfragen formulieren wie gewohnt –Alle WHERE-Bedingungen sind möglich – Indizes werden genutzt –Ergebnisausgabe teilweise oder vollständig maskiert •Hilfreich für den Anwendungsentwickler –Maskierung sensibler Daten in der Anwendungsmasken Kreditkartennummern, Geburtsdatum, etc. –Sicherstellung einheitlicher Maskierungen durch Hinterlegen in der Datenbank  Bspw. "Immer die letzten 4 Stellen" •Lizenz der Advanced Security Option erforderlich
  • 28. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Data Redaction SQL> select * from emp where ename like 'M%' ; EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO ----- ---------- --------- ----- ------------------- ----- ----- ------ 7654 ***TIN SALESMAN 7698 28.09.1981 00:00:00 1250 1400 30 7934 ***LER CLERK 7782 23.01.1982 00:00:00 1300 10 2 Zeilen ausgewählt.
  • 29. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Data Redaction: So geht's BEGIN DBMS_REDACT.ADD_POLICY( object_schema => 'SCOTT', object_name => 'EMP', column_name => 'ENAME', policy_name => 'redact_ename', function_type => DBMS_REDACT.REGEXP, expression => '1=1', regexp_pattern => '(...)(.*)', regexp_replace_string => '***2', regexp_position => DBMS_REDACT.RE_BEGINNING, regexp_occurrence => 0, regexp_match_parameter => 'i'); END; /
  • 30. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Flashback Data Archives für alle •Erweiterung der Flashback Query –Eingeführt mit Oracle11g als Total Recall Option –Capture der UNDO-Informationen in Flashback Data Archives –Abfragen "in die Vergangenheit" nahezu unbegrenzt möglich •Ab Oracle12.1 und 11.2.0.4 –Flashback Data Archives ohne Data Optimization: Alle Editionen –Flashback Data Archives mit Data Optimization: Adv. Compression Option (Partitionierung, Komprimierung)
  • 31. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Flashback Data Archives für alle! •Klausel NO OPTIMIZE DATA stellt lizenzfreie Nutzung sicher •Ab 12.1 und 11.2.0.4 (Patchset) create flashback archive FDBA_MYDATA_1Y_USERS tablespace users quota 100G retention 1 year no optimize data; alter table EMP flashback archive FDBA_MYDATA_1Y_USERS; Data Optimization besonders bei großen Archiven (Transaktionslast) sehr empfehlenswert. Advanced Compression Option
  • 32. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle12c für den Entwickler Werkzeuge und Umgebungen 32
  • 33. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle12c für Entwickler Die Datenbank für alle wichtigen Plattformen JSON Ruby Oracle ADF Oracle APEX Oracle RDS
  • 34. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle REST Data Services (aka 'APEX Listener') •Datenbankzugriffe ohne SQL: RESTful Services –Standardprotokoll: HTTP GET, POST, PUT, DELETE –Anwendungsentwicklung ohne SQL – und ohne spezielle Treiber •Sehr nah an JavaScript –Austauschformat typischerweise JSON
  • 35. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle REST Data Services: Architektur 35 URI Oracle REST Data Services {JSON} Pass Back Auto Generated SQL {JSON} Transform to JSON SQL SQL Result Set PassBack Key Value Lookup {JSON} Map & Bind JSON Collection API NoSQL API HTTP(S) client JSON Document Store Relationale Tabellen NoSQL-Daten
  • 36. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Application Express 5.0 •Derzeit in der Early Adopter Phase (EA2) •Page Designer  http://new.livestream.com/ODTUG/APEXPageDesigner •Universal Theme, Theme Styles and Options, Font Awesome •Verbessertes File-Handling •Neue PL/SQL-Pakete: APEX_ZIP, APEX_JSON •Viele kleinere Verbesserungen im Detail
  • 37. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | APEX 5.0 Page Designer
  • 38. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | APEX 5.0 – Universal Theme •HTML5, CSS3, Responsive Design •Template Options: UI-Features ein-und ausschalten •Theme Styles: Ein Theme – mehrere Ausprägungen •Eigene Theme Styles möglich –Selbst erstellte CSS-Dateien oder –ThemeRoller (Ankündigung KScope14)
  • 39. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | APEX 5.0 – PL/SQL-Paket APEX_ZIP
  • 40. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Oracle SQL Developer 40
  • 41. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Informationen in deutscher Sprache •Communities –APEX Community –DBA Community –Linux und Virtualisierung –Exadata Community •Veranstaltungen –http://tinyurl.com/odd12c
  • 42. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Nutzen Sie Ihre Datenbank voll aus ...? Analytic SQL XML Verarbeitung Mobile Applications (APEX) Java in the Database Fuzzy Search Location Data Flashback Query Linguistische Funktionen Native Webservices Image Processing (MultiMedia) PL/SQL Volltextsuche Pipelined Functions
  • 43. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Carsten.Czarski@oracle.com http://tinyurl.com/apexcommunity http://sql-plsql-de.blogspot.com http://plsqlexecoscomm.sourceforge.net http://plsqlmailclient.sourceforge.net Twitter: @cczarski @oraclebudb