Professional Documents
Culture Documents
1
7/17/2018
blog connor-mcdonald.com
youtube tinyurl.com/connor-tube
twitter @connor_mc_d
Connor McDonald
Developer Advocate
2
7/17/2018
"Whoa....hold on!"
3
7/17/2018
?
12c, 13, 14, 15, 16, 17, 18c
18c = 12.2.0.2
MOS 2285040.1
4
7/17/2018
why me ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 8
5
7/17/2018
6
7/17/2018
7
7/17/2018
https://asktom.oracle.com
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 14
https://asktom.oracle.com/officehours
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 15
8
7/17/2018
Feb - Jun
July 19
5:30pm IST
https://tinyurl.com/biggest-office-hours
9
7/17/2018
why you ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 18
12.2!
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 19
10
7/17/2018
18!
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 19
12.2!
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 19
11
7/17/2018
12.2!
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 19
18!
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 19
12
7/17/2018
reality
13
7/17/2018
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
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
14
7/17/2018
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
15
7/17/2018
16
7/17/2018
install nothing
17
7/17/2018
https://cloud.oracle.com/tryit
install something
18
7/17/2018
http://tinyurl.com/ora122vm
19
7/17/2018
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
coming soon
20
7/17/2018
21
7/17/2018
22
7/17/2018
23
7/17/2018
24
7/17/2018
25
7/17/2018
licensing
licensing
26
7/17/2018
27
7/17/2018
28
7/17/2018
29
7/17/2018
external tables
30
7/17/2018
ext_emp
31
7/17/2018
Table created.
ext_emp
32
7/17/2018
easy fix
33
7/17/2018
Table created.
34
7/17/2018
ITIL
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 56
35
7/17/2018
36
7/17/2018
DONE !
37
7/17/2018
12.2
38
7/17/2018
...
13 rows selected.
...
13 rows selected.
39
7/17/2018
file names
...
20 location ('emp20161001.dat'))
Table created.
40
7/17/2018
...
8 rows selected.
41
7/17/2018
42
7/17/2018
resource control
12.1
43
7/17/2018
multi tenant
44
7/17/2018
"seriously ?"
DRCP
PL/SQL
SQL
45
7/17/2018
DRCP
PL/SQL
SQL
DRCP
PL/SQL
SQL
46
7/17/2018
47
7/17/2018
12.2
48
7/17/2018
Table created.
Index created.
49
7/17/2018
SQL> declare
2 s timestamp;
3 rmax int;
4 l_row t%rowtype;
5 begin
6 select max(r) into rmax from t;
7
8 s := localtimestamp;
9 for i in 1 .. 100000 loop
10 select * into l_row from t where r = i;
11 end loop;
12 dbms_output.put_line(localtimestamp-s);
13 end;
14 /
+000000000 00:00:15.613076000
PL/SQL procedure successfully completed.
50
7/17/2018
System altered.
51
7/17/2018
SQL> declare
2 s timestamp;
3 rmax int;
4 l_row t%rowtype;
5 begin
6 select max(r) into rmax from t;
7
8 s := localtimestamp;
9 for i in 1 .. 100000 loop
10 select * into l_row from t where r = i;
11 end loop;
12 dbms_output.put_line(localtimestamp-s);
13 end;
14 /
+000000000 00:03:58.869568000
PL/SQL procedure successfully completed.
52
7/17/2018
53
7/17/2018
cloning
54
7/17/2018
in 12.1
cloning is easy
55
7/17/2018
56
7/17/2018
57
7/17/2018
12.2
58
7/17/2018
59
7/17/2018
Table created.
SQL> begin
2 for i in 1 .. 300 loop
3 insert into t values (i, systimestamp );
4 commit;
5 dbms_lock.sleep(0.5);
6 end loop;
7 end;
8 /
[executing]
60
7/17/2018
61
7/17/2018
62
7/17/2018
63
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 100
64
7/17/2018
UNDO
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 100
UNDO
UNDO
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 100
65
7/17/2018
...
Database altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 101
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 102
66
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 103
Table created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 103
67
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 103
Table created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 104
68
7/17/2018
SQL> desc T1
Name Null? Type
------------------------------ -------- -------------
OWNER VARCHAR2(128)
OBJECT_NAME VARCHAR2(128)
SUBOBJECT_NAME VARCHAR2(128)
OBJECT_ID NUMBER
DATA_OBJECT_ID NUMBER
...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 104
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 105
69
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 105
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 105
70
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 105
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 106
71
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 106
18c
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 107
72
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 108
CDB1
Server2
CDB2
73
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 110
QTFWBC
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 111
74
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 112
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 113
75
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 113
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 114
76
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 115
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 116
77
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 117
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 118
78
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 119
Elapsed: 06:12:34.00
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 119
79
7/17/2018
Elapsed: 06:12:34.00
ERROR at line 1:
ORA-01847: day of month must be between 1 and last day of month
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 120
Nooooo oooo !
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 121
80
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 122
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 123
81
7/17/2018
COUNT(*)
----------
0
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 124
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 125
82
7/17/2018
validate_conversion
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 126
CREATED_DATE
--------------------
01-FEB-2016
12-MAR-2012
54-AUG-2013
09-SEP-2014
23-OCT-2012
...
...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 127
83
7/17/2018
TO_DATE(C
---------
01-FEB-16
12-MAR-12
09-SEP-14
23-OCT-12
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 128
CAST extended
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 129
84
7/17/2018
SALARY CONV_SAL
---------- ----------
120000 120000
172125 172125
128000 128000
125,000 -1
99500 99500
...
...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 130
SALARY CONV_SAL
---------- ----------
120000 120000
172125 172125
128000 128000
125,000 -1
99500 99500
...
...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 130
85
7/17/2018
SALARY CONV_SAL
---------- ----------
120000 120000
172125 172125
128000 128000
125,000 -1
99500 99500
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 131
SALARY CONV_SAL
---------- ----------
120000 120000
172125 172125
TO_DATE
128000 128000 TO_NUMBER
125,000 -1
99500 99500 TO_TIMESTAMP
etc
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 131
86
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 132
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 133
87
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 134
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 135
88
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 136
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 136
89
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 137
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 138
90
7/17/2018
18c
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 139
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 140
91
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 141
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 142
92
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 143
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 144
93
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 145
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 145
94
7/17/2018
18c
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 146
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 147
95
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 148
one row...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 149
96
7/17/2018
one
lousy
row
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 150
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 151
97
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 152
NUM_ROWS
-----------
7014272505
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 152
98
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 153
--------------------------------------------------------------------------
| 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)|
--------------------------------------------------------------------------
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 154
99
7/17/2018
hero
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 155
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 156
100
7/17/2018
until ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 157
1 row created.
SQL> commit;
Commit complete.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 158
101
7/17/2018
----------------------------------------------------------------
| 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. | 159
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 160
102
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 160
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 161
103
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 162
on commit
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 163
104
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 164
---------------------------------------------------------------------------
| 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. | 165
105
7/17/2018
1 row created.
SQL> commit;
Commit complete.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 166
OWNER CNT
------------------------------ ----------
SYS 50941
SI_INFORMTN_SCHEMA 8
SYSTEM 482
Elapsed: 00:00:01.41
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 167
106
7/17/2018
OWNER CNT
------------------------------ ----------
SYS 50941
SI_INFORMTN_SCHEMA 8
SQL> select /*+ NO_REWRITE */ owner, count(*) cnt
SYSTEM 2 from t 482
3 where owner like 'S%'
Elapsed: 00:00:01.41 4 group by owner;
OWNER CNT
------------------------------ ----------
SYS 50941
SYSTEM 482
SI_INFORMTN_SCHEMA 8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 167
how ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 168
107
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 169
OWNER CNT
------------------------------ ----------
SYS 50941
SI_INFORMTN_SCHEMA 8
SYSTEM 482
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 169
108
7/17/2018
OWNER CNT
------------------------------ ----------
SYS 50941
SI_INFORMTN_SCHEMA 8
SYSTEM 482
OWNER CNT
------------------------------ ----------
SYS 50940
SYSTEM 482
SI_INFORMTN_SCHEMA 8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 169
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 170
109
7/17/2018
-----------------------------------------------------------------------------------------
| 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. | 171
-----------------------------------------------------------------------------------------
| 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. | 171
110
7/17/2018
-----------------------------------------------------------------------------------------
| 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. | 171
-----------------------------------------------------------------------------------------
| 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. | 171
111
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 172
OWNER CNT
------------------------------ ----------
SYSTEM 482
SYS 50940
SI_INFORMTN_SCHEMA 8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 173
112
7/17/2018
OWNER CNT
------------------------------ ----------
SYSTEM 482
SYS 50940
SI_INFORMTN_SCHEMA 8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 173
OWNER CNT
------------------------------ ----------
SYSTEM 482
SYS 50941
50940
SI_INFORMTN_SCHEMA 8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 173
113
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 174
SALES
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 175
114
7/17/2018
SALES
SALES_PK
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 175
SALES
SALES_PK CUSTOMER
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 175
115
7/17/2018
SALES
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 175
SALES
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 175
116
7/17/2018
SALES
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 175
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 176
117
7/17/2018
used ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 177
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 178
118
7/17/2018
Index altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 179
...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 180
119
7/17/2018
...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 180
but ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 181
120
7/17/2018
detection at parse
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 182
Table altered.
Index created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 183
121
7/17/2018
1 row deleted.
-------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |
-------------------------------------------------------
| 0 | DELETE STATEMENT | | 1 | 13 |
| 1 | DELETE | PARENT | | |
|* 2 | INDEX RANGE SCAN| PARENT_PK | 1 | 13 |
-------------------------------------------------------
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 184
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 185
122
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 185
Index dropped.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 186
123
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 187
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 188
124
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 189
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 190
125
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 191
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 192
126
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 193
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 194
127
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 195
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 196
128
7/17/2018
COUNT(*)
----------
200
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 197
SQL> select *
2 from t
3 where c1 = 12
4 and c2 = 12;
---------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
---------------------------------------------------------------
| 0 | SELECT STATEMENT | | 4 | 476 | 52 (6)|
|* 1 | TABLE ACCESS FULL| T1 | 4 | 476 | 52 (6)|
---------------------------------------------------------------
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 198
129
7/17/2018
SQL> select *
2 from t
3 where c1 = 12
4 and c2 = 12;
---------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
---------------------------------------------------------------
| 0 | SELECT STATEMENT | | 4 | 476 | 52 (6)|
|* 1 | TABLE ACCESS FULL| T1 | 4 | 476 | 52 (6)|
---------------------------------------------------------------
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 198
Index created.
SQL> select *
2 from t
3 where c1 = 12
4 and c2 = 12;
---------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
---------------------------------------------------------------
| 0 | SELECT STATEMENT | | 200 | 23800 | 52 (6)|
|* 1 | TABLE ACCESS FULL| T1 | 200 | 23800 | 52 (6)|
---------------------------------------------------------------
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 199
130
7/17/2018
extended statistics
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 200
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 201
131
7/17/2018
so be careful
invisible first
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 202
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 203
132
7/17/2018
security
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 204
(amazingly)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 205
133
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 206
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 207
134
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 208
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 208
135
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 208
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 208
136
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 209
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 210
137
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 211
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 211
138
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 211
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 211
139
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 211
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 212
140
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 212
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 213
141
7/17/2018
Use obfuscated naming convention for users accounts Audit users accounts for weak passwords
Check that max_enabled_roles is set correctly
Secure access to dba role views
Change system password
Audit Java access to the OS
Password protect admin roles Check that O7_dictionary_accessibility is set to false
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 214
DBSAT
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 215
142
7/17/2018
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.
Enter password:
Verify password:
adding: dbsat_collect.json (deflated 87%)
zip completed successfully.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 216
Archive: /tmp/dbsat_collect.zip
[/tmp/dbsat_collect.zip] dbsat_collect.json password:
inflating: /tmp/dbsat_collect.json
DBSAT Reporter ran successfully.
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.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 217
143
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 218
DBSAT
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 219
144
7/17/2018
DBSAT
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 219
not a typo
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 220
145
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 221
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 222
146
7/17/2018
more on security
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 223
common technique
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 224
147
7/17/2018
User altered.
security risk
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 226
148
7/17/2018
149
7/17/2018
18c
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 228
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 229
150
7/17/2018
151
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 232
152
7/17/2018
Oracle
Directory Services
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 233
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 233
153
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 234
more on security
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 235
154
7/17/2018
encryption
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 236
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 237
155
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 237
Table created.
1 row created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 238
156
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 239
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 240
157
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 241
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 241
158
7/17/2018
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 242
TDE online
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 243
159
7/17/2018
Keystore altered.
Keystore altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 244
NAME
--------------------------------------------------------
/u01/oradata/mydb/system01.dbf
/u01/oradata/mydb/sysaux01.dbf
/u01/oradata/mydb/undo01.dbf
/u01/oradata/mydb/users01.dbf
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 245
160
7/17/2018
NAME
--------------------------------------------------------
/u01/oradata/mydb/system01.dbf
/u01/oradata/mydb/sysaux01.dbf
/u01/oradata/mydb/undo01.dbf
/u01/oradata/mydb/users01.dbf
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 245
NAME
--------------------------------------------------------
/u01/oradata/mydb/system01.dbf
/u01/oradata/mydb/sysaux01.dbf
/u01/oradata/mydb/undo01.dbf
/u01/oradata/mydb/users01.dbf
NAME
----------------------------------------------------------
/u01/oradata/mydb/system01.dbf
/u01/oradata/mydb/sysaux01.dbf
/u01/oradata/mydb/undo01.dbf
/u01/oradata/mydb/users_enc01.dbf
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 245
161
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 246
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 247
162
7/17/2018
outages...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 248
...suck
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 249
163
7/17/2018
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 250
online "everything"
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 251
164
7/17/2018
Table created.
Index created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 252
Table created.
SQL> insert into t select * from t where rownum = 1;
SQL> create index ix on t ( object_id );
1 row created.
Index created.
SQL> insert into t select * from t where rownum = 1;
1 row created.
....
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 252
165
7/17/2018
Table created.
SQL> insert into t select * from t where rownum = 1;
SQL> create index ix on t ( object_id );
1 row created.
Index created.
SQL> insert into t select * from t where rownum = 1;
1 row created.
SQL> alter table t move online;
....
[working]
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 252
SQL> commit;
Commit complete.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 253
166
7/17/2018
SQL> commit;
Commit complete.
[working]
Table altered.
INDEX_NAME STATUS
------------------------------ --------
IX VALID
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 253
composite operations
167
7/17/2018
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 255
one command
168
7/17/2018
Table created.
Index created.
Index created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 257
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 258
169
7/17/2018
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 258
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 258
170
7/17/2018
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 258
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 258
171
7/17/2018
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 258
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 258
172
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 259
LOBs
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 260
173
7/17/2018
hey !
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 261
that's
not
new !
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 262
174
7/17/2018
1997
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 263
securefile LOBs
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 264
175
7/17/2018
hey !
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 265
that's
not
new !
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 266
176
7/17/2018
2007
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 267
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 268
177
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 269
compression
de-duplication
178
7/17/2018
until ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 270
n(databases) > 1
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 271
179
7/17/2018
Table created.
1 row created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 272
Table created.
1 row created.
SQL> select *
2 from t;
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 272
180
7/17/2018
Table created.
1 row created.
SQL> select *
2 from t;
ID C
---------- --------------------------------------------
1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 272
SQL> select *
2 from t@db11;
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 273
181
7/17/2018
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. | 273
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 274
182
7/17/2018
SQL> select *
2 from t@db122;
ID C
---------- --------------------------------------------
1 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 275
http://docs.oracle.com/database/122/ADLOB/distributed-LOBs.htm
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 276
183
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 277
exchange partition
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 278
184
7/17/2018
hey !
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 279
that's
not
new !
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 280
185
7/17/2018
P1
P2
T
P3
P4
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 281
P1
P2
P4
P3
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 281
186
7/17/2018
P1
P2
T
P3
P4
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 282
P1
P2
P3
T
P4
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 282
187
7/17/2018
? Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 283
PARTITION_NAME
------------------------------------------------------------
P1
P2
2 rows selected.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 284
188
7/17/2018
Table created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 285
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 286
189
7/17/2018
? Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 287
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 288
190
7/17/2018
COLUMN_ID COLUMN_NAME
---------- ------------------------------
1 X
2 Y
COLUMN_ID COLUMN_NAME
---------- ------------------------------
1 X
2 Y
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 289
USER_TAB_COLUMNS
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 290
191
7/17/2018
USER_TAB_COLUMN
S
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 290
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 291
192
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 291
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 291
193
7/17/2018
"no problem"
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 292
Table altered.
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 293
194
7/17/2018
Table altered.
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 293
precision matters
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 294
195
7/17/2018
Table created.
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 295
Table created.
Table altered.
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 295
196
7/17/2018
it could be worse
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 296
invisible columns
stats extensions
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 297
197
7/17/2018
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 298
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 299
198
7/17/2018
Table created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 300
Table created.
Table altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 300
199
7/17/2018
wrap up
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 301
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 302
200
7/17/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 303
plenty to excite
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 304
201
7/17/2018
oh .. nearly forgot
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 305
18c XE !!!
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 306
202
7/17/2018
blog connor-mcdonald.com
youtube tinyurl.com/connor-tube
twitter @connor_mc_d
July 19
5:30pm IST
https://tinyurl.com/biggest-office-hours
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 308
203