Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Perth APAC Groundbreakers tour - 18c features

346 views

Published on

A tour of the features that are now available in versions 12.2 and 18c of the Oracle Database, with a focus on the new release model and its implications for DBAs

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Perth APAC Groundbreakers tour - 18c features

  1. 1. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Connor McDonald
  2. 2. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 2
  3. 3. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 3
  4. 4. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Stuff youtube bit.ly/youtube-connor blog bit.ly/blog-connor twitter bit.ly/twitter-connor 400+ posts mainly on database & development 250 technical videos, new uploads every week rants and raves on tech and the world :-)
  5. 5. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. etc... facebook bit.ly/facebook-connor linkedin bit.ly/linkedin-connor instagram bit.ly/instagram-connor slideshare bit.ly/slideshare-connor
  6. 6. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | https://asktom.oracle.com
  7. 7. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 7https://asktom.oracle.com/officehours
  8. 8. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 150 hours of free access (so far) 8
  9. 9. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Cool stuff about 12.2/18c/19c Connor McDonald Developer Advocate
  10. 10. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | "Whoa....hold on!" 10
  11. 11. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 12c, 13, 14, 15, 16, 17, 18c 11 ?
  12. 12. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 18c = 12.2.0.2 12 MOS 2285040.1
  13. 13. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 19c = 12.2.0.3 13
  14. 14. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 14 why me ?
  15. 15. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 15
  16. 16. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 16
  17. 17. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 17
  18. 18. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 18
  19. 19. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
  20. 20. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 20 why you ?
  21. 21. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 21 12.2!18! 12.2!12.2! 18!
  22. 22. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | reality 22
  23. 23. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 23
  24. 24. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 24 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
  25. 25. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 25 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
  26. 26. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 26 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
  27. 27. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | you still should be here 27
  28. 28. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 28 there's a lot in 12.2/18/19
  29. 29. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 29 get started right now
  30. 30. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 30 install nothing
  31. 31. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 31 https://cloud.oracle.com/tryit
  32. 32. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 32 install a little bit
  33. 33. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 33 https://tinyurl.com/ora18vm
  34. 34. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 34 install lots :-)
  35. 35. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 35 http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
  36. 36. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 36 18c install lots :-)
  37. 37. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 37
  38. 38. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 38 18c install lots :-)
  39. 39. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 39
  40. 40. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 40 coming soon
  41. 41. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 41 install lots :-)
  42. 42. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 42 1) gold image service
  43. 43. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 43 2) read-only ORACLE_HOME
  44. 44. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 44 3) Oracle database in Docker https://tinyurl.com/ora18docker
  45. 45. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 45 because there's 19c stuff in here
  46. 46. Copyright © 2018, 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. 46
  47. 47. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 47
  48. 48. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 48 licensing
  49. 49. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 49
  50. 50. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 50 UNZIP INSTALL RPM INSTALL DOCKER READ-ONLY GOLD IMAGE
  51. 51. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 51 external tables
  52. 52. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | ext_emp
  53. 53. Copyright © 2018, 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.
  54. 54. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | ext_emp
  55. 55. Copyright © 2018, 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
  56. 56. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 56 easy fix
  57. 57. Copyright © 2018, 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.
  58. 58. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 58 12.2
  59. 59. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 59 query time modification
  60. 60. Copyright © 2018, 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.
  61. 61. Copyright © 2018, 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.
  62. 62. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | select * from ext_tab external modify ( [ default directory ] [ location ] [ access parameters ] [ reject limit ] );
  63. 63. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 63 18c
  64. 64. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 64 zero ddl option
  65. 65. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> select * from external ( 2 empno number(4), 3 ename varchar2(10), 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,...) 19 ) 20 location ('emp20161001.dat') 21 );
  66. 66. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 66
  67. 67. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 67 polymorphic table functions
  68. 68. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 68
  69. 69. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 69 recap: table functions
  70. 70. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 type MY_OBJECT ( 3 empno number(4), 4 ename varchar2(10) ... 10 / Type created. SQL> create or replace 2 type OBJ_LIST as table of MY_OBJECT; 3 / Type created.
  71. 71. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 function MY_PIPE_FUNC return OBJ_LIST pipelined as ... ... pipe row ( obj_list(v_empno, v_ename, ... )); ... 64 end; 65 / Function created.
  72. 72. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> select * from table(my_pipe_func); EMPNO ENAME JOB ---------- ---------- --------- 7369 SMITH CLERK 7499 ALLEN SALESMAN 7521 WARD SALESMAN 7566 JONES MANAGER 7654 MARTIN SALESMAN 7698 BLAKE MANAGER 7782 CLARK MANAGER 7788 SCOTT ANALYST my_pipe_func();
  73. 73. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 73 static return type SQL> create or replace 2 type MY_OBJECT ( 3 empno number(4), 4 ename varchar2(10) ... 10 /
  74. 74. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 74 polymorphic table functions
  75. 75. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 75 "hack" into SQL processing
  76. 76. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 package MY_PKG as 3 -- 4 -- description phase 5 -- 6 function describe ( 7 tab in out dbms_tf.table_t, 8 ... 9 ) return dbms_tf.describe_t; 10 11 -- 12 -- fetch phase 13 -- 14 procedure fetch_rows (col_names varchar2); 15 end ;
  77. 77. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 77 example
  78. 78. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 package row_num_p is 3 function describe(tab in out dbms_tf.table_t) 4 return dbms_tf.describe_t; 5 6 procedure fetch_rows; 7 end; 8 / Package created.
  79. 79. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 package body row_num_p is 3 function describe(tab in out dbms_tf.table_t) 4 return dbms_tf.describe_t as 5 begin 6 return 7 dbms_tf.describe_t( 8 new_columns => 9 dbms_tf.columns_new_t( 10 1=>dbms_tf.column_metadata_t( 11 name => 'ROW_ID', 12 type => dbms_tf.type_number))); 13 end; 14
  80. 80. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 14 15 procedure fetch_rows is 16 row_cnt constant pls_integer := dbms_tf.get_env().row_count; 17 col dbms_tf.tab_number_t; 18 begin 19 for i in 1 .. row_cnt 20 loop 21 col(i) := i; 22 end loop; 23 dbms_tf.put_col(1, col); 24 end; 25 26 END; 27 / Package body created.
  81. 81. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 function row_num(tab table) return table 3 pipelined table polymorphic using row_num_p; 4 / Function created.
  82. 82. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> select * from row_num(scott.dept); DEPTNO DNAME LOC ROW_ID ---------- -------------- ------------- ---------- 10 ACCOUNTING NEW YORK 1 20 RESEARCH DALLAS 2 30 SALES CHICAGO 3 40 OPERATIONS BOSTON 4 SQL> select * from row_num(scott.salgrade); GRADE LOSAL HISAL ROW_ID ---------- ---------- ---------- ---------- 1 700 1200 1 2 1201 1400 2 3 1401 2000 3 4 2001 3000 4 5 3001 9999 5
  83. 83. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 83 any table
  84. 84. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> with MY_TAB as 2 ( select empno, ename 3 from scott.emp 4 ) 5 select * from row_num(my_tab); EMPNO ENAME ROW_ID ---------- ---------- ---------- 7369 SMITH 1 7499 ALLEN 2 7521 WARD 3 7566 JONES 4 7654 MARTIN 5 7698 BLAKE 6 7782 CLARK 7 7788 SCOTT 8 7839 KING 9 ...
  85. 85. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 85 very extensible
  86. 86. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 package csv_pkg as 3 4 function describe ( 5 tab in out dbms_tf.table_t, 6 col_names varchar2 7 ) return dbms_tf.describe_t; 8 9 procedure fetch_rows (col_names varchar2); 10 end csv_pkg; 11 / Package created.
  87. 87. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace 2 package body csv_pkg as 3 function describe( 4 tab in out dbms_tf.table_t, 5 col_names varchar2 ) return dbms_tf.describe_t as 6 new_cols dbms_tf.columns_new_t; 7 col_id pls_integer := 2; 8 begin 9 tab.column(1).pass_through := FALSE; 10 tab.column(1).for_read := TRUE; 11 new_cols(1) := tab.column(1).description; 12 13 for j in 1 .. ( length(col_names) - length(replace(col_names,',')) ) + 1 14 loop 15 new_cols(col_id) := dbms_tf.column_metadata_t( 16 name=>regexp_substr(col_names, '[^,]+', 1, j), 17 type=>dbms_tf.type_varchar2 18 ); 19 col_id := col_id + 1; 20 end loop; 21 22 return dbms_tf.describe_t( new_columns => new_cols ); 23 end;
  88. 88. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 25 procedure fetch_rows (col_names varchar2) as 26 rowset dbms_tf.row_set_t; 27 row_count pls_integer; 28 begin 29 dbms_tf.get_row_set(rowset, row_count => row_count); 30 31 for i in 1 .. row_count loop 32 for j in 2 .. ( length(col_names) - length(replace(col_names,',')) ) + 2 33 loop 34 rowset(j).tab_varchar2(i) := 35 regexp_substr(rowset(1).tab_varchar2(i), '[^,]+', 1, j - 1); 36 end loop; 37 end loop; 38 39 dbms_tf.put_row_set(rowset); 40 41 end; 42 43 end csv_pkg; 44 / Package body created.
  89. 89. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> create or replace function csv_to_columns( 2 tab table, col_names varchar2 3 ) return table pipelined row polymorphic using csv_pkg; 4 / Function created. SQL> with csvs as ( 2 select 'two,comma-separated values' str from dual 3 ) 4 select * 5 from csv_to_columns( csvs, 'c1,c2' ); STR C1 C2 -------------------------- ---------- ----------------------- two,comma-separated values two comma-separated values
  90. 90. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 90 livesql.oracle.com
  91. 91. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 91
  92. 92. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 92 qualified expressions
  93. 93. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 93 aka, full constructor support
  94. 94. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 94 good old days
  95. 95. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> declare 2 type my_rec is record 3 ( c1 int, 4 c2 date, 5 c3 varchar2(30), 6 c4 boolean 7 ); 8 9 l_rec my_rec; 10 begin 11 l_rec.c1 := 10; 12 l_rec.c2 := sysdate; 13 l_rec.c3 := 'Lots of typing'; 14 l_rec.c4 := true; 15 end; 16 / PL/SQL procedure successfully completed.
  96. 96. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 96 18c+
  97. 97. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> declare 2 type my_rec is record 3 ( c1 int, 4 c2 date, 5 c3 varchar2(30), 6 c4 boolean 7 ); 8 9 l_rec my_rec; 10 begin 11 l_rec := my_rec(c1=>10, 12 c2=>sysdate, 13 c3=>'Lots of typing', 14 c4=>true); 15 end; 16 / PL/SQL procedure successfully completed.
  98. 98. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 98 arrays too
  99. 99. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> declare 2 type my_array is table of int 3 index by pls_integer; 4 5 l_array my_array; 6 begin 7 l_array := 8 my_array(1=>123, 9 2=>456, 10 3=>789, 11 7=>1000); 12 end; 13 / PL/SQL procedure successfully completed.
  100. 100. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 100
  101. 101. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 101 a nicer form of murder :-)
  102. 102. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 102 aka, #1 reason for upgrading to 18c
  103. 103. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> insert into MY_TABLE 2 select * 3 from MY_HUGE_GREAT_FAT_TABLE; 103
  104. 104. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 104
  105. 105. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> insert into MY_TABLE 2 select * 3 from MY_HUGE_GREAT_FAT_TABLE 4 where LOAD_DATE > sysdate - 1; 105
  106. 106. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> alter system kill session '123,456' immediate 106
  107. 107. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 107 18c
  108. 108. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> alter system kill cancel sql '123,456'; 108
  109. 109. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 109
  110. 110. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 110 maybe murder won't help
  111. 111. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 111
  112. 112. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 112 bad SQL just keeps coming back...
  113. 113. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 113 19c
  114. 114. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 114 automatic quarantine of bad SQL elapsed time resource consumption
  115. 115. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 115 error on subsequent execution
  116. 116. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 116 1) alerts to administrator
  117. 117. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 117 or...
  118. 118. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 118 2) automated historical diagnosis/repair
  119. 119. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 119
  120. 120. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 120 maybe murder wasn't the right thing
  121. 121. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> insert into MY_TABLE 2 select * 3 from MY_HUGE_GREAT_FAT_TABLE 4 where LOAD_DATE > sysdate - 1; 121
  122. 122. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 122
  123. 123. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> insert into MY_TABLE 2 select * 3 from MY_HUGE_GREAT_FAT_TABLE w 4 where LOAD_DATE > sysdate - 1; 123 /*+ INDEX(W CUST_DATE_IX) */ *
  124. 124. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 124 18c
  125. 125. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> alter system set optimizer_ignore_hints = true 125
  126. 126. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 126
  127. 127. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 127 maybe it was the opposite ?
  128. 128. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 128 cool
  129. 129. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> insert into MY_TABLE 2 select * 3 from MY_HUGE_GREAT_FAT_TABLE 4 where LOAD_DATE > sysdate - 1; 129
  130. 130. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 130
  131. 131. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 131 but what is best practice ?
  132. 132. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 132 1) monitor the SQL workload AWR / Top SQL
  133. 133. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 133 2) consider indexes per SQL leading columns
  134. 134. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 134 3) consolidate tables/columns (a) (a,b) (a,b,c)
  135. 135. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 135 4) create nosegment/unusable dictionary only
  136. 136. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 136 5) check "virtual" explain plan cost/cardinality
  137. 137. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 137 6) create true index (as invisible) no impact risk
  138. 138. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 138 7) test execute each SQL for benefit response time/IO
  139. 139. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 139 8) decide on each index worth "majority wins"
  140. 140. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 140 9) add NO_INDEX hint to others no regression
  141. 141. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 141 10) make new indexes visible
  142. 142. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 142 we're done!
  143. 143. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 143
  144. 144. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 144 go to step 1
  145. 145. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
  146. 146. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 146 19c
  147. 147. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 147 automatic indexes
  148. 148. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 148
  149. 149. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 149 outages... suck
  150. 150. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 150 12.2
  151. 151. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 151 online "everything"
  152. 152. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 152 SQL> alter table t move online; Table altered.
  153. 153. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | really is "everything"
  154. 154. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 154 SQL> alter table MY_SALES move 2 compress tablespace users 3 update indexes 4 (sales_ix1 tablespace indexes01, 5 sales_ix2 tablespace indexes02) 6 online; Table altered.
  155. 155. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | partition existing table one command
  156. 156. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 156 SQL> create table T as 2 select d.* 3 from dba_Objects d, 4 ( select 1 from dual 5 connect by level <= 20 ) 6 where d.object_id is not null; Table created. SQL> create index IX on t ( object_id ); Index created. SQL> create index IX2 on t ( created, object_name ); Index created.
  157. 157. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 157 SQL> alter table T modify 2 partition by range (object_id) interval (10000) 3 ( 4 partition p1 values less than (20000) 5 ) online 6 including rows where created > date '2010-01-01' 7 update indexes 8 ( ix local tablespace new_idx_ts, 9 ix2 global partition by range (created) 10 ( 11 partition ix2_p1 values less than (date '2016-08-01'), 12 partition ix2_p2 values less than (maxvalue) 13 ) 14 ); Table altered. compress
  158. 158. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 158 one thing missing
  159. 159. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 159 fixed in 18c
  160. 160. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 160 online merge partition
  161. 161. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 161 "big deal"
  162. 162. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 162 SQL> create table sales 2 ( ts timestamp, 3 id int, 4 amt number, 5 product int, 6 customer int, ... ... 17 ) 18 partition by range ( ts ) 19 interval ( numtodsinterval(1,'HOUR') ) 20 ( 21 partition p1 values less than ( timestamp '2018-07-01 00:00:00' ) 22 ); Table created.
  163. 163. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 163 24 hours later
  164. 164. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 164 SQL> select partition_name, high_value 2 from user_tab_partitions 3 where table_name = 'SALES' 4 order by partition_position; PARTITION_NAME HIGH_VALUE ------------------------------ ----------------------------------- P1 TIMESTAMP' 2018-07-01 00:00:00' P20180701_00 TIMESTAMP' 2018-07-01 01:00:00' P20180701_01 TIMESTAMP' 2018-07-01 02:00:00' P20180701_02 TIMESTAMP' 2018-07-01 03:00:00' P20180701_03 TIMESTAMP' 2018-07-01 04:00:00' ... ... P20180702_13 TIMESTAMP' 2018-07-02 14:00:00' P20180702_14 TIMESTAMP' 2018-07-02 15:00:00' P20180702_15 TIMESTAMP' 2018-07-02 16:00:00' 41 rows selected.
  165. 165. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 165 SQL> select * from sales 2 where ts > timestamp '2018-07-02 15:00:00'; --------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Pstart| Pstop | --------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 9 | 387 | 7 (0)| | | | 1 | PARTITION RANGE ITERATOR| | 9 | 387 | 7 (0)| 41 |1048575| |* 2 | TABLE ACCESS FULL | SALES | 9 | 387 | 7 (0)| 41 |1048575| ---------------------------------------------------------------------------------------
  166. 166. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 166 one year later ...
  167. 167. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 167 ... lot of partitions
  168. 168. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 168 18c
  169. 169. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 169 SQL> declare 2 d date := date '2018-07-01'; 3 ddl varchar2(4000); 4 begin 5 select listagg(partition_name||chr(10),',') within group ( order by partition_position ) 6 into ddl 7 from user_tab_partitions 8 where table_name = 'SALES' 9 and partition_name like 'P'||to_char(d,'yyyymmdd')||'%'; 10 11 ddl := 'alter table sales merge partitions '||ddl|| 12 ' into partition p'||to_char(d,'yyyymmdd')||' online'; 13 14 dbms_output.put_line(ddl); 15 execute immediate ddl; 16 end; 17 / alter table sales merge partitions P20180701_00 ,P20180701_01 ,P20180701_02 ... ,P20180701_23 into partition p20180701 online
  170. 170. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 170
  171. 171. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 171 security
  172. 172. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 172 security ... is not easy :-(
  173. 173. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 173 Change sys password Stop personal data exposure on users accounts Secure access to dba role views Check use of system tablespace as default Create a role to manage users accounts Secure access to catalog roles Check that O7_dictionary_accessibility is set to false Check that remote_listener is null Make extproc secure Review database accounts, ensuring they belong to business users. Check core_dump_dest is valid Audit utl_file_dir parameter Remove oo4o if not needed Check that global_names is true Check that max_enabled_roles is set correctly Audit dbms_backup_restore package permissions Check user_dump_dest is valid Password protect admin roles Disable remote login password file Use obfuscated naming convention for users accounts Secure ALL_USERS view Audit known default role passwords Lock dormant database accounts and remove after time delay Audit users accounts for weak passwords Use proxy authentication to help resolve SSO issues Audit Java access to the OS Add password management for default accounts Change system password Check that remote_os_roles is set to false Audit use of IFILE
  174. 174. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 174 DBSAT
  175. 175. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 175 [oracle@host122]$ ./dbsat collect system/****** /tmp/dbsat_collect ... Connecting to the target Oracle database... SQL*Plus: Release 12.2.0.1.0 Production on Mon Aug 29 06:16:40 2016 Copyright (c) 1982, 2016, Oracle. All rights reserved. Last Successful login time: Fri Aug 26 2016 06:58:24 +01:00 Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production Setup complete. SQL queries complete. OS commands complete. Disconnected from Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production DBSAT Collector completed successfully. Calling /u01/app/oracle/product/12.2.0/dbhome_2/bin/zip to encrypt dbsat_collect.json... Enter password: Verify password: adding: dbsat_collect.json (deflated 87%) zip completed successfully.
  176. 176. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 176 [oracle@host122 dbsat]$ ./dbsat report /tmp/dbsat_collect ... Archive: /tmp/dbsat_collect.zip [/tmp/dbsat_collect.zip] dbsat_collect.json password: inflating: /tmp/dbsat_collect.json DBSAT Reporter ran successfully. Calling /usr/bin/zip to encrypt the generated reports... Enter password: Verify password: adding: dbsat_collect.txt (deflated 78%) adding: dbsat_collect.html (deflated 83%) adding: dbsat_collect.xlsx (deflated 3%) zip completed successfully.
  177. 177. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 177
  178. 178. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 178 DBSAT
  179. 179. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 179 not a typo
  180. 180. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 180 download from MOS
  181. 181. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 181
  182. 182. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 182 more on security
  183. 183. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 183 common technique
  184. 184. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> alter user data_owner account lock User altered.
  185. 185. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 185 security risk
  186. 186. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> conn wmsys/wmsys ERROR: ORA-28000: the account is locked Warning: You are no longer connected to ORACLE.
  187. 187. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 187 18c
  188. 188. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 188 better schema management
  189. 189. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> create user data_owner 2 no authentication;
  190. 190. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | SQL> conn data_owner/random_password ORA-01017: invalid username/password; logon denied
  191. 191. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 191
  192. 192. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 192 more on security
  193. 193. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 193 etc etc etc
  194. 194. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 194 Oracle Directory Services
  195. 195. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 195
  196. 196. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 196 more on security
  197. 197. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 197 12.2
  198. 198. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 198 TDE online
  199. 199. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 199 SQL> select name from v$datafile; NAME -------------------------------------------------------- /u01/oradata/mydb/system01.dbf /u01/oradata/mydb/sysaux01.dbf /u01/oradata/mydb/undo01.dbf /u01/oradata/mydb/users01.dbf SQL> ALTER TABLESPACE users ENCRYPTION ONLINE USING 'AES192' 2 ENCRYPT FILE_NAME_CONVERT= ('users', 'users_enc'); SQL> select name from v$datafile; NAME ---------------------------------------------------------- /u01/oradata/mydb/system01.dbf /u01/oradata/mydb/sysaux01.dbf /u01/oradata/mydb/undo01.dbf /u01/oradata/mydb/users_enc01.dbf
  200. 200. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 200 18c+
  201. 201. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 201 data dictionary encryption
  202. 202. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 202
  203. 203. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | ACCOUNTING,KING,PRESIDENT,5000 ACCOUNTING,MILLER,CLERK,1300 203
  204. 204. Copyright © 2018, 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> 204
  205. 205. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | { "NAME" :"ACCOUNTING" , "EMPLOYEES" : [ {"ENAME" : "KING", "JOB" : "PRESIDENT", "SAL" : 5000 }, {"ENAME" : "MILLER", "JOB" : "CLERK", "SAL" : 1300 }] } 205
  206. 206. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 12.1 206
  207. 207. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | alter table T add constraint t_chk check ( my_doc is JSON ) 207
  208. 208. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | extraction 208
  209. 209. Copyright © 2018, 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 209
  210. 210. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | dot notation 210
  211. 211. Copyright © 2018, 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] 211
  212. 212. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 12.2 212
  213. 213. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | generation 213
  214. 214. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | {"newJSONfunctions": [ "json_array", "json_object", "json_arrayagg", "json_objectagg" ] }
  215. 215. Copyright © 2018, 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.
  216. 216. Copyright © 2018, 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.
  217. 217. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | { "department": "Accounting", "employees": [ { "name": "Shelley,Higgins", "job": "Accounting Manager" }, { "name": "William,Gietz", "job": "Public Accountant" } ] }
  218. 218. Copyright © 2018, 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;
  219. 219. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 219 ... and more JSON goodies json_exists GeoJSON JSON Partitioning In-Memory support JSON Data Guide Materialized Views Search index
  220. 220. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 220 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", ... } }
  221. 221. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 221 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}]
  222. 222. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 222 18c+
  223. 223. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 223 better data handling
  224. 224. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 224 json_array json_object json_arrayagg json_objectagg VARCHAR2 VARCHAR2
  225. 225. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 225 json_array json_object json_arrayagg json_objectagg BINARY_DOUBLE BINARY_FLOAT CLOB BLOB NVARCHAR2 RAW TIMESTAMP WITH TIME ZONE TIMESTAMP WITH LOCAL TIME ZONE INTERVAL YEAR TO MONTH INTERVAL DAY TO SECOND BLOB CLOB
  226. 226. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 226 TREAT clause
  227. 227. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 227 SQL> with emps as 2 ( 3 select '{"empno":1234, "ename":"Connor"}' j 4 from dual 5 ) 6 select e.j.empno from emps e; select e.j.empno from emps e * ERROR at line 6: ORA-00904: "E"."J"."EMPNO": invalid identifier
  228. 228. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 228 SQL> with emps as 2 ( 3 select '{"empno":1234, "ename":"Connor"}' j 4 from dual 5 ), 6 json_emps as 7 ( 8 select treat(j as json) js 9 from emps 10 ) 11 select je.js.empno 12 from json_emps je; EMPNO ----------------------------------------------------- 1234
  229. 229. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 229 JSON_EQUAL
  230. 230. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 230 { "NAME" :"ACCOUNTING", "EMPLOYEES" : [ {"ENAME" : "KING", "JOB" : "PRESIDENT", "SAL" : 5000 }, {"ENAME" : "MILLER", "JOB" : "CLERK", "SAL" : 1300 } ] } { "EMPLOYEES" : [ {"ENAME" : "KING", "SAL" : 5000, "JOB" : "PRESIDENT" }, {"ENAME" : "MILLER", "JOB" : "CLERK", "SAL" : 1300 } ], "NAME" :"ACCOUNTING" }
  231. 231. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 231 19c
  232. 232. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 232 partial/fragment update
  233. 233. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 233
  234. 234. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | let's talk about ... 234
  235. 235. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | polyglot persistence 235
  236. 236. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 236
  237. 237. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 2016 Perth branch meeting ! 237
  238. 238. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 238
  239. 239. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 239 "I have to learn Hadoop ....and Spark ....and Hive ....and ?"
  240. 240. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 240 Big Data SQL
  241. 241. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 241 19c
  242. 242. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 242 hybrid partitioned table
  243. 243. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 243 Q4_2018Q3_2018Q2_2018Q1_2018Q4_2017Q3_2017Q2_2017Q1_2017Q4_2016 ORDERS OBJECT STORAGE TABLE PARTITIONED BY QUARTER SQL HOT DATACOLD DATA UPDATES * manual transfer initially
  244. 244. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 244
  245. 245. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 245 global temporary tablesprivate
  246. 246. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 246 SQL server etc
  247. 247. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 247 read locking
  248. 248. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 248 SELECT empno, ename, job INTO #HighPaidJobs FROM emp WHERE sal > 3000
  249. 249. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 249 migration to Oracle difficult
  250. 250. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 250 SQL> create private temporary table ORA$PTT_MY_TT 2 ( empno int , ename varchar2(20)) ; Table created. SQL> insert into ORA$PTT_MY_TT 2 select empno, ename 3 from scott.emp 4 where sal > 3000; 1 row created. SQL> select * from ORA$PTT_MY_TT; EMPNO ENAME ---------- -------------------- 7839 KING
  251. 251. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 251 "um...looks the same as before"
  252. 252. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 252 SQL> commit; Commit complete. SQL> select * from ORA$PTT_MY_TT; select * from ORA$PTT_MY_TT * ERROR at line 1: ORA-00942: table or view does not exist
  253. 253. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 253 it's really temporary
  254. 254. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 254 SQL> create private temporary table ORA$PTT_MY_TT 2 ( empno int , ename varchar2(20)) ; Table created. SQL> select * 2 from user_tables 3 where table_name = 'ORA$PTT_MY_TT' ; no rows selected SQL> select * 2 from all_objects 3 where object_name = 'ORA$PTT_MY_TT' ; no rows selected
  255. 255. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 255 SQL> create private temporary table ORA$PTT_MY_TT 2 ( empno , ename ) 3 on commit preserve definition 4 as select 123, 'Larry' from dual; SQL> select * from ORA$PTT_MY_TT; EMPNO ENAME ---------- ----- 123 Larry SQL> commit; SQL> select * from ORA$PTT_MY_TT; EMPNO ENAME ---------- ----- 123 Larry
  256. 256. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 256 it's really private
  257. 257. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 257 SQL> create private temporary table ORA$PTT_MY_TT 2 ( empno int , 3 ename varchar2(20)) ; Table created. SQL> create private temporary table ORA$PTT_MY_TT 2 ( deptno int , 3 dname varchar2(20), 4 bonus int, 5 logo blob) ; Table created.
  258. 258. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 258 it's all in the name !
  259. 259. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 259 SQL> create private temporary table MY_TT ( x int ) ; create private temporary table MY_TT ( x int ) * ERROR at line 1: ORA-00903: invalid table name SQL> show parameter private NAME TYPE VALUE ------------------------------- ----------- ----------- private_temp_table_prefix string ORA$PTT_
  260. 260. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 260
  261. 261. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | this is the big one 261
  262. 262. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 18c XE 262
  263. 263. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 263 100% free
  264. 264. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 264 We grant you a nonexclusive, nontransferable limited license to use the programs for: (a) purposes of developing, prototyping and running your applications for your own internal data processing operations; (b) you may also distribute the programs with your applications; (c) you may use the programs to provide third party demonstrations and training; and d) you may copy and distribute the programs to your licensees provided that each such licensee agrees to the terms of this Agreement https://www.oracle.com/technetwork/licenses/db18c-express-license-5137264.html
  265. 265. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 265 12 GB of user data 2 GB of database RAM 2 CPU threads 3 Pluggable Databases
  266. 266. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 266 "Is it feature hobbled?"
  267. 267. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 267 Oracle Multitenant SQLJ Online index rebuild Online table reorg Online table redefinition Trial recovery Fast start recovery Flashback table Flashback query Flashback database Advanced Queueing Network Compression Client side result cache Server side result cache Adaptive plans In-memory column store In-memory aggregation Attribute Clustering Column encryption Tablespace encryption Advanced Security Database Vault Label Security AD users Privilege Analysis Real Application Security Data Redaction Virtual Private Database Spatial Graph Partitioning Advanced Analytics Advanced Compression Advanced Index Compression Transportable Tablespace Query Rewrite
  268. 268. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 268 EE plus most extra cost options
  269. 269. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 269
  270. 270. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 270 wrap up
  271. 271. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 271 there's a lot in 12.2/18/19
  272. 272. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 272 new feature model
  273. 273. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 273 "dribs and drabs" :-)
  274. 274. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 274 lots not covered today
  275. 275. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | plenty to excite 275
  276. 276. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | Stay in touch! youtube bit.ly/youtube-connor blog bit.ly/blog-connor twitter bit.ly/twitter-connor

×