Documente Academic
Documente Profesional
Documente Cultură
1
4/27/2018
blog connor-mcdonald.com
youtube tinyurl.com/connor-tube
twitter @connor_mc_d
Connor McDonald
Developer Advocate
2
4/27/2018
"Whoa....hold on!"
?
12c, 13, 14, 15, 16, 17, 18c
3
4/27/2018
18c = 12.2.0.2
MOS 2285040.1
4
4/27/2018
5
4/27/2018
6
4/27/2018
https://asktom.oracle.com
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 14
7
4/27/2018
8
4/27/2018
18!
12.2! 12.2!
12.2!18!
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 17
reality
9
4/27/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
10
4/27/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
11
4/27/2018
12
4/27/2018
13
4/27/2018
install nothing
https://cloud.oracle.com/tryit
14
4/27/2018
install something
http://tinyurl.com/ora122vm
15
4/27/2018
http://www.oracle.com/technetwork/database/enterprise-edition/downloads/index.html
16
4/27/2018
coming soon
17
4/27/2018
18
4/27/2018
19
4/27/2018
20
4/27/2018
licensing
21
4/27/2018
asktom.oracle.com
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 44
22
4/27/2018
1
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 45
longer names
23
4/27/2018
128 bytes
24
4/27/2018
Table created.
25
4/27/2018
TABLE_NAME
------------------------------
T001B Permitted Posting Periods
T003 Document types
T004 Chart of accounts
T009 Fiscal year variants
T010O Posting periods
T010P Posting Period Names
T012 House banks
T014 Credit control area
T077S Account group (G/L accounts)
T880 Global company data
… ...
26
4/27/2018
and...
Table created.
27
4/27/2018
but...
28
4/27/2018
COLUMN_NAME
------------------------------
SomeRidiculousPieceOfNonsenseBySomeDudeWhoWantsToAlignWithHisDotNetCodi
ngStyle NUM_DISTINCT AVG_COL_LEN NUM_NULLS
------------ ----------- ----------
29
4/27/2018
Trigger created.
Table created.
30
4/27/2018
Table altered.
2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 62
31
4/27/2018
resource control
32
4/27/2018
12.1
multi tenant
33
4/27/2018
"seriously ?"
34
4/27/2018
DRCP
PL/SQL
SQL
DRCP
PL/SQL
SQL
35
4/27/2018
12.2
36
4/27/2018
Table created.
Index created.
37
4/27/2018
38
4/27/2018
System altered.
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 .. rmax 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.
39
4/27/2018
40
4/27/2018
3
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 81
41
4/27/2018
cloning
in 12.1
42
4/27/2018
cloning is easy
43
4/27/2018
44
4/27/2018
12.2
45
4/27/2018
46
4/27/2018
47
4/27/2018
48
4/27/2018
UNDO
UNDO
...
Database altered.
49
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 100
50
4/27/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. | 101
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 102
51
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 103
18c
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 104
52
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 105
CDB1
CDB2
53
4/27/2018
Server2
CDB2
4
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 108
54
4/27/2018
QTFWBC
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 109
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 110
55
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 111
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 112
56
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 113
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 114
57
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 115
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 116
58
4/27/2018
Elapsed: 06:12:34.00
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 117
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. | 118
59
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 119
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 120
60
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 121
COUNT(*)
----------
0
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 122
61
4/27/2018
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 123
validate_conversion
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 124
62
4/27/2018
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. | 125
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. | 126
63
4/27/2018
CAST extended
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 127
SALARY CONV_SAL
---------- ----------
120000 120000
172125 172125
128000 128000
125,000 -1
99500 99500
...
...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 128
64
4/27/2018
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. | 129
5
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 130
65
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 131
SQL> select *
2 from customers
3 where cust_name = 'ADAMS';
66
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 133
SQL> select *
2 from customers
3 where upper(cust_name) = 'ADAMS';
67
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 135
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 136
68
4/27/2018
COLUMN_NAME
------------------------------
CUST_NAME
-------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |
-------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 152 |
|* 1 | TABLE ACCESS FULL| CUSTOMERS | 1 | 152 |
-------------------------------------------------------
Index created.
Index created.
69
4/27/2018
DML slower
more contention
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 139
"not my problem"
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 140
70
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 141
*
ERROR at line 1:
ORA-10631: SHRINK clause should not be specified for this object
71
4/27/2018
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 143
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 144
72
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 145
Table created.
"case insenstive"
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
73
4/27/2018
Index created.
-----------------------------------------------------------------
| Id | Operation | Name | Rows |
-----------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 |
| 1 | TABLE ACCESS BY INDEX ROWID BATCHED| CUSTOMERS | 1 |
|* 2 | INDEX RANGE SCAN | CUST_IX | 1 |
-----------------------------------------------------------------
"big deal"
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 148
74
4/27/2018
binary_ci
SQL> select * from customers
2 where cust_name = 'ADAMS';
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 150
75
4/27/2018
binary_ai
SQL> select * from customers
2 where cust_name = 'ADAMS';
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 151
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 152
76
4/27/2018
key point
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 154
77
4/27/2018
*
ERROR at line 1:
ORA-43929: Collation cannot be specified if
parameter MAX_STRING_SIZE=STANDARD
6
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 156
78
4/27/2018
SALES
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 157
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 158
79
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 159
Index altered.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 160
80
4/27/2018
...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 161
but ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 162
81
4/27/2018
detection at parse
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 163
Table altered.
Index created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 164
82
4/27/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. | 165
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 166
83
4/27/2018
Index dropped.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 167
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 168
84
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 169
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 170
85
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 171
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 172
86
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 173
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 174
87
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 175
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 176
88
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 177
COUNT(*)
----------
200
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 178
89
4/27/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. | 179
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. | 180
90
4/27/2018
extended statistics
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 181
Index dropped.
DBMS_STATS.CREATE_EXTENDED_STATS('','T','(C1,C2)')
-------------------------------------------------------------
SYS_STUF3GLKIOP5F4B0BTTCFTMX0W
SQL> begin
2 dbms_stats.gather_table_stats('','T'
3 ,method_opt=>'for all columns size auto');
4 end;
5 /
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 182
91
4/27/2018
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| T | 200 | 23800 | 52 (6)|
---------------------------------------------------------------
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 183
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 184
92
4/27/2018
so be careful
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 185
7
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 186
93
4/27/2018
security
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 187
(amazingly)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 188
94
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 189
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 190
95
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 191
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 192
96
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 193
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 194
97
4/27/2018
- Connor McDonald
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 195
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 196
98
4/27/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. | 197
DBSAT
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 198
99
4/27/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. | 199
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. | 200
100
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 201
DBSAT
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 202
101
4/27/2018
not a typo
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 203
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 204
102
4/27/2018
18c
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 205
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 206
103
4/27/2018
104
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 209
Oracle
Directory Services
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 210
105
4/27/2018
8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 211
ACCOUNTING,KING,PRESIDENT,5000
ACCOUNTING,MILLER,CLERK,1300
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 212
106
4/27/2018
<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>
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 213
{ "NAME" :"ACCOUNTING"
, "EMPLOYEES" : [
{"ENAME" : "KING",
"JOB" : "PRESIDENT",
"SAL" : 5000
},
{"ENAME" : "MILLER",
"JOB" : "CLERK",
"SAL" : 1300
}]
}
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 214
107
4/27/2018
12.1
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 215
alter table T
add constraint t_chk
check
(
my_doc is JSON
)
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 216
108
4/27/2018
extraction
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 217
ENAME
----------
KING
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 218
109
4/27/2018
dot notation
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 219
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 220
110
4/27/2018
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 221
generation
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 222
111
4/27/2018
{
"department": "Accounting",
"employees": [
{
"name": "Shelley,Higgins",
"job": "Accounting Manager"
},
{
"name": "William,Gietz",
"job": "Public Accountant"
}
]
}
{"newJSONfunctions": [
"json_array",
"json_object",
"json_arrayagg",
"json_objectagg"
] }
112
4/27/2018
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.
SQL> select
2 json_object(
3 'DeptID' is department_id,
4 'Name' is department_name) depts
5 from hr.departments
6 where department_id > 200;
DEPTS
------------------------------------------------
{"DeptID":210,"Name":"IT Support"}
{"DeptID":220,"Name":"NOC"}
{"DeptID":230,"Name":"IT Helpdesk"}
{"DeptID":240,"Name":"Government Sales"}
{"DeptID":250,"Name":"Retail Sales"}
{"DeptID":260,"Name":"Recruiting"}
{"DeptID":270,"Name":"Payroll"}
7 rows selected.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
113
4/27/2018
Materialized Views
Search index
... and more JSON goodies
GeoJSON
In-Memory support
JSON Data Guide
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 228
114
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 229
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},
...
...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 230
115
4/27/2018
9
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 231
one row...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 232
116
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 233
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 234
117
4/27/2018
NUM_ROWS
-----------
7014272505
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 235
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 236
118
4/27/2018
--------------------------------------------------------------------------
| 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. | 237
hero
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 238
119
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 239
until ...
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 240
120
4/27/2018
1 row created.
SQL> commit;
Commit complete.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 241
----------------------------------------------------------------
| 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. | 242
121
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 243
Procedure created.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 244
122
4/27/2018
12.2
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 245
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 246
123
4/27/2018
on commit
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 247
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 248
124
4/27/2018
---------------------------------------------------------------------------
| 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. | 249
1 row created.
SQL> commit;
Commit complete.
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 250
125
4/27/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. | 251
how ?
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 252
126
4/27/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. | 253
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 254
127
4/27/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. | 255
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 256
128
4/27/2018
OWNER CNT
------------------------------ ----------
SYSTEM 482
SYS 50941
50940
SI_INFORMTN_SCHEMA 8
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 257
wrap up
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 258
129
4/27/2018
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 259
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 260
130
4/27/2018
plenty to excite
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 261
oh .. nearly forgot
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 262
131
4/27/2018
18c XE !!!
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 263
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | 264
132
4/27/2018
blog connor-mcdonald.com
youtube tinyurl.com/connor-tube
twitter @connor_mc_d
133