SlideShare a Scribd company logo
1 of 196
The Fast Lane To Database Success
aka, hints, tips and tricks from an old dude
Connor McDonald
Developer Advocate
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Connor McDonald
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
3
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
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 :-)
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
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
7https://asktom.oracle.com
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
https://asktom.oracle.com/officehours
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
150 hours of free access (so far)
9
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
why tips and techniques ?
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SO...
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
HERE
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
IS
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
WHAT
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
HAPPENED
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
maybe they were right ?
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
I hope not :-)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
it's not about manuals
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
it's not about re-invention
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
it's about sharing
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
it's about community
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
that’s why
Copyright © 2016, Oracle and/or its affiliates. All rights reserved. |
Safe Harbor Statement
The following is intended to outline our general product direction. It is intended for
information purposes only, and may not be incorporated into any contract. It is not a
commitment to deliver any material, code, or functionality, and should not be relied
upon in making purchasing decisions. The development, release, and timing of any
features or functionality described for Oracle’s products remains at the sole discretion
of Oracle.
26
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
if it's not in the documentation
- contact Support
- clarify usage before proceeding
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
rogue session
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> select sid, last_call_et, status,
3 from v$session s;
SID LAST_CALL_ET STATUS
---------- ------------ ----------
39 7376 ACTIVE
40 412 INACTIVE
44 421 INACTIVE
46 12 ACTIVE
51 9 ACTIVE
53 15 ACTIVE
58 8 ACTIVE
69 22 ACTIVE
...
80 453 INACTIVE
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
old days
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
idiot in database
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
much more modern approach...
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
idiot in database
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> alter system kill session ...
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
# kill -9 pid
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> oradebug setorapid nnn
SQL> oradebug suspend
SID LAST_CALL_ET STATUS
---------- ------------ ----------
39 7376 ACTIVE
40 412 INACTIVE
41 412 INACTIVE
44 421 INACTIVE
46 12 ACTIVE
51 9 ACTIVE
53 15 ACTIVE
58 8 ACTIVE
SQL> oradebug resume
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
maybe ...
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
... you don't want to resume
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
rogue session
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
42
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> alter system kill session ...
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
18c
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> alter system cancel sql '123,456';
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
/*+ GATHER_PLAN_STATISTICS */
47
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
48
48
for the optimizer
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
49
49
cardinality is everything
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> explain plan for
2 select count(*)
3 from VEHICLE
4 where MAKE = 'HONDA' and MODEL = 'CIVIC';
SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_PLAN);
--------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |
--------------------------------------------------------
| 1 | SORT AGGREGATE | | 1 | 1 |
|* 2 | TABLE ACCESS FULL| VEHICLE | 20K | 270K |
--------------------------------------------------------
50
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
51
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
actual versus estimate
52
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> select /*+ GATHER_PLAN_STATISTICS */ count(*)
2 from VEHICLE
3 where MAKE = 'HONDA' and MODEL = 'CIVIC';
COUNT(*)
----------
114468
SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(
2 NULL, NULL, 'ALLSTATS LAST'));
-----------------------------------------------------------------
| Id | Operation | Name | Starts | E-Rows | A-Rows |
-----------------------------------------------------------------
| 1 | SORT AGGREGATE | | 1 | 1 | 1 |
|* 2 | TABLE ACCESS FULL| VEHICLE | 1 | 20K| 114K|
-----------------------------------------------------------------
53
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
tracing
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
alter session set sql_trace = true
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
C:oraclediagrdbmsdb122db122trace>dir *.trc
Volume in drive C is OS
Volume Serial Number is 9CB0-0212
Directory of C:oraclediagrdbmsdb122db122trace
27/09/2018 09:18 PM 1,314 db122_ora_10020.trc
20/10/2018 06:21 PM 2,691 db122_ora_10048.trc
30/09/2018 12:21 AM 1,345 db122_ora_10104.trc
29/09/2018 03:18 PM 1,314 db122_ora_10144.trc
21/10/2018 06:21 AM 1,346 db122_ora_10156.trc
11/10/2018 05:18 PM 1,312 db122_ora_1016.trc
02/10/2018 08:49 PM 1,346 db122_ora_10192.trc
29/09/2018 12:21 PM 1,345 db122_ora_10320.trc
12/10/2018 12:21 AM 1,501 db122_ora_10348.trc
15/10/2018 12:18 AM 1,314 db122_ora_10352.trc
13/10/2018 11:21 AM 1,499 db122_ora_1036.trc
28/09/2018 05:18 AM 1,315 db122_ora_10368.trc
18/10/2018 05:18 PM 1,824 db122_ora_10384.trc
05/10/2018 05:18 AM 1,178 db122_ora_10388.trc
28/09/2018 11:21 PM 1,346 db122_ora_10400.trc
14/10/2018 11:21 PM 1,501 db122_ora_10404.trc
30/09/2018 06:25 AM 1,346 db122_ora_10440.trc
04/10/2018 01:18 PM 1,313 db122_ora_10460.trc
04/10/2018 12:18 PM 1,313 db122_ora_10464.trc
08/10/2018 09:18 AM 1,314 db122_ora_10484.trc
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
too many trace files
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> alter session
2 set tracefile_identifier = SALESPGM;
Session altered.
SQL> host ls *.trc
db10r2_ora_3248.trc
db10r2_ora_3284.trc
db10r2_ora_3356.trc
db10r2_ora_3492.trc
db10r2_ora_3504_SALESPGM.trc
db10r2_ora_3608.trc
db10r2_ora_3620.trc
...
...
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
too much trace data
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> alter session
2 set events
3 'immediate trace name trace_buffer_on level 1048576';
Session altered.
SQL> host ls –l *.trc
drw------- oracle dba Jun17 15:10 1048576 db10r2_ora_3248.trc
rolling trace window
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
bonus tip
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> select name, value from v$diag_info;
NAME VALUE
------------------------ ------------------------------------------
Diag Enabled TRUE
ADR Base C:ORACLE
ADR Home C:ORACLEdiagrdbmsdb122db122
Diag Trace C:ORACLEdiagrdbmsdb122db122trace
Diag Alert C:ORACLEdiagrdbmsdb122db122alert
Diag Incident C:ORACLEdiagrdbmsdb122db122incident
Diag Cdump c:oraclediagrdbmsdb122db122cdump
Health Monitor C:ORACLEdiagrdbmsdb122db122hm
Default Trace File C:ORACLE...tracedb122_ora_17296.trc
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> select PAYLOAD
2 from V$DIAG_TRACE_FILE_CONTENTS
3 where TRACE_FILENAME = 'db122_ora_12484.trc';
PAYLOAD
----------------------------------------------------------------------------
Trace file C:ORACLEdiagrdbmsdb122db122tracedb122_ora_12484.trc
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Build label: RDBMS_12.2.0.1.0WINDBBP_WINDOWS.X64_180202
Windows NT Version V6.2
ORACLE_HOME = c:oracleproduct12.2.0.1
Node name : XPS13
CPU : 4 - type 8664, 2 Physical Cores
Process Affinity : 0x0x0000000000000000
Memory (Avail/Total): Ph:9411M/16235M, Ph+PgF:4292M/20985M
Instance name: db122
Redo thread mounted by this instance: 1
...
...
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
19c
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
automatic indexing
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. |
• The Automatic Indexing
methodology is based on a common
approach to manual SQL tuning
• It identifies candidate indexes and
validates them before implementing
• The entire process is full automatic
• Transparency is equally important as
sophisticated automation
– All tuning activities are auditable via
reporting
69
Automatic Indexing Methodology
Monitor
Online
Validation
Capture
Identify
Verify
Decide
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
until then ...
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
“I need a new index
on this 6TB table...”
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
“will it speed up things ?”
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
“I think so”
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
virtual indexes
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> create index TEST on
2 MYTAB ( SALES_DATE ) NOSEGMENT;
Index created.
data dictionary only
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> begin
2 dbms_stats.generate_stats(
3 'SCOTT',
4 'MYTAB');
5 end;
6 /
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> alter session
2 set "_use_nosegment_indexes" = true;
SQL> explain plan for
2 select * from MYTAB
3 where sales_date > sysdate-7;
--------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
--------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 950 | 90109 | 962 (34)|
| 1 | TABLE ACCESS BY INDEX ROWID| MYTAB | 950 | 90109 | 962 (34)|
|* 2 | INDEX RANGE SCAN | TEST | 950 | | 962 (50)|
--------------------------------------------------------------------------
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
79
invisible indexes
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
80
SQL> create table T
2 as select * from all_objects;
Table created.
SQL> create index OBJ_IX on T ( OBJECT_ID );
Index created.
SQL> exec dbms_stats.gather_table_stats('','T')
PL/SQL procedure successfully completed.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
81
SQL> set autotrace traceonly explain
SQL> select * from T
2 where OWNER = 'SCOTT'
3 and created > sysdate - 1
4 /
---------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
---------------------------------------------------------------
| 0 | SELECT STATEMENT | | 6 | 546 | 281 (1)|
|* 1 | TABLE ACCESS FULL| T | 6 | 546 | 281 (1)|
---------------------------------------------------------------
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
82
“Can I index OWNER..”
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
83
“will it speed up things ?”
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
84
“I know so”
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
85
SQL> create index NEW_IX on T ( OWNER );
Index created.
SQL> select * from T
2 where OWNER = 'SCOTT'
3 and created > sysdate - 1
4 /
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 6 | 546 | 122 (0)|
|* 1 | TABLE ACCESS BY INDEX ROWID| T | 6 | 546 | 122 (0)|
|* 2 | INDEX RANGE SCAN | NEW_IX | 4107 | | 10 (0)|
---------------------------------------------------------------------------
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
86
everyone elses queries
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
87
before the new index
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
88
SQL> set autotrace traceonly explain
SQL> select * from T
2 where OWNER = 'SYS'
3 and OBJECT_ID between 10 and 8000
4 /
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 462 | 42042 | 143 (0)|
|* 1 | TABLE ACCESS BY INDEX ROWID| T | 462 | 42042 | 143 (0)|
|* 2 | INDEX RANGE SCAN | OBJ_IX | 7851 | | 20 (0)|
---------------------------------------------------------------------------
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
89
SQL> set autotrace traceonly stat
SQL> select * from T
2 where owner = 'SYS'
3 and object_id between 10 and 8000;
4967 rows selected.
Statistics
-----------------------------------------------------
0 recursive calls
0 db block gets
784 consistent gets
15 physical reads
0 redo size
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
90
after the new index
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
91
SQL> select * from T
2 where owner = 'SYS'
3 and object_id between 10 and 8000
4 /
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 462 | 42042 | 122 (0)|
|* 1 | TABLE ACCESS BY INDEX ROWID| T | 462 | 42042 | 122 (0)|
|* 2 | INDEX RANGE SCAN | NEW_IX | 4105 | | 10 (0)|
---------------------------------------------------------------------------
the new index
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
92
SQL> set autotrace traceonly stat
SQL> select * from T
2 where owner = 'SYS'
3 and object_id between 10 and 8000;
4967 rows selected.
Statistics
------------------------------------------------------
0 recursive calls
0 db block gets
1522 consistent gets
62 physical reads
0 redo size
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
93
the solution ?
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
94
invisible indexes
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
95
SQL> alter index NEW_IX invisible;
Index altered.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
96
SQL> select * from T
2 where owner = 'SYS'
3 and object_id between 10 and 8000
4 /
----------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
----------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 462 | 42042 | 143 (0)|
|* 1 | TABLE ACCESS BY INDEX ROWID| T | 462 | 42042 | 143 (0)|
|* 2 | INDEX RANGE SCAN | OBJ_IX | 7851 | | 20 (0)|
----------------------------------------------------------------------------
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
97
“gee... thanks for nothing”
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
98
SQL> set autotrace traceonly explain
SQL> select * from T
2 where OWNER = 'SCOTT'
3 and created > sysdate - 1
4 /
---------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
---------------------------------------------------------------
| 0 | SELECT STATEMENT | | 6 | 546 | 281 (1)|
|* 1 | TABLE ACCESS FULL| T | 6 | 546 | 281 (1)|
---------------------------------------------------------------
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
99
SQL> alter session set
2 optimizer_use_invisible_indexes = true;
Session altered.
SQL> select * from T
2 where OWNER = 'SCOTT'
3 and created > sysdate - 1
4 /
---------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)|
---------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 462 | 42042 | 122 (0)|
|* 1 | TABLE ACCESS BY INDEX ROWID| T | 462 | 42042 | 122 (0)|
|* 2 | INDEX RANGE SCAN | NEW_IX | 4105 | | 10 (0)|
---------------------------------------------------------------------------
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
100
wrap your SQL to protect others
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
101
statement level hint - contact Support
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
better data guard use...
...for free
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;
10.2
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
open standby read/write
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY
2 DATABASE DISCONNECT;
10.2
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
flashback to resetlogs
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
resume managed recovery
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
archives still transmitted
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
faster queries ... no code changes
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> create table cust_trans
2 ( txn_id int,
3 txn_date date,
4 cust_id int,
5 amt number(10,2)
6 );
112
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> insert /*+ APPEND */ into cust_trans
2 select rownum,
3 sysdate-1000+rownum/1000 txn_date,
4 trunc(dbms_random.value(1,1000)) cust_id,
5 dbms_random.value(1,100) amount
6 from
7 ( select 1 from dual
8 connect by level <= 10000000 );
10000000 rows created.
SQL> create index cust_trans_ix
2 on cust_trans (cust_id );
Index created.
113
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> select max(amt)
2 from cust_trans
3 where cust_id = 123;
114
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
115
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> select max(amt)
2 from cust_trans
3 where cust_id = 123;
------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |
------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 8 |
| 1 | SORT AGGREGATE | | 1 | 8 |
| 2 | TABLE ACCESS BY INDEX ROWID BATCHED| CUST_TRANS | 10010 | 80080 |
|* 3 | INDEX RANGE SCAN | CUST_TRANS_IX | 10010 | |
------------------------------------------------------------------------------
Statistics
-----------------------------------------------------
0 recursive calls
0 db block gets
8867 consistent gets
8854 physical reads
0 redo size
543 bytes sent via SQL*Net to client
607 bytes received via SQL*Net from client
116
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
CUST 123 CUST 47 CUST 123 CUST 76 CUST 95 CUST 47 CUST 123
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> alter table cust_trans
2 add clustering by linear order(cust_id);
Table altered.
SQL> alter table cust_trans move online;
Table altered.
12.1
12.2
118
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> select max(amt)
2 from cust_trans
3 where cust_id = 123;
------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes |
------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 8 |
| 1 | SORT AGGREGATE | | 1 | 8 |
| 2 | TABLE ACCESS BY INDEX ROWID BATCHED| CUST_TRANS | 10010 | 80080 |
|* 3 | INDEX RANGE SCAN | CUST_TRANS_IX | 10010 | |
------------------------------------------------------------------------------
Statistics
-----------------------------------------------------
0 recursive calls
0 db block gets
62 consistent gets
23 physical reads
0 redo size
543 bytes sent via SQL*Net to client
607 bytes received via SQL*Net from client
119
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
DBMS_XPLAN
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> explain plan for ...
SQL> select * from
2 table(dbms_xplan.display_plan)
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
extensions
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
... the (in)famous hint ignore issue
124
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
125
SQL> select *
2 from emp e,
3 dept d
4 where e.deptno = d.deptno
5 and d.dname = 'SALES';
--------------------------------------------------------
| Id | Operation | Name | Rows |
--------------------------------------------------------
| 0 | SELECT STATEMENT | | 5 |
| 1 | MERGE JOIN | | 5 |
|* 2 | TABLE ACCESS BY INDEX ROWID| DEPT | 1 |
| 3 | INDEX FULL SCAN | PK_DEPT | 4 |
|* 4 | SORT JOIN | | 14 |
| 5 | TABLE ACCESS FULL | EMP | 14 |
--------------------------------------------------------
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
126
"I want a hash join"
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
127
SQL> select /*+ use_hash(d) */ *
2 from emp e,
3 dept d
4 where e.deptno = d.deptno
5 and d.dname = 'SALES';
--------------------------------------------------------
| Id | Operation | Name | Rows |
--------------------------------------------------------
| 0 | SELECT STATEMENT | | 5 |
| 1 | MERGE JOIN | | 5 |
|* 2 | TABLE ACCESS BY INDEX ROWID| DEPT | 1 |
| 3 | INDEX FULL SCAN | PK_DEPT | 4 |
|* 4 | SORT JOIN | | 14 |
| 5 | TABLE ACCESS FULL | EMP | 14 |
--------------------------------------------------------
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
128
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
129
/*+ use_hash(d) */
if joining into DEPT...
use a hash join
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
we're not...
130
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
131
--------------------------------------------------------
| Id | Operation | Name | Rows |
--------------------------------------------------------
| 0 | SELECT STATEMENT | | 5 |
| 1 | MERGE JOIN | | 5 |
|* 2 | TABLE ACCESS BY INDEX ROWID| DEPT | 1 |
| 3 | INDEX FULL SCAN | PK_DEPT | 4 |
|* 4 | SORT JOIN | | 14 |
| 5 | TABLE ACCESS FULL | EMP | 14 |
--------------------------------------------------------
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
132
if we want to join into DEPT...
...we must be starting with EMP
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
133
SQL> select /*+ leading(e) use_hash(d) */ *
2 from emp e,
3 dept d
4 where e.deptno = d.deptno
5 and d.dname = 'SALES';
---------------------------------------------------
| Id | Operation | Name | Rows | Bytes |
---------------------------------------------------
| 0 | SELECT STATEMENT | | 5 | 285 |
|* 1 | HASH JOIN | | 5 | 285 |
| 2 | TABLE ACCESS FULL| EMP | 14 | 518 |
|* 3 | TABLE ACCESS FULL| DEPT | 1 | 20 |
---------------------------------------------------
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
not enough hints
134
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
135
"hints are like violence…
if they do not work, use more"
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
back to dbms_xplan
136
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
137
SQL> SELECT *
2 from table(dbms_xplan.display(.... ,
format=>'typical +OUTLINE))
/*+ BEGIN_OUTLINE_DATA
USE_HASH(@"SEL$1" "B"@"SEL$1")
USE_HASH(@"SEL$1" "D"@"SEL$1")
LEADING(@"SEL$1" "E"@"SEL$1" "D"@"SEL$1" "B"@"SEL$1")
FULL(@"SEL$1" "B"@"SEL$1")
FULL(@"SEL$1" "D"@"SEL$1")
FULL(@"SEL$1" "E"@"SEL$1")
OUTLINE_LEAF(@"SEL$1")
ALL_ROWS
DB_VERSION('11.2.0.2')
OPTIMIZER_FEATURES_ENABLE('11.2.0.2')
END_OUTLINE_DATA
*/
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
consider SQL Plan Management
138
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
bonus tip !
139
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
140
SQL> select /*+ INDEX(accounts_pk) */
2 from ACCOUNTS
3 where ...
SQL> select /*+ INDEX(a) */
2 from ACCOUNTS
3 where ...
SQL> select /*+ INDEX(scott.accounts) */
2 from SCOTT.ACCOUNTS
3 where ...
SQL> select /* INDEX(A) */
2 from SCOTT.ACCOUNTS A
3 where ...
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
19c
141
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
142
SQL> SELECT *
2 from table(dbms_xplan.display(.... ,
format=>'typical +HINT_REPORT'))
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
finding bad SQL ...
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
... is probably bad SQL
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
146
SQL> select sql_fulltext
2 from v$sql
3 where buffer_gets > 1000000 or
4 executions > 10000 or
5 disk_reads > 100000;
SQL_FULLTEXT
-----------------------------------------------
SELECT ...
FROM ...
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
you can do better
147
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
148
SQL> select sql_fulltext
2 from v$sqlstats
3 where buffer_gets > 1000000 or
4 executions > 10000 or
5 disk_reads > 100000;
SQL_FULLTEXT
-----------------------------------------------
SELECT ...
FROM ...
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
"The column definitions for columns in V$SQLSTATS are
identical to those in the V$SQL and V$SQLAREA views.
However, the V$SQLSTATS view differs from V$SQL and
V$SQLAREA in that it is faster, more scalable, and has a
greater data retention (the statistics may still appear in
this view, even after the cursor has been aged out of the
shared pool)."
149
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
151
sqlplus hash tags
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
152
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
153
SQL> select SAL
2 from EMP
3 where
"hmmmm....."
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
154
SQL> select SAL
2 from EMP
3 where
4 #desc EMP
Name Null? Type
----------------------------- -------- -------------
EMPNO NOT NULL NUMBER(4)
ENAME VARCHAR2(10)
JOB VARCHAR2(9)
...
4 job = 'CLERK';
SAL
----------
800
1100
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
155
SQL> declare
2 x int;
3 begin
4 select max(sal)
5 into x
6 from emp;
7
8 dbms_output.put_line(x);
9 #set serverout on
9 end;
10 /
10000
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
157
sqlplus error logging
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
158
SQL> set errorlogging on
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
159
SQL> set errorlogging on
SQL> desc SPERRORLOG
Name Type
------------------------------------- ----------------
USERNAME VARCHAR2(256)
TIMESTAMP TIMESTAMP(6)
SCRIPT VARCHAR2(1024)
IDENTIFIER VARCHAR2(256)
MESSAGE CLOB
STATEMENT CLOB
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
160
SQL> select * from THE_WRONG_NAME;
select * from THE_WRONG_NAME
*
ERROR at line 1:
ORA-00942: table or view does not exist
SQL> desc THE_WRONG_NAME;
ERROR:
ORA-04043: object THE_WRONG_NAME does not exist
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
161
SQL> select timestamp, message, statement
2 from SPERRORLOG;
TIMESTAMP
-----------------------------------------------------
MESSAGE
-----------------------------------------------------
STATEMENT
-----------------------------------------------------
01-APR-08 02.29.58.000000 PM
ORA-00942: table or view does not exist
select * from THE_WRONG_NAME
01-APR-08 02.29.58.000000 PM
ORA-04043: object THE_WRONG_NAME does not exist
desc THE_WRONG_NAME;
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
162
installation scripts
SQL> set errorlogging on
SQL> @create_all_objects
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
164
sqlplus / sqlcl transaction safety
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
165
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
166
SQL> set exitcommit
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
context
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
8.1.5
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
“... within a namespace, define, set and
access variable-length application attributes
and values in a secure data cache available
in UGA and SGA.”
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
171
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
in-memory table structure
SURNAME McDonald
FORENAME Connor
DOB 20FEB1990
DETAILS
context
attributes
values
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> select SYS_CONTEXT('USERENV','SID') sname
2 from dual;
SID
---------------------
123
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> select SYS_CONTEXT('DETAILS','SURNAME') sname
2 from dual;
SNAME
---------------------
McDonald
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
default values
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
if you are lucky
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> create table PEOPLE
2 ( person_id number,
3 forename1 varchar2(20),
4 surname varchar2(30),
5 created_by varchar2(10) default USER );
Table created.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
12c
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> create table PEOPLE
2 ( person_id number default per_seq.nextval,
3 forename1 varchar2(20),
4 surname varchar2(30),
5 created_by varchar2(10) );
Table created.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> create table PEOPLE
2 ( person_id number,
3 forename1 varchar2(20),
4 surname varchar2(30),
5 created_by varchar2(10)
6 default <some session specific value> );
Table created.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
triggers
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> create or replace
2 trigger WHO_DID_THIS_ROW
3 before insert or update
4 on PEOPLE
5 for each row
6 begin
7 :new.created_by := my_package.global_var;
8 end;
9 /
Trigger created.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
over rated ...
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
insert /* without trigger */ into PEOPLE
select rownum, 'x','y', null
from all_objects
call count cpu elapsed disk query current
------- ------ -------- ---------- ---------- ---------- ----------
Parse 1 0.03 0.02 0 0 0
Execute 1 1.39 1.37 0 64619 1257
Fetch 0 0.00 0.00 0 0 0
------- ------ -------- ---------- ---------- ---------- ----------
total 2 1.42 1.40 0 64619 1257
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
insert /* with trigger */ into PEOPLE
select rownum, 'x','y', null
from all_objects
call count cpu elapsed disk query current
------- ------ -------- ---------- ---------- ---------- ----------
Parse 1 0.08 0.07 0 0 0
Execute 1 2.73 2.73 0 64631 51763
Fetch 0 0.00 0.00 0 0 0
------- ------ -------- ---------- ---------- ---------- ----------
total 2 2.81 2.80 0 64631 51763
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> create table PEOPLE
2 ( person_id number,
3 forename1 varchar2(20),
4 surname varchar2(30),
5 created_by varchar2(10)
6 default <some session specific value> );
Table created.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
“... within a namespace, define, set and access
variable-length application attributes and values
in a secure data cache available in UGA and
SGA.”
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
SQL> create table PEOPLE
2 ( person_id number,
3 forename1 varchar2(20),
4 surname varchar2(30),
5 created_by varchar2(10)
6 default SYS_CONTEXT('MY_CTX','SOME_ATTRIB') );
Table created.
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
insert /* with context */ into PEOPLE
select rownum, 'x','y', null
from all_objects
call count cpu elapsed disk query current
------- ------ -------- ---------- ---------- ---------- ----------
Parse 1 0.03 0.02 0 0 0
Execute 1 1.38 1.40 0 64623 1257
Fetch 0 0.00 0.00 0 0 0
------- ------ -------- ---------- ---------- ---------- ----------
total 2 1.41 1.43 0 64623 1257
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
it costs you nothing !
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
pass parameters to views
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
QL> create or replace
2 view MY_VIEW as
3 select ...
4 from employees
5 where empno in
6 ( select contractor_empno
7 from contractors
8 where assigned_mgr = sys_context('EMPCTX','MGR')
9 )
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
wrap up
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
poaching ideas is fine
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
learn something new
Follow and Subscribe!
youtube bit.ly/youtube-connor
blog bit.ly/blog-connor
twitter bit.ly/twitter-connor

More Related Content

What's hot

Introducing New AI Ops Innovations in Oracle 19c Autonomous Health Framework ...
Introducing New AI Ops Innovations in Oracle 19c Autonomous Health Framework ...Introducing New AI Ops Innovations in Oracle 19c Autonomous Health Framework ...
Introducing New AI Ops Innovations in Oracle 19c Autonomous Health Framework ...Sandesh Rao
 
AIOUG-GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Preser...
AIOUG-GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Preser...AIOUG-GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Preser...
AIOUG-GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Preser...Sandesh Rao
 
Latin America Tour 2019 - 18c and 19c featues
Latin America Tour 2019   - 18c and 19c featuesLatin America Tour 2019   - 18c and 19c featues
Latin America Tour 2019 - 18c and 19c featuesConnor McDonald
 
AIOUG : ODEVCYathra 2018 - Oracle Autonomous Database What Every DBA should know
AIOUG : ODEVCYathra 2018 - Oracle Autonomous Database What Every DBA should knowAIOUG : ODEVCYathra 2018 - Oracle Autonomous Database What Every DBA should know
AIOUG : ODEVCYathra 2018 - Oracle Autonomous Database What Every DBA should knowSandesh Rao
 
RAC Troubleshooting and Diagnosability Sangam2016
RAC Troubleshooting and Diagnosability Sangam2016RAC Troubleshooting and Diagnosability Sangam2016
RAC Troubleshooting and Diagnosability Sangam2016Sandesh Rao
 
NZOUG - GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Pres...
NZOUG - GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Pres...NZOUG - GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Pres...
NZOUG - GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Pres...Sandesh Rao
 
AIOUG : OTNYathra - Troubleshooting and Diagnosing Oracle Database 12.2 and O...
AIOUG : OTNYathra - Troubleshooting and Diagnosing Oracle Database 12.2 and O...AIOUG : OTNYathra - Troubleshooting and Diagnosing Oracle Database 12.2 and O...
AIOUG : OTNYathra - Troubleshooting and Diagnosing Oracle Database 12.2 and O...Sandesh Rao
 
LAD - GroundBreakers - Jul 2019 - Using Oracle Autonomous Health Framework to...
LAD - GroundBreakers - Jul 2019 - Using Oracle Autonomous Health Framework to...LAD - GroundBreakers - Jul 2019 - Using Oracle Autonomous Health Framework to...
LAD - GroundBreakers - Jul 2019 - Using Oracle Autonomous Health Framework to...Sandesh Rao
 
Oracle RAC on Engineered Systems
Oracle RAC on Engineered SystemsOracle RAC on Engineered Systems
Oracle RAC on Engineered SystemsMarkus Michalewicz
 
MAA - Best Practices for the Cloud
MAA - Best Practices for the CloudMAA - Best Practices for the Cloud
MAA - Best Practices for the CloudMarkus Michalewicz
 
Oracle Extended Clusters for Oracle RAC
Oracle Extended Clusters for Oracle RACOracle Extended Clusters for Oracle RAC
Oracle Extended Clusters for Oracle RACMarkus Michalewicz
 
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best PracticesOracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best PracticesMarkus Michalewicz
 
The Oracle Autonomous Database
The Oracle Autonomous DatabaseThe Oracle Autonomous Database
The Oracle Autonomous DatabaseConnor McDonald
 
Oracle RAC in the Oracle Cloud
Oracle RAC in the Oracle CloudOracle RAC in the Oracle Cloud
Oracle RAC in the Oracle CloudMarkus Michalewicz
 
Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...
Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...
Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...Sandesh Rao
 
Whats new in oracle trace file analyzer 18.3.0
Whats new in oracle trace file analyzer 18.3.0Whats new in oracle trace file analyzer 18.3.0
Whats new in oracle trace file analyzer 18.3.0Gareth Chapman
 
(Oracle) DBA Skills to Have, to Obtain and to Nurture
(Oracle) DBA Skills to Have, to Obtain and to Nurture(Oracle) DBA Skills to Have, to Obtain and to Nurture
(Oracle) DBA Skills to Have, to Obtain and to NurtureMarkus Michalewicz
 
ILOUG 2019 - 18c/19c features
ILOUG 2019 - 18c/19c featuresILOUG 2019 - 18c/19c features
ILOUG 2019 - 18c/19c featuresConnor McDonald
 
Oracle Real Application Clusters (RAC) 12c Rel. 2 - What's Next?
Oracle Real Application Clusters (RAC) 12c Rel. 2 - What's Next?Oracle Real Application Clusters (RAC) 12c Rel. 2 - What's Next?
Oracle Real Application Clusters (RAC) 12c Rel. 2 - What's Next?Markus Michalewicz
 
The Machine Learning behind the Autonomous Database- EMEA Tour Oct 2019
The Machine Learning behind the Autonomous Database- EMEA Tour Oct 2019 The Machine Learning behind the Autonomous Database- EMEA Tour Oct 2019
The Machine Learning behind the Autonomous Database- EMEA Tour Oct 2019 Sandesh Rao
 

What's hot (20)

Introducing New AI Ops Innovations in Oracle 19c Autonomous Health Framework ...
Introducing New AI Ops Innovations in Oracle 19c Autonomous Health Framework ...Introducing New AI Ops Innovations in Oracle 19c Autonomous Health Framework ...
Introducing New AI Ops Innovations in Oracle 19c Autonomous Health Framework ...
 
AIOUG-GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Preser...
AIOUG-GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Preser...AIOUG-GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Preser...
AIOUG-GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Preser...
 
Latin America Tour 2019 - 18c and 19c featues
Latin America Tour 2019   - 18c and 19c featuesLatin America Tour 2019   - 18c and 19c featues
Latin America Tour 2019 - 18c and 19c featues
 
AIOUG : ODEVCYathra 2018 - Oracle Autonomous Database What Every DBA should know
AIOUG : ODEVCYathra 2018 - Oracle Autonomous Database What Every DBA should knowAIOUG : ODEVCYathra 2018 - Oracle Autonomous Database What Every DBA should know
AIOUG : ODEVCYathra 2018 - Oracle Autonomous Database What Every DBA should know
 
RAC Troubleshooting and Diagnosability Sangam2016
RAC Troubleshooting and Diagnosability Sangam2016RAC Troubleshooting and Diagnosability Sangam2016
RAC Troubleshooting and Diagnosability Sangam2016
 
NZOUG - GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Pres...
NZOUG - GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Pres...NZOUG - GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Pres...
NZOUG - GroundBreakers-2018 -Using Oracle Autonomous Health Framework to Pres...
 
AIOUG : OTNYathra - Troubleshooting and Diagnosing Oracle Database 12.2 and O...
AIOUG : OTNYathra - Troubleshooting and Diagnosing Oracle Database 12.2 and O...AIOUG : OTNYathra - Troubleshooting and Diagnosing Oracle Database 12.2 and O...
AIOUG : OTNYathra - Troubleshooting and Diagnosing Oracle Database 12.2 and O...
 
LAD - GroundBreakers - Jul 2019 - Using Oracle Autonomous Health Framework to...
LAD - GroundBreakers - Jul 2019 - Using Oracle Autonomous Health Framework to...LAD - GroundBreakers - Jul 2019 - Using Oracle Autonomous Health Framework to...
LAD - GroundBreakers - Jul 2019 - Using Oracle Autonomous Health Framework to...
 
Oracle RAC on Engineered Systems
Oracle RAC on Engineered SystemsOracle RAC on Engineered Systems
Oracle RAC on Engineered Systems
 
MAA - Best Practices for the Cloud
MAA - Best Practices for the CloudMAA - Best Practices for the Cloud
MAA - Best Practices for the Cloud
 
Oracle Extended Clusters for Oracle RAC
Oracle Extended Clusters for Oracle RACOracle Extended Clusters for Oracle RAC
Oracle Extended Clusters for Oracle RAC
 
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best PracticesOracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
Oracle Real Application Clusters (RAC) 12c Rel. 2 - Operational Best Practices
 
The Oracle Autonomous Database
The Oracle Autonomous DatabaseThe Oracle Autonomous Database
The Oracle Autonomous Database
 
Oracle RAC in the Oracle Cloud
Oracle RAC in the Oracle CloudOracle RAC in the Oracle Cloud
Oracle RAC in the Oracle Cloud
 
Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...
Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...
Oracle Autonomous Health Service- For Protecting Your On-Premise Databases- F...
 
Whats new in oracle trace file analyzer 18.3.0
Whats new in oracle trace file analyzer 18.3.0Whats new in oracle trace file analyzer 18.3.0
Whats new in oracle trace file analyzer 18.3.0
 
(Oracle) DBA Skills to Have, to Obtain and to Nurture
(Oracle) DBA Skills to Have, to Obtain and to Nurture(Oracle) DBA Skills to Have, to Obtain and to Nurture
(Oracle) DBA Skills to Have, to Obtain and to Nurture
 
ILOUG 2019 - 18c/19c features
ILOUG 2019 - 18c/19c featuresILOUG 2019 - 18c/19c features
ILOUG 2019 - 18c/19c features
 
Oracle Real Application Clusters (RAC) 12c Rel. 2 - What's Next?
Oracle Real Application Clusters (RAC) 12c Rel. 2 - What's Next?Oracle Real Application Clusters (RAC) 12c Rel. 2 - What's Next?
Oracle Real Application Clusters (RAC) 12c Rel. 2 - What's Next?
 
The Machine Learning behind the Autonomous Database- EMEA Tour Oct 2019
The Machine Learning behind the Autonomous Database- EMEA Tour Oct 2019 The Machine Learning behind the Autonomous Database- EMEA Tour Oct 2019
The Machine Learning behind the Autonomous Database- EMEA Tour Oct 2019
 

Similar to Fast Lane Database Success Tips

OpenWorld 2018 - 20 years of hints and tips
OpenWorld 2018 - 20 years of hints and tipsOpenWorld 2018 - 20 years of hints and tips
OpenWorld 2018 - 20 years of hints and tipsConnor McDonald
 
Perth APAC Groundbreakers tour - The Autonomous Database
Perth APAC Groundbreakers tour - The Autonomous DatabasePerth APAC Groundbreakers tour - The Autonomous Database
Perth APAC Groundbreakers tour - The Autonomous DatabaseConnor McDonald
 
Hyderabad Mar 2019 - Autonomous Database
Hyderabad Mar 2019 - Autonomous DatabaseHyderabad Mar 2019 - Autonomous Database
Hyderabad Mar 2019 - Autonomous DatabaseConnor McDonald
 
Wellington APAC Groundbreakers tour - Upgrading to the 12c Optimizer
Wellington APAC Groundbreakers tour - Upgrading to the 12c OptimizerWellington APAC Groundbreakers tour - Upgrading to the 12c Optimizer
Wellington APAC Groundbreakers tour - Upgrading to the 12c OptimizerConnor McDonald
 
Kscope19 - Flashback: Good for Developers as well as DBAs
Kscope19 - Flashback: Good for Developers as well as DBAsKscope19 - Flashback: Good for Developers as well as DBAs
Kscope19 - Flashback: Good for Developers as well as DBAsConnor McDonald
 
ITOUG 2019 - 18c, 19c features
ITOUG 2019 - 18c, 19c featuresITOUG 2019 - 18c, 19c features
ITOUG 2019 - 18c, 19c featuresConnor McDonald
 
ILOUG 2019 - Autonomous, what does it mean for DBAs
ILOUG 2019 - Autonomous, what does it mean for DBAsILOUG 2019 - Autonomous, what does it mean for DBAs
ILOUG 2019 - Autonomous, what does it mean for DBAsConnor McDonald
 
Troubleshooting Ecommerce Performance
 Troubleshooting Ecommerce Performance Troubleshooting Ecommerce Performance
Troubleshooting Ecommerce PerformanceDiego Cardozo
 
Melbourne Groundbreakers Tour - Upgrading without risk
Melbourne Groundbreakers Tour - Upgrading without riskMelbourne Groundbreakers Tour - Upgrading without risk
Melbourne Groundbreakers Tour - Upgrading without riskConnor McDonald
 
APEX Connect 2019 - successful application development
APEX Connect 2019 - successful application developmentAPEX Connect 2019 - successful application development
APEX Connect 2019 - successful application developmentConnor McDonald
 
APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101Connor McDonald
 
OpenWorld 2018 - SQL Tuning in 20 mins
OpenWorld 2018 - SQL Tuning in 20 minsOpenWorld 2018 - SQL Tuning in 20 mins
OpenWorld 2018 - SQL Tuning in 20 minsConnor McDonald
 
Latin America tour 2019 - Flashback
Latin America tour 2019 -  FlashbackLatin America tour 2019 -  Flashback
Latin America tour 2019 - FlashbackConnor McDonald
 
Latin America Tour 2019 - slow data and sql processing
Latin America Tour 2019  - slow data and sql processingLatin America Tour 2019  - slow data and sql processing
Latin America Tour 2019 - slow data and sql processingConnor McDonald
 
OpenWorld 2018 - Pagination
OpenWorld 2018 - PaginationOpenWorld 2018 - Pagination
OpenWorld 2018 - PaginationConnor McDonald
 
[Oracle Innovation Summit Tokyo 2018] ブロックチェーンで切り拓く新たな世界
[Oracle Innovation Summit Tokyo 2018] ブロックチェーンで切り拓く新たな世界[Oracle Innovation Summit Tokyo 2018] ブロックチェーンで切り拓く新たな世界
[Oracle Innovation Summit Tokyo 2018] ブロックチェーンで切り拓く新たな世界オラクルエンジニア通信
 
ITOUG 2019 - 25 years of hints and tips
ITOUG 2019 - 25 years of hints and tipsITOUG 2019 - 25 years of hints and tips
ITOUG 2019 - 25 years of hints and tipsConnor McDonald
 
ILOUG 2019 - 25 years of hints and tips
ILOUG 2019 - 25 years of hints and tipsILOUG 2019 - 25 years of hints and tips
ILOUG 2019 - 25 years of hints and tipsConnor McDonald
 
AUSOUG Analytics Update - Nov 14 2018
AUSOUG Analytics Update - Nov 14 2018AUSOUG Analytics Update - Nov 14 2018
AUSOUG Analytics Update - Nov 14 2018Jason Lowe
 

Similar to Fast Lane Database Success Tips (20)

OpenWorld 2018 - 20 years of hints and tips
OpenWorld 2018 - 20 years of hints and tipsOpenWorld 2018 - 20 years of hints and tips
OpenWorld 2018 - 20 years of hints and tips
 
Perth APAC Groundbreakers tour - The Autonomous Database
Perth APAC Groundbreakers tour - The Autonomous DatabasePerth APAC Groundbreakers tour - The Autonomous Database
Perth APAC Groundbreakers tour - The Autonomous Database
 
Hyderabad Mar 2019 - Autonomous Database
Hyderabad Mar 2019 - Autonomous DatabaseHyderabad Mar 2019 - Autonomous Database
Hyderabad Mar 2019 - Autonomous Database
 
Wellington APAC Groundbreakers tour - Upgrading to the 12c Optimizer
Wellington APAC Groundbreakers tour - Upgrading to the 12c OptimizerWellington APAC Groundbreakers tour - Upgrading to the 12c Optimizer
Wellington APAC Groundbreakers tour - Upgrading to the 12c Optimizer
 
Kscope19 - Flashback: Good for Developers as well as DBAs
Kscope19 - Flashback: Good for Developers as well as DBAsKscope19 - Flashback: Good for Developers as well as DBAs
Kscope19 - Flashback: Good for Developers as well as DBAs
 
ITOUG 2019 - 18c, 19c features
ITOUG 2019 - 18c, 19c featuresITOUG 2019 - 18c, 19c features
ITOUG 2019 - 18c, 19c features
 
ILOUG 2019 - Autonomous, what does it mean for DBAs
ILOUG 2019 - Autonomous, what does it mean for DBAsILOUG 2019 - Autonomous, what does it mean for DBAs
ILOUG 2019 - Autonomous, what does it mean for DBAs
 
Troubleshooting Ecommerce Performance
 Troubleshooting Ecommerce Performance Troubleshooting Ecommerce Performance
Troubleshooting Ecommerce Performance
 
Melbourne Groundbreakers Tour - Upgrading without risk
Melbourne Groundbreakers Tour - Upgrading without riskMelbourne Groundbreakers Tour - Upgrading without risk
Melbourne Groundbreakers Tour - Upgrading without risk
 
APEX Connect 2019 - successful application development
APEX Connect 2019 - successful application developmentAPEX Connect 2019 - successful application development
APEX Connect 2019 - successful application development
 
APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101APEX Connect 2019 - SQL Tuning 101
APEX Connect 2019 - SQL Tuning 101
 
OpenWorld 2018 - SQL Tuning in 20 mins
OpenWorld 2018 - SQL Tuning in 20 minsOpenWorld 2018 - SQL Tuning in 20 mins
OpenWorld 2018 - SQL Tuning in 20 mins
 
Latin America tour 2019 - Flashback
Latin America tour 2019 -  FlashbackLatin America tour 2019 -  Flashback
Latin America tour 2019 - Flashback
 
Latin America Tour 2019 - slow data and sql processing
Latin America Tour 2019  - slow data and sql processingLatin America Tour 2019  - slow data and sql processing
Latin America Tour 2019 - slow data and sql processing
 
OpenWorld 2018 - Pagination
OpenWorld 2018 - PaginationOpenWorld 2018 - Pagination
OpenWorld 2018 - Pagination
 
[Oracle Innovation Summit Tokyo 2018] ブロックチェーンで切り拓く新たな世界
[Oracle Innovation Summit Tokyo 2018] ブロックチェーンで切り拓く新たな世界[Oracle Innovation Summit Tokyo 2018] ブロックチェーンで切り拓く新たな世界
[Oracle Innovation Summit Tokyo 2018] ブロックチェーンで切り拓く新たな世界
 
ITOUG 2019 - 25 years of hints and tips
ITOUG 2019 - 25 years of hints and tipsITOUG 2019 - 25 years of hints and tips
ITOUG 2019 - 25 years of hints and tips
 
ILOUG 2019 - 25 years of hints and tips
ILOUG 2019 - 25 years of hints and tipsILOUG 2019 - 25 years of hints and tips
ILOUG 2019 - 25 years of hints and tips
 
AUSOUG Analytics Update - Nov 14 2018
AUSOUG Analytics Update - Nov 14 2018AUSOUG Analytics Update - Nov 14 2018
AUSOUG Analytics Update - Nov 14 2018
 
Autonomous Data Warehouse
Autonomous Data WarehouseAutonomous Data Warehouse
Autonomous Data Warehouse
 

More from Connor McDonald

Sangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestSangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestConnor McDonald
 
Sangam 19 - Analytic SQL
Sangam 19 - Analytic SQLSangam 19 - Analytic SQL
Sangam 19 - Analytic SQLConnor McDonald
 
UKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tipsUKOUG - 25 years of hints and tips
UKOUG - 25 years of hints and tipsConnor McDonald
 
Sangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on AutonomousSangam 19 - Successful Applications on Autonomous
Sangam 19 - Successful Applications on AutonomousConnor McDonald
 
Sangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesSangam 2019 - The Latest Features
Sangam 2019 - The Latest FeaturesConnor McDonald
 
UKOUG 2019 - SQL features
UKOUG 2019 - SQL featuresUKOUG 2019 - SQL features
UKOUG 2019 - SQL featuresConnor McDonald
 
APEX tour 2019 - successful development with autonomous
APEX tour 2019 - successful development with autonomousAPEX tour 2019 - successful development with autonomous
APEX tour 2019 - successful development with autonomousConnor McDonald
 
APAC Groundbreakers 2019 - Perth/Melbourne
APAC Groundbreakers 2019 - Perth/Melbourne APAC Groundbreakers 2019 - Perth/Melbourne
APAC Groundbreakers 2019 - Perth/Melbourne Connor McDonald
 
OOW19 - Flashback, not just for DBAs
OOW19 - Flashback, not just for DBAsOOW19 - Flashback, not just for DBAs
OOW19 - Flashback, not just for DBAsConnor McDonald
 
OOW19 - Read consistency
OOW19 - Read consistencyOOW19 - Read consistency
OOW19 - Read consistencyConnor McDonald
 
OOW19 - Slower and less secure applications
OOW19 - Slower and less secure applicationsOOW19 - Slower and less secure applications
OOW19 - Slower and less secure applicationsConnor McDonald
 
OOW19 - Killing database sessions
OOW19 - Killing database sessionsOOW19 - Killing database sessions
OOW19 - Killing database sessionsConnor McDonald
 
OOW19 - Ten Amazing SQL features
OOW19 - Ten Amazing SQL featuresOOW19 - Ten Amazing SQL features
OOW19 - Ten Amazing SQL featuresConnor McDonald
 
Latin America Tour 2019 - 10 great sql features
Latin America Tour 2019  - 10 great sql featuresLatin America Tour 2019  - 10 great sql features
Latin America Tour 2019 - 10 great sql featuresConnor McDonald
 
Latin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matchingLatin America Tour 2019 - pattern matching
Latin America Tour 2019 - pattern matchingConnor McDonald
 
OG Yatra - upgrading to the new 12c+ optimizer
OG Yatra - upgrading to the new 12c+ optimizerOG Yatra - upgrading to the new 12c+ optimizer
OG Yatra - upgrading to the new 12c+ optimizerConnor McDonald
 
OG Yatra - 25 years of hints and tips
OG Yatra - 25 years of hints and tipsOG Yatra - 25 years of hints and tips
OG Yatra - 25 years of hints and tipsConnor McDonald
 
OG Yatra - Flashback, not just for developers
OG Yatra - Flashback, not just for developersOG Yatra - Flashback, not just for developers
OG Yatra - Flashback, not just for developersConnor McDonald
 

More from Connor McDonald (20)

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

Recently uploaded

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

Fast Lane Database Success Tips

  • 1. The Fast Lane To Database Success aka, hints, tips and tricks from an old dude Connor McDonald Developer Advocate
  • 2. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Connor McDonald
  • 3. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 3
  • 4. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 4
  • 5. 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 :-)
  • 6. 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
  • 7. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 7https://asktom.oracle.com
  • 8. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. https://asktom.oracle.com/officehours
  • 9. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 150 hours of free access (so far) 9
  • 10. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. why tips and techniques ?
  • 11. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SO...
  • 12. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. HERE
  • 13. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. IS
  • 14. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. WHAT
  • 15. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. HAPPENED
  • 16. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 17. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 18. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 19. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. maybe they were right ?
  • 20. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. I hope not :-)
  • 21. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. it's not about manuals
  • 22. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. it's not about re-invention
  • 23. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. it's about sharing
  • 24. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. it's about community
  • 25. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. that’s why
  • 26. Copyright © 2016, Oracle and/or its affiliates. All rights reserved. | Safe Harbor Statement The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle. 26
  • 27. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. if it's not in the documentation - contact Support - clarify usage before proceeding
  • 28. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 29. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. rogue session
  • 30. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> select sid, last_call_et, status, 3 from v$session s; SID LAST_CALL_ET STATUS ---------- ------------ ---------- 39 7376 ACTIVE 40 412 INACTIVE 44 421 INACTIVE 46 12 ACTIVE 51 9 ACTIVE 53 15 ACTIVE 58 8 ACTIVE 69 22 ACTIVE ... 80 453 INACTIVE
  • 31. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. old days
  • 32. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. idiot in database
  • 33. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. much more modern approach...
  • 34. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. idiot in database
  • 35. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> alter system kill session ...
  • 36. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. # kill -9 pid
  • 37. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> oradebug setorapid nnn SQL> oradebug suspend SID LAST_CALL_ET STATUS ---------- ------------ ---------- 39 7376 ACTIVE 40 412 INACTIVE 41 412 INACTIVE 44 421 INACTIVE 46 12 ACTIVE 51 9 ACTIVE 53 15 ACTIVE 58 8 ACTIVE SQL> oradebug resume
  • 38. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 39. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. maybe ...
  • 40. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. ... you don't want to resume
  • 41. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. rogue session
  • 42. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 42
  • 43. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> alter system kill session ...
  • 44. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 18c
  • 45. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> alter system cancel sql '123,456';
  • 46. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 47. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. /*+ GATHER_PLAN_STATISTICS */ 47
  • 48. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 48 48 for the optimizer
  • 49. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 49 49 cardinality is everything
  • 50. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> explain plan for 2 select count(*) 3 from VEHICLE 4 where MAKE = 'HONDA' and MODEL = 'CIVIC'; SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_PLAN); -------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | -------------------------------------------------------- | 1 | SORT AGGREGATE | | 1 | 1 | |* 2 | TABLE ACCESS FULL| VEHICLE | 20K | 270K | -------------------------------------------------------- 50
  • 51. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 51
  • 52. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. actual versus estimate 52
  • 53. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> select /*+ GATHER_PLAN_STATISTICS */ count(*) 2 from VEHICLE 3 where MAKE = 'HONDA' and MODEL = 'CIVIC'; COUNT(*) ---------- 114468 SQL> SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR( 2 NULL, NULL, 'ALLSTATS LAST')); ----------------------------------------------------------------- | Id | Operation | Name | Starts | E-Rows | A-Rows | ----------------------------------------------------------------- | 1 | SORT AGGREGATE | | 1 | 1 | 1 | |* 2 | TABLE ACCESS FULL| VEHICLE | 1 | 20K| 114K| ----------------------------------------------------------------- 53
  • 54. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 55. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. tracing
  • 56. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. alter session set sql_trace = true
  • 57. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. C:oraclediagrdbmsdb122db122trace>dir *.trc Volume in drive C is OS Volume Serial Number is 9CB0-0212 Directory of C:oraclediagrdbmsdb122db122trace 27/09/2018 09:18 PM 1,314 db122_ora_10020.trc 20/10/2018 06:21 PM 2,691 db122_ora_10048.trc 30/09/2018 12:21 AM 1,345 db122_ora_10104.trc 29/09/2018 03:18 PM 1,314 db122_ora_10144.trc 21/10/2018 06:21 AM 1,346 db122_ora_10156.trc 11/10/2018 05:18 PM 1,312 db122_ora_1016.trc 02/10/2018 08:49 PM 1,346 db122_ora_10192.trc 29/09/2018 12:21 PM 1,345 db122_ora_10320.trc 12/10/2018 12:21 AM 1,501 db122_ora_10348.trc 15/10/2018 12:18 AM 1,314 db122_ora_10352.trc 13/10/2018 11:21 AM 1,499 db122_ora_1036.trc 28/09/2018 05:18 AM 1,315 db122_ora_10368.trc 18/10/2018 05:18 PM 1,824 db122_ora_10384.trc 05/10/2018 05:18 AM 1,178 db122_ora_10388.trc 28/09/2018 11:21 PM 1,346 db122_ora_10400.trc 14/10/2018 11:21 PM 1,501 db122_ora_10404.trc 30/09/2018 06:25 AM 1,346 db122_ora_10440.trc 04/10/2018 01:18 PM 1,313 db122_ora_10460.trc 04/10/2018 12:18 PM 1,313 db122_ora_10464.trc 08/10/2018 09:18 AM 1,314 db122_ora_10484.trc
  • 58. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. too many trace files
  • 59. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> alter session 2 set tracefile_identifier = SALESPGM; Session altered. SQL> host ls *.trc db10r2_ora_3248.trc db10r2_ora_3284.trc db10r2_ora_3356.trc db10r2_ora_3492.trc db10r2_ora_3504_SALESPGM.trc db10r2_ora_3608.trc db10r2_ora_3620.trc ... ...
  • 60. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 61. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. too much trace data
  • 62. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> alter session 2 set events 3 'immediate trace name trace_buffer_on level 1048576'; Session altered. SQL> host ls –l *.trc drw------- oracle dba Jun17 15:10 1048576 db10r2_ora_3248.trc rolling trace window
  • 63. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. bonus tip
  • 64. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> select name, value from v$diag_info; NAME VALUE ------------------------ ------------------------------------------ Diag Enabled TRUE ADR Base C:ORACLE ADR Home C:ORACLEdiagrdbmsdb122db122 Diag Trace C:ORACLEdiagrdbmsdb122db122trace Diag Alert C:ORACLEdiagrdbmsdb122db122alert Diag Incident C:ORACLEdiagrdbmsdb122db122incident Diag Cdump c:oraclediagrdbmsdb122db122cdump Health Monitor C:ORACLEdiagrdbmsdb122db122hm Default Trace File C:ORACLE...tracedb122_ora_17296.trc
  • 65. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> select PAYLOAD 2 from V$DIAG_TRACE_FILE_CONTENTS 3 where TRACE_FILENAME = 'db122_ora_12484.trc'; PAYLOAD ---------------------------------------------------------------------------- Trace file C:ORACLEdiagrdbmsdb122db122tracedb122_ora_12484.trc Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production Build label: RDBMS_12.2.0.1.0WINDBBP_WINDOWS.X64_180202 Windows NT Version V6.2 ORACLE_HOME = c:oracleproduct12.2.0.1 Node name : XPS13 CPU : 4 - type 8664, 2 Physical Cores Process Affinity : 0x0x0000000000000000 Memory (Avail/Total): Ph:9411M/16235M, Ph+PgF:4292M/20985M Instance name: db122 Redo thread mounted by this instance: 1 ... ...
  • 66. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 67. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 19c
  • 68. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. automatic indexing
  • 69. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | • The Automatic Indexing methodology is based on a common approach to manual SQL tuning • It identifies candidate indexes and validates them before implementing • The entire process is full automatic • Transparency is equally important as sophisticated automation – All tuning activities are auditable via reporting 69 Automatic Indexing Methodology Monitor Online Validation Capture Identify Verify Decide
  • 70. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. until then ...
  • 71. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. “I need a new index on this 6TB table...”
  • 72. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. “will it speed up things ?”
  • 73. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. “I think so”
  • 74. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. virtual indexes
  • 75. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> create index TEST on 2 MYTAB ( SALES_DATE ) NOSEGMENT; Index created. data dictionary only
  • 76. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> begin 2 dbms_stats.generate_stats( 3 'SCOTT', 4 'MYTAB'); 5 end; 6 /
  • 77. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> alter session 2 set "_use_nosegment_indexes" = true; SQL> explain plan for 2 select * from MYTAB 3 where sales_date > sysdate-7; -------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| -------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 950 | 90109 | 962 (34)| | 1 | TABLE ACCESS BY INDEX ROWID| MYTAB | 950 | 90109 | 962 (34)| |* 2 | INDEX RANGE SCAN | TEST | 950 | | 962 (50)| --------------------------------------------------------------------------
  • 78. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 79. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 79 invisible indexes
  • 80. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 80 SQL> create table T 2 as select * from all_objects; Table created. SQL> create index OBJ_IX on T ( OBJECT_ID ); Index created. SQL> exec dbms_stats.gather_table_stats('','T') PL/SQL procedure successfully completed.
  • 81. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 81 SQL> set autotrace traceonly explain SQL> select * from T 2 where OWNER = 'SCOTT' 3 and created > sysdate - 1 4 / --------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| --------------------------------------------------------------- | 0 | SELECT STATEMENT | | 6 | 546 | 281 (1)| |* 1 | TABLE ACCESS FULL| T | 6 | 546 | 281 (1)| ---------------------------------------------------------------
  • 82. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 82 “Can I index OWNER..”
  • 83. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 83 “will it speed up things ?”
  • 84. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 84 “I know so”
  • 85. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 85 SQL> create index NEW_IX on T ( OWNER ); Index created. SQL> select * from T 2 where OWNER = 'SCOTT' 3 and created > sysdate - 1 4 / --------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| --------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 6 | 546 | 122 (0)| |* 1 | TABLE ACCESS BY INDEX ROWID| T | 6 | 546 | 122 (0)| |* 2 | INDEX RANGE SCAN | NEW_IX | 4107 | | 10 (0)| ---------------------------------------------------------------------------
  • 86. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 86 everyone elses queries
  • 87. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 87 before the new index
  • 88. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 88 SQL> set autotrace traceonly explain SQL> select * from T 2 where OWNER = 'SYS' 3 and OBJECT_ID between 10 and 8000 4 / --------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| --------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 462 | 42042 | 143 (0)| |* 1 | TABLE ACCESS BY INDEX ROWID| T | 462 | 42042 | 143 (0)| |* 2 | INDEX RANGE SCAN | OBJ_IX | 7851 | | 20 (0)| ---------------------------------------------------------------------------
  • 89. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 89 SQL> set autotrace traceonly stat SQL> select * from T 2 where owner = 'SYS' 3 and object_id between 10 and 8000; 4967 rows selected. Statistics ----------------------------------------------------- 0 recursive calls 0 db block gets 784 consistent gets 15 physical reads 0 redo size
  • 90. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 90 after the new index
  • 91. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 91 SQL> select * from T 2 where owner = 'SYS' 3 and object_id between 10 and 8000 4 / --------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| --------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 462 | 42042 | 122 (0)| |* 1 | TABLE ACCESS BY INDEX ROWID| T | 462 | 42042 | 122 (0)| |* 2 | INDEX RANGE SCAN | NEW_IX | 4105 | | 10 (0)| --------------------------------------------------------------------------- the new index
  • 92. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 92 SQL> set autotrace traceonly stat SQL> select * from T 2 where owner = 'SYS' 3 and object_id between 10 and 8000; 4967 rows selected. Statistics ------------------------------------------------------ 0 recursive calls 0 db block gets 1522 consistent gets 62 physical reads 0 redo size
  • 93. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 93 the solution ?
  • 94. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 94 invisible indexes
  • 95. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 95 SQL> alter index NEW_IX invisible; Index altered.
  • 96. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 96 SQL> select * from T 2 where owner = 'SYS' 3 and object_id between 10 and 8000 4 / ---------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| ---------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 462 | 42042 | 143 (0)| |* 1 | TABLE ACCESS BY INDEX ROWID| T | 462 | 42042 | 143 (0)| |* 2 | INDEX RANGE SCAN | OBJ_IX | 7851 | | 20 (0)| ----------------------------------------------------------------------------
  • 97. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 97 “gee... thanks for nothing”
  • 98. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 98 SQL> set autotrace traceonly explain SQL> select * from T 2 where OWNER = 'SCOTT' 3 and created > sysdate - 1 4 / --------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| --------------------------------------------------------------- | 0 | SELECT STATEMENT | | 6 | 546 | 281 (1)| |* 1 | TABLE ACCESS FULL| T | 6 | 546 | 281 (1)| ---------------------------------------------------------------
  • 99. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 99 SQL> alter session set 2 optimizer_use_invisible_indexes = true; Session altered. SQL> select * from T 2 where OWNER = 'SCOTT' 3 and created > sysdate - 1 4 / --------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| --------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 462 | 42042 | 122 (0)| |* 1 | TABLE ACCESS BY INDEX ROWID| T | 462 | 42042 | 122 (0)| |* 2 | INDEX RANGE SCAN | NEW_IX | 4105 | | 10 (0)| ---------------------------------------------------------------------------
  • 100. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 100 wrap your SQL to protect others
  • 101. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 101 statement level hint - contact Support
  • 102. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 103. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. better data guard use... ...for free
  • 104. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> ALTER DATABASE CONVERT TO SNAPSHOT STANDBY; 10.2
  • 105. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. open standby read/write
  • 106. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY; SQL> ALTER DATABASE RECOVER MANAGED STANDBY 2 DATABASE DISCONNECT; 10.2
  • 107. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. flashback to resetlogs
  • 108. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. resume managed recovery
  • 109. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. archives still transmitted
  • 110. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 111. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. faster queries ... no code changes
  • 112. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> create table cust_trans 2 ( txn_id int, 3 txn_date date, 4 cust_id int, 5 amt number(10,2) 6 ); 112
  • 113. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> insert /*+ APPEND */ into cust_trans 2 select rownum, 3 sysdate-1000+rownum/1000 txn_date, 4 trunc(dbms_random.value(1,1000)) cust_id, 5 dbms_random.value(1,100) amount 6 from 7 ( select 1 from dual 8 connect by level <= 10000000 ); 10000000 rows created. SQL> create index cust_trans_ix 2 on cust_trans (cust_id ); Index created. 113
  • 114. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> select max(amt) 2 from cust_trans 3 where cust_id = 123; 114
  • 115. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 115
  • 116. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> select max(amt) 2 from cust_trans 3 where cust_id = 123; ------------------------------------------------------------------------------ | Id | Operation | Name | Rows | Bytes | ------------------------------------------------------------------------------ | 0 | SELECT STATEMENT | | 1 | 8 | | 1 | SORT AGGREGATE | | 1 | 8 | | 2 | TABLE ACCESS BY INDEX ROWID BATCHED| CUST_TRANS | 10010 | 80080 | |* 3 | INDEX RANGE SCAN | CUST_TRANS_IX | 10010 | | ------------------------------------------------------------------------------ Statistics ----------------------------------------------------- 0 recursive calls 0 db block gets 8867 consistent gets 8854 physical reads 0 redo size 543 bytes sent via SQL*Net to client 607 bytes received via SQL*Net from client 116
  • 117. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. CUST 123 CUST 47 CUST 123 CUST 76 CUST 95 CUST 47 CUST 123
  • 118. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> alter table cust_trans 2 add clustering by linear order(cust_id); Table altered. SQL> alter table cust_trans move online; Table altered. 12.1 12.2 118
  • 119. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> select max(amt) 2 from cust_trans 3 where cust_id = 123; ------------------------------------------------------------------------------ | Id | Operation | Name | Rows | Bytes | ------------------------------------------------------------------------------ | 0 | SELECT STATEMENT | | 1 | 8 | | 1 | SORT AGGREGATE | | 1 | 8 | | 2 | TABLE ACCESS BY INDEX ROWID BATCHED| CUST_TRANS | 10010 | 80080 | |* 3 | INDEX RANGE SCAN | CUST_TRANS_IX | 10010 | | ------------------------------------------------------------------------------ Statistics ----------------------------------------------------- 0 recursive calls 0 db block gets 62 consistent gets 23 physical reads 0 redo size 543 bytes sent via SQL*Net to client 607 bytes received via SQL*Net from client 119
  • 120. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 121. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. DBMS_XPLAN
  • 122. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> explain plan for ... SQL> select * from 2 table(dbms_xplan.display_plan)
  • 123. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. extensions
  • 124. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. ... the (in)famous hint ignore issue 124
  • 125. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 125 SQL> select * 2 from emp e, 3 dept d 4 where e.deptno = d.deptno 5 and d.dname = 'SALES'; -------------------------------------------------------- | Id | Operation | Name | Rows | -------------------------------------------------------- | 0 | SELECT STATEMENT | | 5 | | 1 | MERGE JOIN | | 5 | |* 2 | TABLE ACCESS BY INDEX ROWID| DEPT | 1 | | 3 | INDEX FULL SCAN | PK_DEPT | 4 | |* 4 | SORT JOIN | | 14 | | 5 | TABLE ACCESS FULL | EMP | 14 | --------------------------------------------------------
  • 126. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 126 "I want a hash join"
  • 127. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 127 SQL> select /*+ use_hash(d) */ * 2 from emp e, 3 dept d 4 where e.deptno = d.deptno 5 and d.dname = 'SALES'; -------------------------------------------------------- | Id | Operation | Name | Rows | -------------------------------------------------------- | 0 | SELECT STATEMENT | | 5 | | 1 | MERGE JOIN | | 5 | |* 2 | TABLE ACCESS BY INDEX ROWID| DEPT | 1 | | 3 | INDEX FULL SCAN | PK_DEPT | 4 | |* 4 | SORT JOIN | | 14 | | 5 | TABLE ACCESS FULL | EMP | 14 | --------------------------------------------------------
  • 128. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 128
  • 129. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 129 /*+ use_hash(d) */ if joining into DEPT... use a hash join
  • 130. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. we're not... 130
  • 131. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 131 -------------------------------------------------------- | Id | Operation | Name | Rows | -------------------------------------------------------- | 0 | SELECT STATEMENT | | 5 | | 1 | MERGE JOIN | | 5 | |* 2 | TABLE ACCESS BY INDEX ROWID| DEPT | 1 | | 3 | INDEX FULL SCAN | PK_DEPT | 4 | |* 4 | SORT JOIN | | 14 | | 5 | TABLE ACCESS FULL | EMP | 14 | --------------------------------------------------------
  • 132. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 132 if we want to join into DEPT... ...we must be starting with EMP
  • 133. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 133 SQL> select /*+ leading(e) use_hash(d) */ * 2 from emp e, 3 dept d 4 where e.deptno = d.deptno 5 and d.dname = 'SALES'; --------------------------------------------------- | Id | Operation | Name | Rows | Bytes | --------------------------------------------------- | 0 | SELECT STATEMENT | | 5 | 285 | |* 1 | HASH JOIN | | 5 | 285 | | 2 | TABLE ACCESS FULL| EMP | 14 | 518 | |* 3 | TABLE ACCESS FULL| DEPT | 1 | 20 | ---------------------------------------------------
  • 134. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. not enough hints 134
  • 135. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 135 "hints are like violence… if they do not work, use more"
  • 136. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. back to dbms_xplan 136
  • 137. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 137 SQL> SELECT * 2 from table(dbms_xplan.display(.... , format=>'typical +OUTLINE)) /*+ BEGIN_OUTLINE_DATA USE_HASH(@"SEL$1" "B"@"SEL$1") USE_HASH(@"SEL$1" "D"@"SEL$1") LEADING(@"SEL$1" "E"@"SEL$1" "D"@"SEL$1" "B"@"SEL$1") FULL(@"SEL$1" "B"@"SEL$1") FULL(@"SEL$1" "D"@"SEL$1") FULL(@"SEL$1" "E"@"SEL$1") OUTLINE_LEAF(@"SEL$1") ALL_ROWS DB_VERSION('11.2.0.2') OPTIMIZER_FEATURES_ENABLE('11.2.0.2') END_OUTLINE_DATA */
  • 138. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. consider SQL Plan Management 138
  • 139. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. bonus tip ! 139
  • 140. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 140 SQL> select /*+ INDEX(accounts_pk) */ 2 from ACCOUNTS 3 where ... SQL> select /*+ INDEX(a) */ 2 from ACCOUNTS 3 where ... SQL> select /*+ INDEX(scott.accounts) */ 2 from SCOTT.ACCOUNTS 3 where ... SQL> select /* INDEX(A) */ 2 from SCOTT.ACCOUNTS A 3 where ...
  • 141. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 19c 141
  • 142. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 142 SQL> SELECT * 2 from table(dbms_xplan.display(.... , format=>'typical +HINT_REPORT'))
  • 143. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 144. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. finding bad SQL ...
  • 145. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. ... is probably bad SQL
  • 146. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 146 SQL> select sql_fulltext 2 from v$sql 3 where buffer_gets > 1000000 or 4 executions > 10000 or 5 disk_reads > 100000; SQL_FULLTEXT ----------------------------------------------- SELECT ... FROM ...
  • 147. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. you can do better 147
  • 148. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 148 SQL> select sql_fulltext 2 from v$sqlstats 3 where buffer_gets > 1000000 or 4 executions > 10000 or 5 disk_reads > 100000; SQL_FULLTEXT ----------------------------------------------- SELECT ... FROM ...
  • 149. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. "The column definitions for columns in V$SQLSTATS are identical to those in the V$SQL and V$SQLAREA views. However, the V$SQLSTATS view differs from V$SQL and V$SQLAREA in that it is faster, more scalable, and has a greater data retention (the statistics may still appear in this view, even after the cursor has been aged out of the shared pool)." 149
  • 150. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 151. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 151 sqlplus hash tags
  • 152. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 152
  • 153. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 153 SQL> select SAL 2 from EMP 3 where "hmmmm....."
  • 154. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 154 SQL> select SAL 2 from EMP 3 where 4 #desc EMP Name Null? Type ----------------------------- -------- ------------- EMPNO NOT NULL NUMBER(4) ENAME VARCHAR2(10) JOB VARCHAR2(9) ... 4 job = 'CLERK'; SAL ---------- 800 1100
  • 155. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 155 SQL> declare 2 x int; 3 begin 4 select max(sal) 5 into x 6 from emp; 7 8 dbms_output.put_line(x); 9 #set serverout on 9 end; 10 / 10000
  • 156. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 157. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 157 sqlplus error logging
  • 158. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 158 SQL> set errorlogging on
  • 159. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 159 SQL> set errorlogging on SQL> desc SPERRORLOG Name Type ------------------------------------- ---------------- USERNAME VARCHAR2(256) TIMESTAMP TIMESTAMP(6) SCRIPT VARCHAR2(1024) IDENTIFIER VARCHAR2(256) MESSAGE CLOB STATEMENT CLOB
  • 160. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 160 SQL> select * from THE_WRONG_NAME; select * from THE_WRONG_NAME * ERROR at line 1: ORA-00942: table or view does not exist SQL> desc THE_WRONG_NAME; ERROR: ORA-04043: object THE_WRONG_NAME does not exist
  • 161. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 161 SQL> select timestamp, message, statement 2 from SPERRORLOG; TIMESTAMP ----------------------------------------------------- MESSAGE ----------------------------------------------------- STATEMENT ----------------------------------------------------- 01-APR-08 02.29.58.000000 PM ORA-00942: table or view does not exist select * from THE_WRONG_NAME 01-APR-08 02.29.58.000000 PM ORA-04043: object THE_WRONG_NAME does not exist desc THE_WRONG_NAME;
  • 162. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 162 installation scripts SQL> set errorlogging on SQL> @create_all_objects
  • 163. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 164. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 164 sqlplus / sqlcl transaction safety
  • 165. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 165
  • 166. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 166 SQL> set exitcommit
  • 167. Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
  • 168. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. context
  • 169. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 8.1.5
  • 170. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. “... within a namespace, define, set and access variable-length application attributes and values in a secure data cache available in UGA and SGA.”
  • 171. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 171
  • 172. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. in-memory table structure SURNAME McDonald FORENAME Connor DOB 20FEB1990 DETAILS context attributes values
  • 173. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> select SYS_CONTEXT('USERENV','SID') sname 2 from dual; SID --------------------- 123
  • 174. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> select SYS_CONTEXT('DETAILS','SURNAME') sname 2 from dual; SNAME --------------------- McDonald
  • 175. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. default values
  • 176. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. if you are lucky
  • 177. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> create table PEOPLE 2 ( person_id number, 3 forename1 varchar2(20), 4 surname varchar2(30), 5 created_by varchar2(10) default USER ); Table created.
  • 178. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 12c
  • 179. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> create table PEOPLE 2 ( person_id number default per_seq.nextval, 3 forename1 varchar2(20), 4 surname varchar2(30), 5 created_by varchar2(10) ); Table created.
  • 180. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> create table PEOPLE 2 ( person_id number, 3 forename1 varchar2(20), 4 surname varchar2(30), 5 created_by varchar2(10) 6 default <some session specific value> ); Table created.
  • 181. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. triggers
  • 182. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> create or replace 2 trigger WHO_DID_THIS_ROW 3 before insert or update 4 on PEOPLE 5 for each row 6 begin 7 :new.created_by := my_package.global_var; 8 end; 9 / Trigger created.
  • 183. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. over rated ...
  • 184. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. insert /* without trigger */ into PEOPLE select rownum, 'x','y', null from all_objects call count cpu elapsed disk query current ------- ------ -------- ---------- ---------- ---------- ---------- Parse 1 0.03 0.02 0 0 0 Execute 1 1.39 1.37 0 64619 1257 Fetch 0 0.00 0.00 0 0 0 ------- ------ -------- ---------- ---------- ---------- ---------- total 2 1.42 1.40 0 64619 1257
  • 185. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. insert /* with trigger */ into PEOPLE select rownum, 'x','y', null from all_objects call count cpu elapsed disk query current ------- ------ -------- ---------- ---------- ---------- ---------- Parse 1 0.08 0.07 0 0 0 Execute 1 2.73 2.73 0 64631 51763 Fetch 0 0.00 0.00 0 0 0 ------- ------ -------- ---------- ---------- ---------- ---------- total 2 2.81 2.80 0 64631 51763
  • 186. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> create table PEOPLE 2 ( person_id number, 3 forename1 varchar2(20), 4 surname varchar2(30), 5 created_by varchar2(10) 6 default <some session specific value> ); Table created.
  • 187. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. “... within a namespace, define, set and access variable-length application attributes and values in a secure data cache available in UGA and SGA.”
  • 188. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. SQL> create table PEOPLE 2 ( person_id number, 3 forename1 varchar2(20), 4 surname varchar2(30), 5 created_by varchar2(10) 6 default SYS_CONTEXT('MY_CTX','SOME_ATTRIB') ); Table created.
  • 189. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. insert /* with context */ into PEOPLE select rownum, 'x','y', null from all_objects call count cpu elapsed disk query current ------- ------ -------- ---------- ---------- ---------- ---------- Parse 1 0.03 0.02 0 0 0 Execute 1 1.38 1.40 0 64623 1257 Fetch 0 0.00 0.00 0 0 0 ------- ------ -------- ---------- ---------- ---------- ---------- total 2 1.41 1.43 0 64623 1257
  • 190. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. it costs you nothing !
  • 191. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. pass parameters to views
  • 192. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. QL> create or replace 2 view MY_VIEW as 3 select ... 4 from employees 5 where empno in 6 ( select contractor_empno 7 from contractors 8 where assigned_mgr = sys_context('EMPCTX','MGR') 9 )
  • 193. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. wrap up
  • 194. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. poaching ideas is fine
  • 195. Copyright © 2018, Oracle and/or its affiliates. All rights reserved. learn something new
  • 196. Follow and Subscribe! youtube bit.ly/youtube-connor blog bit.ly/blog-connor twitter bit.ly/twitter-connor

Editor's Notes

  1. This is a Safe Harbor Front slide, one of two Safe Harbor Statement slides included in this template. One of the Safe Harbor slides must be used if your presentation covers material affected by Oracle’s Revenue Recognition Policy To learn more about this policy, e-mail: Revrec-americasiebc_us@oracle.com For internal communication, Safe Harbor Statements are not required. However, there is an applicable disclaimer (Exhibit E) that should be used, found in the Oracle Revenue Recognition Policy for Future Product Communications. Copy and paste this link into a web browser, to find out more information.   http://my.oracle.com/site/fin/gfo/GlobalProcesses/cnt452504.pdf For all external communications such as press release, roadmaps, PowerPoint presentations, Safe Harbor Statements are required. You can refer to the link mentioned above to find out additional information/disclaimers required depending on your audience.