SlideShare ist ein Scribd-Unternehmen logo
1 von 137
Downloaden Sie, um offline zu lesen
Oracle 12c for 
Developers 
UGF3100 
Alex Nuijten
SUBMIT YOUR ABSTRACTS TODAY!
⚠️ WARNING ⚠️ 
l o t s a n d l o t s 
There will be code in this 
presentation 
select 'can you read this?' 
from dual;
nuijten.blogspot.com
R1 
4 Years 
2009 2013
Multitenant 
Architecture 
2013 
R1 
2009
2013 
R1 
In Memory Option 
2014 
12.1.0.2
… but what’s in it for the Database Developer?
Increased Size Limit
SQL> create table t 
2 (str varchar2(4000)); 
! 
Table created.
SQL> create table t 
2 (str varchar2(4001)); 
(str varchar2(4001)) 
* 
ERROR at line 2: 
ORA-00910: specified length too long for its datatype
! 
SQL> create table t 
2 (str varchar2(32767)) 
3 / 
(str varchar2(32767)) 
* 
ERROR at line 2: 
ORA-00910: specified length too long for its datatype
a little bit of DBA magic
SQL> create table t 
2 (str varchar2(32767)); 
! 
Table created.
Top N and Pagination
SQL> select ename 
2 ,sal 
3 from emp 
4 where rownum < 4 
5 order by sal desc 
6 / 
! 
ENAME SAL 
------- ------- 
ALLEN 1200 
WARD 1250 
SMITH 800
SQL> select * 
2 from (select ename 
3 ,sal 
4 from emp 
5 order by sal desc 
6 ) 
7 where rownum < 4 
8 / 
! 
ENAME SAL 
-------- ------- 
KING 5000 
SCOTT 3000 
FORD 3000
SQL> select ename 
2 ,sal 
3 from emp 
4 order by sal desc 
5 fetch first 3 rows only 
6 / 
! 
ENAME SAL 
-------- ------- 
KING 5000 
SCOTT 3000 
FORD 3000
SQL> select ename 
2 ,sal 
3 from emp 
4 order by sal desc 
5 offset 3 rows 
6 fetch next 3 rows only 
7 / 
! 
ENAME SAL 
-------- ------- 
JONES 2975 
BLAKE 2850 
CLARK 2450
Execution Plan 
---------------------------------------------------------- 
Plan hash value: 3291446077 
! 
--------------------------------------------------------------------------------- 
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | 
--------------------------------------------------------------------------------- 
| 0 | SELECT STATEMENT | | 14 | 644 | 4 (25)| 00:00:01 | 
|* 1 | VIEW | | 14 | 644 | 4 (25)| 00:00:01 | 
|* 2 | WINDOW SORT PUSHED RANK| | 14 | 140 | 4 (25)| 00:00:01 | 
| 3 | TABLE ACCESS FULL | EMP | 14 | 140 | 3 (0)| 00:00:01 | 
--------------------------------------------------------------------------------- 
! 
Predicate Information (identified by operation id): 
--------------------------------------------------- 
! 
1 - filter("from$_subquery$_002"."rowlimit_$$_rownumber"<=CASE WHEN 
(3>=0) THEN 3 ELSE 0 END +3 AND "from$_subquery$_002"."rowlimit_$$_rownum 
ber">3) 
2 - filter(ROW_NUMBER() OVER ( ORDER BY INTERNAL_FUNCTION("SAL") DESC 
)<=CASE WHEN (3>=0) THEN 3 ELSE 0 END +3)
! 
SQL> select ename 
2 ,sal 
3 from emp 
4 order by sal desc 
5 fetch first 25 percent row only; 
! 
ENAME SAL 
---------- ---------- 
KING 5000 
FORD 3000 
SCOTT 3000 
JONES 2975
Execution Plan 
---------------------------------------------------------- 
Plan hash value: 4130734685 
! 
---------------------------------------------------------------------------- 
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | 
---------------------------------------------------------------------------- 
| 0 | SELECT STATEMENT | | 14 | 826 | 4 (25)| 00:00:01 | 
|* 1 | VIEW | | 14 | 826 | 4 (25)| 00:00:01 | 
| 2 | WINDOW SORT | | 14 | 140 | 4 (25)| 00:00:01 | 
| 3 | TABLE ACCESS FULL| EMP | 14 | 140 | 3 (0)| 00:00:01 | 
---------------------------------------------------------------------------- 
! 
Predicate Information (identified by operation id): 
--------------------------------------------------- 
! 
1 - filter("from$_subquery$_002"."rowlimit_$$_rownumber"<=CEIL("from$ 
_subquery$_002"."rowlimit_$$_total"*25/100))
Pattern Matching
SQL> create table weather 
2 (dt date not null 
3 ,rain number not null 
4 ); 
! 
Table created.
SQL> insert into weather 
2 with rsf(r) 
3 as 
4 (select 1 
5 from dual 
6 union all 
7 select r + 1 
8 from rsf 
9 where r < 31) 
10 select to_date (to_char (r)||'-08-2014', 'dd-mm-yyyy') dt 
11 ,round ((dbms_random.value * 20)) rain 
12 from rsf 
13 / 
! 
31 rows created.
SQL> select dt 
2 ,rain 
3 ,trend 
4 from weather 
5 match_recognize( 
6 order by dt 
7 measures classifier() as trend 
8 all rows per match 
9 pattern (Better* Worse* same*) 
10 define Better as Better.rain < prev (rain) 
11 ,Worse as Worse.rain > prev (rain) 
12 ,same as same.rain = prev (rain) 
13 );
DT RAIN TREND 
--------- ---------- --------- 
01-AUG-14 14 
02-AUG-14 0 BETTER 
03-AUG-14 19 WORSE 
04-AUG-14 6 BETTER 
05-AUG-14 20 WORSE 
06-AUG-14 1 BETTER 
07-AUG-14 17 WORSE 
08-AUG-14 17 SAME 
09-AUG-14 14 BETTER 
10-AUG-14 18 WORSE 
11-AUG-14 9 BETTER 
12-AUG-14 4 BETTER 
13-AUG-14 17 WORSE 
14-AUG-14 16 BETTER 
15-AUG-14 5 BETTER 
Wh a t a b o u t A n a l y t i c 
Fu n c t i o n s?
SQL> select dt 
2 ,rain 
3 ,case 
4 when rain < lag (rain) over (order by dt) 
5 then 'Better' 
6 when rain > lag (rain) over (order by dt) 
7 then 'Worse' 
8 when rain = lag (rain) over (order by dt) 
9 then 'Same' 
10 end trend 
11 from weather;
DT RAIN TREND 
--------- ---------- --------- 
01-AUG-14 14 
02-AUG-14 0 Better 
03-AUG-14 19 Worse 
04-AUG-14 6 Better 
05-AUG-14 20 Worse 
06-AUG-14 1 Better 
07-AUG-14 17 Worse 
08-AUG-14 17 Same 
09-AUG-14 14 Better 
10-AUG-14 18 Worse 
11-AUG-14 9 Better 
12-AUG-14 4 Better 
13-AUG-14 17 Worse 
14-AUG-14 16 Better 
15-AUG-14 5 Better
SQL> select * 
L o o k i n g f o r D r y S p e l l s 
2 from weather 
3 match_recognize 
4 ( 
5 order by dt 
6 measures first (wet.dt) as first_wetday 
7 ,dry.dt as dryday 
8 ,last (wet.dt) as last_wetday 
9 one row per match 
10 pattern (wet dry{2,} wet*) 
11 define 
12 wet as wet.rain > 10, 
13 dry as dry.rain <= 10 
14 );
pattern (wet dry{2,} wet*) 
FIRST_WET DRYDAY LAST_WETD 
--------- --------- --------- 
10-AUG-14 12-AUG-14 14-AUG-14 
23-AUG-14 26-AUG-14 27-AUG-14 
2 rows selected. 
21-AUG-14 15 
22-AUG-14 12 
23-AUG-14 18 
24-AUG-14 2 
25-AUG-14 5 
26-AUG-14 4 
27-AUG-14 15 
28-AUG-14 7 
09-AUG-14 14 
10-AUG-14 18 
11-AUG-14 9 
12-AUG-14 4 
13-AUG-14 17 
14-AUG-14 16 
15-AUG-14 5
Galo Balda 
SQL Pattern Matching in Oracle 12c 
! 
Sunday: UGF4482! 
Time: 1:30 PM 
Stew Ashton 
Oracle Database 12c Row Pattern Matching: 
Beating the Best Pre-12c Solutions 
! 
Monday: CON3450! 
Time: 4:00 PM
Temporal Validity
SQL> create table addresses 
2 (empno number 
3 ,street varchar2(50) 
4 ,houseno number 
5 ,start_date date 
6 ,end_date date 
7 ,period for address_valid (start_date, end_date) 
8 ); 
! 
Table created.
SQL> select street 
2 , houseno 
3 , start_date 
4 , end_date 
5 from addresses; 
! 
STREET HOUSENO START_DAT END_DATE 
--------------- ---------- --------- --------- 
Brandywine Rd 345 05-AUG-95 15-FEB-96 
Spencer Run 12 16-FEB-96 30-APR-00 
Via Palm Lake 741 01-MAY-00 31-JAN-13 
76th Way 7616 01-FEB-13
SQL> select street 
2 ,houseno 
3 ,start_date 
4 ,end_date 
5 from addresses as of period 
6 for address_valid sysdate; 
! 
STREET HOUSENO START_DAT END_DATE 
--------------- ---------- --------- --------- 
76th Way 7616 01-FEB-13
SQL> select street 
2 ,houseno 
3 ,start_date 
4 ,end_date 
5 from addresses 
6 versions period for address_valid 
7 between date '2010-06-01' 
8 and sysdate 
! 
STREET HOUSENO START_DAT END_DATE 
--------------- ---------- --------- --------- 
Via Palm Lake 741 01-MAY-00 31-JAN-13 
76th Way 7616 01-FEB-13
SQL> begin 
2 dbms_flashback_archive.enable_at_valid_time ('CURRENT'); 
3 end; 
4 / 
! 
PL/SQL procedure successfully completed.
! 
SQL> select street 
2 ,houseno 
3 ,start_date 
4 ,end_date 
5 from addresses; 
! 
STREET HOUSENO START_DAT END_DATE 
--------------- ---------- --------- --------- 
76th Way 7616 01-FEB-13
! 
SQL> begin 
2 dbms_flashback_archive.enable_at_valid_time ('ALL'); 
3 end; 
4 / 
! 
PL/SQL procedure successfully completed.
SQL> select street 
2 , houseno 
3 , start_date 
4 , end_date 
5 from addresses; 
! 
STREET HOUSENO START_DAT END_DATE 
--------------- ---------- --------- --------- 
Brandywine Rd 345 05-AUG-95 15-FEB-96 
Spencer Run 12 16-FEB-96 30-APR-00 
Via Palm Lake 741 01-MAY-00 31-JAN-13 
76th Way 7616 01-FEB-13
Identity Columns
SQL> create table t 
2 (id number generated as identity 
3 ,name varchar2(35) 
4 ); 
! 
Table created.
! 
SQL> insert into t (name) values ('Alex'); 
! 
1 row created.
SQL> insert into t (id, name) values (42, 'TEST'); 
insert into t (id, name) values (42, 'TEST') 
* 
ERROR at line 1: 
ORA-32795: cannot insert into a generated always identity column
SQL> insert into t (id, name) values (null, 'TEST'); 
insert into t (id, name) values (null, 'TEST') 
* 
ERROR at line 1: 
ORA-32795: cannot insert into a generated always identity column
SQL> insert into t (id, name) values (default, 'TEST'); 
! 
1 row created.
GENERATED 
[ ALWAYS | BY DEFAULT [ ON NULL ] ] 
AS IDENTITY [ ( identity_options ) ] 
Similar to Sequence Options
SQL> create table t 
2 (id number generated as identity (start with 42 increment by 2) 
3 ,name varchar2(35) 
4 ); 
! 
Table created.
SQL> insert into t 
2 (name) 
3 values 
4 ('Alex'); 
! 
1 row created. 
! 
SQL> select * 
2 from t 
3 / 
! 
ID NAME 
----- --------- 
42 Alex
SQL> insert into t 
2 (name) 
3 values 
4 ('Tim'); 
! 
1 row created. 
! 
SQL> select * 
2 from t 
3 / 
! 
ID NAME 
----- --------- 
42 Alex 
44 Tim
Default Values
SQL> create table t 
2 (str varchar2(10) default 'hello' 
3 ); 
! 
! 
Table created. 
! 
SQL> insert into t values (null) 
2 / 
! 
1 row created.
SQL> select * 
2 from t 
3 / 
! 
STR 
---------- 
Yes, there is a row there
SQL> insert into t values (default) 
2 / 
! 
1 row created. 
! 
SQL> select * 
2 from t 
3 / 
! 
STR 
---------- 
! 
hello
SQL> create table t 
2 (str varchar2(10) default on null 'Hello' 
3 ); 
! 
Table created. 
! 
SQL> insert into t values (null) 
2 / 
! 
1 row created. 
! 
SQL> select * from t 
2 / 
! 
STR 
---------- 
Hello
SQL> create sequence seq 
2 / 
! 
Sequence created. 
! 
SQL> create table t 
2 (id number default seq.nextval 
3 ,name varchar2(35) 
4 ); 
! 
Table created.
SQL> insert into t (name) 
2 values ('Testing'); 
! 
1 row created. 
! 
SQL> insert into t (id, name) 
2 values (42, 'Testing'); 
! 
1 row created. 
! 
SQL> insert into t (id, name) 
2 values (null, 'Testing'); 
! 
1 row created.
SQL> select * 
2 from t 
3 / 
! 
ID NAME 
----- -------- 
1 Testing 
42 Testing 
Testing
SQL> create sequence seq 
2 / 
! 
Sequence created. 
! 
SQL> create table t 
2 (id number default on null seq.nextval 
3 ,name varchar2(35) 
4 ); 
! 
Table created. 
Only when NULL
SQL> insert into t values (null, 'test') 
2 / 
! 
1 row created. 
! 
SQL> select * from t 
2 / 
! 
ID NAME 
------ --------------------------------- 
1 test
SQL> create sequence master_seq 
2 / 
! 
Sequence created. 
! 
SQL> create sequence detail_seq 
2 / 
! 
Sequence created.
SQL> create table masters 
2 (id number default master_seq.nextval 
3 ,name varchar2(35) 
4 ); 
! 
Table created. 
! 
SQL> create table details 
2 (id number default detail_seq.nextval 
3 ,master_id number default master_seq.currval 
4 ,name varchar2(35) 
5 ); 
! 
Table created.
SQL> insert into masters (name) 
2 values ('First Master') 
3 / 
! 
1 row created. 
! 
SQL> insert into details (name) 
2 select 'Detail '||to_char (rownum) 
3 from dual 
4 connect by level <= 5 
5 / 
! 
5 rows created.
SQL> insert into masters (name) 
2 values ('Second Master') 
3 / 
! 
1 row created. 
! 
SQL> insert into details (name) 
2 select 'Detail '||to_char (rownum) 
3 from dual 
4 connect by level <= 5 
5 / 
! 
5 rows created.
SQL> select * 
2 from details 
3 / 
! 
ID MASTER_ID NAME 
---- ---------- ------------ 
1 1 Detail 1 
2 1 Detail 2 
3 1 Detail 3 
4 1 Detail 4 
5 1 Detail 5 
6 2 Detail 1 
7 2 Detail 2 
8 2 Detail 3 
9 2 Detail 4 
10 2 Detail 5 
! 
10 rows selected.
Subquery Factoring 
“Th e W ITH C l a u s e”
SQL> select * 
2 from (select ename 
3 ,sal 
4 from emp 
5 order by sal desc 
6 ) 
7 where rownum < 4 
8 / 
! 
ENAME SAL 
-------- ------- 
KING 5000 
SCOTT 3000 
FORD 3000 
SQL> with ordered_emps 
2 as 
3 (select ename 
4 ,sal 
5 from emp 
6 order by sal desc 
7 ) 
9 select * 
10 from ordered_emps 
11 where rownum < 4 
12 / 
! 
ENAME SAL 
-------- ------- 
KING 5000 
SCOTT 3000 
FORD 3000
SQL> with lots(r) 
2 as 
3 (select 1 r from dual 
4 union all 
5 select r+1 from lots 
6 where r < 5 
7 ) 
8 select * 
9 from lots 
10 / 
! 
R 
---------- 
1 
2 
3 
4 
5 
! 
5 rows selected.
SQL> with 
2 function formatname (p_name in varchar2) 
3 return varchar2 
4 is 
5 begin 
6 return initcap (p_name); 
7 end formatname; 
8 select ename 
9 ,formatname(ename) formatted 
10 from emp; 
! 
ENAME FORMATTED 
---------- ------------------------- 
SMITH Smith 
ALLEN Allen 
WARD Ward 
JONES Jones 
MARTIN Martin
SQL> with 
2 procedure show (p_what in varchar2) 
3 is 
4 begin 
5 dbms_output.put_line (p_what); 
6 end show; 
7 function formatname (p_name in varchar2) 
8 return varchar2 
9 is 
10 begin 
11 show ('The input was: '||p_name); 
12 return initcap (p_name); 
13 end formatname; 
14 select ename 
15 ,formatname (ename) formatted 
16 from emp;
ENAME FORMATTED 
---------- ------------- 
SMITH Smith 
ALLEN Allen 
WARD Ward 
JONES Jones 
MARTIN Martin 
BLAKE Blake 
CLARK Clark 
SCOTT Scott 
KING King 
TURNER Turner 
ADAMS Adams 
JAMES James 
FORD Ford 
MILLER Miller 
! 
14 rows selected.
The input was: SMITH 
The input was: ALLEN 
The input was: WARD 
The input was: JONES 
The input was: MARTIN 
The input was: BLAKE 
The input was: CLARK 
The input was: SCOTT 
The input was: KING 
The input was: TURNER 
The input was: ADAMS 
The input was: JAMES 
The input was: FORD 
The input was: MILLER
SQL> with 
2 procedure show (p_what in varchar2) 
3 is 
4 begin 
5 dbms_output.put_line ('input is: '||p_what); 
6 end show; 
7 function formatname (p_name in varchar2) 
8 return varchar2 
9 is 
10 begin 
11 show (p_name); 
12 return initcap (p_name); 
13 end formatname; 
14 ordered_emps as 
15 (select ename from emp order by ename asc) 
16 select ename 
17 ,formatname(ename) formatted 
18 from ordered_emps 
19 /
ENAME FORMATTED 
---------- ----------- 
ADAMS Adams 
ALLEN Allen 
BLAKE Blake 
CLARK Clark 
FORD Ford 
JAMES James 
JONES Jones 
KING King 
MARTIN Martin 
MILLER Miller 
SCOTT Scott 
SMITH Smith 
TURNER Turner 
WARD Ward 
! 
14 rows selected.
input is: SMITH 
input is: ALLEN 
input is: WARD 
input is: JONES 
input is: MARTIN 
input is: BLAKE 
input is: CLARK 
input is: SCOTT 
input is: KING 
input is: TURNER 
input is: ADAMS 
input is: JAMES 
input is: FORD 
input is: MILLER
Pragma UDF
SQL> create or replace 
2 function formatname (p_name in varchar2) 
3 return varchar2 
4 is 
5 pragma udf; 
6 begin 
7 return initcap (p_name); 
8 end; 
9 /
This page is intentionally left blank
White Listing
SQL> create or replace 
2 procedure restricted_proc 
3 accessible by (public_proc) 
4 is 
5 begin 
6 dbms_output.put_line 
7 ('This can only be called by the public program'); 
8 end restricted_proc; 
! 
Procedure created.
SQL> create or replace 
2 procedure public_proc 
3 is 
4 begin 
5 dbms_output.put_line ('This is the public program'); 
6 restricted_proc; 
7 end public_proc; 
! 
Procedure created.
SQL> begin 
2 public_proc; 
3 end; 
4 / 
This is the public program 
This can only be called by the public program 
! 
PL/SQL procedure successfully completed.
SQL> begin 
2 restricted_proc; 
3 end; 
4 / 
restricted_proc; 
* 
ERROR at line 2: 
ORA-06550: line 2, column 4: 
PLS-00904: insufficient privilege to access object RESTRICTED_PROC 
ORA-06550: line 2, column 4: 
PL/SQL: Statement ignored
Data Redaction
select … 
from … 
Redacted 
Data
SQL> select ename 
2 ,hiredate 
3 ,credit_card 
4 from emp 
5 / 
! 
ENAME HIREDATE CREDIT_CARD 
---------- --------- ------------------ 
SMITH 17-DEC-80 4916328952854172 
ALLEN 20-FEB-81 4539313944751949 
WARD 22-FEB-81 4716066949870198 
JONES 02-APR-81 5535742924238587 
MARTIN 28-SEP-81 5570058606015920 
BLAKE 01-MAY-81 5103520492409737 
CLARK 09-JUN-81 377819476595275 
SCOTT 19-APR-87 349683522367948
begin 
dbms_redact.add_policy 
(object_schema => 'ALEX' 
,object_name => 'EMP' 
,policy_name => 'Hide Creditcard' 
,expression => '1=1' 
,column_name => 'CREDIT_CARD' 
,function_type => dbms_redact.regexp 
,regexp_pattern => dbms_redact.re_pattern_any_digit 
,regexp_replace_string => 'X' 
); 
end; 
/ 
C h o o s e Po l i c y N ame 
Wi s e l y !
ENAME HIREDATE CREDIT_CARD 
---------- --------- ------------------------- 
SMITH 17-DEC-80 XXXXXXXXXXXXXXXX 
ALLEN 20-FEB-81 XXXXXXXXXXXXXXXX 
WARD 22-FEB-81 XXXXXXXXXXXXXXXX 
JONES 02-APR-81 XXXXXXXXXXXXXXXX 
MARTIN 28-SEP-81 XXXXXXXXXXXXXXXX 
BLAKE 01-MAY-81 XXXXXXXXXXXXXXXX 
CLARK 09-JUN-81 XXXXXXXXXXXXXXX 
SCOTT 19-APR-87 XXXXXXXXXXXXXXX
begin 
dbms_redact.add_policy 
(object_schema => 'ALEX' 
,object_name => 'EMP' 
,policy_name => 'Hide Creditcard' 
,expression => '1=1' 
,column_name => 'CREDIT_CARD' 
,function_type => dbms_redact.partial 
,function_parameters => dbms_redact.redact_ccn16_f12 
); 
end; 
/
ENAME HIREDATE CREDIT_CARD 
---------- --------- ------------------------- 
SMITH 17-DEC-80 ****-****-****-2 
ALLEN 20-FEB-81 ****-****-****-9 
WARD 22-FEB-81 ****-****-****-8 
JONES 02-APR-81 ****-****-****-7 
MARTIN 28-SEP-81 ****-****-****-0 
BLAKE 01-MAY-81 ****-****-****-7 
CLARK 09-JUN-81 ****-****-****- 
SCOTT 19-APR-87 ****-****-****-
begin 
dbms_redact.add_policy( 
object_schema => 'ALEX' 
,object_name => 'EMP' 
,column_name => 'CREDIT_CARD' 
,policy_name => 'Hide Credit Card' 
,function_type => dbms_redact.regexp 
,function_parameters => null 
,expression => '1=1' 
,regexp_pattern => dbms_redact.re_pattern_cc_l6_t4 
,regexp_replace_string => dbms_redact.re_redact_cc_middle_digits 
,regexp_position => dbms_redact.re_beginning 
,regexp_occurrence => dbms_redact.re_first 
); 
end; 
/
ENAME HIREDATE CREDIT_CARD 
---------- --------- ------------------------- 
SMITH 17-DEC-80 491632XXXXXX4172 
ALLEN 20-FEB-81 453931XXXXXX1949 
WARD 22-FEB-81 471606XXXXXX0198 
JONES 02-APR-81 553574XXXXXX8587 
MARTIN 28-SEP-81 557005XXXXXX5920 
BLAKE 01-MAY-81 510352XXXXXX9737 
CLARK 09-JUN-81 377819XXXXXX5275 
SCOTT 19-APR-87 349683XXXXXX7948
begin 
dbms_redact.add_policy( 
object_schema => 'ALEX' 
,object_name => 'EMP' 
,column_name => 'CREDIT_CARD' 
,policy_name => 'gibberish' 
,function_type => DBMS_REDACT.RANDOM 
,expression => '1=1' 
); 
END; 
/
ENAME HIREDATE CREDIT_CARD 
---------- --------- ------------------------- 
SMITH 17-DEC-80 _Z^1LYqgbfd9Tay 
ALLEN 20-FEB-81 dN9Vpp_.lVA^xxg6 
WARD 22-FEB-81 ?8!%`:BQG@)-hBJY 
JONES 02-APR-81 ~+bn/Mad'3jv7Ui 
MARTIN 28-SEP-81 hg}BQ8etpo&JY@m| 
BLAKE 01-MAY-81 *PJ" ,qL2XR*(4yT 
CLARK 09-JUN-81 !e5`E)g))m=hM1o 
SCOTT 19-APR-87 *|V]>n%y2%^eFv-
ENAME HIREDATE CREDIT_CARD 
---------- --------- ------------------------- 
SMITH 17-DEC-80 _;T99'L@gCAA/TH 
ALLEN 20-FEB-81 J/Zs)aE@R7b{1iMH 
WARD 22-FEB-81 {?-Z#/b0$G5b+7j8 
JONES 02-APR-81 IKn4cRczQSv<kZk# 
MARTIN 28-SEP-81 qX=>90;?y`EFA8CG 
BLAKE 01-MAY-81 oTSNzmVhw[V#u^p 
CLARK 09-JUN-81 <$/9d5T'D,7Al= 
SCOTT 19-APR-87 au$O]"P|i},We*X
begin 
dbms_redact.add_policy 
(object_schema => 'ALEX' 
,object_name => 'EMP' 
,policy_name => 'Hide Hire Date' 
,expression => '1=1' 
,column_name => 'HIREDATE' 
,function_type => dbms_redact.partial 
,function_parameters => dbms_redact.redact_date_millennium 
); 
end; 
/
ENAME HIREDATE CREDIT_CARD 
---------- --------- ------------------------- 
SMITH 01-JAN-00 4916328952854172 
ALLEN 01-JAN-00 4539313944751949 
WARD 01-JAN-00 4716066949870198 
JONES 01-JAN-00 5535742924238587 
MARTIN 01-JAN-00 5570058606015920 
BLAKE 01-JAN-00 5103520492409737 
CLARK 01-JAN-00 377819476595275 
SCOTT 01-JAN-00 349683522367948
begin 
dbms_redact.alter_policy( 
object_schema => 'ALEX' 
,object_name => 'EMP' 
,policy_name => 'Obscure some data' 
,action => dbms_redact.ADD_COLUMN 
,column_name => 'HIREDATE' 
,function_type => dbms_redact.partial 
,function_parameters => dbms_redact.redact_date_epoch 
); 
end; 
/ 
Same Policy Name 
C h o o s e Po l i c y N ame 
Wi s e l y !
ENAME HIREDATE CREDIT_CARD 
---------- --------- ------------------------- 
SMITH 01-JAN-70 491632XXXXXX4172 
ALLEN 01-JAN-70 453931XXXXXX1949 
WARD 01-JAN-70 471606XXXXXX0198 
JONES 01-JAN-70 553574XXXXXX8587 
MARTIN 01-JAN-70 557005XXXXXX5920 
BLAKE 01-JAN-70 510352XXXXXX9737 
CLARK 01-JAN-70 377819XXXXXX5275 
SCOTT 01-JAN-70 349683XXXXXX7948
12.1.0.2 
Storing 
Query 
Indexing
{Name : Value}
Name : Value 
Name : Value, 
Name : Value, { }
[ { Name : Value 
} , { Name : Value 
Name : Value, 
Name : Value, 
} 
] Name : Value, Name : Value,
{"ACCOUNTING" : { 
"EMPLOYEES" : [ 
{"ENAME" : "KING", 
"JOB" : "PRESIDENT", 
"SAL" : 5000 
}, 
{"ENAME" : "MILLER", 
"JOB" : "CLERK", 
"SAL" : 1300 
}] 
} 
}
SQL> create table t 
2 (json_data varchar2(4000) 
3 ); 
! 
Table created. 
! 
SQL> alter table t 
2 add constraint json_valid check (json_data is json) 
3 / 
! 
Table altered.
SQL> insert into t 
2 values ('{"valid":"json"}'); 
! 
1 row created.
SQL> insert into t 
2 values ('Just a string'); 
insert into t 
* 
ERROR at line 1: 
ORA-02290: check constraint (ALEX.JSON_VALID) violated
SQL> select json_value (json_data 
2 ,'$.valid' 
3 ) 
4 from t 
5 / 
! 
JSON_VALUE(JSON_DATA,'$.VALID') 
-------------------------------- 
json 
Json Path Expression
insert into t 
values ('{"ACCOUNTING" : { 
"EMPLOYEES" : [ 
{"ENAME" : "KING", 
"JOB" : "PRESIDENT", 
"SAL" : 5000 
}, 
{"ENAME" : "MILLER", 
"JOB" : "CLERK", 
"SAL" : 1300 
}] 
} 
}');
SQL> select json_value (json_data 
Json Path Expression 
2 ,'$.ACCOUNTING.EMPLOYEES[0].ENAME') 
2 from t; 
! 
JSON_VALUE(JSON_DATA,'$.ACCOUNTING.EMPLOYEES[0].ENAME') 
------------------------------------------------------- 
! 
KING 
! 
2 rows selected.
SQL> select ename 
2 ,job 
3 ,sal 
4 from t 
5 ,json_table (json_data, '$.ACCOUNTING.EMPLOYEES[*]' 
6 columns (ename varchar2(20) path '$.ENAME' 
7 ,job varchar2(20) path '$.JOB' 
8 ,sal number path '$.SAL' 
9 )); 
! 
ENAME JOB SAL 
------------ ------------ ---------- 
KING PRESIDENT 5000 
MILLER CLERK 1300 
! 
2 rows selected.
SQL> select * 
2 from t 
3 where json_exists (json_data 
4 ,'$.*.EMPLOYEES'); 
! 
JSON_DATA 
------------------------------------------- 
{"ACCOUNTING" : { 
"EMPLOYEES" : [ 
{"ENAME" : "KING", 
"JOB" : "PRESIDENT", 
"SAL" : 5000 
}, 
{"ENAME" : "MILLER", 
"JOB" : "CLERK", 
"SAL" : 1300 
}] 
} 
}
JSON Generation 
post 12.1.0.2 
JSON_OBJECT 
JSON_ARRAY
Callstack
SQL> create or replace 
2 procedure show_callstack 
3 is 
4 begin 
5 dbms_output.put_line (dbms_utility.format_call_stack()); 
6 end show_callstack; 
7 / 
! 
Procedure created.
1 create or replace 
2 package body pkg is 
3 procedure p 
4 is 
5 procedure q 
6 is 
7 procedure r 
8 is 
9 procedure p is 
10 begin 
11 show_callstack(); 
12 raise program_error; 
13 end p; 
14 begin 
15 p(); 
16 end r; 
17 begin 
18 r(); 
19 end q; 
20 begin 
21 q(); 
22 end p; 
23 end pkg;
1 create or replace 
2 package body pkg is 
3 procedure p 
4 is 
5 procedure q 
6 is 
7 procedure r 
8 is 
9 procedure p is 
10 begin 
11 show_callstack(); 
12 raise program_error; 
13 end p; 
14 begin 
15 p(); 
16 end r; 
17 begin 
18 r(); 
19 end q; 
20 begin 
21 q(); 
22 end p; 
23 end pkg;
1 create or replace 
2 package body pkg is 
3 procedure p 
4 is 
5 procedure q 
6 is 
7 procedure r 
8 is 
9 procedure p is 
10 begin 
11 show_callstack(); 
12 raise program_error; 
13 end p; 
14 begin 
15 p(); 
16 end r; 
17 begin 
18 r(); 
19 end q; 
20 begin 
21 q(); 
22 end p; 
23 end pkg;
1 create or replace 
2 package body pkg is 
3 procedure p 
4 is 
5 procedure q 
6 is 
7 procedure r 
8 is 
9 procedure p is 
10 begin 
11 show_callstack(); 
12 raise program_error; 
13 end p; 
14 begin 
15 p(); 
16 end r; 
17 begin 
18 r(); 
19 end q; 
20 begin 
21 q(); 
22 end p; 
23 end pkg;
1 create or replace 
2 package body pkg is 
3 procedure p 
4 is 
5 procedure q 
6 is 
7 procedure r 
8 is 
9 procedure p is 
10 begin 
11 show_callstack(); 
12 raise program_error; 
13 end p; 
14 begin 
15 p(); 
16 end r; 
17 begin 
18 r(); 
19 end q; 
20 begin 
21 q(); 
22 end p; 
23 end pkg;
----- PL/SQL Call Stack ----- 
object line object 
handle number 
name 
0x9faa8f18 4 procedure ALEX.SHOW_CALLSTACK 
0x9dbd2c00 10 
package body ALEX.PKG 
0x9dbd2c00 14 package body ALEX.PKG 
0x9dbd2c00 
17 package body ALEX.PKG 
0x9dbd2c00 20 package body ALEX.PKG 
0x9fc73e18 
2 anonymous block 
! 
begin 
* 
ERROR at line 1: 
ORA-06501: PL/SQL: program error 
ORA-06512: at "ALEX.PKG", line 11 
ORA-06512: at "ALEX.PKG", line 14 
ORA-06512: at "ALEX.PKG", line 17 
ORA-06512: at "ALEX.PKG", line 20 
ORA-06512: at line 2
UTL_CALL_STACK
SQL> create or replace 
2 procedure show_callstack 
3 as 
4 depth pls_integer := utl_call_stack.dynamic_depth(); 
5 procedure headers 
... 
11 end headers; 
12 begin 
13 headers; 
14 for j in reverse 1..depth loop 
15 dbms_output.put_line( 
16 rpad( utl_call_stack.lexical_depth(j), 10 ) || 
17 rpad( j, 7) || 
18 rpad( to_char(utl_call_stack.unit_line(j), '99'), 9 ) || 
19 utl_call_stack.concatenate_subprogram 
20 (utl_call_stack.subprogram(j))); 
21 end loop; 
22 end show_callstack;
SQL> create or replace 
2 procedure show_callstack 
3 as 
4 depth pls_integer := utl_call_stack.dynamic_depth(); 
5 procedure headers 
... 
11 end headers; 
12 begin 
13 headers; 
14 for j in reverse 1..depth loop 
15 dbms_output.put_line( 
16 rpad( utl_call_stack.lexical_depth(j), 10 ) || 
17 rpad( j, 7) || 
18 rpad( to_char(utl_call_stack.unit_line(j), '99'), 9 ) || 
19 utl_call_stack.concatenate_subprogram 
20 (utl_call_stack.subprogram(j))); 
21 end loop; 
22 end show_callstack;
Lexical Depth Line Name 
Depth Number 
------- ----- ---- ---- 
0 6 2 __anonymous_block 
1 5 20 PKG.P 
2 4 17 PKG.P.Q 
3 3 14 PKG.P.Q.R 
4 2 10 PKG.P.Q.R.P 
0 1 14 SHOW_CALLSTACK 
begin 
* 
ERROR at line 1: 
ORA-06501: PL/SQL: program error 
ORA-06512: at "ALEX.PKG", line 11 
ORA-06512: at "ALEX.PKG", line 14 
ORA-06512: at "ALEX.PKG", line 17 
ORA-06512: at "ALEX.PKG", line 20 
ORA-06512: at line 2
Some Plugs
Connor McDonald 
12c for Developers 
! 
Sunday: UGF2244! 
Time: 2:30 PM 
Moscone South 303 
Lucas Jellema 
Everything That Is Really Useful in 
Oracle Database 12c for Application Developers 
! 
Wednesday: CON2394! 
Time: 3:30 PM 
Moscone South 307
five 
Andy Warhol
12 Looks at Oracle Database 12c: EOUC Short Talks 
Jonathan Lewis 
Christian Antognini 
Osama Mustafa 
Gurcan Orhan 
Alex Nuijten 
Oded Raz 
Sunday: UGF8949 and UGF9221! 
Time: 2:30 PM and 3:30 PM 
Moscone South 304 
Tim Hall 
Ami Aharonovich 
Kashif Manzoor 
Julian Dontcheff 
Björn Rost 
Dimitry Volkov
Subquery Factoring
SUBMIT YOUR ABSTRACTS TODAY!
Alex Nuijten 
Alex.Nuijten@Ordina.nl 
! 
nuijten.blogspot.com 
@alexnuijten
NOAA's National Ocean Service 
https://flic.kr/p/dCB8ne 
Geoffrey Fairchild 
https://flic.kr/p/6tKgHz 
Mutant669 
http://bit.ly/1tqcAJu 
Monica Arellano-Ongpin 
https://flic.kr/p/cZ6YT9 
James MacDonald 
https://flic.kr/p/9gX5fM 
_DJ_ 
https://flic.kr/p/dLbzPm 
aussiegall 
https://flic.kr/p/rksBi 
Horia Varlan 
https://flic.kr/p/7vedzj 
Jukka Zitting 
https://flic.kr/p/8EZw4m 
Steve Parker 
https://flic.kr/p/gACG9

Weitere ähnliche Inhalte

Was ist angesagt?

KLIMA Software - Some DEMO Results Outputs in SERBIAN Language
KLIMA Software - Some DEMO Results Outputs in SERBIAN LanguageKLIMA Software - Some DEMO Results Outputs in SERBIAN Language
KLIMA Software - Some DEMO Results Outputs in SERBIAN LanguageKLIMA Software
 
Catalystの設定シナリオ(メモ段階)
Catalystの設定シナリオ(メモ段階)Catalystの設定シナリオ(メモ段階)
Catalystの設定シナリオ(メモ段階)78tch
 
Oracle 12c far sync standby instance
Oracle 12c far sync standby instanceOracle 12c far sync standby instance
Oracle 12c far sync standby instanceMonowar Mukul
 
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習Computational Materials Science Initiative
 
Dbms plan - A swiss army knife for performance engineers
Dbms plan - A swiss army knife for performance engineersDbms plan - A swiss army knife for performance engineers
Dbms plan - A swiss army knife for performance engineersRiyaj Shamsudeen
 
Connor McDonald Partitioning
Connor McDonald PartitioningConnor McDonald Partitioning
Connor McDonald PartitioningInSync Conference
 
Sangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestSangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestConnor McDonald
 
pstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle databasepstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle databaseRiyaj Shamsudeen
 
Tensorflow and python : fault detection system - PyCon Taiwan 2017
Tensorflow and python : fault detection system - PyCon Taiwan 2017Tensorflow and python : fault detection system - PyCon Taiwan 2017
Tensorflow and python : fault detection system - PyCon Taiwan 2017Eric Ahn
 
Introduction to SAGA HighPerformance Computing
Introduction to SAGA HighPerformance ComputingIntroduction to SAGA HighPerformance Computing
Introduction to SAGA HighPerformance ComputingDavid Peris Navarro
 
Same plan different performance
Same plan different performanceSame plan different performance
Same plan different performanceMauro Pagano
 
Sangam 19 - Analytic SQL
Sangam 19 - Analytic SQLSangam 19 - Analytic SQL
Sangam 19 - Analytic SQLConnor McDonald
 
SQL Tuning 101 - Sep 2013
SQL Tuning 101 - Sep 2013SQL Tuning 101 - Sep 2013
SQL Tuning 101 - Sep 2013Connor McDonald
 
Loopback.vhd
Loopback.vhdLoopback.vhd
Loopback.vhdsachindb9
 
Redo logfile addition in oracle rac 12c
Redo logfile addition in oracle rac 12cRedo logfile addition in oracle rac 12c
Redo logfile addition in oracle rac 12cDebasish Nayak
 

Was ist angesagt? (20)

KLIMA Software - Some DEMO Results Outputs in SERBIAN Language
KLIMA Software - Some DEMO Results Outputs in SERBIAN LanguageKLIMA Software - Some DEMO Results Outputs in SERBIAN Language
KLIMA Software - Some DEMO Results Outputs in SERBIAN Language
 
Catalystの設定シナリオ(メモ段階)
Catalystの設定シナリオ(メモ段階)Catalystの設定シナリオ(メモ段階)
Catalystの設定シナリオ(メモ段階)
 
Oracle 12c far sync standby instance
Oracle 12c far sync standby instanceOracle 12c far sync standby instance
Oracle 12c far sync standby instance
 
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習
第5回CCMSハンズオン(ソフトウェア講習会): AkaiKKRチュートリアル 2. AkaiKKRの実習
 
Dbms plan - A swiss army knife for performance engineers
Dbms plan - A swiss army knife for performance engineersDbms plan - A swiss army knife for performance engineers
Dbms plan - A swiss army knife for performance engineers
 
Sap snc configuration
Sap snc configurationSap snc configuration
Sap snc configuration
 
Connor McDonald Partitioning
Connor McDonald PartitioningConnor McDonald Partitioning
Connor McDonald Partitioning
 
Sangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestSangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolest
 
Quick reference for hql
Quick reference for hqlQuick reference for hql
Quick reference for hql
 
pstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle databasepstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle database
 
Tensorflow and python : fault detection system - PyCon Taiwan 2017
Tensorflow and python : fault detection system - PyCon Taiwan 2017Tensorflow and python : fault detection system - PyCon Taiwan 2017
Tensorflow and python : fault detection system - PyCon Taiwan 2017
 
Introduction to SAGA HighPerformance Computing
Introduction to SAGA HighPerformance ComputingIntroduction to SAGA HighPerformance Computing
Introduction to SAGA HighPerformance Computing
 
Same plan different performance
Same plan different performanceSame plan different performance
Same plan different performance
 
Sangam 19 - Analytic SQL
Sangam 19 - Analytic SQLSangam 19 - Analytic SQL
Sangam 19 - Analytic SQL
 
Mysql56 replication
Mysql56 replicationMysql56 replication
Mysql56 replication
 
ANSI vs Oracle language
ANSI vs Oracle languageANSI vs Oracle language
ANSI vs Oracle language
 
SQL Tuning 101 - Sep 2013
SQL Tuning 101 - Sep 2013SQL Tuning 101 - Sep 2013
SQL Tuning 101 - Sep 2013
 
Loopback.vhd
Loopback.vhdLoopback.vhd
Loopback.vhd
 
Analytic SQL Sep 2013
Analytic SQL Sep 2013Analytic SQL Sep 2013
Analytic SQL Sep 2013
 
Redo logfile addition in oracle rac 12c
Redo logfile addition in oracle rac 12cRedo logfile addition in oracle rac 12c
Redo logfile addition in oracle rac 12c
 

Ähnlich wie Oracle12 for Developers - Oracle OpenWorld Preview AMIS

Oracle Database 12c Application Development
Oracle Database 12c Application DevelopmentOracle Database 12c Application Development
Oracle Database 12c Application DevelopmentSaurabh K. Gupta
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersConnor McDonald
 
Database Management System
Database Management SystemDatabase Management System
Database Management SystemHitesh Mohapatra
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11gfcamachob
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01Karam Abuataya
 
UKOUG 2019 - SQL features
UKOUG 2019 - SQL featuresUKOUG 2019 - SQL features
UKOUG 2019 - SQL featuresConnor McDonald
 
12c Mini Lesson - ANSI standard TOP-N query syntax
12c Mini Lesson - ANSI standard TOP-N query syntax12c Mini Lesson - ANSI standard TOP-N query syntax
12c Mini Lesson - ANSI standard TOP-N query syntaxConnor McDonald
 
Metadata Matters
Metadata MattersMetadata Matters
Metadata Mattersafa reg
 
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكل
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكلحل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكل
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكلMohamed Moustafa
 
Connor McDonald 11g for developers
Connor McDonald 11g for developersConnor McDonald 11g for developers
Connor McDonald 11g for developersInSync Conference
 
SQL WORKSHOP::Lecture 2
SQL WORKSHOP::Lecture 2SQL WORKSHOP::Lecture 2
SQL WORKSHOP::Lecture 2Umair Amjad
 
12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQL12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQLConnor McDonald
 
zen and the art of SQL optimization
zen and the art of SQL optimizationzen and the art of SQL optimization
zen and the art of SQL optimizationKaren Morton
 

Ähnlich wie Oracle12 for Developers - Oracle OpenWorld Preview AMIS (20)

Oracle Database 12c Application Development
Oracle Database 12c Application DevelopmentOracle Database 12c Application Development
Oracle Database 12c Application Development
 
11 things about 11gr2
11 things about 11gr211 things about 11gr2
11 things about 11gr2
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer Disasters
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11g
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01
 
UKOUG 2019 - SQL features
UKOUG 2019 - SQL featuresUKOUG 2019 - SQL features
UKOUG 2019 - SQL features
 
Les01
Les01Les01
Les01
 
Plsql examples
Plsql examplesPlsql examples
Plsql examples
 
12c Mini Lesson - ANSI standard TOP-N query syntax
12c Mini Lesson - ANSI standard TOP-N query syntax12c Mini Lesson - ANSI standard TOP-N query syntax
12c Mini Lesson - ANSI standard TOP-N query syntax
 
Les01
Les01Les01
Les01
 
SQLQueries
SQLQueriesSQLQueries
SQLQueries
 
Metadata Matters
Metadata MattersMetadata Matters
Metadata Matters
 
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكل
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكلحل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكل
حل اسئلة الكتاب السعودى فى شرح قواعد البيانات اوراكل
 
Connor McDonald 11g for developers
Connor McDonald 11g for developersConnor McDonald 11g for developers
Connor McDonald 11g for developers
 
Sql queries
Sql queriesSql queries
Sql queries
 
SQL WORKSHOP::Lecture 2
SQL WORKSHOP::Lecture 2SQL WORKSHOP::Lecture 2
SQL WORKSHOP::Lecture 2
 
Les02
Les02Les02
Les02
 
12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQL12c Mini Lesson - Inline PLSQL from SQL
12c Mini Lesson - Inline PLSQL from SQL
 
zen and the art of SQL optimization
zen and the art of SQL optimizationzen and the art of SQL optimization
zen and the art of SQL optimization
 

Mehr von Getting value from IoT, Integration and Data Analytics

Mehr von Getting value from IoT, Integration and Data Analytics (20)

AMIS Oracle OpenWorld en Code One Review 2018 - Blockchain, Integration, Serv...
AMIS Oracle OpenWorld en Code One Review 2018 - Blockchain, Integration, Serv...AMIS Oracle OpenWorld en Code One Review 2018 - Blockchain, Integration, Serv...
AMIS Oracle OpenWorld en Code One Review 2018 - Blockchain, Integration, Serv...
 
AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 2: Custom Application ...
AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 2: Custom Application ...AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 2: Custom Application ...
AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 2: Custom Application ...
 
AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 2: SaaS
AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 2: SaaSAMIS Oracle OpenWorld en Code One Review 2018 - Pillar 2: SaaS
AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 2: SaaS
 
AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 1: Data
AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 1: DataAMIS Oracle OpenWorld en Code One Review 2018 - Pillar 1: Data
AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 1: Data
 
AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 1: Cloud Infrastructure
AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 1: Cloud Infrastructure AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 1: Cloud Infrastructure
AMIS Oracle OpenWorld en Code One Review 2018 - Pillar 1: Cloud Infrastructure
 
10 tips voor verbetering in je Linkedin profiel
10 tips voor verbetering in je Linkedin profiel10 tips voor verbetering in je Linkedin profiel
10 tips voor verbetering in je Linkedin profiel
 
Iot in de zorg the next step - fit for purpose
Iot in de zorg   the next step - fit for purpose Iot in de zorg   the next step - fit for purpose
Iot in de zorg the next step - fit for purpose
 
Iot overview .. Best practices and lessons learned by Conclusion Conenct
Iot overview .. Best practices and lessons learned by Conclusion Conenct Iot overview .. Best practices and lessons learned by Conclusion Conenct
Iot overview .. Best practices and lessons learned by Conclusion Conenct
 
IoT Fit for purpose - how to be successful in IOT Conclusion Connect
IoT Fit for purpose - how to be successful in IOT Conclusion Connect IoT Fit for purpose - how to be successful in IOT Conclusion Connect
IoT Fit for purpose - how to be successful in IOT Conclusion Connect
 
Industry and IOT Overview of protocols and best practices Conclusion Connect
Industry and IOT Overview of protocols and best practices  Conclusion ConnectIndustry and IOT Overview of protocols and best practices  Conclusion Connect
Industry and IOT Overview of protocols and best practices Conclusion Connect
 
IoT practical case using the people counter sensing traffic density build usi...
IoT practical case using the people counter sensing traffic density build usi...IoT practical case using the people counter sensing traffic density build usi...
IoT practical case using the people counter sensing traffic density build usi...
 
R introduction decision_trees
R introduction decision_treesR introduction decision_trees
R introduction decision_trees
 
Introduction overviewmachinelearning sig Door Lucas Jellema
Introduction overviewmachinelearning sig Door Lucas JellemaIntroduction overviewmachinelearning sig Door Lucas Jellema
Introduction overviewmachinelearning sig Door Lucas Jellema
 
IoT and the Future of work
IoT and the Future of work IoT and the Future of work
IoT and the Future of work
 
Oracle OpenWorld 2017 Review (31st October 2017 - 250 slides)
Oracle OpenWorld 2017 Review (31st October 2017 - 250 slides)Oracle OpenWorld 2017 Review (31st October 2017 - 250 slides)
Oracle OpenWorld 2017 Review (31st October 2017 - 250 slides)
 
Ethereum smart contracts - door Peter Reitsma
Ethereum smart contracts - door Peter ReitsmaEthereum smart contracts - door Peter Reitsma
Ethereum smart contracts - door Peter Reitsma
 
Blockchain - Techniek en usecases door Robert van Molken - AMIS - Conclusion
Blockchain - Techniek en usecases door Robert van Molken - AMIS - ConclusionBlockchain - Techniek en usecases door Robert van Molken - AMIS - Conclusion
Blockchain - Techniek en usecases door Robert van Molken - AMIS - Conclusion
 
kennissessie blockchain - Wat is Blockchain en smart contracts @Conclusion
kennissessie blockchain -  Wat is Blockchain en smart contracts @Conclusion kennissessie blockchain -  Wat is Blockchain en smart contracts @Conclusion
kennissessie blockchain - Wat is Blockchain en smart contracts @Conclusion
 
Internet of Things propositie - Enterprise IOT - AMIS - Conclusion
Internet of Things propositie - Enterprise IOT - AMIS - Conclusion Internet of Things propositie - Enterprise IOT - AMIS - Conclusion
Internet of Things propositie - Enterprise IOT - AMIS - Conclusion
 
Omc AMIS evenement 26012017 Dennis van Soest
Omc AMIS evenement 26012017 Dennis van SoestOmc AMIS evenement 26012017 Dennis van Soest
Omc AMIS evenement 26012017 Dennis van Soest
 

Kürzlich hochgeladen

Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????blackmambaettijean
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rick Flair
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxBkGupta21
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningLars Bell
 

Kürzlich hochgeladen (20)

Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
What is Artificial Intelligence?????????
What is Artificial Intelligence?????????What is Artificial Intelligence?????????
What is Artificial Intelligence?????????
 
Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...Rise of the Machines: Known As Drones...
Rise of the Machines: Known As Drones...
 
unit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptxunit 4 immunoblotting technique complete.pptx
unit 4 immunoblotting technique complete.pptx
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
DSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine TuningDSPy a system for AI to Write Prompts and Do Fine Tuning
DSPy a system for AI to Write Prompts and Do Fine Tuning
 

Oracle12 for Developers - Oracle OpenWorld Preview AMIS

  • 1. Oracle 12c for Developers UGF3100 Alex Nuijten
  • 3. ⚠️ WARNING ⚠️ l o t s a n d l o t s There will be code in this presentation select 'can you read this?' from dual;
  • 5. R1 4 Years 2009 2013
  • 7. 2013 R1 In Memory Option 2014 12.1.0.2
  • 8. … but what’s in it for the Database Developer?
  • 9.
  • 11. SQL> create table t 2 (str varchar2(4000)); ! Table created.
  • 12. SQL> create table t 2 (str varchar2(4001)); (str varchar2(4001)) * ERROR at line 2: ORA-00910: specified length too long for its datatype
  • 13. ! SQL> create table t 2 (str varchar2(32767)) 3 / (str varchar2(32767)) * ERROR at line 2: ORA-00910: specified length too long for its datatype
  • 14. a little bit of DBA magic
  • 15. SQL> create table t 2 (str varchar2(32767)); ! Table created.
  • 16. Top N and Pagination
  • 17. SQL> select ename 2 ,sal 3 from emp 4 where rownum < 4 5 order by sal desc 6 / ! ENAME SAL ------- ------- ALLEN 1200 WARD 1250 SMITH 800
  • 18. SQL> select * 2 from (select ename 3 ,sal 4 from emp 5 order by sal desc 6 ) 7 where rownum < 4 8 / ! ENAME SAL -------- ------- KING 5000 SCOTT 3000 FORD 3000
  • 19. SQL> select ename 2 ,sal 3 from emp 4 order by sal desc 5 fetch first 3 rows only 6 / ! ENAME SAL -------- ------- KING 5000 SCOTT 3000 FORD 3000
  • 20. SQL> select ename 2 ,sal 3 from emp 4 order by sal desc 5 offset 3 rows 6 fetch next 3 rows only 7 / ! ENAME SAL -------- ------- JONES 2975 BLAKE 2850 CLARK 2450
  • 21. Execution Plan ---------------------------------------------------------- Plan hash value: 3291446077 ! --------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | --------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 14 | 644 | 4 (25)| 00:00:01 | |* 1 | VIEW | | 14 | 644 | 4 (25)| 00:00:01 | |* 2 | WINDOW SORT PUSHED RANK| | 14 | 140 | 4 (25)| 00:00:01 | | 3 | TABLE ACCESS FULL | EMP | 14 | 140 | 3 (0)| 00:00:01 | --------------------------------------------------------------------------------- ! Predicate Information (identified by operation id): --------------------------------------------------- ! 1 - filter("from$_subquery$_002"."rowlimit_$$_rownumber"<=CASE WHEN (3>=0) THEN 3 ELSE 0 END +3 AND "from$_subquery$_002"."rowlimit_$$_rownum ber">3) 2 - filter(ROW_NUMBER() OVER ( ORDER BY INTERNAL_FUNCTION("SAL") DESC )<=CASE WHEN (3>=0) THEN 3 ELSE 0 END +3)
  • 22.
  • 23. ! SQL> select ename 2 ,sal 3 from emp 4 order by sal desc 5 fetch first 25 percent row only; ! ENAME SAL ---------- ---------- KING 5000 FORD 3000 SCOTT 3000 JONES 2975
  • 24. Execution Plan ---------------------------------------------------------- Plan hash value: 4130734685 ! ---------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ---------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 14 | 826 | 4 (25)| 00:00:01 | |* 1 | VIEW | | 14 | 826 | 4 (25)| 00:00:01 | | 2 | WINDOW SORT | | 14 | 140 | 4 (25)| 00:00:01 | | 3 | TABLE ACCESS FULL| EMP | 14 | 140 | 3 (0)| 00:00:01 | ---------------------------------------------------------------------------- ! Predicate Information (identified by operation id): --------------------------------------------------- ! 1 - filter("from$_subquery$_002"."rowlimit_$$_rownumber"<=CEIL("from$ _subquery$_002"."rowlimit_$$_total"*25/100))
  • 26. SQL> create table weather 2 (dt date not null 3 ,rain number not null 4 ); ! Table created.
  • 27. SQL> insert into weather 2 with rsf(r) 3 as 4 (select 1 5 from dual 6 union all 7 select r + 1 8 from rsf 9 where r < 31) 10 select to_date (to_char (r)||'-08-2014', 'dd-mm-yyyy') dt 11 ,round ((dbms_random.value * 20)) rain 12 from rsf 13 / ! 31 rows created.
  • 28. SQL> select dt 2 ,rain 3 ,trend 4 from weather 5 match_recognize( 6 order by dt 7 measures classifier() as trend 8 all rows per match 9 pattern (Better* Worse* same*) 10 define Better as Better.rain < prev (rain) 11 ,Worse as Worse.rain > prev (rain) 12 ,same as same.rain = prev (rain) 13 );
  • 29. DT RAIN TREND --------- ---------- --------- 01-AUG-14 14 02-AUG-14 0 BETTER 03-AUG-14 19 WORSE 04-AUG-14 6 BETTER 05-AUG-14 20 WORSE 06-AUG-14 1 BETTER 07-AUG-14 17 WORSE 08-AUG-14 17 SAME 09-AUG-14 14 BETTER 10-AUG-14 18 WORSE 11-AUG-14 9 BETTER 12-AUG-14 4 BETTER 13-AUG-14 17 WORSE 14-AUG-14 16 BETTER 15-AUG-14 5 BETTER Wh a t a b o u t A n a l y t i c Fu n c t i o n s?
  • 30. SQL> select dt 2 ,rain 3 ,case 4 when rain < lag (rain) over (order by dt) 5 then 'Better' 6 when rain > lag (rain) over (order by dt) 7 then 'Worse' 8 when rain = lag (rain) over (order by dt) 9 then 'Same' 10 end trend 11 from weather;
  • 31. DT RAIN TREND --------- ---------- --------- 01-AUG-14 14 02-AUG-14 0 Better 03-AUG-14 19 Worse 04-AUG-14 6 Better 05-AUG-14 20 Worse 06-AUG-14 1 Better 07-AUG-14 17 Worse 08-AUG-14 17 Same 09-AUG-14 14 Better 10-AUG-14 18 Worse 11-AUG-14 9 Better 12-AUG-14 4 Better 13-AUG-14 17 Worse 14-AUG-14 16 Better 15-AUG-14 5 Better
  • 32. SQL> select * L o o k i n g f o r D r y S p e l l s 2 from weather 3 match_recognize 4 ( 5 order by dt 6 measures first (wet.dt) as first_wetday 7 ,dry.dt as dryday 8 ,last (wet.dt) as last_wetday 9 one row per match 10 pattern (wet dry{2,} wet*) 11 define 12 wet as wet.rain > 10, 13 dry as dry.rain <= 10 14 );
  • 33. pattern (wet dry{2,} wet*) FIRST_WET DRYDAY LAST_WETD --------- --------- --------- 10-AUG-14 12-AUG-14 14-AUG-14 23-AUG-14 26-AUG-14 27-AUG-14 2 rows selected. 21-AUG-14 15 22-AUG-14 12 23-AUG-14 18 24-AUG-14 2 25-AUG-14 5 26-AUG-14 4 27-AUG-14 15 28-AUG-14 7 09-AUG-14 14 10-AUG-14 18 11-AUG-14 9 12-AUG-14 4 13-AUG-14 17 14-AUG-14 16 15-AUG-14 5
  • 34. Galo Balda SQL Pattern Matching in Oracle 12c ! Sunday: UGF4482! Time: 1:30 PM Stew Ashton Oracle Database 12c Row Pattern Matching: Beating the Best Pre-12c Solutions ! Monday: CON3450! Time: 4:00 PM
  • 36. SQL> create table addresses 2 (empno number 3 ,street varchar2(50) 4 ,houseno number 5 ,start_date date 6 ,end_date date 7 ,period for address_valid (start_date, end_date) 8 ); ! Table created.
  • 37. SQL> select street 2 , houseno 3 , start_date 4 , end_date 5 from addresses; ! STREET HOUSENO START_DAT END_DATE --------------- ---------- --------- --------- Brandywine Rd 345 05-AUG-95 15-FEB-96 Spencer Run 12 16-FEB-96 30-APR-00 Via Palm Lake 741 01-MAY-00 31-JAN-13 76th Way 7616 01-FEB-13
  • 38. SQL> select street 2 ,houseno 3 ,start_date 4 ,end_date 5 from addresses as of period 6 for address_valid sysdate; ! STREET HOUSENO START_DAT END_DATE --------------- ---------- --------- --------- 76th Way 7616 01-FEB-13
  • 39. SQL> select street 2 ,houseno 3 ,start_date 4 ,end_date 5 from addresses 6 versions period for address_valid 7 between date '2010-06-01' 8 and sysdate ! STREET HOUSENO START_DAT END_DATE --------------- ---------- --------- --------- Via Palm Lake 741 01-MAY-00 31-JAN-13 76th Way 7616 01-FEB-13
  • 40. SQL> begin 2 dbms_flashback_archive.enable_at_valid_time ('CURRENT'); 3 end; 4 / ! PL/SQL procedure successfully completed.
  • 41. ! SQL> select street 2 ,houseno 3 ,start_date 4 ,end_date 5 from addresses; ! STREET HOUSENO START_DAT END_DATE --------------- ---------- --------- --------- 76th Way 7616 01-FEB-13
  • 42. ! SQL> begin 2 dbms_flashback_archive.enable_at_valid_time ('ALL'); 3 end; 4 / ! PL/SQL procedure successfully completed.
  • 43. SQL> select street 2 , houseno 3 , start_date 4 , end_date 5 from addresses; ! STREET HOUSENO START_DAT END_DATE --------------- ---------- --------- --------- Brandywine Rd 345 05-AUG-95 15-FEB-96 Spencer Run 12 16-FEB-96 30-APR-00 Via Palm Lake 741 01-MAY-00 31-JAN-13 76th Way 7616 01-FEB-13
  • 45. SQL> create table t 2 (id number generated as identity 3 ,name varchar2(35) 4 ); ! Table created.
  • 46. ! SQL> insert into t (name) values ('Alex'); ! 1 row created.
  • 47. SQL> insert into t (id, name) values (42, 'TEST'); insert into t (id, name) values (42, 'TEST') * ERROR at line 1: ORA-32795: cannot insert into a generated always identity column
  • 48. SQL> insert into t (id, name) values (null, 'TEST'); insert into t (id, name) values (null, 'TEST') * ERROR at line 1: ORA-32795: cannot insert into a generated always identity column
  • 49. SQL> insert into t (id, name) values (default, 'TEST'); ! 1 row created.
  • 50. GENERATED [ ALWAYS | BY DEFAULT [ ON NULL ] ] AS IDENTITY [ ( identity_options ) ] Similar to Sequence Options
  • 51. SQL> create table t 2 (id number generated as identity (start with 42 increment by 2) 3 ,name varchar2(35) 4 ); ! Table created.
  • 52. SQL> insert into t 2 (name) 3 values 4 ('Alex'); ! 1 row created. ! SQL> select * 2 from t 3 / ! ID NAME ----- --------- 42 Alex
  • 53. SQL> insert into t 2 (name) 3 values 4 ('Tim'); ! 1 row created. ! SQL> select * 2 from t 3 / ! ID NAME ----- --------- 42 Alex 44 Tim
  • 55. SQL> create table t 2 (str varchar2(10) default 'hello' 3 ); ! ! Table created. ! SQL> insert into t values (null) 2 / ! 1 row created.
  • 56. SQL> select * 2 from t 3 / ! STR ---------- Yes, there is a row there
  • 57. SQL> insert into t values (default) 2 / ! 1 row created. ! SQL> select * 2 from t 3 / ! STR ---------- ! hello
  • 58. SQL> create table t 2 (str varchar2(10) default on null 'Hello' 3 ); ! Table created. ! SQL> insert into t values (null) 2 / ! 1 row created. ! SQL> select * from t 2 / ! STR ---------- Hello
  • 59. SQL> create sequence seq 2 / ! Sequence created. ! SQL> create table t 2 (id number default seq.nextval 3 ,name varchar2(35) 4 ); ! Table created.
  • 60. SQL> insert into t (name) 2 values ('Testing'); ! 1 row created. ! SQL> insert into t (id, name) 2 values (42, 'Testing'); ! 1 row created. ! SQL> insert into t (id, name) 2 values (null, 'Testing'); ! 1 row created.
  • 61. SQL> select * 2 from t 3 / ! ID NAME ----- -------- 1 Testing 42 Testing Testing
  • 62. SQL> create sequence seq 2 / ! Sequence created. ! SQL> create table t 2 (id number default on null seq.nextval 3 ,name varchar2(35) 4 ); ! Table created. Only when NULL
  • 63. SQL> insert into t values (null, 'test') 2 / ! 1 row created. ! SQL> select * from t 2 / ! ID NAME ------ --------------------------------- 1 test
  • 64. SQL> create sequence master_seq 2 / ! Sequence created. ! SQL> create sequence detail_seq 2 / ! Sequence created.
  • 65. SQL> create table masters 2 (id number default master_seq.nextval 3 ,name varchar2(35) 4 ); ! Table created. ! SQL> create table details 2 (id number default detail_seq.nextval 3 ,master_id number default master_seq.currval 4 ,name varchar2(35) 5 ); ! Table created.
  • 66. SQL> insert into masters (name) 2 values ('First Master') 3 / ! 1 row created. ! SQL> insert into details (name) 2 select 'Detail '||to_char (rownum) 3 from dual 4 connect by level <= 5 5 / ! 5 rows created.
  • 67. SQL> insert into masters (name) 2 values ('Second Master') 3 / ! 1 row created. ! SQL> insert into details (name) 2 select 'Detail '||to_char (rownum) 3 from dual 4 connect by level <= 5 5 / ! 5 rows created.
  • 68. SQL> select * 2 from details 3 / ! ID MASTER_ID NAME ---- ---------- ------------ 1 1 Detail 1 2 1 Detail 2 3 1 Detail 3 4 1 Detail 4 5 1 Detail 5 6 2 Detail 1 7 2 Detail 2 8 2 Detail 3 9 2 Detail 4 10 2 Detail 5 ! 10 rows selected.
  • 69. Subquery Factoring “Th e W ITH C l a u s e”
  • 70. SQL> select * 2 from (select ename 3 ,sal 4 from emp 5 order by sal desc 6 ) 7 where rownum < 4 8 / ! ENAME SAL -------- ------- KING 5000 SCOTT 3000 FORD 3000 SQL> with ordered_emps 2 as 3 (select ename 4 ,sal 5 from emp 6 order by sal desc 7 ) 9 select * 10 from ordered_emps 11 where rownum < 4 12 / ! ENAME SAL -------- ------- KING 5000 SCOTT 3000 FORD 3000
  • 71. SQL> with lots(r) 2 as 3 (select 1 r from dual 4 union all 5 select r+1 from lots 6 where r < 5 7 ) 8 select * 9 from lots 10 / ! R ---------- 1 2 3 4 5 ! 5 rows selected.
  • 72. SQL> with 2 function formatname (p_name in varchar2) 3 return varchar2 4 is 5 begin 6 return initcap (p_name); 7 end formatname; 8 select ename 9 ,formatname(ename) formatted 10 from emp; ! ENAME FORMATTED ---------- ------------------------- SMITH Smith ALLEN Allen WARD Ward JONES Jones MARTIN Martin
  • 73. SQL> with 2 procedure show (p_what in varchar2) 3 is 4 begin 5 dbms_output.put_line (p_what); 6 end show; 7 function formatname (p_name in varchar2) 8 return varchar2 9 is 10 begin 11 show ('The input was: '||p_name); 12 return initcap (p_name); 13 end formatname; 14 select ename 15 ,formatname (ename) formatted 16 from emp;
  • 74. ENAME FORMATTED ---------- ------------- SMITH Smith ALLEN Allen WARD Ward JONES Jones MARTIN Martin BLAKE Blake CLARK Clark SCOTT Scott KING King TURNER Turner ADAMS Adams JAMES James FORD Ford MILLER Miller ! 14 rows selected.
  • 75. The input was: SMITH The input was: ALLEN The input was: WARD The input was: JONES The input was: MARTIN The input was: BLAKE The input was: CLARK The input was: SCOTT The input was: KING The input was: TURNER The input was: ADAMS The input was: JAMES The input was: FORD The input was: MILLER
  • 76. SQL> with 2 procedure show (p_what in varchar2) 3 is 4 begin 5 dbms_output.put_line ('input is: '||p_what); 6 end show; 7 function formatname (p_name in varchar2) 8 return varchar2 9 is 10 begin 11 show (p_name); 12 return initcap (p_name); 13 end formatname; 14 ordered_emps as 15 (select ename from emp order by ename asc) 16 select ename 17 ,formatname(ename) formatted 18 from ordered_emps 19 /
  • 77. ENAME FORMATTED ---------- ----------- ADAMS Adams ALLEN Allen BLAKE Blake CLARK Clark FORD Ford JAMES James JONES Jones KING King MARTIN Martin MILLER Miller SCOTT Scott SMITH Smith TURNER Turner WARD Ward ! 14 rows selected.
  • 78. input is: SMITH input is: ALLEN input is: WARD input is: JONES input is: MARTIN input is: BLAKE input is: CLARK input is: SCOTT input is: KING input is: TURNER input is: ADAMS input is: JAMES input is: FORD input is: MILLER
  • 80. SQL> create or replace 2 function formatname (p_name in varchar2) 3 return varchar2 4 is 5 pragma udf; 6 begin 7 return initcap (p_name); 8 end; 9 /
  • 81. This page is intentionally left blank
  • 83. SQL> create or replace 2 procedure restricted_proc 3 accessible by (public_proc) 4 is 5 begin 6 dbms_output.put_line 7 ('This can only be called by the public program'); 8 end restricted_proc; ! Procedure created.
  • 84. SQL> create or replace 2 procedure public_proc 3 is 4 begin 5 dbms_output.put_line ('This is the public program'); 6 restricted_proc; 7 end public_proc; ! Procedure created.
  • 85. SQL> begin 2 public_proc; 3 end; 4 / This is the public program This can only be called by the public program ! PL/SQL procedure successfully completed.
  • 86. SQL> begin 2 restricted_proc; 3 end; 4 / restricted_proc; * ERROR at line 2: ORA-06550: line 2, column 4: PLS-00904: insufficient privilege to access object RESTRICTED_PROC ORA-06550: line 2, column 4: PL/SQL: Statement ignored
  • 88. select … from … Redacted Data
  • 89. SQL> select ename 2 ,hiredate 3 ,credit_card 4 from emp 5 / ! ENAME HIREDATE CREDIT_CARD ---------- --------- ------------------ SMITH 17-DEC-80 4916328952854172 ALLEN 20-FEB-81 4539313944751949 WARD 22-FEB-81 4716066949870198 JONES 02-APR-81 5535742924238587 MARTIN 28-SEP-81 5570058606015920 BLAKE 01-MAY-81 5103520492409737 CLARK 09-JUN-81 377819476595275 SCOTT 19-APR-87 349683522367948
  • 90. begin dbms_redact.add_policy (object_schema => 'ALEX' ,object_name => 'EMP' ,policy_name => 'Hide Creditcard' ,expression => '1=1' ,column_name => 'CREDIT_CARD' ,function_type => dbms_redact.regexp ,regexp_pattern => dbms_redact.re_pattern_any_digit ,regexp_replace_string => 'X' ); end; / C h o o s e Po l i c y N ame Wi s e l y !
  • 91. ENAME HIREDATE CREDIT_CARD ---------- --------- ------------------------- SMITH 17-DEC-80 XXXXXXXXXXXXXXXX ALLEN 20-FEB-81 XXXXXXXXXXXXXXXX WARD 22-FEB-81 XXXXXXXXXXXXXXXX JONES 02-APR-81 XXXXXXXXXXXXXXXX MARTIN 28-SEP-81 XXXXXXXXXXXXXXXX BLAKE 01-MAY-81 XXXXXXXXXXXXXXXX CLARK 09-JUN-81 XXXXXXXXXXXXXXX SCOTT 19-APR-87 XXXXXXXXXXXXXXX
  • 92. begin dbms_redact.add_policy (object_schema => 'ALEX' ,object_name => 'EMP' ,policy_name => 'Hide Creditcard' ,expression => '1=1' ,column_name => 'CREDIT_CARD' ,function_type => dbms_redact.partial ,function_parameters => dbms_redact.redact_ccn16_f12 ); end; /
  • 93. ENAME HIREDATE CREDIT_CARD ---------- --------- ------------------------- SMITH 17-DEC-80 ****-****-****-2 ALLEN 20-FEB-81 ****-****-****-9 WARD 22-FEB-81 ****-****-****-8 JONES 02-APR-81 ****-****-****-7 MARTIN 28-SEP-81 ****-****-****-0 BLAKE 01-MAY-81 ****-****-****-7 CLARK 09-JUN-81 ****-****-****- SCOTT 19-APR-87 ****-****-****-
  • 94. begin dbms_redact.add_policy( object_schema => 'ALEX' ,object_name => 'EMP' ,column_name => 'CREDIT_CARD' ,policy_name => 'Hide Credit Card' ,function_type => dbms_redact.regexp ,function_parameters => null ,expression => '1=1' ,regexp_pattern => dbms_redact.re_pattern_cc_l6_t4 ,regexp_replace_string => dbms_redact.re_redact_cc_middle_digits ,regexp_position => dbms_redact.re_beginning ,regexp_occurrence => dbms_redact.re_first ); end; /
  • 95. ENAME HIREDATE CREDIT_CARD ---------- --------- ------------------------- SMITH 17-DEC-80 491632XXXXXX4172 ALLEN 20-FEB-81 453931XXXXXX1949 WARD 22-FEB-81 471606XXXXXX0198 JONES 02-APR-81 553574XXXXXX8587 MARTIN 28-SEP-81 557005XXXXXX5920 BLAKE 01-MAY-81 510352XXXXXX9737 CLARK 09-JUN-81 377819XXXXXX5275 SCOTT 19-APR-87 349683XXXXXX7948
  • 96. begin dbms_redact.add_policy( object_schema => 'ALEX' ,object_name => 'EMP' ,column_name => 'CREDIT_CARD' ,policy_name => 'gibberish' ,function_type => DBMS_REDACT.RANDOM ,expression => '1=1' ); END; /
  • 97. ENAME HIREDATE CREDIT_CARD ---------- --------- ------------------------- SMITH 17-DEC-80 _Z^1LYqgbfd9Tay ALLEN 20-FEB-81 dN9Vpp_.lVA^xxg6 WARD 22-FEB-81 ?8!%`:BQG@)-hBJY JONES 02-APR-81 ~+bn/Mad'3jv7Ui MARTIN 28-SEP-81 hg}BQ8etpo&JY@m| BLAKE 01-MAY-81 *PJ" ,qL2XR*(4yT CLARK 09-JUN-81 !e5`E)g))m=hM1o SCOTT 19-APR-87 *|V]>n%y2%^eFv-
  • 98. ENAME HIREDATE CREDIT_CARD ---------- --------- ------------------------- SMITH 17-DEC-80 _;T99'L@gCAA/TH ALLEN 20-FEB-81 J/Zs)aE@R7b{1iMH WARD 22-FEB-81 {?-Z#/b0$G5b+7j8 JONES 02-APR-81 IKn4cRczQSv<kZk# MARTIN 28-SEP-81 qX=>90;?y`EFA8CG BLAKE 01-MAY-81 oTSNzmVhw[V#u^p CLARK 09-JUN-81 <$/9d5T'D,7Al= SCOTT 19-APR-87 au$O]"P|i},We*X
  • 99. begin dbms_redact.add_policy (object_schema => 'ALEX' ,object_name => 'EMP' ,policy_name => 'Hide Hire Date' ,expression => '1=1' ,column_name => 'HIREDATE' ,function_type => dbms_redact.partial ,function_parameters => dbms_redact.redact_date_millennium ); end; /
  • 100. ENAME HIREDATE CREDIT_CARD ---------- --------- ------------------------- SMITH 01-JAN-00 4916328952854172 ALLEN 01-JAN-00 4539313944751949 WARD 01-JAN-00 4716066949870198 JONES 01-JAN-00 5535742924238587 MARTIN 01-JAN-00 5570058606015920 BLAKE 01-JAN-00 5103520492409737 CLARK 01-JAN-00 377819476595275 SCOTT 01-JAN-00 349683522367948
  • 101. begin dbms_redact.alter_policy( object_schema => 'ALEX' ,object_name => 'EMP' ,policy_name => 'Obscure some data' ,action => dbms_redact.ADD_COLUMN ,column_name => 'HIREDATE' ,function_type => dbms_redact.partial ,function_parameters => dbms_redact.redact_date_epoch ); end; / Same Policy Name C h o o s e Po l i c y N ame Wi s e l y !
  • 102. ENAME HIREDATE CREDIT_CARD ---------- --------- ------------------------- SMITH 01-JAN-70 491632XXXXXX4172 ALLEN 01-JAN-70 453931XXXXXX1949 WARD 01-JAN-70 471606XXXXXX0198 JONES 01-JAN-70 553574XXXXXX8587 MARTIN 01-JAN-70 557005XXXXXX5920 BLAKE 01-JAN-70 510352XXXXXX9737 CLARK 01-JAN-70 377819XXXXXX5275 SCOTT 01-JAN-70 349683XXXXXX7948
  • 105. Name : Value Name : Value, Name : Value, { }
  • 106. [ { Name : Value } , { Name : Value Name : Value, Name : Value, } ] Name : Value, Name : Value,
  • 107. {"ACCOUNTING" : { "EMPLOYEES" : [ {"ENAME" : "KING", "JOB" : "PRESIDENT", "SAL" : 5000 }, {"ENAME" : "MILLER", "JOB" : "CLERK", "SAL" : 1300 }] } }
  • 108. SQL> create table t 2 (json_data varchar2(4000) 3 ); ! Table created. ! SQL> alter table t 2 add constraint json_valid check (json_data is json) 3 / ! Table altered.
  • 109. SQL> insert into t 2 values ('{"valid":"json"}'); ! 1 row created.
  • 110. SQL> insert into t 2 values ('Just a string'); insert into t * ERROR at line 1: ORA-02290: check constraint (ALEX.JSON_VALID) violated
  • 111. SQL> select json_value (json_data 2 ,'$.valid' 3 ) 4 from t 5 / ! JSON_VALUE(JSON_DATA,'$.VALID') -------------------------------- json Json Path Expression
  • 112. insert into t values ('{"ACCOUNTING" : { "EMPLOYEES" : [ {"ENAME" : "KING", "JOB" : "PRESIDENT", "SAL" : 5000 }, {"ENAME" : "MILLER", "JOB" : "CLERK", "SAL" : 1300 }] } }');
  • 113. SQL> select json_value (json_data Json Path Expression 2 ,'$.ACCOUNTING.EMPLOYEES[0].ENAME') 2 from t; ! JSON_VALUE(JSON_DATA,'$.ACCOUNTING.EMPLOYEES[0].ENAME') ------------------------------------------------------- ! KING ! 2 rows selected.
  • 114. SQL> select ename 2 ,job 3 ,sal 4 from t 5 ,json_table (json_data, '$.ACCOUNTING.EMPLOYEES[*]' 6 columns (ename varchar2(20) path '$.ENAME' 7 ,job varchar2(20) path '$.JOB' 8 ,sal number path '$.SAL' 9 )); ! ENAME JOB SAL ------------ ------------ ---------- KING PRESIDENT 5000 MILLER CLERK 1300 ! 2 rows selected.
  • 115. SQL> select * 2 from t 3 where json_exists (json_data 4 ,'$.*.EMPLOYEES'); ! JSON_DATA ------------------------------------------- {"ACCOUNTING" : { "EMPLOYEES" : [ {"ENAME" : "KING", "JOB" : "PRESIDENT", "SAL" : 5000 }, {"ENAME" : "MILLER", "JOB" : "CLERK", "SAL" : 1300 }] } }
  • 116. JSON Generation post 12.1.0.2 JSON_OBJECT JSON_ARRAY
  • 118. SQL> create or replace 2 procedure show_callstack 3 is 4 begin 5 dbms_output.put_line (dbms_utility.format_call_stack()); 6 end show_callstack; 7 / ! Procedure created.
  • 119. 1 create or replace 2 package body pkg is 3 procedure p 4 is 5 procedure q 6 is 7 procedure r 8 is 9 procedure p is 10 begin 11 show_callstack(); 12 raise program_error; 13 end p; 14 begin 15 p(); 16 end r; 17 begin 18 r(); 19 end q; 20 begin 21 q(); 22 end p; 23 end pkg;
  • 120. 1 create or replace 2 package body pkg is 3 procedure p 4 is 5 procedure q 6 is 7 procedure r 8 is 9 procedure p is 10 begin 11 show_callstack(); 12 raise program_error; 13 end p; 14 begin 15 p(); 16 end r; 17 begin 18 r(); 19 end q; 20 begin 21 q(); 22 end p; 23 end pkg;
  • 121. 1 create or replace 2 package body pkg is 3 procedure p 4 is 5 procedure q 6 is 7 procedure r 8 is 9 procedure p is 10 begin 11 show_callstack(); 12 raise program_error; 13 end p; 14 begin 15 p(); 16 end r; 17 begin 18 r(); 19 end q; 20 begin 21 q(); 22 end p; 23 end pkg;
  • 122. 1 create or replace 2 package body pkg is 3 procedure p 4 is 5 procedure q 6 is 7 procedure r 8 is 9 procedure p is 10 begin 11 show_callstack(); 12 raise program_error; 13 end p; 14 begin 15 p(); 16 end r; 17 begin 18 r(); 19 end q; 20 begin 21 q(); 22 end p; 23 end pkg;
  • 123. 1 create or replace 2 package body pkg is 3 procedure p 4 is 5 procedure q 6 is 7 procedure r 8 is 9 procedure p is 10 begin 11 show_callstack(); 12 raise program_error; 13 end p; 14 begin 15 p(); 16 end r; 17 begin 18 r(); 19 end q; 20 begin 21 q(); 22 end p; 23 end pkg;
  • 124. ----- PL/SQL Call Stack ----- object line object handle number name 0x9faa8f18 4 procedure ALEX.SHOW_CALLSTACK 0x9dbd2c00 10 package body ALEX.PKG 0x9dbd2c00 14 package body ALEX.PKG 0x9dbd2c00 17 package body ALEX.PKG 0x9dbd2c00 20 package body ALEX.PKG 0x9fc73e18 2 anonymous block ! begin * ERROR at line 1: ORA-06501: PL/SQL: program error ORA-06512: at "ALEX.PKG", line 11 ORA-06512: at "ALEX.PKG", line 14 ORA-06512: at "ALEX.PKG", line 17 ORA-06512: at "ALEX.PKG", line 20 ORA-06512: at line 2
  • 126. SQL> create or replace 2 procedure show_callstack 3 as 4 depth pls_integer := utl_call_stack.dynamic_depth(); 5 procedure headers ... 11 end headers; 12 begin 13 headers; 14 for j in reverse 1..depth loop 15 dbms_output.put_line( 16 rpad( utl_call_stack.lexical_depth(j), 10 ) || 17 rpad( j, 7) || 18 rpad( to_char(utl_call_stack.unit_line(j), '99'), 9 ) || 19 utl_call_stack.concatenate_subprogram 20 (utl_call_stack.subprogram(j))); 21 end loop; 22 end show_callstack;
  • 127. SQL> create or replace 2 procedure show_callstack 3 as 4 depth pls_integer := utl_call_stack.dynamic_depth(); 5 procedure headers ... 11 end headers; 12 begin 13 headers; 14 for j in reverse 1..depth loop 15 dbms_output.put_line( 16 rpad( utl_call_stack.lexical_depth(j), 10 ) || 17 rpad( j, 7) || 18 rpad( to_char(utl_call_stack.unit_line(j), '99'), 9 ) || 19 utl_call_stack.concatenate_subprogram 20 (utl_call_stack.subprogram(j))); 21 end loop; 22 end show_callstack;
  • 128. Lexical Depth Line Name Depth Number ------- ----- ---- ---- 0 6 2 __anonymous_block 1 5 20 PKG.P 2 4 17 PKG.P.Q 3 3 14 PKG.P.Q.R 4 2 10 PKG.P.Q.R.P 0 1 14 SHOW_CALLSTACK begin * ERROR at line 1: ORA-06501: PL/SQL: program error ORA-06512: at "ALEX.PKG", line 11 ORA-06512: at "ALEX.PKG", line 14 ORA-06512: at "ALEX.PKG", line 17 ORA-06512: at "ALEX.PKG", line 20 ORA-06512: at line 2
  • 130.
  • 131. Connor McDonald 12c for Developers ! Sunday: UGF2244! Time: 2:30 PM Moscone South 303 Lucas Jellema Everything That Is Really Useful in Oracle Database 12c for Application Developers ! Wednesday: CON2394! Time: 3:30 PM Moscone South 307
  • 133. 12 Looks at Oracle Database 12c: EOUC Short Talks Jonathan Lewis Christian Antognini Osama Mustafa Gurcan Orhan Alex Nuijten Oded Raz Sunday: UGF8949 and UGF9221! Time: 2:30 PM and 3:30 PM Moscone South 304 Tim Hall Ami Aharonovich Kashif Manzoor Julian Dontcheff Björn Rost Dimitry Volkov
  • 136. Alex Nuijten Alex.Nuijten@Ordina.nl ! nuijten.blogspot.com @alexnuijten
  • 137. NOAA's National Ocean Service https://flic.kr/p/dCB8ne Geoffrey Fairchild https://flic.kr/p/6tKgHz Mutant669 http://bit.ly/1tqcAJu Monica Arellano-Ongpin https://flic.kr/p/cZ6YT9 James MacDonald https://flic.kr/p/9gX5fM _DJ_ https://flic.kr/p/dLbzPm aussiegall https://flic.kr/p/rksBi Horia Varlan https://flic.kr/p/7vedzj Jukka Zitting https://flic.kr/p/8EZw4m Steve Parker https://flic.kr/p/gACG9