SlideShare a Scribd company logo
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
WE
ARE
SHOWING
CODING SAMPLES
SO IF YOU HAVE PASSED
THE AGE OF TWENTY THEN YOU SHOULD PROBABLY THINK
ABOUT SITTING RIGHT UP CLOSE TO THE FRONT OF THE ROOM BECAUSE OTHERWISE YOU MIGHT MISS OUT
A N D I F Y O U C A N R E A D T H I S, T H E N Y O U S H O U L D L E A V E B E C A U S E Y O U H A V E S U P E R P O W E R S A N D Y O U S H O U L D B E I N A N A V E N G E R S M O V I E N O T L E A R N I N G A B O U T I N F O R M A T I O N T E C H N O L O G Y. :-)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 3
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 4
@connor_mc_d connormcdonald.wordpress.com
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 5
https://www.youtube.com/c/ConnorMcDonaldOracle
https://www.facebook.com/connor.mcdonald42
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
12 things Devs will love about 12.2
Connor McDonald
Developer Advocate
November 2017
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 7
why me ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 9
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 10
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 11
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 12
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 14
https://asktom.oracle.com
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 15
18c
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 16
why you ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 17
12.2!12.2!
12.2!12.2!
12.2!
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
reality
18
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 19
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 20
SQL> select * from v$version;
BANNER
----------------------------------------------------------
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
PL/SQL Release 8.1.7.4.0 - Production
CORE 8.1.7.0.0 Production
TNS for HPUX: Version 8.1.7.4.0 - Production
NLSRTL Version 3.4.1.0.0 - Production
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 21
SQL> select * from v$version;
BANNER
----------------------------------------------------------
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
PL/SQL Release 8.1.7.4.0 - Production
CORE 8.1.7.0.0 Production
TNS for HPUX: Version 8.1.7.4.0 - Production
NLSRTL Version 3.4.1.0.0 - Production
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 22
SQL> select * from v$version;
BANNER
----------------------------------------------------------
Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production
PL/SQL Release 8.1.7.4.0 - Production
CORE 8.1.7.0.0 Production
TNS for HPUX: Version 8.1.7.4.0 - Production
NLSRTL Version 3.4.1.0.0 - Production
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
you still should be here
23
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 24
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 26
there's a lot in 12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 27
get started right now
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 28
install nothing
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 29
https://cloud.oracle.com/tryit
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 30
install something
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 31
http://tinyurl.com/ora122vm
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 32
install lots :-)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 33
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 34
before we get started
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
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.
35
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 36
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 37
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 38
test ! Test ! TEST !
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 39
licensing
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 40
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 41
time is short ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 42
asktom.oracle.com
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 43
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 44
longer names
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 45
128 bytes
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 46
cool
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 47
SQL> create table MY_TABLE
2 (
3 LONGER_COLUMNS_ARE_BETTER_BECAUSE_THEY_GIVE_MORE_MEANING DATE
4 );
Table created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 48
the ol' days
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 49
"can I get a CSV of the chart of accounts?"
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 50
SQL> select table_name
2 from user_tables;
TABLE_NAME
------------------------------
T001B
T003
T004
T009
T010O
T010P
T012
T014
T077S
T880
…
Permitted Posting Periods
Document types
Chart of accounts
Fiscal year variants
Posting periods
Posting Period Names
House banks
Credit control area
Account group (G/L accounts)
Global company data
...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 51
and...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 52
SQL> create table FINALISED_ANNUAL_BUDGET_STATS
2 ( budget_seq int,
3 fiscal_year int,
...
...
24 );
Table created.
SQL> alter table FINALISED_ANNUAL_BUDGET_STATS
2 add constraint FINALISED_ANNUAL_BUDGET_STATS_PK
3 primary key ( budget_seq );
add constraint FINALISED_ANNUAL_BUDGET_STATS_PK
*
ERROR at line 2:
ORA-00972: identifier is too long
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 53
but...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 54
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 55
SQL> create table MY_TABLE
2 (
3 "SomeRidiculousPieceOfNonsenseBySomeDude
WhoWantsToAlignTheDatabaseWithHisDotNetCodingStyle" DATE
4 );
Table created.
SQL> select column_name,num_distinct,avg_col_len, num_nulls
2 from all_tab_cols
3 where table_name = upper('&table_name')
4 order by column_id;
Enter value for table_name: MY_TABLE
COLUMN_NAME
------------------------------
SomeRidiculousPieceOfNonsenseBySomeDudeWhoWantsToAlignWithHisDotNetCodi
ngStyle NUM_DISTINCT AVG_COL_LEN NUM_NULLS
------------ ----------- ----------
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 56
have some fun :-)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 57
SQL> create or replace
2 trigger ddl_trigger
3 before create or alter on demo.SCHEMA
4 declare
5 l_obj varchar2(128);
6 l_power int;
7 begin
8 l_obj := ora_dict_obj_name;
9
10 select count(*)
11 into l_power
12 from dba_role_privs
13 where grantee = user
14 and granted_role = 'SENIOR_DEV';
15
16 if l_power = 0 and length(l_obj) > 30 then
17 raise_application_error(-20000,'Identifier "'||l_obj||'" is too long');
18 end if;
19 end;
Trigger created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 58
SQL> conn junior_dev/junior_dev@db122pdb
Connected.
SQL> create table EMPLOYEES ( empno int , dept int);
Table created.
SQL> create table EMPLOYEE_RATINGS_BENEFITS_BEFORE_SALARY_REVIEW
2 ( empno int, dept int );
create table EMPLOYEE_RATINGS_BENEFITS_BEFORE_SALARY_REVIEW
*
ERROR at line 1:
ORA-04088: error during execution of trigger 'CONNOR.DDL_TRIGGER'
ORA-00604: error occurred at recursive SQL level 1
ORA-20000: Identifier "EMPLOYEE_RATINGS_BENEFITS_BEFORE_SALARY_REVIEW" is too long
ORA-06512: at line 16
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 59
SQL> conn connor/*******@db122pdb
Connected.
SQL> alter table DEMO.EMPLOYEES add
2 constraint EMPLOYEES_CROSS_DIVISION_DEPARTMENTS_FK foreign key
3 ( dept ) references DEMO.CROSS_DIVISION_DEPARTMENTS ( dept ) ;
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 60
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 61
PL/SQL resolved expressions
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 62
longer names
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> create or replace
2 procedure process_tab is
3 l_tab varchar2(30);
4 begin
5 select table_name
6 into l_tab
7 from user_tables
8 where ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> exec process_tab;
ORA-06502: PL/SQL: numeric or value
error: character string buffer too
small
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 66
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 67
expression in place of literal
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> declare
2 c_var_length constant pls_integer := 30;
3 l_str varchar2(c_var_length);
4 begin
5 null;
6 end;
7 /
PL/SQL procedure successfully completed.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 69
must be resolvable at compile time
SQL
function
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> declare
2 c_var_length constant pls_integer := to_number('30');
3 l_str varchar2(c_var_length);
4 begin
5 null;
6 end;
7 /
l_str varchar2(c_var_length);
*
ERROR at line 3:
ORA-06550: line 3, column 25:
PLS-00491: numeric literal required
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> declare
2 c_var_length constant pls_integer := 30;
3 l_str varchar2(c_var_length);
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> create or replace
2 procedure process_tab is
3 l_str varchar2(ora_max_name_len);
4 begin
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 73
start today
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> create or replace
2 procedure process_tab is
3
4 $if DBMS_DB_VERSION.VER_LE_12_1 $then
5 l_str varchar2(30);
6 $else
7 l_str varchar2(ora_max_name_len);
8 $end
9
10 begin
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 75
"Wasn't I just supposed to use ..."
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
user_tables.table_name%type
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 77
Yes ... but
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> create or replace
2 procedure process_tab is
3 l_str varchar2( );
4 begin
5 select owner||'.'||table_name
6 into l_str
7 from all_tables
8 where ...
9
?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> create or replace
2 procedure process_tab is
3 l_str varchar2(2*ora_max_name_len+1);
4 begin
5 select owner||'.'||table_name
6 into l_str
7 from all_tables
8 where ...
9
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 80
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 81
So ... let's try that again
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 82
longer names
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 83
compile time resolvable sizes
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> desc STORE_SALES
Name Type
--------------------------------------------------------------------------------- ----------
SALES_PK NUMBER(38)
DATE_AT_WHICH_CUSTOMER_CAME_INTO_THE_STOP DATE
DATE_AT_WHICH_CUSTOMER_CAME_LEFT_THE_STOP DATE
DURATION_CUSTOMER_SPENT_BROWSING_SALES_CATALOG_BEFORE_ASKING_FOR_ASSISTANCE_MINS NUMBER(38)
ITEM_THAT_CUSTOMER_PURCHASED VARCHAR2(50)
AMOUNT_CUSTOMER_TENDERED_TO_CASHIER_IN_50DOLLAR_NOTES NUMBER(38)
AMOUNT_CUSTOMER_TENDERED_TO_CASHIER_IN_20DOLLAR_NOTES NUMBER(38)
AMOUNT_CUSTOMER_TENDERED_TO_CASHIER_IN_10DOLLAR_NOTES NUMBER(38)
AMOUNT_CUSTOMER_TENDERED_TO_CASHIER_IN_5DOLLAR_NOTES NUMBER(38)
AMOUNT_CUSTOMER_TENDERED_TO_CASHIER_IN_COINS_IN_TOTAL_CENTS NUMBER(38)
LENGTH_IN_MILLIMETERS_OF_THE_RECEIPT_WE_PRINTED_FOR_THE_CUSTOMER NUMBER(38)
AVERAGE_LENGTH_OF_SHOELACE_OF_STORE_ASSISTANT_THAT_HELPED_THE_CUSTOMER NUMBER(38)
...
...
...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select table_name,
2 listagg(column_name, ',') within group
3 (order by column_id) cols
4 from user_tab_columns
5 group by table_name;
*
ERROR at line 1:
ORA-01489: result of string concatenation is too long
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 87
tough to solve
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select
2 column_name,
3 ( select listagg(column_name,',') within group ( order by column_id )
4 from all_tab_columns
5 where table_name = 'EMP'
6 and owner = 'SCOTT'
7 and column_id <= a.column_id ) cols
8 from all_tab_columns a
9 where table_name = 'EMP'
10 and owner = 'SCOTT'
11 order by column_id;
COLUMN_NAME COLS
------------------------------ ----------------------------------------------------
EMPNO EMPNO
ENAME EMPNO,ENAME
JOB EMPNO,ENAME,JOB
MGR EMPNO,ENAME,JOB,MGR
HIREDATE EMPNO,ENAME,JOB,MGR,HIREDATE
SAL EMPNO,ENAME,JOB,MGR,HIREDATE,SAL
COMM EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM
DEPTNO EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO
8 rows selected.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 89
first principles
pipeline function
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 90
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 91
improved overflow handling
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select table_name,
2 listagg(column_name, ',' on overflow truncate)
3 within group (order by column_id) cols
4 from user_tab_columns
5 group by table_name;
TABLE_NAME COLS
------------- ------------------------------------------------------------
STORE_SALES SALES_PK,DATE_AT_WHICH_CUSTOMER_CAME_INTO_THE_STOP,DATE_AT_W
HICH_CUSTOMER_CAME_LEFT_THE_STOP,DURATION_CUSTOMER_SPENT_BRO
WSING_SALES_CATALOG_BEFORE_ASKING_FOR_ASSISTANCE_IN_MINS,ITE
,LENGTH_IN_MILLIMETERS_OF_THE_RECEIPT_WE_PRINTED_FOR_THE_CUS
[snip]
TIME_SPENT_WHILST_REFOLDING_ITE...(2378)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 93
plus you get control
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select table_name,
2 listagg(column_name, ',' on overflow truncate '[more]')
3 within group (order by column_id) cols
4 from user_tab_columns
5 group by table_name;
TABLE_NAME COLS
------------- ------------------------------------------------------------
STORE_SALES SALES_PK,DATE_AT_WHICH_CUSTOMER_CAME_INTO_THE_STOP,DATE_AT_W
HICH_CUSTOMER_CAME_LEFT_THE_STOP,DURATION_CUSTOMER_SPENT_BRO
WSING_SALES_CATALOG_BEFORE_ASKING_FOR_ASSISTANCE_IN_MINS,ITE
,LENGTH_IN_MILLIMETERS_OF_THE_RECEIPT_WE_PRINTED_FOR_THE_CUS
[snip]
TIME_SPENT_WHILST_REFOLDING_ITE[more](2378)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select table_name,
2 listagg(column_name,','
3 on overflow truncate '[more]' without count)
4 within group (order by column_id) cols
5 from user_tab_columns
6 group by table_name;
TABLE_NAME COLS
------------- ------------------------------------------------------------
STORE_SALES SALES_PK,DATE_AT_WHICH_CUSTOMER_CAME_INTO_THE_STOP,DATE_AT_W
HICH_CUSTOMER_CAME_LEFT_THE_STOP,DURATION_CUSTOMER_SPENT_BRO
WSING_SALES_CATALOG_BEFORE_ASKING_FOR_ASSISTANCE_IN_MINS,ITE
,LENGTH_IN_MILLIMETERS_OF_THE_RECEIPT_WE_PRINTED_FOR_THE_CUS
[snip]
TIME_SPENT_WHILST_REFOLDING_ITE[more]
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select table_name,
2 listagg(column_name,','
3 on overflow truncate '' without count)
4 within group (order by column_id) cols
5 from user_tab_columns
6 group by table_name;
TABLE_NAME COLS
------------- ------------------------------------------------------------
STORE_SALES SALES_PK,DATE_AT_WHICH_CUSTOMER_CAME_INTO_THE_STOP,DATE_AT_W
HICH_CUSTOMER_CAME_LEFT_THE_STOP,DURATION_CUSTOMER_SPENT_BRO
WSING_SALES_CATALOG_BEFORE_ASKING_FOR_ASSISTANCE_IN_MINS,ITE
,LENGTH_IN_MILLIMETERS_OF_THE_RECEIPT_WE_PRINTED_FOR_THE_CUS
[snip]
TIME_SPENT_WHILST_REFOLDING_ITE
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 97
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 98
QTFWBC
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 99
queries that finish without bloody crashing
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> insert into MY_TABLE
2 select *
3 from MY_WHOPPING_GREAT_FAT_TABLE;
100
MY_WHOPPING_GREAT_FAT_TABLE;
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 101
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 102
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 103
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 104
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 105
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> insert into MY_TABLE
2 select *
3 from MY_WHOPPING_GREAT_FAT_TABLE;
Elapsed: 06:12:34.00
106
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> insert into MY_TABLE
2 select *
3 from MY_WHOPPING_GREAT_FAT_TABLE;
Elapsed: 06:12:34.00
ERROR at line 1:
ORA-01847: day of month must be between 1 and last day of month
107
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 108
ooooooo
o !
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 109
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 110
and then we do this :-)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select count(*) from MY_TABLE;
COUNT(*)
----------
0
111
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 112
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 113
validate_conversion
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select CREATED_DATE
2 from MY_WHOPPING_GREAT_FAT_TABLE;
CREATED_DATE
--------------------
01-FEB-2016
12-MAR-2012
54-AUG-2013
09-SEP-2014
23-OCT-2012
...
...
114
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select to_date(created_date, 'dd-mon-yyyy')
2 from MY_WHOPPING_GREAT_FAT_TABLE
3 where validate_conversion(
4 created_date as date, 'dd-MON-yyyy'
5 ) = 1;
TO_DATE(C
---------
01-FEB-16
12-MAR-12
09-SEP-14
23-OCT-12
115
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 116
CAST extended
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select SALARY,
2 cast(SALARY as number
3 DEFAULT -1 ON CONVERSION ERROR) conv_sal
4 from MY_WHOPPING_GREAT_FAT_TABLE;
SALARY CONV_SAL
---------- ----------
120000 120000
172125 172125
128000 128000
125,000 -1
99500 99500
...
...
117
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select SALARY,
2 TO_NUMBER(SALARY
3 DEFAULT -1 ON CONVERSION ERROR) conv_sal
4 from MY_WHOPPING_GREAT_FAT_TABLE;
SALARY CONV_SAL
---------- ----------
120000 120000
172125 172125
128000 128000
125,000 -1
99500 99500
118
TO_DATE
TO_NUMBER
TO_TIMESTAMP
etc
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 119
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 120
column level collation
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select *
2 from customers
3 where cust_name = 'ADAMS';
COUNTRY CREATED CUST_NAME
------------ --------- ---------------------
AUS 08-NOV-16 ADAMS
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 122
looks great... until
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select *
2 from customers
3 where upper(cust_name) = 'ADAMS';
COUNTRY CREATED CUST_NAME
------------ --------- ------------
AUS 07-NOV-16 Adams
AUS 08-NOV-16 ADAMS
AUS 09-NOV-16 adams
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 124
SQL> select * from customers
2 where upper(cust_name) = 'ADAMS';
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select column_name
2 from user_ind_columns
3 where index_name = 'CUST_IX';
COLUMN_NAME
------------------------------
CUST_NAME
SQL> select * from customers
2 where upper(cust_name) = 'ADAMS';
-------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |
-------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 152 |
|* 1 | TABLE ACCESS FULL| CUSTOMERS | 1 | 152 |
-------------------------------------------------------
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> create index cust_ix
2 on customers ( cust_name );
Index created.
SQL> create index cust_ix2
2 on customers ( upper(cust_name) );
Index created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 127
DML slower
more contention
more redo/undo space
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 128
"not my problem"
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 129
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> alter table customers shrink space;
*
ERROR at line 1:
ORA-10631: SHRINK clause should not be specified for this object
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 131
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 132
column level collation
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 133
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> CREATE TABLE CUSTOMERS
2 (
3 COUNTRY VARCHAR2(128),
4 CREATED DATE,
5 CUST_NAME VARCHAR2(150) COLLATE BINARY_CI
6 );
Table created.
"case insenstive"
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> create index cust_ix
2 on customers ( cust_name);
Index created.
SQL> set autotrace traceonly explain
SQL> select * from customers
2 where cust_name = 'ADAMS';
-----------------------------------------------------------------
| Id | Operation | Name | Rows |
-----------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 |
| 1 | TABLE ACCESS BY INDEX ROWID BATCHED| CUSTOMERS | 1 |
|* 2 | INDEX RANGE SCAN | CUST_IX | 1 |
-----------------------------------------------------------------
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 136
"big deal"
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select * from customers
2 where cust_name = 'ADAMS';
COUNTRY CREATED CUST_NAME
------------ --------- ----------------
AUS 07-NOV-16 Adams
AUS 08-NOV-16 ADAMS
AUS 09-NOV-16 adams
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 138
binary_ci
SQL> select * from customers
2 where cust_name = 'ADAMS';
COUNTRY CREATED CUST_NAME
------------ --------- ----------------
AUS 07-NOV-16 Adams
AUS 08-NOV-16 ADAMS
AUS 09-NOV-16 adams
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 139
binary_ai
SQL> select * from customers
2 where cust_name = 'ADAMS';
COUNTRY CREATED CUST_NAME
------------ --------- ----------------
AUS 07-NOV-16 Adams
AUS 08-NOV-16 ADAMS
AUS 09-NOV-16 adams
AUS 10-NOV-16 adáms
adáms
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 140
column | table | user
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> alter table people default collation binary_ai;
new columns only
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 142
key point
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> alter table people default collation binary_ai;
*
ERROR at line 1:
ORA-43929: Collation cannot be specified if
parameter MAX_STRING_SIZE=STANDARD
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 144
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 145
deprecated code
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 146
"huh?"
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 147
deprecate your code
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 148
column collation
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 149
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 150
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> create or replace
2 package customer_pkg as
3
4 cursor get_customers(p_name varchar2) is
5 select * from customers
6 where upper(customer_name) = upper(p_name);
7
8 ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> create or replace
2 package customer_pkg as
3
4 --
5 -- do not use
6 --
7 cursor get_customers(p_name varchar2) is
8 select * from customers
9 where upper(customer_name) = upper(p_name);
10
11 --
12 -- fixed with CI collation
13 --
14 cursor get_cust_ci(p_name varchar2) is
15 select * from customers
16 where customer_name = p_name;
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 153
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 154
new pragma
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> create or replace
2 package customer_pkg as
3 cursor get_customers(p_name varchar2) is
4 select * from customers
5 where upper(customer_name) = upper(p_name);
6
7 pragma deprecate(get_customers,'Use get_cust_ci');
8
9 cursor get_cust_ci(p_name varchar2) is
10 select * from customers
11 where customer_name = p_name;
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> alter system set
2 plsql_warnings = enable:(6019,6020,6021,6022)';
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> alter procedure PROCESS_CUSTOMERS compile;
SP2-0804: Procedure created with compilation warnings
LINE/COL ERROR
-------- -----------------------------------------------------------
1/1 PLW-05018: unit PROCESS_CUSTOMERS omitted optional AUTHID
clause; default value DEFINER used
7/9 PLW-06020: reference to a deprecated entity:
GET_CUSTOMERS declared in unit CUSTOMER_PKG[2,10].
Use get_cust_ci instead
8/9 PLW-06020: reference to a deprecated entity:
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 158
one month later
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 159
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> alter system set
2 plsql_warnings = error:(6019,6020,6021,6022)';
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> alter procedure PROCESS_CUSTOMERS compile;
SP2-0804: Procedure created with compilation errors
LINE/COL ERROR
-------- -----------------------------------------------------------
1/1 PLW-05018: unit PROCESS_CUSTOMERS omitted optional AUTHID
clause; default value DEFINER used
7/9 PLW-06020: reference to a deprecated entity:
GET_CUSTOMERS declared in unit CUSTOMER_PKG[2,10].
Use get_cust_ci instead
8/9 PLW-06020: reference to a deprecated entity:
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 162
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 163
external tables
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
ext_emp
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> create table ext_emp (
2 empno number(4),
3 ename varchar2(10),
4 job varchar2(9),
5 mgr number(4),
6 hiredate date,
7 sal number(7,2),
8 comm number(7,2),
9 deptno number(2)
10 )
11 organization external
12 ( type oracle_loader
13 default directory TMP
14 access parameters
15 ( records delimited by newline
16 fields terminated by ','
17 missing field values are null
18 ( empno,ename,job,mgr,hiredate,sal,comm,deptno )
19 )
20 location ('emp20161001.dat'));
Table created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
ext_emp
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select * from ext_emp;
select * from ext_emp
*
ERROR at line 1:
ORA-29913: error in executing ODCIEXTTABLEFETCH callout
ORA-30653: reject limit reached
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 168
easy fix
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> create table ext_emp (
2 empno number(4),
...
12 ( type oracle_loader
13 default directory TMP
14 access parameters
15 ( records delimited by newline
16 fields terminated by ','
17 missing field values are null
18 ( empno,ename,job,mgr,hiredate,sal,comm,deptno )
19 )
20 location ('emp20161001.dat'))
21 REJECT LIMIT UNLIMITED;
Table created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 170
it's ddl
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 171
ITIL :-(
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
service
call
help
desk
problem
recordDONE !
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 173
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 174
query time modification
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select * from ext_emp
2 external modify ( reject limit unlimited );
EMPNO ENAME JOB MGR HIREDATE SAL
---------- ---------- --------- ---------- --------- ---------- ---
7499 ALLEN SALESMAN 7698 20-FEB-81 1600
7521 WARD SALESMAN 7698 22-FEB-81 1250
7566 JONES MANAGER 7839 02-APR-81 2975
...
7902 FORD ANALYST 7566 03-DEC-81 3000
7934 MILLER CLERK 7782 23-JAN-82 1300
13 rows selected.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 176
file names
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> create table ext_emp (
2 empno number(4),
...
20 location ('emp20161001.dat'))
Table created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select * from ext_emp
2 external modify ( location ('emp20161002.dat') );
EMPNO ENAME JOB MGR HIREDATE SAL
---------- ---------- --------- ---------- --------- ---------- ---
7902 FORD ANALYST 7566 03-DEC-81 3000
7934 MILLER CLERK 7782 23-JAN-82 1300
7566 JONES MANAGER 7839 02-APR-81 2975
...
7499 ALLEN SALESMAN 7698 20-FEB-81 1600
7521 WARD SALESMAN 7698 22-FEB-81 1250
8 rows selected.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
select * from ext_tab external modify (
[ default directory ]
[ location ]
[ access parameters ]
[ reject limit ]
);
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 180
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
ACCOUNTING,KING,PRESIDENT,5000
ACCOUNTING,MILLER,CLERK,1300
181
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
<department name="ACCOUNTING">
<employees>
<employee>
<ename>KING</ename>
<job>PRESIDENT</job>
<sal>5000</sal>
</employee>
<employee>
<ename>MILLER</ename>
<job>CLERK</job>
<sal>1300</sal>
</employee>
</employees>
</department>
182
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
{ "NAME" :"ACCOUNTING"
, "EMPLOYEES" : [
{"ENAME" : "KING",
"JOB" : "PRESIDENT",
"SAL" : 5000
},
{"ENAME" : "MILLER",
"JOB" : "CLERK",
"SAL" : 1300
}]
}
183
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
12.1
184
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
alter table T
add constraint t_chk
check
(
my_doc is JSON
)
185
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
extraction
186
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select json_value(my_doc,
2 '$.ACCOUNTING.EMPLOYEES[0].ENAME') as ename
3 from t;
ENAME
----------
KING
187
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
dot notation
188
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select t.my_doc.ACCOUNTING.EMPLOYEES.ENAME emps,
2 t.my_doc.ACCOUNTING.EMPLOYEES.JOB jobs,
3 t.my_doc.ACCOUNTING.EMPLOYEES.SAL sals
4 from T t;
EMPS JOBS SALS
-------------------- ------------------- ---------------
[KING,MILLER] [PRESIDENT,CLERK] [5000,1300]
189
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
12.2
190
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
generation
191
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
{
"department": "Accounting",
"employees": [
{
"name": "Shelley,Higgins",
"job": "Accounting Manager"
},
{
"name": "William,Gietz",
"job": "Public Accountant"
}
]
}
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
{"newJSONfunctions": [
"json_array",
"json_object",
"json_arrayagg",
"json_objectagg"
] }
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select
2 json_array(department_id, department_name) depts
3 from hr.departments
4 where department_id > 200;
DEPTS
--------------------------------------------------------
[210,"IT Support"]
[220,"NOC"]
[230,"IT Helpdesk"]
[240,"Government Sales"]
[250,"Retail Sales"]
[260,"Recruiting"]
[270,"Payroll"]
7 rows selected.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select
2 json_object(
3 'DeptID' is department_id,
4 'Name' is department_name) depts
5 from hr.departments
6 where department_id > 200;
DEPTS
------------------------------------------------
{"DeptID":210,"Name":"IT Support"}
{"DeptID":220,"Name":"NOC"}
{"DeptID":230,"Name":"IT Helpdesk"}
{"DeptID":240,"Name":"Government Sales"}
{"DeptID":250,"Name":"Retail Sales"}
{"DeptID":260,"Name":"Recruiting"}
{"DeptID":270,"Name":"Payroll"}
7 rows selected.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select json_object(
2 'department' value d.department_name,
3 'employees' value json_arrayagg(
4 json_object(
5 'name' value first_name||','||last_name,
6 'job' value job_title
7 )))
8 from hr.departments d, hr.employees e, hr.jobs j
9 where d.department_id = e.department_id
10 and e.job_id = j.job_id
11 and d.department_id = 110
12 group by d.department_name;
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 197
... and more JSON goodies
json_exists
GeoJSON
JSON Partitioning
In-Memory support
JSON Data Guide
Materialized Views
Search index
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 198
SQL> desc ORDERS
NAME TYPE
------------------ -----------
ORDER_DETAILS BLOB
{"date": "2016-05-03 10:40:36",
"loyaltyCardNo": 1230,
"location": {
"city": "Dallas",
"state": "TX”},
"salesAmount": 7.55,
"order": [ {
"item": "Espresso”, ... }
}
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 199
SQL> SELECT JSON_DATAGUIDE(o.order_details) FROM orders o;
JSON_DATAGUIDE(O.ORDER_DETAILS)
----------------------------------------------------------------------
[ {"o:path": "$.date", "type": "string", "o:length": 32 },
{"o:path": "$.order", "type": "array", "o:length": 256 },
{"o:path": "$.location", "type": "object", "o:length": 32},
{"o:path": "$.location.city", "type": "string", "o:length": 8},
...
...
{ "o:path": "$.salesAmount", "type": "number", "o:length": 4 },
{ "o:path": "$.loyaltyCardNo","type": "number", "o:length": 8}]
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 200
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 201
one row...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 202
one
lousy
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 203
can really spoil your day :-(
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 204
SQL> select owner,
2 count(*) as cnt
3 from t
4 where owner like 'S%'
5 group by owner;
SQL> select num_rows
2 from user_tables
3 where table_name = 'T';
NUM_ROWS
-----------
7014272505
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 205
SQL> create materialized view log on T
2 with rowid (owner,object_id)
3 including new values;
Materialized view log created.
SQL> create materialized view T_MV
2 refresh fast on demand
3 enable query rewrite
4 as
5 select owner,
6 sum(object_id) as sum_obj,
7 count(object_id) as cnt_obj,
8 count(*) as cnt
9 from t
10 group by owner;
Materialized view created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 206
SQL> set autotrace traceonly explain
SQL> select owner, count(*)
2 from t
3 where owner like 'S%'
4 group by owner;
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 2 | 26 | 3 (0)|
|* 1 | MAT_VIEW REWRITE ACCESS FULL| T_MV | 2 | 26 | 3 (0)|
--------------------------------------------------------------------------
Predicate Information (identified by operation id):
---------------------------------------------------
1 - filter("T_MV"."OWNER" LIKE 'S%')
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 207
hero
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 208
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 209
until ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 210
SQL> insert into t
2 values ( ... , ... , ..., ..... );
1 row created.
SQL> commit;
Commit complete.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 211
SQL> select owner, count(*)
2 from t
3 where owner like 'S%'
4 group by owner;
----------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
----------------------------------------------------------------
| 0 | SELECT STATEMENT | | 2 | 10 | 14M (1)|
| 1 | HASH GROUP BY | | 2 | 10 | 14M (1)|
|* 2 | TABLE ACCESS FULL| T | 574M| 2738M| 14M (1)|
----------------------------------------------------------------
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 212
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 213
SQL> create or replace
2 procedure KILL_MY_CPU_MIXED_WITH_PRAYER is
3 begin
4 loop
5 dbms_mview.refresh('T_MV');
6 end loop;
7 end;
8 /
Procedure created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 214
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 215
real time refresh
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 216
on commit
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 217
SQL> create materialized view T_MV
2 refresh fast on demand
3 enable query rewrite
4 enable on query computation
5 as
6 select owner,
7 sum(object_id) as sum_obj,
8 count(object_id) as cnt_obj,
9 count(*) as cnt
10 from t
11 group by owner;
Materialized view created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 218
SQL> set autotrace traceonly explain
SQL> select owner, count(*)
2 from t
3 where owner like 'S%'
4 group by owner;
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 2 | 26 | 3 (0)|
|* 1 | MAT_VIEW REWRITE ACCESS FULL| T_MV | 2 | 26 | 3 (0)|
---------------------------------------------------------------------------
as before
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 219
SQL> insert into t
2 values ( ... , ... , ..., ..... );
1 row created.
SQL> commit;
Commit complete.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 220
SQL> select owner, count(*) cnt
2 from t
3 where owner like 'S%'
4 group by owner;
OWNER CNT
------------------------------ ----------
SYS 50941
SI_INFORMTN_SCHEMA 8
SYSTEM 482
Elapsed: 00:00:01.41
SQL> select /*+ NO_REWRITE */ owner, count(*) cnt
2 from t
3 where owner like 'S%'
4 group by owner;
OWNER CNT
------------------------------ ----------
SYS 50941
SYSTEM 482
SI_INFORMTN_SCHEMA 8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 221
how ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 222
we didn't refresh the mview
SQL> select owner, count(*) as cnt
2 from t
3 where owner like 'S%'
4 group by owner;
OWNER CNT
------------------------------ ----------
SYS 50941
SI_INFORMTN_SCHEMA 8
SYSTEM 482
SQL> select owner, cnt
2 from T_MV
3 where owner like 'S%';
OWNER CNT
------------------------------ ----------
SYS 50940
SYSTEM 482
SI_INFORMTN_SCHEMA 8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 223
SQL> set autotrace traceonly explain
SQL> select owner,
2 count(*) as cnt
3 from t
4 where owner like 'S%'
5 group by owner;
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 224
-----------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
-----------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 4 | 316 | 15 (20)|
| 1 | VIEW | | 4 | 316 | 15 (20)|
| 2 | UNION-ALL | | | | |
|* 3 | FILTER | | | | |
|* 4 | HASH JOIN OUTER | | 2 | 184 | 6 (17)|
|* 5 | MAT_VIEW ACCESS FULL | T_MV | 2 | 46 | 2 (0)|
| 6 | VIEW | | 1 | 69 | 4 (25)|
| 7 | HASH GROUP BY | | 1 | 88 | 4 (25)|
|* 8 | TABLE ACCESS FULL | MLOG$_T | 1 | 88 | 3 (0)|
| 9 | VIEW | | 2 | 158 | 9 (23)|
| 10 | UNION-ALL | | | | |
|* 11 | FILTER | | | | |
| 12 | NESTED LOOPS OUTER | | 1 | 102 | 4 (25)|
| 13 | VIEW | | 1 | 79 | 4 (25)|
|* 14 | FILTER | | | | |
| 15 | HASH GROUP BY | | 1 | 88 | 4 (25)|
|* 16 | TABLE ACCESS FULL | MLOG$_T | 1 | 88 | 3 (0)|
|* 17 | INDEX UNIQUE SCAN | I_SNAP$_T_MV | 1 | 23 | 0 (0)|
| 18 | NESTED LOOPS | | 1 | 105 | 5 (20)|
| 19 | VIEW | | 1 | 82 | 4 (25)|
| 20 | HASH GROUP BY | | 1 | 88 | 4 (25)|
|* 21 | TABLE ACCESS FULL | MLOG$_T | 1 | 88 | 3 (0)|
|* 22 | MAT_VIEW ACCESS BY INDEX ROWID| T_MV | 1 | 23 | 1 (0)|
|* 23 | INDEX UNIQUE SCAN | I_SNAP$_T_MV | 1 | | 0 (0)|
-----------------------------------------------------------------------------------------
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 225
what about direct queries ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 226
SQL> select /*+ FRESH_MV */ owner, cnt
2 from T_MV
3 where owner like 'S%';
OWNER CNT
------------------------------ ----------
SYSTEM 482
SYS 50940
SI_INFORMTN_SCHEMA 8
owner, cnt
50941
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 227
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 228
almost correct SQL
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 229
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 230
background
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 231
don't you hate ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 232
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 233
ALERT: Batch load failed
Batch process ended in error.
Module: Financial Reconcilation
Issue: Yearly total
Expected: $7,102,231.76
Actual: $7,102,231.32
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 234
$7,100,000
$8,200,000
$7,700,000
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 235
sometimes ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 236
close enough ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 237
... is good enough
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 238
the hardest work for a database ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select count(distinct ...) cdist
2 from my_super_massive_table;
CDIST
-------
12
Elapsed: 01:32:17.00
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 240
12.1
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
SQL> select approx_count_distinct(...) cdist
2 from my_super_massive_table;
CDIST
-------
12
Elapsed: 00:12:43.00
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 242
but ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 243
SQL> select count(*)
2 from user_source
3 where upper(text) like '%COUNT(%DISTINCT%';
COUNT(*)
----------
1723
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 244
"I don't think so"
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 245
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 246
SQL> alter session set approx_for_count_distinct = true;
Session altered.
SQL> select count(distinct ...)
2 from my_super_massive_table;
approx_count_distinct(...)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 247
more functions
approx_median
approx_percentile
approx_count_distinct_detail
to_approx_...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 248
more confidence
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 249
SQL> select department,
2 approx_median(salary deterministic) med_sal
3 from employees
4 group by department
5 order by department;
DEPARTMENT MED_SAL
---------- -------------
10 4400
20 6000
30 2765
40 6500
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 250
SQL> select
2 department,
3 approx_median(salary deterministic, 'ERROR_RATE') err
4 from employees
5 group by department
6 order by department;
DEPARTMENT ERR
---------- -------------
10 .002718282
20 .021746255
30 .021746255
40 .002718282
50 .019027973
60 .019027973
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 251
SQL> select
2 department,
3 approx_median(salary, 'CONFIDENCE') conf
4 from employees
5 group by department
6 order by department;
DEPARTMENT CONF
---------- -------------
10 .997281718
20 .999660215
30 .999660215
40 .997281718
50 .999611674
60 .999611674
70 .997281718
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 252
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 253
partitioning
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 254
10g and earlier
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 255
SQL> create table SALES
2 ( cal_year date,
3 txn_id int,
...
...
24 )
25 partition by range ( cal_year )
26 (
27 partition p_low values less than ( date '2000-01-01' ),
28 partition p2000 values less than ( date '2001-01-01' ),
...
...
34 partition p2016 values less than ( date '2017-01-01' )
35 );
Table created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 256
SQL> insert into SALES
2 values ( trunc(sysdate), .... );
insert into SALES
*
ERROR at line 1:
ORA-14400: inserted partition key does not map to any partition
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 257
11g
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 258
interval partitioning
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 259
SQL> create table SALES
2 ( cal_year date,
3 txn_is int
4 )
5 partition by range ( cal_year )
6 interval ( numtoyminterval(1,'YEAR') )
7 (
8 partition p_low values less than ( date '2000-01-01' )
9 );
Table created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 260
lists
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 261
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 262
SQL> create table PEOPLE
2 (
3 id int,
4 forename varchar2(30),
5 surname varchar2(30),
6 gender varchar2(1)
7 )
8 partition by list (gender)
9 (
10 partition male values ('M'),
11 partition female values ('F')
12 );
Table created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 263
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 264
SQL> insert into PEOPLE
3 values ( 1,'Connor','McDonald','U');
insert into PEOPLE *
ERROR at line 1:
ORA-14400: inserted partition key does not map to any partition
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 265
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 266
automatic lists
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 267
SQL> create table PEOPLE
2 (
3 id int,
4 forename varchar2(30),
5 surname varchar2(30),
6 gender varchar2(1)
7 )
8 partition by list (gender) automatic
9 (
10 partition male values ('M'),
11 partition female values ('F')
12 );
Table created.
must still be >=1
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 268
SQL> insert into PEOPLE
2 values ( 1,'Connor','McDonald','U');
1 row created.
SQL> select partition_name
2 from user_tab_partitions
3 where table_name = 'PEOPLE';
PARTITION_NAME
-------------------------------------------------
FEMALE
MALE
SYS_P661
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 269
existing tables
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 270
SQL> alter table PEOPLE set partitioning automatic;
Table altered.
SQL> alter table PEOPLE set partitioning manual;
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 271
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 272
save the largest for last
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 273
LOBs
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 274
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 275
1997
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 276
securefile LOBs
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 277
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 278
2007
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 279
LOBs are cool
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 280
securefile LOBs are cooler
compression
de-duplication
encryption
write cache
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 281
until ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 282
n(databases) > 1
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 283
SQL> create table t ( id int, c clob );
Table created.
SQL> insert into t values (1,rpad('x',32000,'x'));
1 row created.
SQL> select *
2 from t;
ID C
---------- --------------------------------------------
1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 284
SQL> select *
2 from t@db11;
ERROR:
ORA-22992: cannot use LOB locators selected from remote tables
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 285
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 286
SQL> select *
2 from t@db122;
ID C
---------- --------------------------------------------
1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 287
http://docs.oracle.com/database/122/ADLOB/distributed-LOBs.htm
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 288
wrap up
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 289
there's a lot in 12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 290
lots not covered today
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
plenty to excite
291
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
never too soon to start
292
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |294
Connor McDonaldORA-03113
@connor_mc_d
connor-mcdonald.com
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 295
asktom.oracle.com

More Related Content

What's hot

OpenWorld 2018 - 20 years of hints and tips
OpenWorld 2018 - 20 years of hints and tipsOpenWorld 2018 - 20 years of hints and tips
OpenWorld 2018 - 20 years of hints and tips
Connor McDonald
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer Disasters
Connor McDonald
 
Latin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matchingLatin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matching
Connor McDonald
 
Cool SQL Features
Cool SQL FeaturesCool SQL Features
Cool SQL Features
Connor McDonald
 
Perth APAC Groundbreakers tour - SQL Techniques
Perth APAC Groundbreakers tour - SQL TechniquesPerth APAC Groundbreakers tour - SQL Techniques
Perth APAC Groundbreakers tour - SQL Techniques
Connor McDonald
 
Latin America tour 2019 - Flashback
Latin America tour 2019 -  FlashbackLatin America tour 2019 -  Flashback
Latin America tour 2019 - Flashback
Connor McDonald
 
Latin America Tour 2019 - 18c and 19c featues
Latin America Tour 2019   - 18c and 19c featuesLatin America Tour 2019   - 18c and 19c featues
Latin America Tour 2019 - 18c and 19c featues
Connor McDonald
 
APEX Connect 2019 - array/bulk processing in PLSQL
APEX Connect 2019 - array/bulk processing in PLSQLAPEX Connect 2019 - array/bulk processing in PLSQL
APEX Connect 2019 - array/bulk processing in PLSQL
Connor McDonald
 
Sangam 18 - Database Development: Return of the SQL Jedi
Sangam 18 - Database Development: Return of the SQL JediSangam 18 - Database Development: Return of the SQL Jedi
Sangam 18 - Database Development: Return of the SQL Jedi
Connor McDonald
 
18c and 19c features for DBAs
18c and 19c features for DBAs18c and 19c features for DBAs
18c and 19c features for DBAs
Connor McDonald
 
Sangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesSangam 2019 - The Latest Features
Sangam 2019 - The Latest Features
Connor McDonald
 

What's hot (11)

OpenWorld 2018 - 20 years of hints and tips
OpenWorld 2018 - 20 years of hints and tipsOpenWorld 2018 - 20 years of hints and tips
OpenWorld 2018 - 20 years of hints and tips
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer Disasters
 
Latin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matchingLatin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matching
 
Cool SQL Features
Cool SQL FeaturesCool SQL Features
Cool SQL Features
 
Perth APAC Groundbreakers tour - SQL Techniques
Perth APAC Groundbreakers tour - SQL TechniquesPerth APAC Groundbreakers tour - SQL Techniques
Perth APAC Groundbreakers tour - SQL Techniques
 
Latin America tour 2019 - Flashback
Latin America tour 2019 -  FlashbackLatin America tour 2019 -  Flashback
Latin America tour 2019 - Flashback
 
Latin America Tour 2019 - 18c and 19c featues
Latin America Tour 2019   - 18c and 19c featuesLatin America Tour 2019   - 18c and 19c featues
Latin America Tour 2019 - 18c and 19c featues
 
APEX Connect 2019 - array/bulk processing in PLSQL
APEX Connect 2019 - array/bulk processing in PLSQLAPEX Connect 2019 - array/bulk processing in PLSQL
APEX Connect 2019 - array/bulk processing in PLSQL
 
Sangam 18 - Database Development: Return of the SQL Jedi
Sangam 18 - Database Development: Return of the SQL JediSangam 18 - Database Development: Return of the SQL Jedi
Sangam 18 - Database Development: Return of the SQL Jedi
 
18c and 19c features for DBAs
18c and 19c features for DBAs18c and 19c features for DBAs
18c and 19c features for DBAs
 
Sangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesSangam 2019 - The Latest Features
Sangam 2019 - The Latest Features
 

Similar to 12 Things About 12c Release 2 for Developers

Developers vs DBA's - APACOUC webinar 2017
Developers vs DBA's - APACOUC webinar 2017Developers vs DBA's - APACOUC webinar 2017
Developers vs DBA's - APACOUC webinar 2017
Connor McDonald
 
The History of AskTOM
The History of AskTOMThe History of AskTOM
The History of AskTOM
Connor McDonald
 
OEM13c_PPT.pptx
OEM13c_PPT.pptxOEM13c_PPT.pptx
OEM13c_PPT.pptx
SDPL Technologies
 
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
David Buck
 
The Oracle Autonomous Database
The Oracle Autonomous DatabaseThe Oracle Autonomous Database
The Oracle Autonomous Database
Connor McDonald
 
Jfokus 2017 Oracle Dev Cloud and Containers
Jfokus 2017 Oracle Dev Cloud and ContainersJfokus 2017 Oracle Dev Cloud and Containers
Jfokus 2017 Oracle Dev Cloud and Containers
Mika Rinne
 
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
David Buck
 
State of NetBeans
State of NetBeansState of NetBeans
State of NetBeans
Geertjan Wielenga
 
A2 run vmware_workloads_on_public_cloud-without_any_change
A2 run vmware_workloads_on_public_cloud-without_any_changeA2 run vmware_workloads_on_public_cloud-without_any_change
A2 run vmware_workloads_on_public_cloud-without_any_change
Dr. Wilfred Lin (Ph.D.)
 
SkiPHP -- Database Basics for PHP
SkiPHP -- Database Basics for PHP SkiPHP -- Database Basics for PHP
SkiPHP -- Database Basics for PHP
Dave Stokes
 
LET’S GET STARTED WITH ORACLE DATABASE CLOUD
LET’S GET STARTED WITH ORACLE DATABASE CLOUDLET’S GET STARTED WITH ORACLE DATABASE CLOUD
LET’S GET STARTED WITH ORACLE DATABASE CLOUD
Alex Zaballa
 
APEX Connect 2019 - successful application development
APEX Connect 2019 - successful application developmentAPEX Connect 2019 - successful application development
APEX Connect 2019 - successful application development
Connor McDonald
 
Backup DB to Cloud and Restore
Backup DB to Cloud and RestoreBackup DB to Cloud and Restore
Backup DB to Cloud and Restore
MarketingArrowECS_CZ
 
B1 keynote reimagine_application_development_and_delivery_with_oracle_platform
B1 keynote reimagine_application_development_and_delivery_with_oracle_platformB1 keynote reimagine_application_development_and_delivery_with_oracle_platform
B1 keynote reimagine_application_development_and_delivery_with_oracle_platform
Dr. Wilfred Lin (Ph.D.)
 
Perth APAC Groundbreakers tour - 18c features
Perth APAC Groundbreakers tour - 18c featuresPerth APAC Groundbreakers tour - 18c features
Perth APAC Groundbreakers tour - 18c features
Connor McDonald
 
Oracle Fusion - Core HR - Manager Experience
Oracle Fusion - Core HR - Manager ExperienceOracle Fusion - Core HR - Manager Experience
Oracle Fusion - Core HR - Manager Experience
ssuserce1bac1
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
Melbourne Groundbreakers Tour - Upgrading without risk
Melbourne Groundbreakers Tour - Upgrading without riskMelbourne Groundbreakers Tour - Upgrading without risk
Melbourne Groundbreakers Tour - Upgrading without risk
Connor McDonald
 
Sangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12cSangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12c
Connor McDonald
 
Enterprise manager 13c
Enterprise manager 13cEnterprise manager 13c
Enterprise manager 13c
MarketingArrowECS_CZ
 

Similar to 12 Things About 12c Release 2 for Developers (20)

Developers vs DBA's - APACOUC webinar 2017
Developers vs DBA's - APACOUC webinar 2017Developers vs DBA's - APACOUC webinar 2017
Developers vs DBA's - APACOUC webinar 2017
 
The History of AskTOM
The History of AskTOMThe History of AskTOM
The History of AskTOM
 
OEM13c_PPT.pptx
OEM13c_PPT.pptxOEM13c_PPT.pptx
OEM13c_PPT.pptx
 
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
Bytecode Verification, the Hero That Java Needs [JavaOne 2016 CON1500]
 
The Oracle Autonomous Database
The Oracle Autonomous DatabaseThe Oracle Autonomous Database
The Oracle Autonomous Database
 
Jfokus 2017 Oracle Dev Cloud and Containers
Jfokus 2017 Oracle Dev Cloud and ContainersJfokus 2017 Oracle Dev Cloud and Containers
Jfokus 2017 Oracle Dev Cloud and Containers
 
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
Java Concurrency, A(nother) Peek Under the Hood [JavaOne 2016 CON1497]
 
State of NetBeans
State of NetBeansState of NetBeans
State of NetBeans
 
A2 run vmware_workloads_on_public_cloud-without_any_change
A2 run vmware_workloads_on_public_cloud-without_any_changeA2 run vmware_workloads_on_public_cloud-without_any_change
A2 run vmware_workloads_on_public_cloud-without_any_change
 
SkiPHP -- Database Basics for PHP
SkiPHP -- Database Basics for PHP SkiPHP -- Database Basics for PHP
SkiPHP -- Database Basics for PHP
 
LET’S GET STARTED WITH ORACLE DATABASE CLOUD
LET’S GET STARTED WITH ORACLE DATABASE CLOUDLET’S GET STARTED WITH ORACLE DATABASE CLOUD
LET’S GET STARTED WITH ORACLE DATABASE CLOUD
 
APEX Connect 2019 - successful application development
APEX Connect 2019 - successful application developmentAPEX Connect 2019 - successful application development
APEX Connect 2019 - successful application development
 
Backup DB to Cloud and Restore
Backup DB to Cloud and RestoreBackup DB to Cloud and Restore
Backup DB to Cloud and Restore
 
B1 keynote reimagine_application_development_and_delivery_with_oracle_platform
B1 keynote reimagine_application_development_and_delivery_with_oracle_platformB1 keynote reimagine_application_development_and_delivery_with_oracle_platform
B1 keynote reimagine_application_development_and_delivery_with_oracle_platform
 
Perth APAC Groundbreakers tour - 18c features
Perth APAC Groundbreakers tour - 18c featuresPerth APAC Groundbreakers tour - 18c features
Perth APAC Groundbreakers tour - 18c features
 
Oracle Fusion - Core HR - Manager Experience
Oracle Fusion - Core HR - Manager ExperienceOracle Fusion - Core HR - Manager Experience
Oracle Fusion - Core HR - Manager Experience
 
DBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should KnowDBA Commands and Concepts That Every Developer Should Know
DBA Commands and Concepts That Every Developer Should Know
 
Melbourne Groundbreakers Tour - Upgrading without risk
Melbourne Groundbreakers Tour - Upgrading without riskMelbourne Groundbreakers Tour - Upgrading without risk
Melbourne Groundbreakers Tour - Upgrading without risk
 
Sangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12cSangam 18 - The New Optimizer in Oracle 12c
Sangam 18 - The New Optimizer in Oracle 12c
 
Enterprise manager 13c
Enterprise manager 13cEnterprise manager 13c
Enterprise manager 13c
 

More from Connor McDonald

Flashback ITOUG
Flashback ITOUGFlashback ITOUG
Flashback ITOUG
Connor McDonald
 
Sangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestSangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolest
Connor McDonald
 
Sangam 19 - Analytic SQL
Sangam 19 - Analytic SQLSangam 19 - Analytic SQL
Sangam 19 - Analytic SQL
Connor McDonald
 
UKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tipsUKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tips
Connor McDonald
 
Sangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on AutonomousSangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on Autonomous
Connor McDonald
 
UKOUG 2019 - SQL features
UKOUG 2019 - SQL featuresUKOUG 2019 - SQL features
UKOUG 2019 - SQL features
Connor McDonald
 
APEX tour 2019 - successful development with autonomous
APEX tour 2019 - successful development with autonomousAPEX tour 2019 - successful development with autonomous
APEX tour 2019 - successful development with autonomous
Connor McDonald
 
APAC Groundbreakers 2019 - Perth/Melbourne
APAC Groundbreakers 2019 - Perth/Melbourne APAC Groundbreakers 2019 - Perth/Melbourne
APAC Groundbreakers 2019 - Perth/Melbourne
Connor McDonald
 
OOW19 - Flashback, not just for DBAs
OOW19 - Flashback, not just for DBAsOOW19 - Flashback, not just for DBAs
OOW19 - Flashback, not just for DBAs
Connor McDonald
 
OOW19 - Read consistency
OOW19 - Read consistencyOOW19 - Read consistency
OOW19 - Read consistency
Connor McDonald
 
OOW19 - Slower and less secure applications
OOW19 - Slower and less secure applicationsOOW19 - Slower and less secure applications
OOW19 - Slower and less secure applications
Connor McDonald
 
OOW19 - Killing database sessions
OOW19 - Killing database sessionsOOW19 - Killing database sessions
OOW19 - Killing database sessions
Connor McDonald
 
OOW19 - Ten Amazing SQL features
OOW19 - Ten Amazing SQL featuresOOW19 - Ten Amazing SQL features
OOW19 - Ten Amazing SQL features
Connor McDonald
 
Latin America Tour 2019 - 10 great sql features
Latin America Tour 2019  - 10 great sql featuresLatin America Tour 2019  - 10 great sql features
Latin America Tour 2019 - 10 great sql features
Connor McDonald
 
ANSI vs Oracle language
ANSI vs Oracle languageANSI vs Oracle language
ANSI vs Oracle language
Connor McDonald
 
OG Yatra - upgrading to the new 12c+ optimizer
OG Yatra - upgrading to the new 12c+ optimizerOG Yatra - upgrading to the new 12c+ optimizer
OG Yatra - upgrading to the new 12c+ optimizer
Connor McDonald
 
OG Yatra - 25 years of hints and tips
OG Yatra - 25 years of hints and tipsOG Yatra - 25 years of hints and tips
OG Yatra - 25 years of hints and tips
Connor McDonald
 
OG Yatra - Flashback, not just for developers
OG Yatra - Flashback, not just for developersOG Yatra - Flashback, not just for developers
OG Yatra - Flashback, not just for developers
Connor McDonald
 
Kscope19 - Understanding the basics of SQL processing
Kscope19 - Understanding the basics of SQL processingKscope19 - Understanding the basics of SQL processing
Kscope19 - Understanding the basics of SQL processing
Connor McDonald
 
KScope19 - SQL Features
KScope19 - SQL FeaturesKScope19 - SQL Features
KScope19 - SQL Features
Connor McDonald
 

More from Connor McDonald (20)

Flashback ITOUG
Flashback ITOUGFlashback ITOUG
Flashback ITOUG
 
Sangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestSangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolest
 
Sangam 19 - Analytic SQL
Sangam 19 - Analytic SQLSangam 19 - Analytic SQL
Sangam 19 - Analytic SQL
 
UKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tipsUKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tips
 
Sangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on AutonomousSangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on Autonomous
 
UKOUG 2019 - SQL features
UKOUG 2019 - SQL featuresUKOUG 2019 - SQL features
UKOUG 2019 - SQL features
 
APEX tour 2019 - successful development with autonomous
APEX tour 2019 - successful development with autonomousAPEX tour 2019 - successful development with autonomous
APEX tour 2019 - successful development with autonomous
 
APAC Groundbreakers 2019 - Perth/Melbourne
APAC Groundbreakers 2019 - Perth/Melbourne APAC Groundbreakers 2019 - Perth/Melbourne
APAC Groundbreakers 2019 - Perth/Melbourne
 
OOW19 - Flashback, not just for DBAs
OOW19 - Flashback, not just for DBAsOOW19 - Flashback, not just for DBAs
OOW19 - Flashback, not just for DBAs
 
OOW19 - Read consistency
OOW19 - Read consistencyOOW19 - Read consistency
OOW19 - Read consistency
 
OOW19 - Slower and less secure applications
OOW19 - Slower and less secure applicationsOOW19 - Slower and less secure applications
OOW19 - Slower and less secure applications
 
OOW19 - Killing database sessions
OOW19 - Killing database sessionsOOW19 - Killing database sessions
OOW19 - Killing database sessions
 
OOW19 - Ten Amazing SQL features
OOW19 - Ten Amazing SQL featuresOOW19 - Ten Amazing SQL features
OOW19 - Ten Amazing SQL features
 
Latin America Tour 2019 - 10 great sql features
Latin America Tour 2019  - 10 great sql featuresLatin America Tour 2019  - 10 great sql features
Latin America Tour 2019 - 10 great sql features
 
ANSI vs Oracle language
ANSI vs Oracle languageANSI vs Oracle language
ANSI vs Oracle language
 
OG Yatra - upgrading to the new 12c+ optimizer
OG Yatra - upgrading to the new 12c+ optimizerOG Yatra - upgrading to the new 12c+ optimizer
OG Yatra - upgrading to the new 12c+ optimizer
 
OG Yatra - 25 years of hints and tips
OG Yatra - 25 years of hints and tipsOG Yatra - 25 years of hints and tips
OG Yatra - 25 years of hints and tips
 
OG Yatra - Flashback, not just for developers
OG Yatra - Flashback, not just for developersOG Yatra - Flashback, not just for developers
OG Yatra - Flashback, not just for developers
 
Kscope19 - Understanding the basics of SQL processing
Kscope19 - Understanding the basics of SQL processingKscope19 - Understanding the basics of SQL processing
Kscope19 - Understanding the basics of SQL processing
 
KScope19 - SQL Features
KScope19 - SQL FeaturesKScope19 - SQL Features
KScope19 - SQL Features
 

Recently uploaded

Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
UiPathCommunity
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
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
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
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
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 

Recently uploaded (20)

Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
Le nuove frontiere dell'AI nell'RPA con UiPath Autopilot™
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
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
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
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
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 

12 Things About 12c Release 2 for Developers

  • 1. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | WE ARE SHOWING CODING SAMPLES SO IF YOU HAVE PASSED THE AGE OF TWENTY THEN YOU SHOULD PROBABLY THINK ABOUT SITTING RIGHT UP CLOSE TO THE FRONT OF THE ROOM BECAUSE OTHERWISE YOU MIGHT MISS OUT A N D I F Y O U C A N R E A D T H I S, T H E N Y O U S H O U L D L E A V E B E C A U S E Y O U H A V E S U P E R P O W E R S A N D Y O U S H O U L D B E I N A N A V E N G E R S M O V I E N O T L E A R N I N G A B O U T I N F O R M A T I O N T E C H N O L O G Y. :-)
  • 2.
  • 3. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 3
  • 4. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 4 @connor_mc_d connormcdonald.wordpress.com
  • 5. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 5 https://www.youtube.com/c/ConnorMcDonaldOracle https://www.facebook.com/connor.mcdonald42
  • 6. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 12 things Devs will love about 12.2 Connor McDonald Developer Advocate November 2017
  • 7. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 7 why me ?
  • 8. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 8
  • 9. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 9
  • 10. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 10
  • 11. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 11
  • 12. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 12
  • 13. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
  • 14. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 14 https://asktom.oracle.com
  • 15. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 15 18c
  • 16. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 16 why you ?
  • 17. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 17 12.2!12.2! 12.2!12.2! 12.2!
  • 18. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | reality 18
  • 19. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 19
  • 20. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 20 SQL> select * from v$version; BANNER ---------------------------------------------------------- Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production PL/SQL Release 8.1.7.4.0 - Production CORE 8.1.7.0.0 Production TNS for HPUX: Version 8.1.7.4.0 - Production NLSRTL Version 3.4.1.0.0 - Production
  • 21. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 21 SQL> select * from v$version; BANNER ---------------------------------------------------------- Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production PL/SQL Release 8.1.7.4.0 - Production CORE 8.1.7.0.0 Production TNS for HPUX: Version 8.1.7.4.0 - Production NLSRTL Version 3.4.1.0.0 - Production
  • 22. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 22 SQL> select * from v$version; BANNER ---------------------------------------------------------- Oracle8i Enterprise Edition Release 8.1.7.4.0 - Production PL/SQL Release 8.1.7.4.0 - Production CORE 8.1.7.0.0 Production TNS for HPUX: Version 8.1.7.4.0 - Production NLSRTL Version 3.4.1.0.0 - Production
  • 23. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | you still should be here 23
  • 24. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 24
  • 25. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
  • 26. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 26 there's a lot in 12.2
  • 27. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 27 get started right now
  • 28. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 28 install nothing
  • 29. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 29 https://cloud.oracle.com/tryit
  • 30. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 30 install something
  • 31. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 31 http://tinyurl.com/ora122vm
  • 32. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 32 install lots :-)
  • 33. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 33 http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
  • 34. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 34 before we get started
  • 35. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement 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. 35
  • 36. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 36
  • 37. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 37
  • 38. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 38 test ! Test ! TEST !
  • 39. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 39 licensing
  • 40. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 40
  • 41. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 41 time is short ...
  • 42. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 42 asktom.oracle.com
  • 43. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 43
  • 44. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 44 longer names
  • 45. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 45 128 bytes
  • 46. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 46 cool
  • 47. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 47 SQL> create table MY_TABLE 2 ( 3 LONGER_COLUMNS_ARE_BETTER_BECAUSE_THEY_GIVE_MORE_MEANING DATE 4 ); Table created.
  • 48. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 48 the ol' days
  • 49. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 49 "can I get a CSV of the chart of accounts?"
  • 50. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 50 SQL> select table_name 2 from user_tables; TABLE_NAME ------------------------------ T001B T003 T004 T009 T010O T010P T012 T014 T077S T880 … Permitted Posting Periods Document types Chart of accounts Fiscal year variants Posting periods Posting Period Names House banks Credit control area Account group (G/L accounts) Global company data ...
  • 51. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 51 and...
  • 52. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 52 SQL> create table FINALISED_ANNUAL_BUDGET_STATS 2 ( budget_seq int, 3 fiscal_year int, ... ... 24 ); Table created. SQL> alter table FINALISED_ANNUAL_BUDGET_STATS 2 add constraint FINALISED_ANNUAL_BUDGET_STATS_PK 3 primary key ( budget_seq ); add constraint FINALISED_ANNUAL_BUDGET_STATS_PK * ERROR at line 2: ORA-00972: identifier is too long
  • 53. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 53 but...
  • 54. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 54
  • 55. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 55 SQL> create table MY_TABLE 2 ( 3 "SomeRidiculousPieceOfNonsenseBySomeDude WhoWantsToAlignTheDatabaseWithHisDotNetCodingStyle" DATE 4 ); Table created. SQL> select column_name,num_distinct,avg_col_len, num_nulls 2 from all_tab_cols 3 where table_name = upper('&table_name') 4 order by column_id; Enter value for table_name: MY_TABLE COLUMN_NAME ------------------------------ SomeRidiculousPieceOfNonsenseBySomeDudeWhoWantsToAlignWithHisDotNetCodi ngStyle NUM_DISTINCT AVG_COL_LEN NUM_NULLS ------------ ----------- ----------
  • 56. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 56 have some fun :-)
  • 57. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 57 SQL> create or replace 2 trigger ddl_trigger 3 before create or alter on demo.SCHEMA 4 declare 5 l_obj varchar2(128); 6 l_power int; 7 begin 8 l_obj := ora_dict_obj_name; 9 10 select count(*) 11 into l_power 12 from dba_role_privs 13 where grantee = user 14 and granted_role = 'SENIOR_DEV'; 15 16 if l_power = 0 and length(l_obj) > 30 then 17 raise_application_error(-20000,'Identifier "'||l_obj||'" is too long'); 18 end if; 19 end; Trigger created.
  • 58. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 58 SQL> conn junior_dev/junior_dev@db122pdb Connected. SQL> create table EMPLOYEES ( empno int , dept int); Table created. SQL> create table EMPLOYEE_RATINGS_BENEFITS_BEFORE_SALARY_REVIEW 2 ( empno int, dept int ); create table EMPLOYEE_RATINGS_BENEFITS_BEFORE_SALARY_REVIEW * ERROR at line 1: ORA-04088: error during execution of trigger 'CONNOR.DDL_TRIGGER' ORA-00604: error occurred at recursive SQL level 1 ORA-20000: Identifier "EMPLOYEE_RATINGS_BENEFITS_BEFORE_SALARY_REVIEW" is too long ORA-06512: at line 16
  • 59. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 59 SQL> conn connor/*******@db122pdb Connected. SQL> alter table DEMO.EMPLOYEES add 2 constraint EMPLOYEES_CROSS_DIVISION_DEPARTMENTS_FK foreign key 3 ( dept ) references DEMO.CROSS_DIVISION_DEPARTMENTS ( dept ) ; Table altered.
  • 60. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 60
  • 61. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 61 PL/SQL resolved expressions
  • 62. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 62 longer names
  • 63. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
  • 64. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 procedure process_tab is 3 l_tab varchar2(30); 4 begin 5 select table_name 6 into l_tab 7 from user_tables 8 where ...
  • 65. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> exec process_tab; ORA-06502: PL/SQL: numeric or value error: character string buffer too small
  • 66. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 66 12.2
  • 67. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 67 expression in place of literal
  • 68. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> declare 2 c_var_length constant pls_integer := 30; 3 l_str varchar2(c_var_length); 4 begin 5 null; 6 end; 7 / PL/SQL procedure successfully completed.
  • 69. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 69 must be resolvable at compile time SQL function
  • 70. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> declare 2 c_var_length constant pls_integer := to_number('30'); 3 l_str varchar2(c_var_length); 4 begin 5 null; 6 end; 7 / l_str varchar2(c_var_length); * ERROR at line 3: ORA-06550: line 3, column 25: PLS-00491: numeric literal required
  • 71. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> declare 2 c_var_length constant pls_integer := 30; 3 l_str varchar2(c_var_length);
  • 72. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 procedure process_tab is 3 l_str varchar2(ora_max_name_len); 4 begin
  • 73. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 73 start today
  • 74. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 procedure process_tab is 3 4 $if DBMS_DB_VERSION.VER_LE_12_1 $then 5 l_str varchar2(30); 6 $else 7 l_str varchar2(ora_max_name_len); 8 $end 9 10 begin
  • 75. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 75 "Wasn't I just supposed to use ..."
  • 76. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | user_tables.table_name%type
  • 77. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 77 Yes ... but
  • 78. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 procedure process_tab is 3 l_str varchar2( ); 4 begin 5 select owner||'.'||table_name 6 into l_str 7 from all_tables 8 where ... 9 ?
  • 79. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 procedure process_tab is 3 l_str varchar2(2*ora_max_name_len+1); 4 begin 5 select owner||'.'||table_name 6 into l_str 7 from all_tables 8 where ... 9
  • 80. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 80
  • 81. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 81 So ... let's try that again
  • 82. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 82 longer names
  • 83. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 83 compile time resolvable sizes
  • 84. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> desc STORE_SALES Name Type --------------------------------------------------------------------------------- ---------- SALES_PK NUMBER(38) DATE_AT_WHICH_CUSTOMER_CAME_INTO_THE_STOP DATE DATE_AT_WHICH_CUSTOMER_CAME_LEFT_THE_STOP DATE DURATION_CUSTOMER_SPENT_BROWSING_SALES_CATALOG_BEFORE_ASKING_FOR_ASSISTANCE_MINS NUMBER(38) ITEM_THAT_CUSTOMER_PURCHASED VARCHAR2(50) AMOUNT_CUSTOMER_TENDERED_TO_CASHIER_IN_50DOLLAR_NOTES NUMBER(38) AMOUNT_CUSTOMER_TENDERED_TO_CASHIER_IN_20DOLLAR_NOTES NUMBER(38) AMOUNT_CUSTOMER_TENDERED_TO_CASHIER_IN_10DOLLAR_NOTES NUMBER(38) AMOUNT_CUSTOMER_TENDERED_TO_CASHIER_IN_5DOLLAR_NOTES NUMBER(38) AMOUNT_CUSTOMER_TENDERED_TO_CASHIER_IN_COINS_IN_TOTAL_CENTS NUMBER(38) LENGTH_IN_MILLIMETERS_OF_THE_RECEIPT_WE_PRINTED_FOR_THE_CUSTOMER NUMBER(38) AVERAGE_LENGTH_OF_SHOELACE_OF_STORE_ASSISTANT_THAT_HELPED_THE_CUSTOMER NUMBER(38) ... ... ...
  • 85. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
  • 86. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select table_name, 2 listagg(column_name, ',') within group 3 (order by column_id) cols 4 from user_tab_columns 5 group by table_name; * ERROR at line 1: ORA-01489: result of string concatenation is too long
  • 87. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 87 tough to solve
  • 88. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select 2 column_name, 3 ( select listagg(column_name,',') within group ( order by column_id ) 4 from all_tab_columns 5 where table_name = 'EMP' 6 and owner = 'SCOTT' 7 and column_id <= a.column_id ) cols 8 from all_tab_columns a 9 where table_name = 'EMP' 10 and owner = 'SCOTT' 11 order by column_id; COLUMN_NAME COLS ------------------------------ ---------------------------------------------------- EMPNO EMPNO ENAME EMPNO,ENAME JOB EMPNO,ENAME,JOB MGR EMPNO,ENAME,JOB,MGR HIREDATE EMPNO,ENAME,JOB,MGR,HIREDATE SAL EMPNO,ENAME,JOB,MGR,HIREDATE,SAL COMM EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM DEPTNO EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO 8 rows selected.
  • 89. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 89 first principles pipeline function
  • 90. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 90 12.2
  • 91. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 91 improved overflow handling
  • 92. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select table_name, 2 listagg(column_name, ',' on overflow truncate) 3 within group (order by column_id) cols 4 from user_tab_columns 5 group by table_name; TABLE_NAME COLS ------------- ------------------------------------------------------------ STORE_SALES SALES_PK,DATE_AT_WHICH_CUSTOMER_CAME_INTO_THE_STOP,DATE_AT_W HICH_CUSTOMER_CAME_LEFT_THE_STOP,DURATION_CUSTOMER_SPENT_BRO WSING_SALES_CATALOG_BEFORE_ASKING_FOR_ASSISTANCE_IN_MINS,ITE ,LENGTH_IN_MILLIMETERS_OF_THE_RECEIPT_WE_PRINTED_FOR_THE_CUS [snip] TIME_SPENT_WHILST_REFOLDING_ITE...(2378)
  • 93. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 93 plus you get control
  • 94. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select table_name, 2 listagg(column_name, ',' on overflow truncate '[more]') 3 within group (order by column_id) cols 4 from user_tab_columns 5 group by table_name; TABLE_NAME COLS ------------- ------------------------------------------------------------ STORE_SALES SALES_PK,DATE_AT_WHICH_CUSTOMER_CAME_INTO_THE_STOP,DATE_AT_W HICH_CUSTOMER_CAME_LEFT_THE_STOP,DURATION_CUSTOMER_SPENT_BRO WSING_SALES_CATALOG_BEFORE_ASKING_FOR_ASSISTANCE_IN_MINS,ITE ,LENGTH_IN_MILLIMETERS_OF_THE_RECEIPT_WE_PRINTED_FOR_THE_CUS [snip] TIME_SPENT_WHILST_REFOLDING_ITE[more](2378)
  • 95. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select table_name, 2 listagg(column_name,',' 3 on overflow truncate '[more]' without count) 4 within group (order by column_id) cols 5 from user_tab_columns 6 group by table_name; TABLE_NAME COLS ------------- ------------------------------------------------------------ STORE_SALES SALES_PK,DATE_AT_WHICH_CUSTOMER_CAME_INTO_THE_STOP,DATE_AT_W HICH_CUSTOMER_CAME_LEFT_THE_STOP,DURATION_CUSTOMER_SPENT_BRO WSING_SALES_CATALOG_BEFORE_ASKING_FOR_ASSISTANCE_IN_MINS,ITE ,LENGTH_IN_MILLIMETERS_OF_THE_RECEIPT_WE_PRINTED_FOR_THE_CUS [snip] TIME_SPENT_WHILST_REFOLDING_ITE[more]
  • 96. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select table_name, 2 listagg(column_name,',' 3 on overflow truncate '' without count) 4 within group (order by column_id) cols 5 from user_tab_columns 6 group by table_name; TABLE_NAME COLS ------------- ------------------------------------------------------------ STORE_SALES SALES_PK,DATE_AT_WHICH_CUSTOMER_CAME_INTO_THE_STOP,DATE_AT_W HICH_CUSTOMER_CAME_LEFT_THE_STOP,DURATION_CUSTOMER_SPENT_BRO WSING_SALES_CATALOG_BEFORE_ASKING_FOR_ASSISTANCE_IN_MINS,ITE ,LENGTH_IN_MILLIMETERS_OF_THE_RECEIPT_WE_PRINTED_FOR_THE_CUS [snip] TIME_SPENT_WHILST_REFOLDING_ITE
  • 97. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 97
  • 98. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 98 QTFWBC
  • 99. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 99 queries that finish without bloody crashing
  • 100. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> insert into MY_TABLE 2 select * 3 from MY_WHOPPING_GREAT_FAT_TABLE; 100 MY_WHOPPING_GREAT_FAT_TABLE;
  • 101. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 101
  • 102. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 102
  • 103. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 103
  • 104. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 104
  • 105. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 105
  • 106. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> insert into MY_TABLE 2 select * 3 from MY_WHOPPING_GREAT_FAT_TABLE; Elapsed: 06:12:34.00 106
  • 107. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> insert into MY_TABLE 2 select * 3 from MY_WHOPPING_GREAT_FAT_TABLE; Elapsed: 06:12:34.00 ERROR at line 1: ORA-01847: day of month must be between 1 and last day of month 107
  • 108. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 108 ooooooo o !
  • 109. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 109
  • 110. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 110 and then we do this :-)
  • 111. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select count(*) from MY_TABLE; COUNT(*) ---------- 0 111
  • 112. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 112 12.2
  • 113. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 113 validate_conversion
  • 114. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select CREATED_DATE 2 from MY_WHOPPING_GREAT_FAT_TABLE; CREATED_DATE -------------------- 01-FEB-2016 12-MAR-2012 54-AUG-2013 09-SEP-2014 23-OCT-2012 ... ... 114
  • 115. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select to_date(created_date, 'dd-mon-yyyy') 2 from MY_WHOPPING_GREAT_FAT_TABLE 3 where validate_conversion( 4 created_date as date, 'dd-MON-yyyy' 5 ) = 1; TO_DATE(C --------- 01-FEB-16 12-MAR-12 09-SEP-14 23-OCT-12 115
  • 116. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 116 CAST extended
  • 117. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select SALARY, 2 cast(SALARY as number 3 DEFAULT -1 ON CONVERSION ERROR) conv_sal 4 from MY_WHOPPING_GREAT_FAT_TABLE; SALARY CONV_SAL ---------- ---------- 120000 120000 172125 172125 128000 128000 125,000 -1 99500 99500 ... ... 117
  • 118. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select SALARY, 2 TO_NUMBER(SALARY 3 DEFAULT -1 ON CONVERSION ERROR) conv_sal 4 from MY_WHOPPING_GREAT_FAT_TABLE; SALARY CONV_SAL ---------- ---------- 120000 120000 172125 172125 128000 128000 125,000 -1 99500 99500 118 TO_DATE TO_NUMBER TO_TIMESTAMP etc
  • 119. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 119
  • 120. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 120 column level collation
  • 121. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select * 2 from customers 3 where cust_name = 'ADAMS'; COUNTRY CREATED CUST_NAME ------------ --------- --------------------- AUS 08-NOV-16 ADAMS
  • 122. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 122 looks great... until
  • 123. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select * 2 from customers 3 where upper(cust_name) = 'ADAMS'; COUNTRY CREATED CUST_NAME ------------ --------- ------------ AUS 07-NOV-16 Adams AUS 08-NOV-16 ADAMS AUS 09-NOV-16 adams
  • 124. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 124 SQL> select * from customers 2 where upper(cust_name) = 'ADAMS';
  • 125. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select column_name 2 from user_ind_columns 3 where index_name = 'CUST_IX'; COLUMN_NAME ------------------------------ CUST_NAME SQL> select * from customers 2 where upper(cust_name) = 'ADAMS'; ------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | ------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | 152 | |* 1 | TABLE ACCESS FULL| CUSTOMERS | 1 | 152 | -------------------------------------------------------
  • 126. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> create index cust_ix 2 on customers ( cust_name ); Index created. SQL> create index cust_ix2 2 on customers ( upper(cust_name) ); Index created.
  • 127. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 127 DML slower more contention more redo/undo space
  • 128. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 128 "not my problem"
  • 129. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 129
  • 130. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> alter table customers shrink space; * ERROR at line 1: ORA-10631: SHRINK clause should not be specified for this object
  • 131. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 131 12.2
  • 132. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 132 column level collation
  • 133. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 133
  • 134. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> CREATE TABLE CUSTOMERS 2 ( 3 COUNTRY VARCHAR2(128), 4 CREATED DATE, 5 CUST_NAME VARCHAR2(150) COLLATE BINARY_CI 6 ); Table created. "case insenstive"
  • 135. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> create index cust_ix 2 on customers ( cust_name); Index created. SQL> set autotrace traceonly explain SQL> select * from customers 2 where cust_name = 'ADAMS'; ----------------------------------------------------------------- | Id | Operation | Name | Rows | ----------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | | 1 | TABLE ACCESS BY INDEX ROWID BATCHED| CUSTOMERS | 1 | |* 2 | INDEX RANGE SCAN | CUST_IX | 1 | -----------------------------------------------------------------
  • 136. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 136 "big deal"
  • 137. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select * from customers 2 where cust_name = 'ADAMS'; COUNTRY CREATED CUST_NAME ------------ --------- ---------------- AUS 07-NOV-16 Adams AUS 08-NOV-16 ADAMS AUS 09-NOV-16 adams
  • 138. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 138 binary_ci SQL> select * from customers 2 where cust_name = 'ADAMS'; COUNTRY CREATED CUST_NAME ------------ --------- ---------------- AUS 07-NOV-16 Adams AUS 08-NOV-16 ADAMS AUS 09-NOV-16 adams
  • 139. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 139 binary_ai SQL> select * from customers 2 where cust_name = 'ADAMS'; COUNTRY CREATED CUST_NAME ------------ --------- ---------------- AUS 07-NOV-16 Adams AUS 08-NOV-16 ADAMS AUS 09-NOV-16 adams AUS 10-NOV-16 adáms adáms
  • 140. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 140 column | table | user
  • 141. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> alter table people default collation binary_ai; new columns only
  • 142. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 142 key point
  • 143. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> alter table people default collation binary_ai; * ERROR at line 1: ORA-43929: Collation cannot be specified if parameter MAX_STRING_SIZE=STANDARD
  • 144. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 144
  • 145. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 145 deprecated code
  • 146. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 146 "huh?"
  • 147. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 147 deprecate your code
  • 148. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 148 column collation
  • 149. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 149
  • 150. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 150
  • 151. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 package customer_pkg as 3 4 cursor get_customers(p_name varchar2) is 5 select * from customers 6 where upper(customer_name) = upper(p_name); 7 8 ...
  • 152. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 package customer_pkg as 3 4 -- 5 -- do not use 6 -- 7 cursor get_customers(p_name varchar2) is 8 select * from customers 9 where upper(customer_name) = upper(p_name); 10 11 -- 12 -- fixed with CI collation 13 -- 14 cursor get_cust_ci(p_name varchar2) is 15 select * from customers 16 where customer_name = p_name;
  • 153. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 153
  • 154. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 154 new pragma
  • 155. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 package customer_pkg as 3 cursor get_customers(p_name varchar2) is 4 select * from customers 5 where upper(customer_name) = upper(p_name); 6 7 pragma deprecate(get_customers,'Use get_cust_ci'); 8 9 cursor get_cust_ci(p_name varchar2) is 10 select * from customers 11 where customer_name = p_name;
  • 156. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> alter system set 2 plsql_warnings = enable:(6019,6020,6021,6022)';
  • 157. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> alter procedure PROCESS_CUSTOMERS compile; SP2-0804: Procedure created with compilation warnings LINE/COL ERROR -------- ----------------------------------------------------------- 1/1 PLW-05018: unit PROCESS_CUSTOMERS omitted optional AUTHID clause; default value DEFINER used 7/9 PLW-06020: reference to a deprecated entity: GET_CUSTOMERS declared in unit CUSTOMER_PKG[2,10]. Use get_cust_ci instead 8/9 PLW-06020: reference to a deprecated entity:
  • 158. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 158 one month later
  • 159. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 159
  • 160. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> alter system set 2 plsql_warnings = error:(6019,6020,6021,6022)';
  • 161. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> alter procedure PROCESS_CUSTOMERS compile; SP2-0804: Procedure created with compilation errors LINE/COL ERROR -------- ----------------------------------------------------------- 1/1 PLW-05018: unit PROCESS_CUSTOMERS omitted optional AUTHID clause; default value DEFINER used 7/9 PLW-06020: reference to a deprecated entity: GET_CUSTOMERS declared in unit CUSTOMER_PKG[2,10]. Use get_cust_ci instead 8/9 PLW-06020: reference to a deprecated entity:
  • 162. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 162
  • 163. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 163 external tables
  • 164. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | ext_emp
  • 165. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> create table ext_emp ( 2 empno number(4), 3 ename varchar2(10), 4 job varchar2(9), 5 mgr number(4), 6 hiredate date, 7 sal number(7,2), 8 comm number(7,2), 9 deptno number(2) 10 ) 11 organization external 12 ( type oracle_loader 13 default directory TMP 14 access parameters 15 ( records delimited by newline 16 fields terminated by ',' 17 missing field values are null 18 ( empno,ename,job,mgr,hiredate,sal,comm,deptno ) 19 ) 20 location ('emp20161001.dat')); Table created.
  • 166. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | ext_emp
  • 167. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select * from ext_emp; select * from ext_emp * ERROR at line 1: ORA-29913: error in executing ODCIEXTTABLEFETCH callout ORA-30653: reject limit reached
  • 168. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 168 easy fix
  • 169. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> create table ext_emp ( 2 empno number(4), ... 12 ( type oracle_loader 13 default directory TMP 14 access parameters 15 ( records delimited by newline 16 fields terminated by ',' 17 missing field values are null 18 ( empno,ename,job,mgr,hiredate,sal,comm,deptno ) 19 ) 20 location ('emp20161001.dat')) 21 REJECT LIMIT UNLIMITED; Table created.
  • 170. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 170 it's ddl
  • 171. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 171 ITIL :-(
  • 172. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | service call help desk problem recordDONE !
  • 173. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 173 12.2
  • 174. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 174 query time modification
  • 175. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select * from ext_emp 2 external modify ( reject limit unlimited ); EMPNO ENAME JOB MGR HIREDATE SAL ---------- ---------- --------- ---------- --------- ---------- --- 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250 7566 JONES MANAGER 7839 02-APR-81 2975 ... 7902 FORD ANALYST 7566 03-DEC-81 3000 7934 MILLER CLERK 7782 23-JAN-82 1300 13 rows selected.
  • 176. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 176 file names
  • 177. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> create table ext_emp ( 2 empno number(4), ... 20 location ('emp20161001.dat')) Table created.
  • 178. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select * from ext_emp 2 external modify ( location ('emp20161002.dat') ); EMPNO ENAME JOB MGR HIREDATE SAL ---------- ---------- --------- ---------- --------- ---------- --- 7902 FORD ANALYST 7566 03-DEC-81 3000 7934 MILLER CLERK 7782 23-JAN-82 1300 7566 JONES MANAGER 7839 02-APR-81 2975 ... 7499 ALLEN SALESMAN 7698 20-FEB-81 1600 7521 WARD SALESMAN 7698 22-FEB-81 1250 8 rows selected.
  • 179. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | select * from ext_tab external modify ( [ default directory ] [ location ] [ access parameters ] [ reject limit ] );
  • 180. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 180
  • 181. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | ACCOUNTING,KING,PRESIDENT,5000 ACCOUNTING,MILLER,CLERK,1300 181
  • 182. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | <department name="ACCOUNTING"> <employees> <employee> <ename>KING</ename> <job>PRESIDENT</job> <sal>5000</sal> </employee> <employee> <ename>MILLER</ename> <job>CLERK</job> <sal>1300</sal> </employee> </employees> </department> 182
  • 183. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | { "NAME" :"ACCOUNTING" , "EMPLOYEES" : [ {"ENAME" : "KING", "JOB" : "PRESIDENT", "SAL" : 5000 }, {"ENAME" : "MILLER", "JOB" : "CLERK", "SAL" : 1300 }] } 183
  • 184. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 12.1 184
  • 185. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | alter table T add constraint t_chk check ( my_doc is JSON ) 185
  • 186. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | extraction 186
  • 187. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select json_value(my_doc, 2 '$.ACCOUNTING.EMPLOYEES[0].ENAME') as ename 3 from t; ENAME ---------- KING 187
  • 188. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | dot notation 188
  • 189. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select t.my_doc.ACCOUNTING.EMPLOYEES.ENAME emps, 2 t.my_doc.ACCOUNTING.EMPLOYEES.JOB jobs, 3 t.my_doc.ACCOUNTING.EMPLOYEES.SAL sals 4 from T t; EMPS JOBS SALS -------------------- ------------------- --------------- [KING,MILLER] [PRESIDENT,CLERK] [5000,1300] 189
  • 190. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 12.2 190
  • 191. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | generation 191
  • 192. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | { "department": "Accounting", "employees": [ { "name": "Shelley,Higgins", "job": "Accounting Manager" }, { "name": "William,Gietz", "job": "Public Accountant" } ] }
  • 193. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | {"newJSONfunctions": [ "json_array", "json_object", "json_arrayagg", "json_objectagg" ] }
  • 194. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select 2 json_array(department_id, department_name) depts 3 from hr.departments 4 where department_id > 200; DEPTS -------------------------------------------------------- [210,"IT Support"] [220,"NOC"] [230,"IT Helpdesk"] [240,"Government Sales"] [250,"Retail Sales"] [260,"Recruiting"] [270,"Payroll"] 7 rows selected.
  • 195. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select 2 json_object( 3 'DeptID' is department_id, 4 'Name' is department_name) depts 5 from hr.departments 6 where department_id > 200; DEPTS ------------------------------------------------ {"DeptID":210,"Name":"IT Support"} {"DeptID":220,"Name":"NOC"} {"DeptID":230,"Name":"IT Helpdesk"} {"DeptID":240,"Name":"Government Sales"} {"DeptID":250,"Name":"Retail Sales"} {"DeptID":260,"Name":"Recruiting"} {"DeptID":270,"Name":"Payroll"} 7 rows selected.
  • 196. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select json_object( 2 'department' value d.department_name, 3 'employees' value json_arrayagg( 4 json_object( 5 'name' value first_name||','||last_name, 6 'job' value job_title 7 ))) 8 from hr.departments d, hr.employees e, hr.jobs j 9 where d.department_id = e.department_id 10 and e.job_id = j.job_id 11 and d.department_id = 110 12 group by d.department_name;
  • 197. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 197 ... and more JSON goodies json_exists GeoJSON JSON Partitioning In-Memory support JSON Data Guide Materialized Views Search index
  • 198. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 198 SQL> desc ORDERS NAME TYPE ------------------ ----------- ORDER_DETAILS BLOB {"date": "2016-05-03 10:40:36", "loyaltyCardNo": 1230, "location": { "city": "Dallas", "state": "TX”}, "salesAmount": 7.55, "order": [ { "item": "Espresso”, ... } }
  • 199. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 199 SQL> SELECT JSON_DATAGUIDE(o.order_details) FROM orders o; JSON_DATAGUIDE(O.ORDER_DETAILS) ---------------------------------------------------------------------- [ {"o:path": "$.date", "type": "string", "o:length": 32 }, {"o:path": "$.order", "type": "array", "o:length": 256 }, {"o:path": "$.location", "type": "object", "o:length": 32}, {"o:path": "$.location.city", "type": "string", "o:length": 8}, ... ... { "o:path": "$.salesAmount", "type": "number", "o:length": 4 }, { "o:path": "$.loyaltyCardNo","type": "number", "o:length": 8}]
  • 200. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 200
  • 201. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 201 one row...
  • 202. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 202 one lousy
  • 203. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 203 can really spoil your day :-(
  • 204. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 204 SQL> select owner, 2 count(*) as cnt 3 from t 4 where owner like 'S%' 5 group by owner; SQL> select num_rows 2 from user_tables 3 where table_name = 'T'; NUM_ROWS ----------- 7014272505
  • 205. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 205 SQL> create materialized view log on T 2 with rowid (owner,object_id) 3 including new values; Materialized view log created. SQL> create materialized view T_MV 2 refresh fast on demand 3 enable query rewrite 4 as 5 select owner, 6 sum(object_id) as sum_obj, 7 count(object_id) as cnt_obj, 8 count(*) as cnt 9 from t 10 group by owner; Materialized view created.
  • 206. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 206 SQL> set autotrace traceonly explain SQL> select owner, count(*) 2 from t 3 where owner like 'S%' 4 group by owner; -------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| -------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 2 | 26 | 3 (0)| |* 1 | MAT_VIEW REWRITE ACCESS FULL| T_MV | 2 | 26 | 3 (0)| -------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter("T_MV"."OWNER" LIKE 'S%')
  • 207. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 207 hero
  • 208. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 208
  • 209. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 209 until ...
  • 210. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 210 SQL> insert into t 2 values ( ... , ... , ..., ..... ); 1 row created. SQL> commit; Commit complete.
  • 211. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 211 SQL> select owner, count(*) 2 from t 3 where owner like 'S%' 4 group by owner; ---------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| ---------------------------------------------------------------- | 0 | SELECT STATEMENT | | 2 | 10 | 14M (1)| | 1 | HASH GROUP BY | | 2 | 10 | 14M (1)| |* 2 | TABLE ACCESS FULL| T | 574M| 2738M| 14M (1)| ----------------------------------------------------------------
  • 212. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 212
  • 213. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 213 SQL> create or replace 2 procedure KILL_MY_CPU_MIXED_WITH_PRAYER is 3 begin 4 loop 5 dbms_mview.refresh('T_MV'); 6 end loop; 7 end; 8 / Procedure created.
  • 214. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 214 12.2
  • 215. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 215 real time refresh
  • 216. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 216 on commit
  • 217. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 217 SQL> create materialized view T_MV 2 refresh fast on demand 3 enable query rewrite 4 enable on query computation 5 as 6 select owner, 7 sum(object_id) as sum_obj, 8 count(object_id) as cnt_obj, 9 count(*) as cnt 10 from t 11 group by owner; Materialized view created.
  • 218. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 218 SQL> set autotrace traceonly explain SQL> select owner, count(*) 2 from t 3 where owner like 'S%' 4 group by owner; --------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| --------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 2 | 26 | 3 (0)| |* 1 | MAT_VIEW REWRITE ACCESS FULL| T_MV | 2 | 26 | 3 (0)| --------------------------------------------------------------------------- as before
  • 219. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 219 SQL> insert into t 2 values ( ... , ... , ..., ..... ); 1 row created. SQL> commit; Commit complete.
  • 220. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 220 SQL> select owner, count(*) cnt 2 from t 3 where owner like 'S%' 4 group by owner; OWNER CNT ------------------------------ ---------- SYS 50941 SI_INFORMTN_SCHEMA 8 SYSTEM 482 Elapsed: 00:00:01.41 SQL> select /*+ NO_REWRITE */ owner, count(*) cnt 2 from t 3 where owner like 'S%' 4 group by owner; OWNER CNT ------------------------------ ---------- SYS 50941 SYSTEM 482 SI_INFORMTN_SCHEMA 8
  • 221. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 221 how ?
  • 222. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 222 we didn't refresh the mview SQL> select owner, count(*) as cnt 2 from t 3 where owner like 'S%' 4 group by owner; OWNER CNT ------------------------------ ---------- SYS 50941 SI_INFORMTN_SCHEMA 8 SYSTEM 482 SQL> select owner, cnt 2 from T_MV 3 where owner like 'S%'; OWNER CNT ------------------------------ ---------- SYS 50940 SYSTEM 482 SI_INFORMTN_SCHEMA 8
  • 223. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 223 SQL> set autotrace traceonly explain SQL> select owner, 2 count(*) as cnt 3 from t 4 where owner like 'S%' 5 group by owner;
  • 224. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 224 ----------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| ----------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 4 | 316 | 15 (20)| | 1 | VIEW | | 4 | 316 | 15 (20)| | 2 | UNION-ALL | | | | | |* 3 | FILTER | | | | | |* 4 | HASH JOIN OUTER | | 2 | 184 | 6 (17)| |* 5 | MAT_VIEW ACCESS FULL | T_MV | 2 | 46 | 2 (0)| | 6 | VIEW | | 1 | 69 | 4 (25)| | 7 | HASH GROUP BY | | 1 | 88 | 4 (25)| |* 8 | TABLE ACCESS FULL | MLOG$_T | 1 | 88 | 3 (0)| | 9 | VIEW | | 2 | 158 | 9 (23)| | 10 | UNION-ALL | | | | | |* 11 | FILTER | | | | | | 12 | NESTED LOOPS OUTER | | 1 | 102 | 4 (25)| | 13 | VIEW | | 1 | 79 | 4 (25)| |* 14 | FILTER | | | | | | 15 | HASH GROUP BY | | 1 | 88 | 4 (25)| |* 16 | TABLE ACCESS FULL | MLOG$_T | 1 | 88 | 3 (0)| |* 17 | INDEX UNIQUE SCAN | I_SNAP$_T_MV | 1 | 23 | 0 (0)| | 18 | NESTED LOOPS | | 1 | 105 | 5 (20)| | 19 | VIEW | | 1 | 82 | 4 (25)| | 20 | HASH GROUP BY | | 1 | 88 | 4 (25)| |* 21 | TABLE ACCESS FULL | MLOG$_T | 1 | 88 | 3 (0)| |* 22 | MAT_VIEW ACCESS BY INDEX ROWID| T_MV | 1 | 23 | 1 (0)| |* 23 | INDEX UNIQUE SCAN | I_SNAP$_T_MV | 1 | | 0 (0)| -----------------------------------------------------------------------------------------
  • 225. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 225 what about direct queries ?
  • 226. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 226 SQL> select /*+ FRESH_MV */ owner, cnt 2 from T_MV 3 where owner like 'S%'; OWNER CNT ------------------------------ ---------- SYSTEM 482 SYS 50940 SI_INFORMTN_SCHEMA 8 owner, cnt 50941
  • 227. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 227
  • 228. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 228 almost correct SQL
  • 229. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 229
  • 230. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 230 background
  • 231. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 231 don't you hate ...
  • 232. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 232
  • 233. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 233 ALERT: Batch load failed Batch process ended in error. Module: Financial Reconcilation Issue: Yearly total Expected: $7,102,231.76 Actual: $7,102,231.32
  • 234. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 234 $7,100,000 $8,200,000 $7,700,000
  • 235. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 235 sometimes ...
  • 236. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 236 close enough ...
  • 237. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 237 ... is good enough
  • 238. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 238 the hardest work for a database ...
  • 239. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select count(distinct ...) cdist 2 from my_super_massive_table; CDIST ------- 12 Elapsed: 01:32:17.00
  • 240. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 240 12.1
  • 241. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | SQL> select approx_count_distinct(...) cdist 2 from my_super_massive_table; CDIST ------- 12 Elapsed: 00:12:43.00
  • 242. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 242 but ...
  • 243. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 243 SQL> select count(*) 2 from user_source 3 where upper(text) like '%COUNT(%DISTINCT%'; COUNT(*) ---------- 1723
  • 244. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 244 "I don't think so"
  • 245. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 245 12.2
  • 246. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 246 SQL> alter session set approx_for_count_distinct = true; Session altered. SQL> select count(distinct ...) 2 from my_super_massive_table; approx_count_distinct(...)
  • 247. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 247 more functions approx_median approx_percentile approx_count_distinct_detail to_approx_...
  • 248. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 248 more confidence
  • 249. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 249 SQL> select department, 2 approx_median(salary deterministic) med_sal 3 from employees 4 group by department 5 order by department; DEPARTMENT MED_SAL ---------- ------------- 10 4400 20 6000 30 2765 40 6500
  • 250. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 250 SQL> select 2 department, 3 approx_median(salary deterministic, 'ERROR_RATE') err 4 from employees 5 group by department 6 order by department; DEPARTMENT ERR ---------- ------------- 10 .002718282 20 .021746255 30 .021746255 40 .002718282 50 .019027973 60 .019027973
  • 251. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 251 SQL> select 2 department, 3 approx_median(salary, 'CONFIDENCE') conf 4 from employees 5 group by department 6 order by department; DEPARTMENT CONF ---------- ------------- 10 .997281718 20 .999660215 30 .999660215 40 .997281718 50 .999611674 60 .999611674 70 .997281718
  • 252. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 252
  • 253. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 253 partitioning
  • 254. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 254 10g and earlier
  • 255. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 255 SQL> create table SALES 2 ( cal_year date, 3 txn_id int, ... ... 24 ) 25 partition by range ( cal_year ) 26 ( 27 partition p_low values less than ( date '2000-01-01' ), 28 partition p2000 values less than ( date '2001-01-01' ), ... ... 34 partition p2016 values less than ( date '2017-01-01' ) 35 ); Table created.
  • 256. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 256 SQL> insert into SALES 2 values ( trunc(sysdate), .... ); insert into SALES * ERROR at line 1: ORA-14400: inserted partition key does not map to any partition
  • 257. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 257 11g
  • 258. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 258 interval partitioning
  • 259. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 259 SQL> create table SALES 2 ( cal_year date, 3 txn_is int 4 ) 5 partition by range ( cal_year ) 6 interval ( numtoyminterval(1,'YEAR') ) 7 ( 8 partition p_low values less than ( date '2000-01-01' ) 9 ); Table created.
  • 260. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 260 lists
  • 261. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 261
  • 262. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 262 SQL> create table PEOPLE 2 ( 3 id int, 4 forename varchar2(30), 5 surname varchar2(30), 6 gender varchar2(1) 7 ) 8 partition by list (gender) 9 ( 10 partition male values ('M'), 11 partition female values ('F') 12 ); Table created.
  • 263. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 263
  • 264. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 264 SQL> insert into PEOPLE 3 values ( 1,'Connor','McDonald','U'); insert into PEOPLE * ERROR at line 1: ORA-14400: inserted partition key does not map to any partition
  • 265. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 265 12.2
  • 266. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 266 automatic lists
  • 267. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 267 SQL> create table PEOPLE 2 ( 3 id int, 4 forename varchar2(30), 5 surname varchar2(30), 6 gender varchar2(1) 7 ) 8 partition by list (gender) automatic 9 ( 10 partition male values ('M'), 11 partition female values ('F') 12 ); Table created. must still be >=1
  • 268. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 268 SQL> insert into PEOPLE 2 values ( 1,'Connor','McDonald','U'); 1 row created. SQL> select partition_name 2 from user_tab_partitions 3 where table_name = 'PEOPLE'; PARTITION_NAME ------------------------------------------------- FEMALE MALE SYS_P661
  • 269. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 269 existing tables
  • 270. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 270 SQL> alter table PEOPLE set partitioning automatic; Table altered. SQL> alter table PEOPLE set partitioning manual; Table altered.
  • 271. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 271
  • 272. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 272 save the largest for last
  • 273. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 273 LOBs
  • 274. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 274
  • 275. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 275 1997
  • 276. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 276 securefile LOBs
  • 277. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 277
  • 278. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 278 2007
  • 279. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 279 LOBs are cool
  • 280. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 280 securefile LOBs are cooler compression de-duplication encryption write cache
  • 281. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 281 until ...
  • 282. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 282 n(databases) > 1
  • 283. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 283 SQL> create table t ( id int, c clob ); Table created. SQL> insert into t values (1,rpad('x',32000,'x')); 1 row created. SQL> select * 2 from t; ID C ---------- -------------------------------------------- 1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • 284. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 284 SQL> select * 2 from t@db11; ERROR: ORA-22992: cannot use LOB locators selected from remote tables
  • 285. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 285 12.2
  • 286. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 286 SQL> select * 2 from t@db122; ID C ---------- -------------------------------------------- 1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  • 287. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 287 http://docs.oracle.com/database/122/ADLOB/distributed-LOBs.htm
  • 288. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 288 wrap up
  • 289. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 289 there's a lot in 12.2
  • 290. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 290 lots not covered today
  • 291. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | plenty to excite 291
  • 292. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | never too soon to start 292
  • 293. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
  • 294. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |294 Connor McDonaldORA-03113 @connor_mc_d connor-mcdonald.com
  • 295. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 295 asktom.oracle.com

Editor's Notes

  1. This is a Branded Title Slide with Event Look and Feel slide ideal for including a brief title, subtitle and presenter information. Do not customize this slide with your own picture. To reuse this branded background in another presentation on PC Locate and open the presentation where you will be placing this artwork. Click New Slide from the Home tab's Slides group and select Reuse Slides. Click Browse in the Reuse Slides panel and select Browse Files. Double-click the PowerPoint presentation that contains the background you wish to copy. Check Keep Source Formatting and click the slide that contains the background you want. Click the left-hand slide preview to which you wish to apply the new master layout. Apply New Layout (Important): Right-click any selected slide, point to Layout, and click the slide containing the desired layout from the layout gallery. Delete any unwanted slides or duplicates. To reuse this branded background in another presentation on Mac Locate and open the presentation where you will be placing this artwork. Click New Slide from the Home tab's Slides group and select Insert Slides from Other Presentation… Navigate to the PowerPoint presentation file that contains the background you wish to copy. Double-click or press Insert. This prompts the Slide Finder dialogue box. Make sure Keep design of original slides is unchecked and click the slide(s) that contains the background you want. Hold Shift key to select multiple slides. Click the left-hand slide preview to which you wish to apply the new master layout. Apply New Layout (Important): Click Layout from the Home tab's Slides group, and click the slide containing the desired layout from the layout gallery. Delete any unwanted slides or duplicates.
  2. This is a Safe Harbor Front slide, one of two Safe Harbor Statement slides included in this template. One of the Safe Harbor slides must be used if your presentation covers material affected by Oracle’s Revenue Recognition Policy To learn more about this policy, e-mail: Revrec-americasiebc_us@oracle.com For internal communication, Safe Harbor Statements are not required. However, there is an applicable disclaimer (Exhibit E) that should be used, found in the Oracle Revenue Recognition Policy for Future Product Communications. Copy and paste this link into a web browser, to find out more information.   http://my.oracle.com/site/fin/gfo/GlobalProcesses/cnt452504.pdf For all external communications such as press release, roadmaps, PowerPoint presentations, Safe Harbor Statements are required. You can refer to the link mentioned above to find out additional information/disclaimers required depending on your audience.
  3. Devs and DBAs gone crazy: 128 character tables!
  4. Devs and DBAs gone crazy: 128 character tables!
  5. Devs and DBAs gone crazy: 128 character tables!
  6. Devs and DBAs gone crazy: 128 character tables!
  7. Devs and DBAs gone crazy: 128 character tables!
  8. Devs and DBAs gone crazy: 128 character tables!
  9. Devs and DBAs gone crazy: 128 character tables!
  10. or use %type (been around "forever")
  11. Devs and DBAs gone crazy: 128 character tables!
  12. Devs and DBAs gone crazy: 128 character tables!
  13. Devs and DBAs gone crazy: 128 character tables!
  14. Devs and DBAs gone crazy: 128 character tables!
  15. Devs and DBAs gone crazy: 128 character tables!
  16. Devs and DBAs gone crazy: 128 character tables!
  17. Devs and DBAs gone crazy: 128 character tables!
  18. Devs and DBAs gone crazy: 128 character tables!
  19. Devs and DBAs gone crazy: 128 character tables!
  20. Can also have country specific collations
  21. Can also have country specific collations
  22. Can also have country specific collations
  23. Can also have country specific collations
  24. Can also have country specific collations
  25. Can also have country specific collations
  26. Can also have country specific collations
  27. Can also have country specific collations
  28. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  29. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  30. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  31. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  32. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  33. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  34. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  35. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  36. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  37. Load files into DB using external tables. Great. Until there's a problem.
  38. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  39. Load files into DB using external tables. Great. Until there's a problem.
  40. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  41. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  42. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  43. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  44. Won't affect existing columns – they keep their current collation MAX_STRING_SIZE=STANDARD is the default; but if you upgraded may not be set So now we've enabled column level collation, we can revisit old code...
  45. Can override any of these for your query!
  46. Produces doc in earlier slide
  47. Produces doc in earlier slide
  48. Produces doc in earlier slide
  49. https://pixabay.com/en/coffee-percolator-coffee-percolator-157876/
  50. https://pixabay.com/en/coffee-percolator-coffee-percolator-157876/
  51. Everyone is a beginner