SlideShare a Scribd company logo
The following is intended to outline our general product 
direction. It is intended for information purposes only, and 
may not be incorporated into any contract. It is not a 
commitment to deliver any material, code, or functionality, 
and should not be relied upon in making purchasing 
decisions. The development, release, and timing of any 
features or functionality described for Oracle's products 
remains at the sole discretion of Oracle. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Oracle Database 12c 
Application Development 
Saurabh K. Gupta 
Oracle Database Product Management
AApppplliiccaattiioonn DDeevveellooppmmeenntt 
BBiigg DDaattaa 
CCoonnssoolliiddaattiioonn 
DDaattaa OOppttiimmiizzaattiioonn 
DDaattaa WWaarreehhoouussiinngg 
Plug into the Cloud 
HHiigghh AAvvaaiillaabbiilliittyy 
IInn-MMeemmoorryy 
PPeerrffoorrmmaannccee && SSccaallaabbiilliittyy 
SSeeccuurriittyy && CCoommpplliiaannccee 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Development in Oracle Database 12c 
A rich and powerful development environment 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Agenda 
• Temporal Databases 
• SQL New features 
• PL/SQL New features 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
• Partitioning 
• SQL Developer
Multitenant New Features in 12.1.0.2 
• Subset by tablespace 
• Metadata-only clone 
• Remote clone (including 
snapshots) 
• New SQL clause to aggregate 
data across PDBs 
select ENAME from 
containers(scott.EMP) 
where CON_ID in (45, 49); 
Cloning 
SQL 
Cross PDB Queries 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
• New “standbys” clause 
• (all | none) 
• Nologging clause at PDB level 
• Flashback data archive, 
transaction query & backout 
• Temporal SQL Support 
• Compatible with DB In-Memory 
• Maintains state of PDBs 
between CDB restarts 
7 
PRIMARY STANDBY 
Standby & Logging 
Additional 
Features
Oracle Database 12c and Temporal Data 
• Managing the time dimension 
TTeemmppoorraall VVaalliiddiittyy 
FFllaasshh BBaacckk DDaattaa AArrcchhiivvee 
FFllaasshhbbaacckk QQuueerryy 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Temporal Applications 
Modeling time is hard 
• Developing applications that understand history is 
complicated 
• Querying and reporting history data is hard, as 
schemas evolve 
Employees 
History Kept 
• The result is history is only tracked for a few key 
tables 
– Often raw fact data is tracked but context is not 
– e.g. Sales history is tracked, but not quota rules, or 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
territories 
Departments 
No History
Oracle Database 12c Temporal Support 
Transaction Time Temporal 
(Flashback Data Archive) 
 Tracks transactional changes to a 
table over its lifetime 
Valid Time Temporal 
 Enables user to model  query data 
for “real world validity” 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
 Typically used for compliance and 
auditing 
 Enables the users to see the data 
as it was at a point in time in the 
past 
 Typically used for insurance policies, 
financial markets, trade data  future 
changes 
 Users can model concepts such as 
the “Life time of an insurance policy”
Valid Time Temporal 
Querying Data Validity 
• VALID TIME rows are stored in the base table itself 
• By default, queries see all rows in the table 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Changes are written to 
timestamp columns on base 
table 
Valid Time Data read from base table 
(filtered using SQL)
Valid Time Temporal 
Example 
CREATE TABLE customers( 
custid NUMBER, 
custname VARCHAR2(30), 
custaddr1 VARCHAR2(50), 
custaddr2 VARCHAR2(50), 
custcity VARCHAR2(50), 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
custstate VARCHAR2(2), 
custzip VARCHAR2(20), 
start_time TIMESTAMP, 
end_time TIMESTAMP, 
PERIOD FOR cust_valid_time (start_time, end_time));
Valid Time Temporal 
Example 
custid custname custaddr1 custaddr2 custcity custstate custzip start_time end_time 
1 Acme Inc 123 Any 
Street 
Suite 17 Anytown CA 99999 01-JAN-14 
INSERT INTO CUSTOMERS VALUES (1,'Acme Inc.','123 Any Street', 
'Suite 17','Anytown','AS','99999', TO_TIMESTAMP('01-JAN-14’), 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
NULL);
Valid Time Temporal 
Example 
custid custname custaddr1 custaddr2 custcity custstate custzip start_time end_time 
1 Acme Inc 123 Any 
Street 
Suite 17 Anytown CA 99999 01-JAN-14 31-AUG-14 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
UPDATE customers 
SET end_time = TO_TIMESTAMP('31-AUG-14’) 
WHERE custid = 1 ;
custid custname custaddr1 custaddr2 custcity custstate custzip start_time end_time 
1 Acme Inc 123 Any 
Street 
Suite 17 Anytown CA 99999 01-JAN-14 31-AUG-14 
1 Acme Inc 456 
Another 
Street 
Anytown CA 99998 01-SEP-14 
Valid Time Temporal 
Example 
INSERT INTO CUSTOMERS VALUES (1, 'Acme Inc.', 
’456 Another Street', NULL, 'Anytown', 'AS', ‘99998', 
TO_TIMESTAMP('01-SEP-14’), NULL ) ; 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
custid custname custaddr1 custaddr2 custcity custstate custzip start_time end_time 
1 Acme Inc 123 Any 
Street 
Suite 17 Anytown CA 99999 01-JAN-14 31-AUG-14 
1 Acme Inc 456 
Another 
Street 
Anytown CA 99998 01-SEP-14 
Valid Time Temporal 
Example 
SELECT custaddr1, custaddr2, custcity, custstate, custzip 
FROM customers WHERE custid=1; 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
custid custname custaddr1 custaddr2 custcity custstate custzip start_time end_time 
1 Acme Inc 123 Any 
Street 
Suite 17 Anytown CA 99999 01-JAN-14 31-AUG-14 
1 Acme Inc 456 
Another 
Street 
Anytown CA 99998 01-SEP-14 
Valid Time Temporal 
Example 
EXEC DBMS_FLASHBACK_ARCHIVE.ENABLE_AT_VALID_TIME('CURRENT'); 
SELECT custid, start_time, end_time 
FROM customers WHERE custid=1; 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
custid custname custaddr1 custaddr2 custcity custstate custzip start_time end_time 
1 Acme Inc 123 Any 
Street 
Suite 17 Anytown CA 99999 01-JAN-14 31-AUG-14 
1 Acme Inc 456 
Another 
Street 
Anytown CA 99998 01-SEP-14 
Valid Time Temporal 
Example 
SELECT custid, start_time, end_time 
FROM customers 
AS OF PERIOD FOR cust_valid_time TO_TIMESTAMP('03-SEP-14'); 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Temporal with Oracle Database 12c 
Minimizing custom Code 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
 Transaction Time Temporal 
(flashback data archive) 
maintains history 
 Valid Time Temporal maintains 
business validity
Oracle Database 12c : The Evolution of SQL 
PPaatttteerrnn MMaattcchhiinngg 
PPLL//SSQQLL iinn ““WWiitthh”” CCllaauussee 
IIddeennttiittyy BBaasseedd CCoolluummnnss 
3322kk VVaarrcchhaarr 
A more powerful expressive language 
FFeettcchh FFiirrsstt 
IInnvviissiibbllee CCoolluummnnss 
IImmpprroovveedd LLeefftt OOuutteerr JJooiinn SSyynnttaaxx 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Pattern Matching 
Simplified Analysis of Big Data 
Select * from 
Employees MATCH_RECOGNIZE ( 
… 
PATTERN(X+ Z{2}) 
… 
) 
• Scalable discovery of business event sequences 
– Clickstream logs: sessionization, search behaviour 
– Financial transactions: fraud detection, double 
bottom (“W”) stock analysis 
– Telco: dropped calls 
–Medical sensors: automated medical observations 
and detections 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Patterns are defined 
using regular 
expressions 
Ascending Order
SQL Pattern Matching 
Example: Find Double Bottom (W) 
Find double bottom (W) 
patterns and report: 
• Beginning and ending date 
of the pattern 
days 
X 
Stock price 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
• Average Price Increase in 
the second ascent 
• Modify the search to find 
only patterns that lasted 
less than a week 
PATTERN (X+ Y+ W+ Z+) 
DEFINE X AS (price  PREV(price))
SQL Pattern Matching 
Example: Find Double Bottom (W) 
Find double bottom (W) 
patterns and report: 
• Beginning and ending date 
of the pattern 
days 
X Y 
Stock price 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
• Average Price Increase in 
the second ascent 
• Modify the search to find 
only patterns that lasted 
less than a week 
PATTERN (X+ Y+ W+ Z+) 
DEFINE X AS (price  PREV(price)) 
Y AS (price  PREV(price))
SQL Pattern Matching 
Example: Find Double Bottom (W) 
Find double bottom (W) 
patterns and report: 
• Beginning and ending date 
of the pattern 
days 
X Y W Z 
Stock price 
SELECT ffiirrsstt__xx,, llaasstt__zz 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
• Average Price Increase in 
the second ascent 
• Modify the search to find 
only patterns that lasted 
less than a week 
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))
SQL Pattern Matching 
First_x Last_z 
1 9 
13 19 Example: Find Double Bottom (W) 
Stock price 
1 9 13 19 days 
SELECT ffiirrsstt__xx,, llaasstt__zz 
Find double bottom (W) 
patterns and report: 
• Beginning and ending date 
of the pattern 
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))) 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
• Average Price Increase in 
the second ascent 
• Modify the search to find 
only patterns that lasted 
less than a week
if (lineNext == null) { 
next = ; 
} else { 
next = lineNext.getQuantity(); 
} 
if (!q.isEmpty()  (prev.Pattern isEmpty() || (eq(q, prev)  gt(q, next)))) { 
state = S; 
return state; 
Matching 
} 
if (gt(q, prev)  gt(Finding q, next)) { 
Double Bottom (W) 
state = T; 
return state; 
} 
if (lt(q, prev)  lt(q, next)) { 
state = B; 
return state; 
} 
if (!q.isEmpty()  (next.isEmpty() || (gt(q, prev)  eq(q, next)))) { 
state = E; 
return state; 
} 
if (q.isEmpty() || eq(q, prev)) { 
state = F; 
return state; 
} 
return state; 
} 
private boolean eq(String a, String b) { 
if (a.isEmpty() || b.isEmpty()) { 
return false; 
} 
return a.equals(b); 
} 
private boolean gt(String a, String b) { 
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)), 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
if (a.isEmpty() || b.isEmpty()) { 
return false; 
} 
return Double.parseDouble(a)  Double.parseDouble(b); 
} 
private boolean lt(String a, String b) { 
if (a.isEmpty() || b.isEmpty()) { 
return false; 
} 
return Double.parseDouble(a)  Double.parseDouble(b); 
} 
public String getState() { 
return this.state; 
} 
} 
BagFactory bagFactory = BagFactory.getInstance(); 
@Override 
public Tuple exec(Tuple input) throws IOException { 
long c = 0; 
String line = ; 
String pbkey = ; 
V0Line nextLine; 
V0Line thisLine; 
V0Line processLine; 
V0Line evalLine = null; 
V0Line prevLine; 
boolean noMoreValues = false; 
String matchList = ; 
ArrayListV0Line lineFifo = new ArrayListV0Line(); 
boolean finished = false; 
DataBag output = bagFactory.newDefaultBag(); 
if (input == null) { 
return null; 
} 
if (input.size() == 0) { 
return null; 
W AS (price  PREV(price)), 
Z AS (price  PREV(price) AND 
z.time - FIRST(x.time) = 7 )) 
250+ Lines of Java and PIG 12 Lines of SQL 
20x less code, 5x faster
New SQL Functionality 
• PL/SQL in SQL via the “with” clause 
– Useful for read only databases 
– Potentially faster for some operations 
• IDENTITY based columns 
– Auto incrementing columns 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
– Supports ANSI standard 
• Increased size for VARCHAR2 
– Increase from 4000 to 32K 
• New Row limiting clause
PL/SQL in SQL 
Example 
PL/SQL Function embedded in “with” clause 
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); 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
END; 
SELECT DISTINCT get_domain(catalog_url) 
FROM orders;
PL/SQL from SQL 
sql create table t ( x varchar2(5) ); 
Table created. 
sql insert into t values ( 'a' ); 
sql insert into t values ( '1' ); 
sql insert into t values ( null ); 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
PL/SQL from SQL 
sql create or replace 
2 function is_number_ool(x in varchar2) 
3 return varchar2 
4 is 
5 Plsql_Num_Error exception; 
6 pragma exception_init(Plsql_Num_Error, -06502); 
7 begin 
8 if (To_Number(x) is NOT null) then 
9 return 'Y'; 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
10 else 
11 return ''; 
12 end if; 
13 exception 
14 when Plsql_Num_Error then 
15 return 'N'; 
16 end Is_Number_ool; 
17 / 
Function created.
PL/SQL from SQL 
sql select rownum, x, 
2 is_number_ool(x) is_num 
3 from t; 
ROWNUM X IS_NUM 
---------- ----- ---------- 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
1 a N 
2 1 Y 
3
PL/SQL from SQL 
sql with 
2 function Is_Number 
3 (x in varchar2) return varchar2 is 
4 Plsql_Num_Error exception; 
5 pragma exception_init(Plsql_Num_Error, -06502); 
6 begin 
7 if (To_Number(x) is NOT null) then 
8 return 'Y'; 
9 else 
10 return ''; 
11 end if; 
12 exception 
13 when Plsql_Num_Error then 
14 return 'N'; 
15 end Is_Number; 
16 select rownum, x, is_number(x) is_num from t 
17 / 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
PL/SQL from SQL 
select is_number_ool( to_char(object_id) ), 
is_number_ool( owner ) 
from stage 
call count cpu elapsed rows 
------- ------ -------- ---------- --------- 
Parse 1 0.00 0.00 0 
Execute 1 0.00 0.00 0 
Fetch 875 0.93 1.34 87310 
------- ------ -------- ---------- --------- 
total 877 0.93 1.34 87310 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
PL/SQL from SQL 
with 
function Is_Number ... end Is_Number; 
select is_number( to_char(object_id) ) …, 
call count cpu elapsed rows 
------- ------ -------- ---------- --------- 
Parse 1 0.00 0.00 0 
Execute 1 0.00 0.00 0 
Fetch 875 0.29 0.55 87310 
------- ------ -------- ---------- --------- 
total 877 0.29 0.55 87310 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Improved Defaults 
 Default to a sequence 
 Default when null inserted 
 Identity Columns 
 Metadata-only Defaults for NULL columns 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Improved Defaults - sequences 
sql create sequence s; 
Sequence created. 
sql create table t 
2 ( x int default s.nextval primary key, 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
3 y varchar2(30) 
4 ) 
5 / 
Table created.
Improved Defaults - sequences 
sql insert into t(y) values ('hello world'); 
1 row created. 
sql select * from t; 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
X Y 
---------- ------------------------------ 
1 hello world
Improved Defaults – when null 
sql create table t 
2 ( x number default s.nextval primary key, 
3 y number, 
4 z number default on null 42 
5 ); 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Table created.
Improved Defaults – when null 
sql insert into t (y, z) values ( 55, NULL ); 
sql insert into t (y,z) values ( 100, 200 ); 
sql insert into t (x,y,z) values (-1,-2,-3); 
sql select * from t; 
X Y Z 
---------- ---------- ---------- 
2 55 42 
3 100 200 
-1 -2 -3 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
IDENTITY 
Example 
Create a table where the id column is always populated by Oracle 
CREATE TABLE t1 
x NUMBER GENERATED AS IDENTITY, 
y NUMBER 
); 
Create a table where the id column is populated by Oracle when not provided 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
CREATE TABLE t2 
(x NUMBER GENERATED BY DEFAULT AS IDENTITY 
(START WITH 100 INCREMENT BY 10), 
y NUMBER 
);
Identity columns 
sql insert into t1 (x,y) values (1,100); 
insert into t1 (x,y) values (1,100) 
* 
ERROR at line 1: 
ORA-32795: cannot insert into a generated always identity column 
sql insert into t1 (y) values (200); 
1 row created. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
sql select * from t1; 
X Y 
---------- ---------- 
1 200
Identity columns 
sql insert into t2 (x,y) values (1,100); 
1 row created. 
sql insert into t2 (y) values (200); 
1 row created. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
sql select * from t2; 
X Y 
---------- ---------- 
1 100 
100 200
Improved Defaults – metadata only defaults 
sqlORA12CR1 set timing on 
sqlORA12CR1 alter table t add (data char(2000) default 'x'); 
Table altered. 
Elapsed: 00:00:00.07 
sqlORA11GR2 set timing on 
sqlORA11GR2 alter table t add (data char(2000) default 'x'); 
Table altered. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Elapsed: 00:00:28.59
32K VARCHAR2/NVARCHAR2 
Example 
Enable 32k support in the Oracle Database 12c 
ALTER SYSTEM set MAX_STRING_SIZE = EXTENDED ssccooppee == SSPPFFIILLEE 
Create table with 32k varchar2 
CREATE TABLE Applicants 
(id NUMBER GENERATED AS IDENTITY, 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
first_name varchar2(30), 
last_name varchar2(30), 
application date, 
CV varchar2(32767) 
);
Row Limit 
Example 
Select only the first 5 rows 
SELECT employee_id, last_name 
FROM employees 
ORDER BY employee_id 
FETCH FIRST 5 ROWS ONLY ; 
Select the first 5% of rows and those whose salary “ties” with the lowest of the 5% 
SELECT employee_id, last_name, salary 
FROM employees 
ORDER BY salary 
FETCH FIRST 5 PERCENT ROWS WITH TIES ; 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Session Sequences 
Example 
 Persistent only within a session 
 Specific for use with GTTs 
 Global sequences created by the primary database can now be 
accessed from standby databases. 
sql create sequence seqsess session; 
sql create sequence seqglob global; 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Invisible Columns 
Example 
 User specified hidden columns 
 The DESCRIBE shows invisible column metadata only when 
SET COLINVISIBLE is set 
sql create table t3 (x NUMBER, y NNUUMMBBEERR iinnvviissiibbllee));; 
sql insert into t3 values (1); 
sql insert into t3 (x,y) values (2,5); 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
sql select * from t3; 
X 
---------- 
1 
2 
sql select x,y from t3; 
X Y 
------- ---------- 
1 
2 5
Fine-Grained access controls for PL/SQL program units 
 Specify the “white list” of PL/SQL program units which can access a 
packaged subprograms or a PL/SQL unit 
 Use ACCESSIBLE BY clause to specify the authorized subprograms 
ACCESSIBLE BY (accessor_list) 
 Can appear in CREATE PACKAGE, CREATE PROCEDURE, CREATE 
FUNCTION and CREATE TYPE statements 
 Can be used with AUTHID clause in any order 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
The ACCESSIBLE BY clause 
CREATE OR REPLACE PROCEDURE p_demo_acc 
ACCESSIBLE BY (PROCEDURE proc, FUNCTION fun) 
IS 
BEGIN 
dbms_output.put_line('Demonstrate White List Access'); 
END; 
PROC and FUN 
constitute 
the “White List” 
Anonymously Invoked Invoked from a “White list” unit 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
Exec P_DEMO_ACC(); 
BEGIN p_demo_acc(); END; 
* 
ERROR at line 1: 
ORA-06550: line 1, column 7: 
PLS-00904: insufficient privilege to access object P_DEMO_ACC 
ORA-06550: line 1, column 7: 
PL/SQL: Statement ignored 
Exec PROC(); 
Demonstrate White List Access 
PL/SQL procedure successfully completed.
Binding PL/SQL Only data types 
● Prior to 12c, PL/SQL – only data types could not be bound from client 
programs or using native dynamic SQL 
● In Oracle database 12c, a PL/SQL anonymous block, a SQL CALL statement 
or SQL query can invoke a PL/SQL subprogram which has parameters 
BOOLEAN 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
● ● Collection or records declared in a package specification 
● PL/SQL – only data types can cross PL/SQL to SQL interface
Binding PL/SQL Only data types 
EXECUTE IMMEDIATE l_stmt USING var_x; 
* 
ERROR at line 6: 
ORA-06550: line 6, column 33: 
PLS-00457: expressions have to be of SQL types 
ORA-06550: line 6, column 2: 
PL/SQL: Statement ignored 
CREATE OR REPLACE PROCEDURE proc (p_x BOOLEAN) 
IS 
BEGIN 
IF p_x THEN 
dbms_output.put_line('TRUE'); 
ELSE 
dbms_output.put_line('FALSE'); 
END IF; 
END; 
Pre Oracle 12c 
TRUE 
PL/SQL procedure successfully 
completed. 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 
/ 
SET SERVEROUTPUT ON 
DECLARE 
l_stmt VARCHAR2(1000); 
var_x BOOLEAN := TRUE; 
BEGIN 
l_stmt := 'begin proc(:1); end;'; 
EXECUTE IMMEDIATE l_stmt USING var_x; 
end; 
/ 
Oracle Database 12c
Miscellaneous PL/SQL Enhancements 
● Compilation parameter PLSQL_DEBUG deprecated 
● An invoker’s rights function can be result cached in Oracle 12c. 
● Grant roles to PL/SQL packages and standalone subprograms. 
● An Object of Type LIBRARY Can Be Defined Using an Object of Type 
DIRECTORY 
● New PL/SQL Subprogram DBMS_UTILITY.EXPAND_SQL_TEXT 
● The $$PLSQL_OWNER and $$PLSQL_TYPE predefined PL/SQL inquiry 
directives are supported in Oracle 12c 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Simplifying development and management in the Oracle Database 
Support for OOrraaccllee DDaattaabbaassee 1122c 
SSQQLL TTrraannssllaattiioonn FFrraammeewwoorrkk 
DDaattaa RReeddaaccttiioonn SSuuppppoorrtt 
Oracle SQL Developer 
MMaannaaggee PPlluuggggaabbllee DDaattaabbaasseess 
AAPPEEXX AAddmmiinniissttrraattiioonn 
CClloouudd DDaattaabbaassee SSuuppppoorrtt 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Oracle Database 12c: Pluggable Databases 
SQL Developer Release 3.2 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Oracle Database 12c: Pluggable Databases 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Oracle Data Redaction 
Example: Partial 
Before 
After 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
In Database Archiving 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
In-Database Archiving 
• Applications typically work with recent data 
– But often need to retain data for 5 to 10 years 
• Can potentially improve upgrade times as only data that is active is 
modified 
• In-DB Archiving provides the ability to archive infrequently used data 
within the database 
– Archived Data is invisible by default 
• Archived data remains online for historical analysis 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
In-Database Archiving 
Enable In-Database Archiving on the Sales Table 
ALTER TABLE SALES RROOWW AARRCCHHIIVVAALL;; 
Archive the rows with a non zero value (null, -1, 1 etc.) 
UUPPDDAATTEE SSAALLEESS sseett OORRAA__AARRCCHHIIVVEE__SSTTAATTEE == 11;; 
Modify your session to see all rows including archived versions 
AALLTTEERR SSEESSSSIIOONN SSEETT RROOWW AARRCCHHIIVVAALL VVIISSIIBBIILLIITTYY == AALLLL;; 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Oracle Application Development Summary 
• Oracle provides a rich development experience with support for a wide 
range of languages and approaches 
• Oracle Database 12c continues to improve on the developer’s experience 
by providing improved tools and APIs 
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |

More Related Content

What's hot

Er model
Er modelEr model
Integrity & security
Integrity & securityIntegrity & security
Integrity & security
saurabhshertukde
 
Agile Database Development with JSON
Agile Database Development with JSONAgile Database Development with JSON
Agile Database Development with JSON
Chris Saxon
 
Hack reduce mr-intro
Hack reduce mr-introHack reduce mr-intro
Hack reduce mr-intro
montrealouvert
 
Oracle 122 partitioning_in_action_slide_share
Oracle 122 partitioning_in_action_slide_shareOracle 122 partitioning_in_action_slide_share
Oracle 122 partitioning_in_action_slide_share
Thomas Teske
 
[系列活動] Data exploration with modern R
[系列活動] Data exploration with modern R[系列活動] Data exploration with modern R
[系列活動] Data exploration with modern R
台灣資料科學年會
 
Business Intelligence Portfolio
Business Intelligence PortfolioBusiness Intelligence Portfolio
Business Intelligence Portfolio
Bob Litsinger
 
XLeratorDB - Business Analytics Software for SQL Server
XLeratorDB - Business Analytics Software for SQL ServerXLeratorDB - Business Analytics Software for SQL Server
XLeratorDB - Business Analytics Software for SQL Server
jstampf
 

What's hot (8)

Er model
Er modelEr model
Er model
 
Integrity & security
Integrity & securityIntegrity & security
Integrity & security
 
Agile Database Development with JSON
Agile Database Development with JSONAgile Database Development with JSON
Agile Database Development with JSON
 
Hack reduce mr-intro
Hack reduce mr-introHack reduce mr-intro
Hack reduce mr-intro
 
Oracle 122 partitioning_in_action_slide_share
Oracle 122 partitioning_in_action_slide_shareOracle 122 partitioning_in_action_slide_share
Oracle 122 partitioning_in_action_slide_share
 
[系列活動] Data exploration with modern R
[系列活動] Data exploration with modern R[系列活動] Data exploration with modern R
[系列活動] Data exploration with modern R
 
Business Intelligence Portfolio
Business Intelligence PortfolioBusiness Intelligence Portfolio
Business Intelligence Portfolio
 
XLeratorDB - Business Analytics Software for SQL Server
XLeratorDB - Business Analytics Software for SQL ServerXLeratorDB - Business Analytics Software for SQL Server
XLeratorDB - Business Analytics Software for SQL Server
 

Viewers also liked

Mastering the Oracle Data Pump API
Mastering the Oracle Data Pump APIMastering the Oracle Data Pump API
Mastering the Oracle Data Pump API
Enkitec
 
Writing Java Stored Procedures in Oracle 12c
Writing Java Stored Procedures in Oracle 12cWriting Java Stored Procedures in Oracle 12c
Writing Java Stored Procedures in Oracle 12c
Martin Toshev
 
RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)
Gustavo Rene Antunez
 
Web Development In Oracle APEX
Web Development In Oracle APEXWeb Development In Oracle APEX
Web Development In Oracle APEX
iWare Logic Technologies Pvt. Ltd.
 
Oracle 12c Architecture
Oracle 12c ArchitectureOracle 12c Architecture
Oracle 12c Architecture
AmeerpetTrainingOnline
 
Introduction to OBIEE 11g
Introduction to OBIEE 11gIntroduction to OBIEE 11g
Introduction to OBIEE 11g
iWare Logic Technologies Pvt. Ltd.
 
Oracle 12c and its pluggable databases
Oracle 12c and its pluggable databasesOracle 12c and its pluggable databases
Oracle 12c and its pluggable databases
Gustavo Rene Antunez
 
Write Less (code) With More (Oracle Database 12c New Features)
Write Less (code) With More (Oracle Database 12c New Features)Write Less (code) With More (Oracle Database 12c New Features)
Write Less (code) With More (Oracle Database 12c New Features)
Oren Nakdimon
 

Viewers also liked (8)

Mastering the Oracle Data Pump API
Mastering the Oracle Data Pump APIMastering the Oracle Data Pump API
Mastering the Oracle Data Pump API
 
Writing Java Stored Procedures in Oracle 12c
Writing Java Stored Procedures in Oracle 12cWriting Java Stored Procedures in Oracle 12c
Writing Java Stored Procedures in Oracle 12c
 
RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)RMAN in 12c: The Next Generation (WP)
RMAN in 12c: The Next Generation (WP)
 
Web Development In Oracle APEX
Web Development In Oracle APEXWeb Development In Oracle APEX
Web Development In Oracle APEX
 
Oracle 12c Architecture
Oracle 12c ArchitectureOracle 12c Architecture
Oracle 12c Architecture
 
Introduction to OBIEE 11g
Introduction to OBIEE 11gIntroduction to OBIEE 11g
Introduction to OBIEE 11g
 
Oracle 12c and its pluggable databases
Oracle 12c and its pluggable databasesOracle 12c and its pluggable databases
Oracle 12c and its pluggable databases
 
Write Less (code) With More (Oracle Database 12c New Features)
Write Less (code) With More (Oracle Database 12c New Features)Write Less (code) With More (Oracle Database 12c New Features)
Write Less (code) With More (Oracle Database 12c New Features)
 

Similar to Oracle 12c Application development

Advanced SQL - Quebec 2014
Advanced SQL - Quebec 2014Advanced SQL - Quebec 2014
Advanced SQL - Quebec 2014
Connor McDonald
 
Stream Analytics
Stream Analytics Stream Analytics
Stream Analytics
Franco Ucci
 
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRsMySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
Mayank Prasad
 
Advanced tips for making Oracle databases faster
Advanced tips for making Oracle databases fasterAdvanced tips for making Oracle databases faster
Advanced tips for making Oracle databases faster
SolarWinds
 
MySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMySQL Performance Schema : fossasia
MySQL Performance Schema : fossasia
Mayank Prasad
 
Ebs dba con4696_pdf_4696_0001
Ebs dba con4696_pdf_4696_0001Ebs dba con4696_pdf_4696_0001
Ebs dba con4696_pdf_4696_0001
jucaab
 
Top 10 SQL Performance tips & tricks for Java Developers
Top 10 SQL Performance tips & tricks for Java DevelopersTop 10 SQL Performance tips & tricks for Java Developers
Top 10 SQL Performance tips & tricks for Java Developers
gvenzl
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
udaymoogala
 
AWR and ASH in an EM12c World
AWR and ASH in an EM12c WorldAWR and ASH in an EM12c World
AWR and ASH in an EM12c World
Kellyn Pot'Vin-Gorman
 
How to analyze and tune sql queries for better performance vts2016
How to analyze and tune sql queries for better performance vts2016How to analyze and tune sql queries for better performance vts2016
How to analyze and tune sql queries for better performance vts2016
oysteing
 
2013 Collaborate - OAUG - Presentation
2013 Collaborate - OAUG - Presentation2013 Collaborate - OAUG - Presentation
2013 Collaborate - OAUG - Presentation
Biju Thomas
 
Getting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentationGetting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentation
Berry Clemens
 
Optimizer overviewoow2014
Optimizer overviewoow2014Optimizer overviewoow2014
Optimizer overviewoow2014
Mysql User Camp
 
AWR, ASH with EM13 at HotSos 2016
AWR, ASH with EM13 at HotSos 2016AWR, ASH with EM13 at HotSos 2016
AWR, ASH with EM13 at HotSos 2016
Kellyn Pot'Vin-Gorman
 
Spec 2300 Common and Unique Design Features
Spec 2300 Common and Unique Design FeaturesSpec 2300 Common and Unique Design Features
Spec 2300 Common and Unique Design Features
Flatirons Solutions®
 
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Jean Ihm
 
Mysql Performance Schema - fossasia 2016
Mysql Performance Schema - fossasia 2016Mysql Performance Schema - fossasia 2016
Mysql Performance Schema - fossasia 2016
Mayank Prasad
 
con9577-ash-deep-dive-oow2013-2031468.pdf
con9577-ash-deep-dive-oow2013-2031468.pdfcon9577-ash-deep-dive-oow2013-2031468.pdf
con9577-ash-deep-dive-oow2013-2031468.pdf
cookie1969
 
Apouc 2014-enterprise-manager-12c
Apouc 2014-enterprise-manager-12cApouc 2014-enterprise-manager-12c
Apouc 2014-enterprise-manager-12c
OUGTH Oracle User Group in Thailand
 
MySQL Optimizer Cost Model
MySQL Optimizer Cost ModelMySQL Optimizer Cost Model
MySQL Optimizer Cost Model
Olav Sandstå
 

Similar to Oracle 12c Application development (20)

Advanced SQL - Quebec 2014
Advanced SQL - Quebec 2014Advanced SQL - Quebec 2014
Advanced SQL - Quebec 2014
 
Stream Analytics
Stream Analytics Stream Analytics
Stream Analytics
 
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRsMySQL-Performance Schema- What's new in MySQL-5.7 DMRs
MySQL-Performance Schema- What's new in MySQL-5.7 DMRs
 
Advanced tips for making Oracle databases faster
Advanced tips for making Oracle databases fasterAdvanced tips for making Oracle databases faster
Advanced tips for making Oracle databases faster
 
MySQL Performance Schema : fossasia
MySQL Performance Schema : fossasiaMySQL Performance Schema : fossasia
MySQL Performance Schema : fossasia
 
Ebs dba con4696_pdf_4696_0001
Ebs dba con4696_pdf_4696_0001Ebs dba con4696_pdf_4696_0001
Ebs dba con4696_pdf_4696_0001
 
Top 10 SQL Performance tips & tricks for Java Developers
Top 10 SQL Performance tips & tricks for Java DevelopersTop 10 SQL Performance tips & tricks for Java Developers
Top 10 SQL Performance tips & tricks for Java Developers
 
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And WhatPerformance Tuning With Oracle ASH and AWR. Part 1 How And What
Performance Tuning With Oracle ASH and AWR. Part 1 How And What
 
AWR and ASH in an EM12c World
AWR and ASH in an EM12c WorldAWR and ASH in an EM12c World
AWR and ASH in an EM12c World
 
How to analyze and tune sql queries for better performance vts2016
How to analyze and tune sql queries for better performance vts2016How to analyze and tune sql queries for better performance vts2016
How to analyze and tune sql queries for better performance vts2016
 
2013 Collaborate - OAUG - Presentation
2013 Collaborate - OAUG - Presentation2013 Collaborate - OAUG - Presentation
2013 Collaborate - OAUG - Presentation
 
Getting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentationGetting optimal performance from oracle e-business suite presentation
Getting optimal performance from oracle e-business suite presentation
 
Optimizer overviewoow2014
Optimizer overviewoow2014Optimizer overviewoow2014
Optimizer overviewoow2014
 
AWR, ASH with EM13 at HotSos 2016
AWR, ASH with EM13 at HotSos 2016AWR, ASH with EM13 at HotSos 2016
AWR, ASH with EM13 at HotSos 2016
 
Spec 2300 Common and Unique Design Features
Spec 2300 Common and Unique Design FeaturesSpec 2300 Common and Unique Design Features
Spec 2300 Common and Unique Design Features
 
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
Powerful Spatial Features You Never Knew Existed in Oracle Spatial and Graph ...
 
Mysql Performance Schema - fossasia 2016
Mysql Performance Schema - fossasia 2016Mysql Performance Schema - fossasia 2016
Mysql Performance Schema - fossasia 2016
 
con9577-ash-deep-dive-oow2013-2031468.pdf
con9577-ash-deep-dive-oow2013-2031468.pdfcon9577-ash-deep-dive-oow2013-2031468.pdf
con9577-ash-deep-dive-oow2013-2031468.pdf
 
Apouc 2014-enterprise-manager-12c
Apouc 2014-enterprise-manager-12cApouc 2014-enterprise-manager-12c
Apouc 2014-enterprise-manager-12c
 
MySQL Optimizer Cost Model
MySQL Optimizer Cost ModelMySQL Optimizer Cost Model
MySQL Optimizer Cost Model
 

More from pasalapudi123

Editioning use in ebs
Editioning use in  ebsEditioning use in  ebs
Editioning use in ebs
pasalapudi123
 
Dmz aa aioug
Dmz aa aiougDmz aa aioug
Dmz aa aioug
pasalapudi123
 
Ebs12.2 online patching(aioug_aug2015)
Ebs12.2 online patching(aioug_aug2015)Ebs12.2 online patching(aioug_aug2015)
Ebs12.2 online patching(aioug_aug2015)
pasalapudi123
 
Ebs upgrade-to-12.2 technical-upgrade_best_practices(aioug-aug2015)
Ebs upgrade-to-12.2 technical-upgrade_best_practices(aioug-aug2015)Ebs upgrade-to-12.2 technical-upgrade_best_practices(aioug-aug2015)
Ebs upgrade-to-12.2 technical-upgrade_best_practices(aioug-aug2015)
pasalapudi123
 
Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)
pasalapudi123
 
Oracle12c flex asm_flexcluster - Y V RAVI KUMAR
Oracle12c flex asm_flexcluster - Y V RAVI KUMAROracle12c flex asm_flexcluster - Y V RAVI KUMAR
Oracle12c flex asm_flexcluster - Y V RAVI KUMAR
pasalapudi123
 
Oracle12c data guard farsync and whats new - Nassyam Basha
Oracle12c data guard farsync and whats new - Nassyam BashaOracle12c data guard farsync and whats new - Nassyam Basha
Oracle12c data guard farsync and whats new - Nassyam Basha
pasalapudi123
 
Oracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra PasalapudiOracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra Pasalapudi
pasalapudi123
 
Dba to data scientist -Satyendra
Dba to data scientist -SatyendraDba to data scientist -Satyendra
Dba to data scientist -Satyendra
pasalapudi123
 
12c In Memory Management - Saurabh Gupta
12c In Memory Management - Saurabh Gupta 12c In Memory Management - Saurabh Gupta
12c In Memory Management - Saurabh Gupta
pasalapudi123
 

More from pasalapudi123 (10)

Editioning use in ebs
Editioning use in  ebsEditioning use in  ebs
Editioning use in ebs
 
Dmz aa aioug
Dmz aa aiougDmz aa aioug
Dmz aa aioug
 
Ebs12.2 online patching(aioug_aug2015)
Ebs12.2 online patching(aioug_aug2015)Ebs12.2 online patching(aioug_aug2015)
Ebs12.2 online patching(aioug_aug2015)
 
Ebs upgrade-to-12.2 technical-upgrade_best_practices(aioug-aug2015)
Ebs upgrade-to-12.2 technical-upgrade_best_practices(aioug-aug2015)Ebs upgrade-to-12.2 technical-upgrade_best_practices(aioug-aug2015)
Ebs upgrade-to-12.2 technical-upgrade_best_practices(aioug-aug2015)
 
Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)Getting optimal performance from oracle e business suite(aioug aug2015)
Getting optimal performance from oracle e business suite(aioug aug2015)
 
Oracle12c flex asm_flexcluster - Y V RAVI KUMAR
Oracle12c flex asm_flexcluster - Y V RAVI KUMAROracle12c flex asm_flexcluster - Y V RAVI KUMAR
Oracle12c flex asm_flexcluster - Y V RAVI KUMAR
 
Oracle12c data guard farsync and whats new - Nassyam Basha
Oracle12c data guard farsync and whats new - Nassyam BashaOracle12c data guard farsync and whats new - Nassyam Basha
Oracle12c data guard farsync and whats new - Nassyam Basha
 
Oracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra PasalapudiOracle database 12c introduction- Satyendra Pasalapudi
Oracle database 12c introduction- Satyendra Pasalapudi
 
Dba to data scientist -Satyendra
Dba to data scientist -SatyendraDba to data scientist -Satyendra
Dba to data scientist -Satyendra
 
12c In Memory Management - Saurabh Gupta
12c In Memory Management - Saurabh Gupta 12c In Memory Management - Saurabh Gupta
12c In Memory Management - Saurabh Gupta
 

Recently uploaded

Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems S.M.S.A.
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 

Recently uploaded (20)

Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Uni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdfUni Systems Copilot event_05062024_C.Vlachos.pdf
Uni Systems Copilot event_05062024_C.Vlachos.pdf
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 

Oracle 12c Application development

  • 1.
  • 2. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle's products remains at the sole discretion of Oracle. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 3. Oracle Database 12c Application Development Saurabh K. Gupta Oracle Database Product Management
  • 4. AApppplliiccaattiioonn DDeevveellooppmmeenntt BBiigg DDaattaa CCoonnssoolliiddaattiioonn DDaattaa OOppttiimmiizzaattiioonn DDaattaa WWaarreehhoouussiinngg Plug into the Cloud HHiigghh AAvvaaiillaabbiilliittyy IInn-MMeemmoorryy PPeerrffoorrmmaannccee && SSccaallaabbiilliittyy SSeeccuurriittyy && CCoommpplliiaannccee Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 5. Development in Oracle Database 12c A rich and powerful development environment Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 6. Agenda • Temporal Databases • SQL New features • PL/SQL New features Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | • Partitioning • SQL Developer
  • 7. Multitenant New Features in 12.1.0.2 • Subset by tablespace • Metadata-only clone • Remote clone (including snapshots) • New SQL clause to aggregate data across PDBs select ENAME from containers(scott.EMP) where CON_ID in (45, 49); Cloning SQL Cross PDB Queries Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | • New “standbys” clause • (all | none) • Nologging clause at PDB level • Flashback data archive, transaction query & backout • Temporal SQL Support • Compatible with DB In-Memory • Maintains state of PDBs between CDB restarts 7 PRIMARY STANDBY Standby & Logging Additional Features
  • 8. Oracle Database 12c and Temporal Data • Managing the time dimension TTeemmppoorraall VVaalliiddiittyy FFllaasshh BBaacckk DDaattaa AArrcchhiivvee FFllaasshhbbaacckk QQuueerryy Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 9. Temporal Applications Modeling time is hard • Developing applications that understand history is complicated • Querying and reporting history data is hard, as schemas evolve Employees History Kept • The result is history is only tracked for a few key tables – Often raw fact data is tracked but context is not – e.g. Sales history is tracked, but not quota rules, or Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | territories Departments No History
  • 10. Oracle Database 12c Temporal Support Transaction Time Temporal (Flashback Data Archive) Tracks transactional changes to a table over its lifetime Valid Time Temporal Enables user to model query data for “real world validity” Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Typically used for compliance and auditing Enables the users to see the data as it was at a point in time in the past Typically used for insurance policies, financial markets, trade data future changes Users can model concepts such as the “Life time of an insurance policy”
  • 11. Valid Time Temporal Querying Data Validity • VALID TIME rows are stored in the base table itself • By default, queries see all rows in the table Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Changes are written to timestamp columns on base table Valid Time Data read from base table (filtered using SQL)
  • 12. Valid Time Temporal Example CREATE TABLE customers( custid NUMBER, custname VARCHAR2(30), custaddr1 VARCHAR2(50), custaddr2 VARCHAR2(50), custcity VARCHAR2(50), Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | custstate VARCHAR2(2), custzip VARCHAR2(20), start_time TIMESTAMP, end_time TIMESTAMP, PERIOD FOR cust_valid_time (start_time, end_time));
  • 13. Valid Time Temporal Example custid custname custaddr1 custaddr2 custcity custstate custzip start_time end_time 1 Acme Inc 123 Any Street Suite 17 Anytown CA 99999 01-JAN-14 INSERT INTO CUSTOMERS VALUES (1,'Acme Inc.','123 Any Street', 'Suite 17','Anytown','AS','99999', TO_TIMESTAMP('01-JAN-14’), Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | NULL);
  • 14. Valid Time Temporal Example custid custname custaddr1 custaddr2 custcity custstate custzip start_time end_time 1 Acme Inc 123 Any Street Suite 17 Anytown CA 99999 01-JAN-14 31-AUG-14 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | UPDATE customers SET end_time = TO_TIMESTAMP('31-AUG-14’) WHERE custid = 1 ;
  • 15. custid custname custaddr1 custaddr2 custcity custstate custzip start_time end_time 1 Acme Inc 123 Any Street Suite 17 Anytown CA 99999 01-JAN-14 31-AUG-14 1 Acme Inc 456 Another Street Anytown CA 99998 01-SEP-14 Valid Time Temporal Example INSERT INTO CUSTOMERS VALUES (1, 'Acme Inc.', ’456 Another Street', NULL, 'Anytown', 'AS', ‘99998', TO_TIMESTAMP('01-SEP-14’), NULL ) ; Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 16. custid custname custaddr1 custaddr2 custcity custstate custzip start_time end_time 1 Acme Inc 123 Any Street Suite 17 Anytown CA 99999 01-JAN-14 31-AUG-14 1 Acme Inc 456 Another Street Anytown CA 99998 01-SEP-14 Valid Time Temporal Example SELECT custaddr1, custaddr2, custcity, custstate, custzip FROM customers WHERE custid=1; Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 17. custid custname custaddr1 custaddr2 custcity custstate custzip start_time end_time 1 Acme Inc 123 Any Street Suite 17 Anytown CA 99999 01-JAN-14 31-AUG-14 1 Acme Inc 456 Another Street Anytown CA 99998 01-SEP-14 Valid Time Temporal Example EXEC DBMS_FLASHBACK_ARCHIVE.ENABLE_AT_VALID_TIME('CURRENT'); SELECT custid, start_time, end_time FROM customers WHERE custid=1; Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 18. custid custname custaddr1 custaddr2 custcity custstate custzip start_time end_time 1 Acme Inc 123 Any Street Suite 17 Anytown CA 99999 01-JAN-14 31-AUG-14 1 Acme Inc 456 Another Street Anytown CA 99998 01-SEP-14 Valid Time Temporal Example SELECT custid, start_time, end_time FROM customers AS OF PERIOD FOR cust_valid_time TO_TIMESTAMP('03-SEP-14'); Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 19. Temporal with Oracle Database 12c Minimizing custom Code Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Transaction Time Temporal (flashback data archive) maintains history Valid Time Temporal maintains business validity
  • 20. Oracle Database 12c : The Evolution of SQL PPaatttteerrnn MMaattcchhiinngg PPLL//SSQQLL iinn ““WWiitthh”” CCllaauussee IIddeennttiittyy BBaasseedd CCoolluummnnss 3322kk VVaarrcchhaarr A more powerful expressive language FFeettcchh FFiirrsstt IInnvviissiibbllee CCoolluummnnss IImmpprroovveedd LLeefftt OOuutteerr JJooiinn SSyynnttaaxx Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 21. Pattern Matching Simplified Analysis of Big Data Select * from Employees MATCH_RECOGNIZE ( … PATTERN(X+ Z{2}) … ) • Scalable discovery of business event sequences – Clickstream logs: sessionization, search behaviour – Financial transactions: fraud detection, double bottom (“W”) stock analysis – Telco: dropped calls –Medical sensors: automated medical observations and detections Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Patterns are defined using regular expressions Ascending Order
  • 22. SQL Pattern Matching Example: Find Double Bottom (W) Find double bottom (W) patterns and report: • Beginning and ending date of the pattern days X Stock price Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | • Average Price Increase in the second ascent • Modify the search to find only patterns that lasted less than a week PATTERN (X+ Y+ W+ Z+) DEFINE X AS (price PREV(price))
  • 23. SQL Pattern Matching Example: Find Double Bottom (W) Find double bottom (W) patterns and report: • Beginning and ending date of the pattern days X Y Stock price Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | • Average Price Increase in the second ascent • Modify the search to find only patterns that lasted less than a week PATTERN (X+ Y+ W+ Z+) DEFINE X AS (price PREV(price)) Y AS (price PREV(price))
  • 24. SQL Pattern Matching Example: Find Double Bottom (W) Find double bottom (W) patterns and report: • Beginning and ending date of the pattern days X Y W Z Stock price SELECT ffiirrsstt__xx,, llaasstt__zz Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | • Average Price Increase in the second ascent • Modify the search to find only patterns that lasted less than a week 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))
  • 25. SQL Pattern Matching First_x Last_z 1 9 13 19 Example: Find Double Bottom (W) Stock price 1 9 13 19 days SELECT ffiirrsstt__xx,, llaasstt__zz Find double bottom (W) patterns and report: • Beginning and ending date of the pattern 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))) Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | • Average Price Increase in the second ascent • Modify the search to find only patterns that lasted less than a week
  • 26. if (lineNext == null) { next = ; } else { next = lineNext.getQuantity(); } if (!q.isEmpty() (prev.Pattern isEmpty() || (eq(q, prev) gt(q, next)))) { state = S; return state; Matching } if (gt(q, prev) gt(Finding q, next)) { Double Bottom (W) state = T; return state; } if (lt(q, prev) lt(q, next)) { state = B; return state; } if (!q.isEmpty() (next.isEmpty() || (gt(q, prev) eq(q, next)))) { state = E; return state; } if (q.isEmpty() || eq(q, prev)) { state = F; return state; } return state; } private boolean eq(String a, String b) { if (a.isEmpty() || b.isEmpty()) { return false; } return a.equals(b); } private boolean gt(String a, String b) { 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)), Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | if (a.isEmpty() || b.isEmpty()) { return false; } return Double.parseDouble(a) Double.parseDouble(b); } private boolean lt(String a, String b) { if (a.isEmpty() || b.isEmpty()) { return false; } return Double.parseDouble(a) Double.parseDouble(b); } public String getState() { return this.state; } } BagFactory bagFactory = BagFactory.getInstance(); @Override public Tuple exec(Tuple input) throws IOException { long c = 0; String line = ; String pbkey = ; V0Line nextLine; V0Line thisLine; V0Line processLine; V0Line evalLine = null; V0Line prevLine; boolean noMoreValues = false; String matchList = ; ArrayListV0Line lineFifo = new ArrayListV0Line(); boolean finished = false; DataBag output = bagFactory.newDefaultBag(); if (input == null) { return null; } if (input.size() == 0) { return null; W AS (price PREV(price)), Z AS (price PREV(price) AND z.time - FIRST(x.time) = 7 )) 250+ Lines of Java and PIG 12 Lines of SQL 20x less code, 5x faster
  • 27. New SQL Functionality • PL/SQL in SQL via the “with” clause – Useful for read only databases – Potentially faster for some operations • IDENTITY based columns – Auto incrementing columns Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | – Supports ANSI standard • Increased size for VARCHAR2 – Increase from 4000 to 32K • New Row limiting clause
  • 28. PL/SQL in SQL Example PL/SQL Function embedded in “with” clause 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); Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | END; SELECT DISTINCT get_domain(catalog_url) FROM orders;
  • 29. PL/SQL from SQL sql create table t ( x varchar2(5) ); Table created. sql insert into t values ( 'a' ); sql insert into t values ( '1' ); sql insert into t values ( null ); Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 30. PL/SQL from SQL sql create or replace 2 function is_number_ool(x in varchar2) 3 return varchar2 4 is 5 Plsql_Num_Error exception; 6 pragma exception_init(Plsql_Num_Error, -06502); 7 begin 8 if (To_Number(x) is NOT null) then 9 return 'Y'; Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 10 else 11 return ''; 12 end if; 13 exception 14 when Plsql_Num_Error then 15 return 'N'; 16 end Is_Number_ool; 17 / Function created.
  • 31. PL/SQL from SQL sql select rownum, x, 2 is_number_ool(x) is_num 3 from t; ROWNUM X IS_NUM ---------- ----- ---------- Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 1 a N 2 1 Y 3
  • 32. PL/SQL from SQL sql with 2 function Is_Number 3 (x in varchar2) return varchar2 is 4 Plsql_Num_Error exception; 5 pragma exception_init(Plsql_Num_Error, -06502); 6 begin 7 if (To_Number(x) is NOT null) then 8 return 'Y'; 9 else 10 return ''; 11 end if; 12 exception 13 when Plsql_Num_Error then 14 return 'N'; 15 end Is_Number; 16 select rownum, x, is_number(x) is_num from t 17 / Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 33. PL/SQL from SQL select is_number_ool( to_char(object_id) ), is_number_ool( owner ) from stage call count cpu elapsed rows ------- ------ -------- ---------- --------- Parse 1 0.00 0.00 0 Execute 1 0.00 0.00 0 Fetch 875 0.93 1.34 87310 ------- ------ -------- ---------- --------- total 877 0.93 1.34 87310 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 34. PL/SQL from SQL with function Is_Number ... end Is_Number; select is_number( to_char(object_id) ) …, call count cpu elapsed rows ------- ------ -------- ---------- --------- Parse 1 0.00 0.00 0 Execute 1 0.00 0.00 0 Fetch 875 0.29 0.55 87310 ------- ------ -------- ---------- --------- total 877 0.29 0.55 87310 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 35. Improved Defaults Default to a sequence Default when null inserted Identity Columns Metadata-only Defaults for NULL columns Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 36. Improved Defaults - sequences sql create sequence s; Sequence created. sql create table t 2 ( x int default s.nextval primary key, Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 3 y varchar2(30) 4 ) 5 / Table created.
  • 37. Improved Defaults - sequences sql insert into t(y) values ('hello world'); 1 row created. sql select * from t; Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | X Y ---------- ------------------------------ 1 hello world
  • 38. Improved Defaults – when null sql create table t 2 ( x number default s.nextval primary key, 3 y number, 4 z number default on null 42 5 ); Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Table created.
  • 39. Improved Defaults – when null sql insert into t (y, z) values ( 55, NULL ); sql insert into t (y,z) values ( 100, 200 ); sql insert into t (x,y,z) values (-1,-2,-3); sql select * from t; X Y Z ---------- ---------- ---------- 2 55 42 3 100 200 -1 -2 -3 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 40. IDENTITY Example Create a table where the id column is always populated by Oracle CREATE TABLE t1 x NUMBER GENERATED AS IDENTITY, y NUMBER ); Create a table where the id column is populated by Oracle when not provided Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | CREATE TABLE t2 (x NUMBER GENERATED BY DEFAULT AS IDENTITY (START WITH 100 INCREMENT BY 10), y NUMBER );
  • 41. Identity columns sql insert into t1 (x,y) values (1,100); insert into t1 (x,y) values (1,100) * ERROR at line 1: ORA-32795: cannot insert into a generated always identity column sql insert into t1 (y) values (200); 1 row created. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | sql select * from t1; X Y ---------- ---------- 1 200
  • 42. Identity columns sql insert into t2 (x,y) values (1,100); 1 row created. sql insert into t2 (y) values (200); 1 row created. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | sql select * from t2; X Y ---------- ---------- 1 100 100 200
  • 43. Improved Defaults – metadata only defaults sqlORA12CR1 set timing on sqlORA12CR1 alter table t add (data char(2000) default 'x'); Table altered. Elapsed: 00:00:00.07 sqlORA11GR2 set timing on sqlORA11GR2 alter table t add (data char(2000) default 'x'); Table altered. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Elapsed: 00:00:28.59
  • 44. 32K VARCHAR2/NVARCHAR2 Example Enable 32k support in the Oracle Database 12c ALTER SYSTEM set MAX_STRING_SIZE = EXTENDED ssccooppee == SSPPFFIILLEE Create table with 32k varchar2 CREATE TABLE Applicants (id NUMBER GENERATED AS IDENTITY, Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | first_name varchar2(30), last_name varchar2(30), application date, CV varchar2(32767) );
  • 45. Row Limit Example Select only the first 5 rows SELECT employee_id, last_name FROM employees ORDER BY employee_id FETCH FIRST 5 ROWS ONLY ; Select the first 5% of rows and those whose salary “ties” with the lowest of the 5% SELECT employee_id, last_name, salary FROM employees ORDER BY salary FETCH FIRST 5 PERCENT ROWS WITH TIES ; Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 46. Session Sequences Example Persistent only within a session Specific for use with GTTs Global sequences created by the primary database can now be accessed from standby databases. sql create sequence seqsess session; sql create sequence seqglob global; Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 47. Invisible Columns Example User specified hidden columns The DESCRIBE shows invisible column metadata only when SET COLINVISIBLE is set sql create table t3 (x NUMBER, y NNUUMMBBEERR iinnvviissiibbllee));; sql insert into t3 values (1); sql insert into t3 (x,y) values (2,5); Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | sql select * from t3; X ---------- 1 2 sql select x,y from t3; X Y ------- ---------- 1 2 5
  • 48. Fine-Grained access controls for PL/SQL program units Specify the “white list” of PL/SQL program units which can access a packaged subprograms or a PL/SQL unit Use ACCESSIBLE BY clause to specify the authorized subprograms ACCESSIBLE BY (accessor_list) Can appear in CREATE PACKAGE, CREATE PROCEDURE, CREATE FUNCTION and CREATE TYPE statements Can be used with AUTHID clause in any order Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 49. The ACCESSIBLE BY clause CREATE OR REPLACE PROCEDURE p_demo_acc ACCESSIBLE BY (PROCEDURE proc, FUNCTION fun) IS BEGIN dbms_output.put_line('Demonstrate White List Access'); END; PROC and FUN constitute the “White List” Anonymously Invoked Invoked from a “White list” unit Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | Exec P_DEMO_ACC(); BEGIN p_demo_acc(); END; * ERROR at line 1: ORA-06550: line 1, column 7: PLS-00904: insufficient privilege to access object P_DEMO_ACC ORA-06550: line 1, column 7: PL/SQL: Statement ignored Exec PROC(); Demonstrate White List Access PL/SQL procedure successfully completed.
  • 50. Binding PL/SQL Only data types ● Prior to 12c, PL/SQL – only data types could not be bound from client programs or using native dynamic SQL ● In Oracle database 12c, a PL/SQL anonymous block, a SQL CALL statement or SQL query can invoke a PL/SQL subprogram which has parameters BOOLEAN Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | ● ● Collection or records declared in a package specification ● PL/SQL – only data types can cross PL/SQL to SQL interface
  • 51. Binding PL/SQL Only data types EXECUTE IMMEDIATE l_stmt USING var_x; * ERROR at line 6: ORA-06550: line 6, column 33: PLS-00457: expressions have to be of SQL types ORA-06550: line 6, column 2: PL/SQL: Statement ignored CREATE OR REPLACE PROCEDURE proc (p_x BOOLEAN) IS BEGIN IF p_x THEN dbms_output.put_line('TRUE'); ELSE dbms_output.put_line('FALSE'); END IF; END; Pre Oracle 12c TRUE PL/SQL procedure successfully completed. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | / SET SERVEROUTPUT ON DECLARE l_stmt VARCHAR2(1000); var_x BOOLEAN := TRUE; BEGIN l_stmt := 'begin proc(:1); end;'; EXECUTE IMMEDIATE l_stmt USING var_x; end; / Oracle Database 12c
  • 52. Miscellaneous PL/SQL Enhancements ● Compilation parameter PLSQL_DEBUG deprecated ● An invoker’s rights function can be result cached in Oracle 12c. ● Grant roles to PL/SQL packages and standalone subprograms. ● An Object of Type LIBRARY Can Be Defined Using an Object of Type DIRECTORY ● New PL/SQL Subprogram DBMS_UTILITY.EXPAND_SQL_TEXT ● The $$PLSQL_OWNER and $$PLSQL_TYPE predefined PL/SQL inquiry directives are supported in Oracle 12c Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 53. Simplifying development and management in the Oracle Database Support for OOrraaccllee DDaattaabbaassee 1122c SSQQLL TTrraannssllaattiioonn FFrraammeewwoorrkk DDaattaa RReeddaaccttiioonn SSuuppppoorrtt Oracle SQL Developer MMaannaaggee PPlluuggggaabbllee DDaattaabbaasseess AAPPEEXX AAddmmiinniissttrraattiioonn CClloouudd DDaattaabbaassee SSuuppppoorrtt Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 54. Oracle Database 12c: Pluggable Databases SQL Developer Release 3.2 Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 55. Oracle Database 12c: Pluggable Databases Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 56. Oracle Data Redaction Example: Partial Before After Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 57. In Database Archiving Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 58. In-Database Archiving • Applications typically work with recent data – But often need to retain data for 5 to 10 years • Can potentially improve upgrade times as only data that is active is modified • In-DB Archiving provides the ability to archive infrequently used data within the database – Archived Data is invisible by default • Archived data remains online for historical analysis Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 59. In-Database Archiving Enable In-Database Archiving on the Sales Table ALTER TABLE SALES RROOWW AARRCCHHIIVVAALL;; Archive the rows with a non zero value (null, -1, 1 etc.) UUPPDDAATTEE SSAALLEESS sseett OORRAA__AARRCCHHIIVVEE__SSTTAATTEE == 11;; Modify your session to see all rows including archived versions AALLTTEERR SSEESSSSIIOONN SSEETT RROOWW AARRCCHHIIVVAALL VVIISSIIBBIILLIITTYY == AALLLL;; Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 60. Oracle Application Development Summary • Oracle provides a rich development experience with support for a wide range of languages and approaches • Oracle Database 12c continues to improve on the developer’s experience by providing improved tools and APIs Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 61. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 62. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |
  • 63. Copyright © 2014 Oracle and/or its affiliates. All rights reserved. |