SlideShare uma empresa Scribd logo
1 de 98
Baixar para ler offline
22/07/2019
1
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
Connor McDonald
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
2
1
2
22/07/2019
2
Copyright © 2018, Oracle and/or its affiliates. All rights reserved.
3
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 :-)
3
4
22/07/2019
3
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. |
In Memoriam
5
6
22/07/2019
4
25 years of tips and tricks
Connor McDonald
Developer Advocate
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
why tips and techniques ?
7
8
22/07/2019
5
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
SO
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
HERE
9
10
22/07/2019
6
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
IS
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
WHAT
11
12
22/07/2019
7
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
HAPPENED
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
13
14
22/07/2019
8
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
15
16
22/07/2019
9
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
maybe they were right ?
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
I hope not :-)
17
18
22/07/2019
10
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
it's not about re-invention
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
it's not about "RTFM"
19
20
22/07/2019
11
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
it's about sharing
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
it's about community
21
22
22/07/2019
12
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
that’s why
Copyright © 2019, 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.
24
23
24
22/07/2019
13
Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 25
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
if it's not in the documentation
- contact Support
- clarify usage before proceeding
25
26
22/07/2019
14
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
1
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
rogue session
27
28
22/07/2019
15
Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved.
old days
29
30
22/07/2019
16
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
idiot in database
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
much more modern...
31
32
22/07/2019
17
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
idiot in database
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
SQL> alter system kill session ...
33
34
22/07/2019
18
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
# kill -9 pid
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
36
35
36
22/07/2019
19
Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved.
2
37
38
22/07/2019
20
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
maybe ...
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
... you don't want to resume
39
40
22/07/2019
21
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
rogue session
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
42
41
42
22/07/2019
22
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
SQL> alter system kill session ...
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
44
43
44
22/07/2019
23
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
18c
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
SQL> alter system cancel sql '123,456';
45
46
22/07/2019
24
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
bonus tip!
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
48
maybe killing won't help
47
48
22/07/2019
25
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
49
BAD
SQL
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
50
bad SQL just keeps coming back...
49
50
22/07/2019
26
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
51
19c
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
52
automatic quarantine of bad SQL
elapsed time
resource consumption
51
52
22/07/2019
27
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
53
error on subsequent execution
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
54
1) alerts to administrator
53
54
22/07/2019
28
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
55
or...
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
56
2) automated historical diagnosis/repair
55
56
22/07/2019
29
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
3
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
58
triggers
57
58
22/07/2019
30
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
59
SQL> create or replace
2 trigger CHECK_SAL_ON_MON
3 after insert or update on EMP
4 for each row
5 begin
6 if updateing then
7 if new.sal > 20 and to_char(sysdate,'DY') = 'MON'
8 then
9 raise_application_error(-20000,'Too high');
10 end if;
11 end;
12 end;
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
60
SQL> create or replace
2 trigger CHECK_SAL_ON_MON
3 after insert or update on EMP
4 for each row
5 begin
6 if updateing then
7 if new.sal > 20 and to_char(sysdate,'DY') = 'MON'
8 then
9 raise_application_error(-20000,'Too high');
10 end if;
11 end;
12 end;
LINE/COL ERROR
-------- --------------------------------------------------
2/3 PL/SQL: Statement ignored
8/9 PLS-00201: identifier 'UPDATEING' must be declared
59
60
22/07/2019
31
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
61
SQL> create or replace
2 trigger CHECK_SAL_ON_MON
3 after insert or update on EMP
4 for each row
5 begin
6 if updateing then
7 if new.sal > 20 and to_char(sysdate,'DY') = 'MON'
8 then
9 raise_application_error(-20000,'Too high');
10 end if;
11 end;
12 end;
LINE/COL ERROR
-------- --------------------------------------------------
3/5 PL/SQL: Statement ignored
3/11 PLS-00201: identifier 'NEW.SAL' must be declared
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
62
SQL> create or replace
2 trigger CHECK_SAL_ON_MON
3 after insert or update on EMP
4 for each row
5 begin
6 if updateing then
7 if new.sal > 20 and to_char(sysdate,'DY') = 'MON'
8 then
9 raise_application_error(-20000,'Too high');
10 end if;
11 end;
12 end;
LINE/COL ERROR
-------- --------------------------------------------------
3/5 PLS-00103: Encountered the symbol ";" when
expecting one of the following:
61
62
22/07/2019
32
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
63
etc etc etc
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
64
EMP
63
64
22/07/2019
33
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
65
SQL> update EMP
2 set DEPTNO = 10
3 where EMPNO = 7365;
update EMP
*
ERROR at line 1:
ORA-04098: trigger
'SCOTT.CHECK_SAL_ON_MON' is invalid and
failed re-validation
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
66
it is all dml
65
66
22/07/2019
34
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
67
SQL> update EMP
2 set DEPTNO = 10
3 where EMPNO = 7365;
update EMP
*
ERROR at line 1:
SQL> select * from EMP
2 where EMPNO = 7365;
no rows selected
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
68
disabled triggers
67
68
22/07/2019
35
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
69
SQL> create or replace
2 trigger CHECK_SAL_ON_MON
3 after insert or update on EMP
4 for each row
5 DISABLE
6 begin
7 if updateing then
8 if new.sal > 20 and to_char(sysdate,'DY') = 'MON'
9 then
10 raise_application_error(-20000,'Too high');
11 end if;
12 end;
13 end;
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
4
69
70
22/07/2019
36
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
tracing
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
alter session set sql_trace = true
71
72
22/07/2019
37
Copyright © 2019, 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
27/09/2018 10:21 PM 1,344 db122_ora_10492.trc
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
too many trace files
73
74
22/07/2019
38
Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved.
bonus tip
75
76
22/07/2019
39
Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved.
5
77
78
22/07/2019
40
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
too much trace data
Copyright © 2019, 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
79
80
22/07/2019
41
Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved.
6
81
82
22/07/2019
42
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
19c
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
automatic indexing
83
84
22/07/2019
43
Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 85
Capture
Identify
VerifyDecide
Monitor
Identify index
candidates based
on column usage
(SQL workload)
Create indexes
unusable, invisible
and evaluate new
execution plans
without parse costs
Rebuild indexes
that offer potential
benefit (status as
invisible). Test
execute each SQL
statement
Use SPM to ensure
no regression for
excluded SQL
statements. Mark
indexes as visible
Monitor all indexes
(automatic and
manual) for ongoing
usage and potential
removal
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
until then ...
85
86
22/07/2019
44
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
“I need a new index
on this 6TB table...”
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
“will it speed up things ?”
87
88
22/07/2019
45
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
“I think so”
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
virtual indexes
89
90
22/07/2019
46
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
SQL> create index TEST on
2 MYTAB ( SALES_DATE ) NOSEGMENT;
Index created.
data dictionary only
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
SQL> begin
2 dbms_stats.generate_stats(
3 'SCOTT',
4 'MYTAB');
5 end;
6 /
91
92
22/07/2019
47
Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved.
7
93
94
22/07/2019
48
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
95
invisible indexes
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
96
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.
95
96
22/07/2019
49
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
97
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 © 2019, Oracle and/or its affiliates. All rights reserved.
98
“Can I index OWNER..”
97
98
22/07/2019
50
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
99
“will it speed up things ?”
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
100
“I know so”
99
100
22/07/2019
51
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
101
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 © 2019, Oracle and/or its affiliates. All rights reserved.
102
101
102
22/07/2019
52
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
103
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
104
everyone elses queries
103
104
22/07/2019
53
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
105
before the new index
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
106
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)|
---------------------------------------------------------------------------
105
106
22/07/2019
54
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
107
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 © 2019, Oracle and/or its affiliates. All rights reserved.
108
after the new index
107
108
22/07/2019
55
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
109
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 © 2019, Oracle and/or its affiliates. All rights reserved.
110
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
109
110
22/07/2019
56
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
111
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
112
the solution ?
111
112
22/07/2019
57
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
113
invisible indexes
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
114
SQL> alter index NEW_IX invisible;
Index altered.
113
114
22/07/2019
58
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
115
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 © 2019, Oracle and/or its affiliates. All rights reserved.
116
“what about my code ???”
115
116
22/07/2019
59
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
117
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 © 2019, Oracle and/or its affiliates. All rights reserved.
118
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)|
---------------------------------------------------------------------------
117
118
22/07/2019
60
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
119
wrap your SQL to protect others
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
120
statement level hint
USE_INVISIBLE_INDEXES
119
120
22/07/2019
61
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
8
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
better data guard use...
...for free
121
122
22/07/2019
62
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
SQL> ALTER DATABASE CONVERT TO SNAPSHOT STANDBY;
10.2
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
open standby read/write
123
124
22/07/2019
63
Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved.
flashback to resetlogs
125
126
22/07/2019
64
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
resume managed recovery
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
archives still transmitted
127
128
22/07/2019
65
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
9
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
faster queries ... no code changes
129
130
22/07/2019
66
Copyright © 2019, 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 );
131
Copyright © 2019, 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.
132
131
132
22/07/2019
67
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
SQL> select max(amt)
2 from cust_trans
3 where cust_id = 123;
133
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
134
133
134
22/07/2019
68
Copyright © 2019, 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
135
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
CUST 123 CUST 47 CUST 123 CUST 76 CUST 95 CUST 47 CUST 123
135
136
22/07/2019
69
Copyright © 2019, 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
137
Copyright © 2019, 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
138
137
138
22/07/2019
70
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
10
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
DBMS_XPLAN
151
152
22/07/2019
71
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
SQL> explain plan for ...
SQL> select * from
2 table(dbms_xplan.display_plan)
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
extensions
153
154
22/07/2019
72
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
... the (in)famous hint ignore issue
155
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
156
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 |
--------------------------------------------------------
155
156
22/07/2019
73
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
157
"I want a hash join"
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
158
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 |
--------------------------------------------------------
157
158
22/07/2019
74
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
? 159
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
160
/*+ use_hash(d) */
if joining into DEPT...
use a hash join
159
160
22/07/2019
75
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
we're not...
161
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
162
--------------------------------------------------------
| 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 |
--------------------------------------------------------
161
162
22/07/2019
76
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
163
if we want to join into DEPT...
...we must be starting with EMP
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
164
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 |
---------------------------------------------------
163
164
22/07/2019
77
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
not enough hints
165
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
166
"hints are like violence…
if they do not work, use more"
165
166
22/07/2019
78
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
back to dbms_xplan
167
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
168
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
*/
167
168
22/07/2019
79
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
consider SQL Plan Management
169
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
bonus tip !
170
169
170
22/07/2019
80
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
171
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 © 2019, Oracle and/or its affiliates. All rights reserved.
19c
172
171
172
22/07/2019
81
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
173
SQL> SELECT *
2 from table(dbms_xplan.display(.... ,
format=>'typical +HINT_REPORT'))
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
11
173
174
22/07/2019
82
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
finding bad SQL ...
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
... is probably bad SQL
175
176
22/07/2019
83
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
177
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 © 2019, Oracle and/or its affiliates. All rights reserved.
you can do better
178
177
178
22/07/2019
84
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
179
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 © 2019, 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)."
180
179
180
22/07/2019
85
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
12
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
182
sqlplus hash tags
181
182
22/07/2019
86
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
183
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
184
SQL> select SAL
2 from EMP
3 where
"hmmmm....."
183
184
22/07/2019
87
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
185
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 © 2019, Oracle and/or its affiliates. All rights reserved.
186
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
185
186
22/07/2019
88
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
13
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
188
sqlplus error logging
187
188
22/07/2019
89
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
189
SQL> set errorlogging on
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
190
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
189
190
22/07/2019
90
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
191
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 © 2019, Oracle and/or its affiliates. All rights reserved.
192
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;
191
192
22/07/2019
91
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
193
installation scripts
SQL> set errorlogging on
SQL> @create_all_objects
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
14
193
194
22/07/2019
92
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
195
sqlplus / sqlcl transaction safety
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
196
195
196
22/07/2019
93
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
197
SQL> set exitcommit
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
15
197
198
22/07/2019
94
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
index compression
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
SQL> create index IX on T ( col1, col2, col3)
2 compress 2;
Index created.
reduce storage for repeated keys
"compress" leading columns col1, col2
= dense index blocks
= better use of buffer cache
199
200
22/07/2019
95
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
which indexes ?
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
how much compression ?
201
202
22/07/2019
96
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
SQL> analyze index IX validate structure;
Index analyzed.
SQL> desc INDEX_STATS
Name Null? Type
----------------------- -------- --------------
HEIGHT NUMBER
BLOCKS NUMBER
...
...
OPT_CMPR_COUNT NUMBER
OPT_CMPR_PCTSAVE NUMBER
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
wrap up
203
204
22/07/2019
97
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
poaching ideas is fine
Copyright © 2019, Oracle and/or its affiliates. All rights reserved.
learn something new
205
206
22/07/2019
98
Follow and Subscribe!
youtube bit.ly/youtube-connor
blog bit.ly/blog-connor
twitter bit.ly/twitter-connor
207

Mais conteúdo relacionado

Mais procurados

Chicago EPM Day-Excellence in Consolidations with HFM
Chicago EPM Day-Excellence in Consolidations with HFMChicago EPM Day-Excellence in Consolidations with HFM
Chicago EPM Day-Excellence in Consolidations with HFMAlithya
 
ILOUG 2019 - Flashback, the forgotten feature
ILOUG 2019 - Flashback, the forgotten featureILOUG 2019 - Flashback, the forgotten feature
ILOUG 2019 - Flashback, the forgotten featureConnor McDonald
 
Ora db 2 day+ app express dev guide
Ora db 2 day+ app express dev guideOra db 2 day+ app express dev guide
Ora db 2 day+ app express dev guideDarnette A
 
Oracle@cloud adapter(SFDC integration with SOA Suites12c)
Oracle@cloud adapter(SFDC integration with SOA Suites12c)Oracle@cloud adapter(SFDC integration with SOA Suites12c)
Oracle@cloud adapter(SFDC integration with SOA Suites12c)TUSHAR VARSHNEY
 
Oracle service procurement manual
Oracle  service procurement manualOracle  service procurement manual
Oracle service procurement manualVikram Reddy
 
Orac appl express guide release 4
Orac appl express guide release 4Orac appl express guide release 4
Orac appl express guide release 4Darnette A
 
Manufacturing scheduling user guide
Manufacturing scheduling user guideManufacturing scheduling user guide
Manufacturing scheduling user guideRajesh Kumar
 
Oracle Enterprise Scheduler(ESS Job Scheduling)
Oracle Enterprise Scheduler(ESS Job Scheduling)Oracle Enterprise Scheduler(ESS Job Scheduling)
Oracle Enterprise Scheduler(ESS Job Scheduling)TUSHAR VARSHNEY
 
Sales userguide121asnug
Sales userguide121asnugSales userguide121asnug
Sales userguide121asnugG Selvam Guru
 
Shipping execution user guide r12
Shipping execution user guide r12Shipping execution user guide r12
Shipping execution user guide r12aruna777
 
Oracle database 12c 2 day + php developer's guide
Oracle database 12c 2 day + php developer's guideOracle database 12c 2 day + php developer's guide
Oracle database 12c 2 day + php developer's guidebupbechanhgmail
 
Web logic installation document
Web logic installation documentWeb logic installation document
Web logic installation documentTaoqir Hassan
 

Mais procurados (14)

Chicago EPM Day-Excellence in Consolidations with HFM
Chicago EPM Day-Excellence in Consolidations with HFMChicago EPM Day-Excellence in Consolidations with HFM
Chicago EPM Day-Excellence in Consolidations with HFM
 
ILOUG 2019 - Flashback, the forgotten feature
ILOUG 2019 - Flashback, the forgotten featureILOUG 2019 - Flashback, the forgotten feature
ILOUG 2019 - Flashback, the forgotten feature
 
Ora db 2 day+ app express dev guide
Ora db 2 day+ app express dev guideOra db 2 day+ app express dev guide
Ora db 2 day+ app express dev guide
 
Oracle@cloud adapter(SFDC integration with SOA Suites12c)
Oracle@cloud adapter(SFDC integration with SOA Suites12c)Oracle@cloud adapter(SFDC integration with SOA Suites12c)
Oracle@cloud adapter(SFDC integration with SOA Suites12c)
 
Oracle service procurement manual
Oracle  service procurement manualOracle  service procurement manual
Oracle service procurement manual
 
Orac appl express guide release 4
Orac appl express guide release 4Orac appl express guide release 4
Orac appl express guide release 4
 
Manufacturing scheduling user guide
Manufacturing scheduling user guideManufacturing scheduling user guide
Manufacturing scheduling user guide
 
Oracle Enterprise Scheduler(ESS Job Scheduling)
Oracle Enterprise Scheduler(ESS Job Scheduling)Oracle Enterprise Scheduler(ESS Job Scheduling)
Oracle Enterprise Scheduler(ESS Job Scheduling)
 
Sales userguide121asnug
Sales userguide121asnugSales userguide121asnug
Sales userguide121asnug
 
Shipping execution user guide r12
Shipping execution user guide r12Shipping execution user guide r12
Shipping execution user guide r12
 
Oracle database 12c 2 day + php developer's guide
Oracle database 12c 2 day + php developer's guideOracle database 12c 2 day + php developer's guide
Oracle database 12c 2 day + php developer's guide
 
Web logic installation document
Web logic installation documentWeb logic installation document
Web logic installation document
 
Opm 11i
Opm 11iOpm 11i
Opm 11i
 
Lease mang
Lease mangLease mang
Lease mang
 

Semelhante a OG Yatra - 25 years of hints and tips

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
 
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
 
ILOUG 2019 - 18c/19c features
ILOUG 2019 - 18c/19c featuresILOUG 2019 - 18c/19c features
ILOUG 2019 - 18c/19c featuresConnor McDonald
 
ITOUG 2019 - 18c, 19c features
ITOUG 2019 - 18c, 19c featuresITOUG 2019 - 18c, 19c features
ITOUG 2019 - 18c, 19c featuresConnor 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
 
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
 
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
 
Kscope19 - Understanding the basics of SQL processing
Kscope19 - Understanding the basics of SQL processingKscope19 - Understanding the basics of SQL processing
Kscope19 - Understanding the basics of SQL processingConnor McDonald
 
General Capabilities of GraalVM by Oleg Selajev @shelajev
General Capabilities of GraalVM by Oleg Selajev @shelajevGeneral Capabilities of GraalVM by Oleg Selajev @shelajev
General Capabilities of GraalVM by Oleg Selajev @shelajevOracle Developers
 
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
 
Latin America tour 2019 - Flashback
Latin America tour 2019 -  FlashbackLatin America tour 2019 -  Flashback
Latin America tour 2019 - FlashbackConnor McDonald
 
GraalVM Native Images by Oleg Selajev @shelajev
GraalVM Native Images by Oleg Selajev @shelajevGraalVM Native Images by Oleg Selajev @shelajev
GraalVM Native Images by Oleg Selajev @shelajevOracle Developers
 
Melbourne Groundbreakers Tour - Hints and Tips
Melbourne Groundbreakers Tour - Hints and TipsMelbourne Groundbreakers Tour - Hints and Tips
Melbourne Groundbreakers Tour - Hints and TipsConnor McDonald
 
AIOUG - Groundbreakers - Jul 2019 - 19 Troubleshooting Tips and Tricks for Da...
AIOUG - Groundbreakers - Jul 2019 - 19 Troubleshooting Tips and Tricks for Da...AIOUG - Groundbreakers - Jul 2019 - 19 Troubleshooting Tips and Tricks for Da...
AIOUG - Groundbreakers - Jul 2019 - 19 Troubleshooting Tips and Tricks for Da...Sandesh Rao
 
MySQL Performance Schema in MySQL 8.0
MySQL Performance Schema in MySQL 8.0MySQL Performance Schema in MySQL 8.0
MySQL Performance Schema in MySQL 8.0Mayank Prasad
 
GraalVM: Run Programs Faster Everywhere
GraalVM: Run Programs Faster EverywhereGraalVM: Run Programs Faster Everywhere
GraalVM: Run Programs Faster EverywhereJ On The Beach
 
AUSOUG - NZOUG - Groundbreakers - Jun 2019 - 19 Troubleshooting Tips and Tric...
AUSOUG - NZOUG - Groundbreakers - Jun 2019 - 19 Troubleshooting Tips and Tric...AUSOUG - NZOUG - Groundbreakers - Jun 2019 - 19 Troubleshooting Tips and Tric...
AUSOUG - NZOUG - Groundbreakers - Jun 2019 - 19 Troubleshooting Tips and Tric...Sandesh Rao
 

Semelhante a OG Yatra - 25 years of hints and tips (20)

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
 
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
 
ILOUG 2019 - 18c/19c features
ILOUG 2019 - 18c/19c featuresILOUG 2019 - 18c/19c features
ILOUG 2019 - 18c/19c features
 
ITOUG 2019 - 18c, 19c features
ITOUG 2019 - 18c, 19c featuresITOUG 2019 - 18c, 19c features
ITOUG 2019 - 18c, 19c features
 
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
 
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
 
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
 
Kscope19 - Understanding the basics of SQL processing
Kscope19 - Understanding the basics of SQL processingKscope19 - Understanding the basics of SQL processing
Kscope19 - Understanding the basics of SQL processing
 
General Capabilities of GraalVM by Oleg Selajev @shelajev
General Capabilities of GraalVM by Oleg Selajev @shelajevGeneral Capabilities of GraalVM by Oleg Selajev @shelajev
General Capabilities of GraalVM by Oleg Selajev @shelajev
 
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
 
Latin America tour 2019 - Flashback
Latin America tour 2019 -  FlashbackLatin America tour 2019 -  Flashback
Latin America tour 2019 - Flashback
 
GraalVM Native Images by Oleg Selajev @shelajev
GraalVM Native Images by Oleg Selajev @shelajevGraalVM Native Images by Oleg Selajev @shelajev
GraalVM Native Images by Oleg Selajev @shelajev
 
Melbourne Groundbreakers Tour - Hints and Tips
Melbourne Groundbreakers Tour - Hints and TipsMelbourne Groundbreakers Tour - Hints and Tips
Melbourne Groundbreakers Tour - Hints and Tips
 
20190220 Oracle Blockchain Day公開資料
20190220 Oracle Blockchain Day公開資料20190220 Oracle Blockchain Day公開資料
20190220 Oracle Blockchain Day公開資料
 
Srishti
SrishtiSrishti
Srishti
 
AIOUG - Groundbreakers - Jul 2019 - 19 Troubleshooting Tips and Tricks for Da...
AIOUG - Groundbreakers - Jul 2019 - 19 Troubleshooting Tips and Tricks for Da...AIOUG - Groundbreakers - Jul 2019 - 19 Troubleshooting Tips and Tricks for Da...
AIOUG - Groundbreakers - Jul 2019 - 19 Troubleshooting Tips and Tricks for Da...
 
MySQL Performance Schema in MySQL 8.0
MySQL Performance Schema in MySQL 8.0MySQL Performance Schema in MySQL 8.0
MySQL Performance Schema in MySQL 8.0
 
GraalVM: Run Programs Faster Everywhere
GraalVM: Run Programs Faster EverywhereGraalVM: Run Programs Faster Everywhere
GraalVM: Run Programs Faster Everywhere
 
20190315 Oracle Cloud Friends #2 Blockchain GIG ご紹介
20190315 Oracle Cloud Friends #2  Blockchain GIG ご紹介20190315 Oracle Cloud Friends #2  Blockchain GIG ご紹介
20190315 Oracle Cloud Friends #2 Blockchain GIG ご紹介
 
AUSOUG - NZOUG - Groundbreakers - Jun 2019 - 19 Troubleshooting Tips and Tric...
AUSOUG - NZOUG - Groundbreakers - Jun 2019 - 19 Troubleshooting Tips and Tric...AUSOUG - NZOUG - Groundbreakers - Jun 2019 - 19 Troubleshooting Tips and Tric...
AUSOUG - NZOUG - Groundbreakers - Jun 2019 - 19 Troubleshooting Tips and Tric...
 

Mais de 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 - 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
 
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
 
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
 

Mais de 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 - 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
 
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
 
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
 
ANSI vs Oracle language
ANSI vs Oracle languageANSI vs Oracle language
ANSI vs Oracle language
 
KScope19 - SQL Features
KScope19 - SQL FeaturesKScope19 - SQL Features
KScope19 - SQL Features
 

Último

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 

Último (20)

TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 

OG Yatra - 25 years of hints and tips

  • 1. 22/07/2019 1 Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Connor McDonald Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 2 1 2
  • 2. 22/07/2019 2 Copyright © 2018, Oracle and/or its affiliates. All rights reserved. 3 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 :-) 3 4
  • 3. 22/07/2019 3 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. | In Memoriam 5 6
  • 4. 22/07/2019 4 25 years of tips and tricks Connor McDonald Developer Advocate Copyright © 2019, Oracle and/or its affiliates. All rights reserved. why tips and techniques ? 7 8
  • 5. 22/07/2019 5 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. SO Copyright © 2019, Oracle and/or its affiliates. All rights reserved. HERE 9 10
  • 6. 22/07/2019 6 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. IS Copyright © 2019, Oracle and/or its affiliates. All rights reserved. WHAT 11 12
  • 7. 22/07/2019 7 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. HAPPENED Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 13 14
  • 8. 22/07/2019 8 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 15 16
  • 9. 22/07/2019 9 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. maybe they were right ? Copyright © 2019, Oracle and/or its affiliates. All rights reserved. I hope not :-) 17 18
  • 10. 22/07/2019 10 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. it's not about re-invention Copyright © 2019, Oracle and/or its affiliates. All rights reserved. it's not about "RTFM" 19 20
  • 11. 22/07/2019 11 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. it's about sharing Copyright © 2019, Oracle and/or its affiliates. All rights reserved. it's about community 21 22
  • 12. 22/07/2019 12 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. that’s why Copyright © 2019, 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. 24 23 24
  • 13. 22/07/2019 13 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. | 25 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. if it's not in the documentation - contact Support - clarify usage before proceeding 25 26
  • 14. 22/07/2019 14 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 1 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. rogue session 27 28
  • 15. 22/07/2019 15 Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved. old days 29 30
  • 16. 22/07/2019 16 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. idiot in database Copyright © 2019, Oracle and/or its affiliates. All rights reserved. much more modern... 31 32
  • 17. 22/07/2019 17 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. idiot in database Copyright © 2019, Oracle and/or its affiliates. All rights reserved. SQL> alter system kill session ... 33 34
  • 18. 22/07/2019 18 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. # kill -9 pid Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 36 35 36
  • 19. 22/07/2019 19 Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved. 2 37 38
  • 20. 22/07/2019 20 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. maybe ... Copyright © 2019, Oracle and/or its affiliates. All rights reserved. ... you don't want to resume 39 40
  • 21. 22/07/2019 21 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. rogue session Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 42 41 42
  • 22. 22/07/2019 22 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. SQL> alter system kill session ... Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 44 43 44
  • 23. 22/07/2019 23 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 18c Copyright © 2019, Oracle and/or its affiliates. All rights reserved. SQL> alter system cancel sql '123,456'; 45 46
  • 24. 22/07/2019 24 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. bonus tip! Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 48 maybe killing won't help 47 48
  • 25. 22/07/2019 25 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 49 BAD SQL Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 50 bad SQL just keeps coming back... 49 50
  • 26. 22/07/2019 26 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 51 19c Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 52 automatic quarantine of bad SQL elapsed time resource consumption 51 52
  • 27. 22/07/2019 27 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 53 error on subsequent execution Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 54 1) alerts to administrator 53 54
  • 28. 22/07/2019 28 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 55 or... Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 56 2) automated historical diagnosis/repair 55 56
  • 29. 22/07/2019 29 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 3 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 58 triggers 57 58
  • 30. 22/07/2019 30 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 59 SQL> create or replace 2 trigger CHECK_SAL_ON_MON 3 after insert or update on EMP 4 for each row 5 begin 6 if updateing then 7 if new.sal > 20 and to_char(sysdate,'DY') = 'MON' 8 then 9 raise_application_error(-20000,'Too high'); 10 end if; 11 end; 12 end; Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 60 SQL> create or replace 2 trigger CHECK_SAL_ON_MON 3 after insert or update on EMP 4 for each row 5 begin 6 if updateing then 7 if new.sal > 20 and to_char(sysdate,'DY') = 'MON' 8 then 9 raise_application_error(-20000,'Too high'); 10 end if; 11 end; 12 end; LINE/COL ERROR -------- -------------------------------------------------- 2/3 PL/SQL: Statement ignored 8/9 PLS-00201: identifier 'UPDATEING' must be declared 59 60
  • 31. 22/07/2019 31 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 61 SQL> create or replace 2 trigger CHECK_SAL_ON_MON 3 after insert or update on EMP 4 for each row 5 begin 6 if updateing then 7 if new.sal > 20 and to_char(sysdate,'DY') = 'MON' 8 then 9 raise_application_error(-20000,'Too high'); 10 end if; 11 end; 12 end; LINE/COL ERROR -------- -------------------------------------------------- 3/5 PL/SQL: Statement ignored 3/11 PLS-00201: identifier 'NEW.SAL' must be declared Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 62 SQL> create or replace 2 trigger CHECK_SAL_ON_MON 3 after insert or update on EMP 4 for each row 5 begin 6 if updateing then 7 if new.sal > 20 and to_char(sysdate,'DY') = 'MON' 8 then 9 raise_application_error(-20000,'Too high'); 10 end if; 11 end; 12 end; LINE/COL ERROR -------- -------------------------------------------------- 3/5 PLS-00103: Encountered the symbol ";" when expecting one of the following: 61 62
  • 32. 22/07/2019 32 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 63 etc etc etc Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 64 EMP 63 64
  • 33. 22/07/2019 33 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 65 SQL> update EMP 2 set DEPTNO = 10 3 where EMPNO = 7365; update EMP * ERROR at line 1: ORA-04098: trigger 'SCOTT.CHECK_SAL_ON_MON' is invalid and failed re-validation Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 66 it is all dml 65 66
  • 34. 22/07/2019 34 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 67 SQL> update EMP 2 set DEPTNO = 10 3 where EMPNO = 7365; update EMP * ERROR at line 1: SQL> select * from EMP 2 where EMPNO = 7365; no rows selected Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 68 disabled triggers 67 68
  • 35. 22/07/2019 35 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 69 SQL> create or replace 2 trigger CHECK_SAL_ON_MON 3 after insert or update on EMP 4 for each row 5 DISABLE 6 begin 7 if updateing then 8 if new.sal > 20 and to_char(sysdate,'DY') = 'MON' 9 then 10 raise_application_error(-20000,'Too high'); 11 end if; 12 end; 13 end; Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 4 69 70
  • 36. 22/07/2019 36 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. tracing Copyright © 2019, Oracle and/or its affiliates. All rights reserved. alter session set sql_trace = true 71 72
  • 37. 22/07/2019 37 Copyright © 2019, 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 27/09/2018 10:21 PM 1,344 db122_ora_10492.trc Copyright © 2019, Oracle and/or its affiliates. All rights reserved. too many trace files 73 74
  • 38. 22/07/2019 38 Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved. bonus tip 75 76
  • 39. 22/07/2019 39 Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved. 5 77 78
  • 40. 22/07/2019 40 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. too much trace data Copyright © 2019, 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 79 80
  • 41. 22/07/2019 41 Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved. 6 81 82
  • 42. 22/07/2019 42 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 19c Copyright © 2019, Oracle and/or its affiliates. All rights reserved. automatic indexing 83 84
  • 43. 22/07/2019 43 Copyright © 2018, Oracle and/or its affiliates. All rights reserved. | 85 Capture Identify VerifyDecide Monitor Identify index candidates based on column usage (SQL workload) Create indexes unusable, invisible and evaluate new execution plans without parse costs Rebuild indexes that offer potential benefit (status as invisible). Test execute each SQL statement Use SPM to ensure no regression for excluded SQL statements. Mark indexes as visible Monitor all indexes (automatic and manual) for ongoing usage and potential removal Copyright © 2019, Oracle and/or its affiliates. All rights reserved. until then ... 85 86
  • 44. 22/07/2019 44 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. “I need a new index on this 6TB table...” Copyright © 2019, Oracle and/or its affiliates. All rights reserved. “will it speed up things ?” 87 88
  • 45. 22/07/2019 45 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. “I think so” Copyright © 2019, Oracle and/or its affiliates. All rights reserved. virtual indexes 89 90
  • 46. 22/07/2019 46 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. SQL> create index TEST on 2 MYTAB ( SALES_DATE ) NOSEGMENT; Index created. data dictionary only Copyright © 2019, Oracle and/or its affiliates. All rights reserved. SQL> begin 2 dbms_stats.generate_stats( 3 'SCOTT', 4 'MYTAB'); 5 end; 6 / 91 92
  • 47. 22/07/2019 47 Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved. 7 93 94
  • 48. 22/07/2019 48 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 95 invisible indexes Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 96 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. 95 96
  • 49. 22/07/2019 49 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 97 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 © 2019, Oracle and/or its affiliates. All rights reserved. 98 “Can I index OWNER..” 97 98
  • 50. 22/07/2019 50 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 99 “will it speed up things ?” Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 100 “I know so” 99 100
  • 51. 22/07/2019 51 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 101 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 © 2019, Oracle and/or its affiliates. All rights reserved. 102 101 102
  • 52. 22/07/2019 52 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 103 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 104 everyone elses queries 103 104
  • 53. 22/07/2019 53 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 105 before the new index Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 106 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)| --------------------------------------------------------------------------- 105 106
  • 54. 22/07/2019 54 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 107 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 © 2019, Oracle and/or its affiliates. All rights reserved. 108 after the new index 107 108
  • 55. 22/07/2019 55 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 109 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 © 2019, Oracle and/or its affiliates. All rights reserved. 110 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 109 110
  • 56. 22/07/2019 56 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 111 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 112 the solution ? 111 112
  • 57. 22/07/2019 57 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 113 invisible indexes Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 114 SQL> alter index NEW_IX invisible; Index altered. 113 114
  • 58. 22/07/2019 58 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 115 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 © 2019, Oracle and/or its affiliates. All rights reserved. 116 “what about my code ???” 115 116
  • 59. 22/07/2019 59 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 117 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 © 2019, Oracle and/or its affiliates. All rights reserved. 118 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)| --------------------------------------------------------------------------- 117 118
  • 60. 22/07/2019 60 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 119 wrap your SQL to protect others Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 120 statement level hint USE_INVISIBLE_INDEXES 119 120
  • 61. 22/07/2019 61 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 8 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. better data guard use... ...for free 121 122
  • 62. 22/07/2019 62 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. SQL> ALTER DATABASE CONVERT TO SNAPSHOT STANDBY; 10.2 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. open standby read/write 123 124
  • 63. 22/07/2019 63 Copyright © 2019, 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 © 2019, Oracle and/or its affiliates. All rights reserved. flashback to resetlogs 125 126
  • 64. 22/07/2019 64 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. resume managed recovery Copyright © 2019, Oracle and/or its affiliates. All rights reserved. archives still transmitted 127 128
  • 65. 22/07/2019 65 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 9 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. faster queries ... no code changes 129 130
  • 66. 22/07/2019 66 Copyright © 2019, 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 ); 131 Copyright © 2019, 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. 132 131 132
  • 67. 22/07/2019 67 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. SQL> select max(amt) 2 from cust_trans 3 where cust_id = 123; 133 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 134 133 134
  • 68. 22/07/2019 68 Copyright © 2019, 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 135 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. CUST 123 CUST 47 CUST 123 CUST 76 CUST 95 CUST 47 CUST 123 135 136
  • 69. 22/07/2019 69 Copyright © 2019, 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 137 Copyright © 2019, 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 138 137 138
  • 70. 22/07/2019 70 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 10 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. DBMS_XPLAN 151 152
  • 71. 22/07/2019 71 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. SQL> explain plan for ... SQL> select * from 2 table(dbms_xplan.display_plan) Copyright © 2019, Oracle and/or its affiliates. All rights reserved. extensions 153 154
  • 72. 22/07/2019 72 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. ... the (in)famous hint ignore issue 155 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 156 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 | -------------------------------------------------------- 155 156
  • 73. 22/07/2019 73 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 157 "I want a hash join" Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 158 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 | -------------------------------------------------------- 157 158
  • 74. 22/07/2019 74 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. ? 159 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 160 /*+ use_hash(d) */ if joining into DEPT... use a hash join 159 160
  • 75. 22/07/2019 75 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. we're not... 161 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 162 -------------------------------------------------------- | 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 | -------------------------------------------------------- 161 162
  • 76. 22/07/2019 76 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 163 if we want to join into DEPT... ...we must be starting with EMP Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 164 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 | --------------------------------------------------- 163 164
  • 77. 22/07/2019 77 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. not enough hints 165 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 166 "hints are like violence… if they do not work, use more" 165 166
  • 78. 22/07/2019 78 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. back to dbms_xplan 167 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 168 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 */ 167 168
  • 79. 22/07/2019 79 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. consider SQL Plan Management 169 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. bonus tip ! 170 169 170
  • 80. 22/07/2019 80 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 171 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 © 2019, Oracle and/or its affiliates. All rights reserved. 19c 172 171 172
  • 81. 22/07/2019 81 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 173 SQL> SELECT * 2 from table(dbms_xplan.display(.... , format=>'typical +HINT_REPORT')) Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 11 173 174
  • 82. 22/07/2019 82 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. finding bad SQL ... Copyright © 2019, Oracle and/or its affiliates. All rights reserved. ... is probably bad SQL 175 176
  • 83. 22/07/2019 83 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 177 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 © 2019, Oracle and/or its affiliates. All rights reserved. you can do better 178 177 178
  • 84. 22/07/2019 84 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 179 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 © 2019, 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)." 180 179 180
  • 85. 22/07/2019 85 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 12 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 182 sqlplus hash tags 181 182
  • 86. 22/07/2019 86 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 183 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 184 SQL> select SAL 2 from EMP 3 where "hmmmm....." 183 184
  • 87. 22/07/2019 87 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 185 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 © 2019, Oracle and/or its affiliates. All rights reserved. 186 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 185 186
  • 88. 22/07/2019 88 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 13 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 188 sqlplus error logging 187 188
  • 89. 22/07/2019 89 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 189 SQL> set errorlogging on Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 190 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 189 190
  • 90. 22/07/2019 90 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 191 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 © 2019, Oracle and/or its affiliates. All rights reserved. 192 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; 191 192
  • 91. 22/07/2019 91 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 193 installation scripts SQL> set errorlogging on SQL> @create_all_objects Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 14 193 194
  • 92. 22/07/2019 92 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 195 sqlplus / sqlcl transaction safety Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 196 195 196
  • 93. 22/07/2019 93 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 197 SQL> set exitcommit Copyright © 2019, Oracle and/or its affiliates. All rights reserved. 15 197 198
  • 94. 22/07/2019 94 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. index compression Copyright © 2019, Oracle and/or its affiliates. All rights reserved. SQL> create index IX on T ( col1, col2, col3) 2 compress 2; Index created. reduce storage for repeated keys "compress" leading columns col1, col2 = dense index blocks = better use of buffer cache 199 200
  • 95. 22/07/2019 95 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. which indexes ? Copyright © 2019, Oracle and/or its affiliates. All rights reserved. how much compression ? 201 202
  • 96. 22/07/2019 96 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. SQL> analyze index IX validate structure; Index analyzed. SQL> desc INDEX_STATS Name Null? Type ----------------------- -------- -------------- HEIGHT NUMBER BLOCKS NUMBER ... ... OPT_CMPR_COUNT NUMBER OPT_CMPR_PCTSAVE NUMBER Copyright © 2019, Oracle and/or its affiliates. All rights reserved. wrap up 203 204
  • 97. 22/07/2019 97 Copyright © 2019, Oracle and/or its affiliates. All rights reserved. poaching ideas is fine Copyright © 2019, Oracle and/or its affiliates. All rights reserved. learn something new 205 206
  • 98. 22/07/2019 98 Follow and Subscribe! youtube bit.ly/youtube-connor blog bit.ly/blog-connor twitter bit.ly/twitter-connor 207