SlideShare ist ein Scribd-Unternehmen logo
1 von 47
Downloaden Sie, um offline zu lesen
Cary Millsap
@CaryMillsap
Dallas Oracle Users Group
Oracle Database Forum
5:00p–7:00p Thursday 25 January 2018
© 2015, 2018 Cary Millsap
Performance
@carymillsap
Cary Millsap
2
Method R
TM
@carymillsap 3
Something I need to say
about performance data
@carymillsap
Surrogate measures suck.
utilizations latencies samples hit ratios
They’re too hard. Too error-prone. And too slow.
4
@carymillsap
The code path for
measuring software
belongs in your tools,
not your brain.
5
@carymillsap 6
@carymillsap wired.com 7
@carymillsap
Text
hubbelsite.org 8
@carymillsap
Relevance

Measured durations must match experienced durations.
Determinism

The data interpretation process must be deterministic, unambiguous, devoid of magic.
Integrity

Numbers must reconcile within a report, across drill-downs, across reports, etc.
Quality

There must be no unit-mixing, no chartjunk, no longjumps, etc.
9
Some requirements for measurement tools
@carymillsap
Database Total Size Total Storage
----------------- --------------- ---------------
SAD99PS 635.53 GB 1.24 TB
ANGLL 9.15 TB 18.3 TB
FRI_W1 2.14 TB 4.29 TB
DEMO 6.62 TB 13.24 TB
H111D16 7.81 TB 15.63 TB
HAANT 1.1 TB 2.2 TB
FSU 7.41 TB 14.81 TB
BYNANK 2.69 TB 5.38 TB
HDMI7 237.68 GB 476.12 GB
SXXZPP 598.49 GB 1.17 TB
TPAA 1.71 TB 3.43 TB
MAISTERS 823.96 GB 1.61 TB
p17gv_data01.dbf 800.0 GB 1.56 TB
10
Database Size (TB) Storage (TB)
---------------- --------- ------------
ANGLL 9.15 18.30
H111D16 7.81 15.63
FSU 7.41 14.81
DEMO 6.62 13.24
BYNANK 2.69 5.38
FRI_W1 2.14 4.29
TPAA 1.71 3.43
HAANT 1.10 2.20
MAISTERS .82 1.61
p17gv_data01.dbf .80 1.56
SAD99PS .64 1.24
SXXZPP .60 1.17
HDMI7 .24 .48
Example
@carymillsap
$ mrskew v11203_ora_26827.trc --rc=exp.rc --z=.05 --where='$exp_id != 0' --top=5
EXP-ID DURATION % CALLS MEAN MIN MAX
----------- --------- ------ ------ -------- -------- --------
19537 2.212251 3.5% 807 0.002741 0.000000 0.049582
27239 2.112561 3.3% 791 0.002671 0.000000 0.048360
24213 1.927336 3.0% 267 0.007218 0.000000 0.048210
16121 1.450686 2.3% 683 0.002124 0.000000 0.049147
22279 0.997744 1.6% 643 0.001552 0.000000 0.045547
323 others 55.300800 86.4% 13,841 0.003995 0.000000 0.049996
----------- --------- ------ ------ -------- -------- --------
TOTAL (328) 64.001378 100.0% 17,032 0.003758 0.000000 0.049996
$ mrskew v11203_ora_26827.trc --z=.05 —where='$exp_id == 19537'
CALL-NAME DURATION % CALLS MEAN MIN MAX
--------------------------- -------- ------ ----- -------- -------- --------
SQL*Net message from client 2.211694 100.0% 251 0.008812 0.001512 0.049582
SQL*Net message to client 0.000557 0.0% 252 0.000002 0.000001 0.000035
FETCH 0.000000 0.0% 252 0.000000 0.000000 0.000000
EXEC 0.000000 0.0% 52 0.000000 0.000000 0.000000
--------------------------- -------- ------ ----- -------- -------- --------
TOTAL (4) 2.212251 100.0% 807 0.002741 0.000000 0.049582
11
Example
@carymillsap 12
New ways to control tracing
@carymillsap
alter session set events '10046 trace name context forever, level 12'
-- Trace this session until you disable.
alter session set events '10046 trace name context off'
13
The old way
alter session set events 'sql_trace wait=true, bind=true, plan_stat=all_executions'
-- Trace this session until you disable.
alter session set events 'sql_trace off'
The new11g way
Better alter session syntax
@carymillsap 14
alter system set events 'sql_trace[sql: sql_id=ds9j6z3j9n49k|95hh6uvjgspm2] wait=true, bind=true, plan_stat=adaptive';
-- Trace statements with matching SQL IDs until you disable.
alter system set events 'sql_trace[sql: sql_id=ds9j6z3j9n49k|95hh6uvjgspm2] off';
alter system set events 'sql_trace{process: 9176} wait=true, bind=true, plan_stat=adaptive';
-- Trace the identified process until you disable.
alter system set events 'sql_trace{process: 9176} off';
alter system set events 'sql_trace{process: orapid=75} wait=true, bind=true, plan_stat=adaptive';
-- Trace the identified process until you disable.
alter system set events 'sql_trace{process: orapid=75} off';
alter system set events 'sql_trace{process: pname=smon|p0000|p0003} wait=true, bind=true, plan_stat=adaptive';
-- Trace the named processes until you disable.
alter system set events 'sql_trace{process: pname=smon|p0000|p0003} off';
alter system set events 'sql_trace[sql: sql_id=4cxhkp5ckjs6s]{process:9176} wait=true, bind=true, plan_stat=adaptive';
-- Trace the specified SQL only in the specified process until you disable.
alter system set events 'sql_trace[sql: sql_id=4cxhkp5ckjs6s]{process:9176} off';
More alter system options
@carymillsap
oradebug setmypid
oradebug event dump system
15
Showing pending traces
@carymillsap
dbms_session.session_trace_enable(…)
dbms_monitor.session_trace enable(sid, serial, …)
dbms_monitor.serv_mod_act_trace_enable(serv, mod, act, …)
16
And, of course…
@carymillsap 17
Measurement intrusion
@carymillsap
What is the performance
penalty of tracing?
18
@carymillsap
Tracing is
unnoticeable 

if you do it
right.
19
@carymillsap
What is “if you do it right”?
20
@carymillsap
You never want anyone
to perceive—fairly or
not—that tracing is
hurting your business.
21
@carymillsap
Respect the IOPS capacity of your storage
Thumb rule: ≤ 5 simultaneous traces
Make a plan for an immediate emergency trace disable
Test your tracing strategy
Trace at the right level
22
What is “if you do it right”?
@carymillsap
What is “the right level”?
23
@carymillsap
If you don’t have time to think about it, then use…
sql_trace wait=true, bind=false, plan_stat=adaptive
Using the wrong level can get you into big trouble.
24
@carymillsap
Example: A batch program is too slow. With tracing disabled, the program processes
10,000 rows in 1.222 s. However, with wait=true,bind=true tracing enabled, the
same program takes 29.342 s to process the same 10,000 rows. This is a 24×
performance penalty, which is horrifying. With wait=true,bind=false tracing
enabled, the same program processes its 10,000 rows in 1.211 s, which is within ±1%
of the trace-disabled duration.
Investigation of the trace reveals that the program’s duration is dominated nearly 100%
by a complicated update statement. The statement is parsed only once, which is good,
but each EXEC of this statement updates only one row (this, of course, is the root of the
problem). The statement’s where clause references 100 placeholders
named :b001, :b002, ..., :b100. With bind tracing disabled, we can tell that each
EXEC call consumes 0.000 122 s, but with bind tracing enabled, each EXEC call
consumes 0.002 921 s. For each call, the tracing overhead is 95.8%!
25
@carymillsap
bind=false 122 μs/row
bind=true 2,921 μs/row
(2921-122)/2921 = 95.8% overhead, 2921/122 = 24× penalty
26
The problem
@carymillsap
bind=true prints 5n + 1 lines per EXEC call.
Lots of placeholders (n) makes 2(5n + 1) large.
Application makes way too many EXEC calls.
27
Problem is a combination of three factors…
@carymillsap
Trace with wait=true,bind=false.
Now you know the application makes way too many EXEC calls.
Fix the application (process sets, not rows).
Now the application is faster.
And now you can use wait=true,bind=true.
28
Solution
@carymillsap
Don’t use bind=true
until you know it’s safe.
29
@carymillsap
Same analysis applies for
plan_stat=all_executions.
30
@carymillsap
The Magic of Interposing
31
@carymillsap
What is c?
32
@carymillsap
FETCH #46996428170184:c=281957,e=293172,p=1,cr=6244,cu=3,

mis=0,r=1,dep=0,og=1,plh=4061086508,tim=1400860472606066
33
sql_trace
@carymillsap
1
user
running
2
kernel
running
3
ready to
run
4
asleep
sys call
or interrupt
schedule
process
wakeup
context
switch
permissible
sleep
interrupt
return
return
interrupt
[Bach 1986 (31)]
34
@carymillsap
1
user
running
2
kernel
running
3
ready to
run
4
asleep
sys call
or interrupt
schedule
process
wakeup
context
switch
permissible
sleep
interrupt
return
return
interrupt
[Bach 1986 (31)]
35
What is c?

User running? Kernel running? Both?
@carymillsap
1. Use strace to find out what function Oracle
calls to calculate c.
2. Use function interposition to replace that
function; make it return what we want.
3. Trace something. See what c is.
36
What is c?
User running? Kernel running? Both?
@carymillsap 37
Oracle OS
A syscall
@carymillsap 38
Oracle OSMagic
A syscall with function interposition
@carymillsap 39
dbcall(...) {
e0 = gettime;
c0 = getrusage;
/* execute the dbcall here */
e1 = gettime;
c1 = getrusage;
e = e1 - e0;
c = c1 - c0;
write(TRC, "%s #%d:c=%d,e=%d,...",nam,cid,c,e,...);
}
Millsap: The Method R Guide to Mastering Oracle Trace Data, 2nd ed., p96
The function...
@carymillsap
static int seq = 1;
int getrusage(who, struct rusage *u) {
int r = real_getrusage(who, u);
u->ru_utime = 1 * seq;
u->ru_stime = 2 * seq;
++seq;
return r;
}
40
c0 = getrusageseq=1: utime = 1, stime = 2, utime+stime = 3
c1 = getrusageseq=2: utime = 2, stime = 4, utime+stime = 6
c1 - c0: utime = 1, stime = 2, utime+stime = 3
calls the real getrusage,Our getrusage
The interposition…
but lies about
what it returned.
@carymillsap
c0 = getrusageseq=1: utime = 1, stime = 2, utime+stime = 3
c1 = getrusageseq=2: utime = 2, stime = 4, utime+stime = 6
c1 - c0: utime = 1, stime = 2, utime+stime = 3
41
FETCH #31286428452191:c=3,e=42,p=1,cr=0,cu=0,mis=0,r=1,

dep=0,og=1,plh=8211425821,tim=1400871283103972
Therefore, c = utime+stime. QED
sql_trace
getrusage
@carymillsap
More fun with interposing
42
@carymillsap 43
Oracle sql_trace executes two write calls per line.
Let’s fix it.
Mission...
@carymillsap
write(10, "PARSE #139778455421104:c=1000,e=1304,p=0,cr=0,

cu=0,mis=0,r=0,dep=0,og=1,plh=0,tim=280953708083", 94) = 94
write(10, "n", 1)
44
strace of a sql_trace’d Oracle session
@carymillsap 45
1. Interpose all fd = open(path,…) calls:

if path is *.trc, then set trcfile = fd.
2. Interpose all write(fd,s) calls:

if (fd == trcfile) then...

if s doesn’t end with “n”, then save s;

otherwise, write deferred content and s.
A solution…
@carymillsap 46
1. Buffer trace writes (Oracle SR 3-9616334591).
2. Write your own WAIT lines into the trace file that
summarize the cost of all the sql_trace write calls.
3. Intercept unnecessary commit calls.
4. Write In-Memory DB or Exadata Storage stats from
Oracle shared memory to the sql_trace file.
Other things you could do…
@carymillsap
Discussion
47
@CaryMillsap
carymillsap.blogspot.com
www.cintra.com
method-r.com

Weitere ähnliche Inhalte

Was ist angesagt?

pstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle databasepstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle databaseRiyaj Shamsudeen
 
Agile Database Development with JSON
Agile Database Development with JSONAgile Database Development with JSON
Agile Database Development with JSONChris Saxon
 
A close encounter_with_real_world_and_odd_perf_issues
A close encounter_with_real_world_and_odd_perf_issuesA close encounter_with_real_world_and_odd_perf_issues
A close encounter_with_real_world_and_odd_perf_issuesRiyaj Shamsudeen
 
Maximal slice problem
Maximal slice problemMaximal slice problem
Maximal slice problemmininerej
 
Arna Friend Controls II Final
Arna Friend Controls II FinalArna Friend Controls II Final
Arna Friend Controls II FinalArna Friend
 
New Tuning Features in Oracle 11g - How to make your database as boring as po...
New Tuning Features in Oracle 11g - How to make your database as boring as po...New Tuning Features in Oracle 11g - How to make your database as boring as po...
New Tuning Features in Oracle 11g - How to make your database as boring as po...Sage Computing Services
 
ILOUG 2019 - SQL features for Developers
ILOUG 2019 - SQL features for DevelopersILOUG 2019 - SQL features for Developers
ILOUG 2019 - SQL features for DevelopersConnor McDonald
 
Whose fault is it? - a review of application tuning problems
Whose fault is it? - a review of application tuning problemsWhose fault is it? - a review of application tuning problems
Whose fault is it? - a review of application tuning problemsSage Computing Services
 
Yin & Yang: Demonstrating complementary provenance from noWorkflow & YesWorkflow
Yin & Yang: Demonstrating complementary provenance from noWorkflow & YesWorkflowYin & Yang: Demonstrating complementary provenance from noWorkflow & YesWorkflow
Yin & Yang: Demonstrating complementary provenance from noWorkflow & YesWorkflowBertram Ludäscher
 

Was ist angesagt? (12)

Efficient Programs
Efficient ProgramsEfficient Programs
Efficient Programs
 
pstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle databasepstack, truss etc to understand deeper issues in Oracle database
pstack, truss etc to understand deeper issues in Oracle database
 
Aspects of 10 Tuning
Aspects of 10 TuningAspects of 10 Tuning
Aspects of 10 Tuning
 
Agile Database Development with JSON
Agile Database Development with JSONAgile Database Development with JSON
Agile Database Development with JSON
 
A close encounter_with_real_world_and_odd_perf_issues
A close encounter_with_real_world_and_odd_perf_issuesA close encounter_with_real_world_and_odd_perf_issues
A close encounter_with_real_world_and_odd_perf_issues
 
Maximal slice problem
Maximal slice problemMaximal slice problem
Maximal slice problem
 
Arna Friend Controls II Final
Arna Friend Controls II FinalArna Friend Controls II Final
Arna Friend Controls II Final
 
New Tuning Features in Oracle 11g - How to make your database as boring as po...
New Tuning Features in Oracle 11g - How to make your database as boring as po...New Tuning Features in Oracle 11g - How to make your database as boring as po...
New Tuning Features in Oracle 11g - How to make your database as boring as po...
 
ILOUG 2019 - SQL features for Developers
ILOUG 2019 - SQL features for DevelopersILOUG 2019 - SQL features for Developers
ILOUG 2019 - SQL features for Developers
 
Whose fault is it? - a review of application tuning problems
Whose fault is it? - a review of application tuning problemsWhose fault is it? - a review of application tuning problems
Whose fault is it? - a review of application tuning problems
 
ScalaMeter 2012
ScalaMeter 2012ScalaMeter 2012
ScalaMeter 2012
 
Yin & Yang: Demonstrating complementary provenance from noWorkflow & YesWorkflow
Yin & Yang: Demonstrating complementary provenance from noWorkflow & YesWorkflowYin & Yang: Demonstrating complementary provenance from noWorkflow & YesWorkflow
Yin & Yang: Demonstrating complementary provenance from noWorkflow & YesWorkflow
 

Ähnlich wie Cary Millsap Performance Forum Presentation on Oracle Database Tracing Techniques

Sangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestSangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestConnor McDonald
 
Monitoring Complex Systems: Keeping Your Head on Straight in a Hard World
Monitoring Complex Systems: Keeping Your Head on Straight in a Hard WorldMonitoring Complex Systems: Keeping Your Head on Straight in a Hard World
Monitoring Complex Systems: Keeping Your Head on Straight in a Hard WorldBrian Troutwine
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersConnor McDonald
 
Adaptive Query Optimization
Adaptive Query OptimizationAdaptive Query Optimization
Adaptive Query OptimizationAnju Garg
 
Databse & Technology 2 | Connor McDonald | Managing Optimiser Statistics - A ...
Databse & Technology 2 | Connor McDonald | Managing Optimiser Statistics - A ...Databse & Technology 2 | Connor McDonald | Managing Optimiser Statistics - A ...
Databse & Technology 2 | Connor McDonald | Managing Optimiser Statistics - A ...InSync2011
 
Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Ontico
 
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
 
Oracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatOracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatFranck Pachot
 
Scylla Summit 2017: Cry in the Dojo, Laugh in the Battlefield: How We Constan...
Scylla Summit 2017: Cry in the Dojo, Laugh in the Battlefield: How We Constan...Scylla Summit 2017: Cry in the Dojo, Laugh in the Battlefield: How We Constan...
Scylla Summit 2017: Cry in the Dojo, Laugh in the Battlefield: How We Constan...ScyllaDB
 
Autonomic Resource Provisioning for Cloud-Based Software
Autonomic Resource Provisioning for Cloud-Based SoftwareAutonomic Resource Provisioning for Cloud-Based Software
Autonomic Resource Provisioning for Cloud-Based SoftwarePooyan Jamshidi
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging RubyAman Gupta
 
Recent my sql_performance Test detail
Recent my sql_performance Test detailRecent my sql_performance Test detail
Recent my sql_performance Test detailLouis liu
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersConnor McDonald
 
Parallel R in snow (english after 2nd slide)
Parallel R in snow (english after 2nd slide)Parallel R in snow (english after 2nd slide)
Parallel R in snow (english after 2nd slide)Cdiscount
 
SQL Tuning 101 - Sep 2013
SQL Tuning 101 - Sep 2013SQL Tuning 101 - Sep 2013
SQL Tuning 101 - Sep 2013Connor McDonald
 

Ähnlich wie Cary Millsap Performance Forum Presentation on Oracle Database Tracing Techniques (20)

Sangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolestSangam 19 - PLSQL still the coolest
Sangam 19 - PLSQL still the coolest
 
Monitoring Complex Systems: Keeping Your Head on Straight in a Hard World
Monitoring Complex Systems: Keeping Your Head on Straight in a Hard WorldMonitoring Complex Systems: Keeping Your Head on Straight in a Hard World
Monitoring Complex Systems: Keeping Your Head on Straight in a Hard World
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer Disasters
 
Mysql tracing
Mysql tracingMysql tracing
Mysql tracing
 
Mysql tracing
Mysql tracingMysql tracing
Mysql tracing
 
Performance tests - it's a trap
Performance tests - it's a trapPerformance tests - it's a trap
Performance tests - it's a trap
 
Adaptive Query Optimization
Adaptive Query OptimizationAdaptive Query Optimization
Adaptive Query Optimization
 
Databse & Technology 2 | Connor McDonald | Managing Optimiser Statistics - A ...
Databse & Technology 2 | Connor McDonald | Managing Optimiser Statistics - A ...Databse & Technology 2 | Connor McDonald | Managing Optimiser Statistics - A ...
Databse & Technology 2 | Connor McDonald | Managing Optimiser Statistics - A ...
 
Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)Performance tweaks and tools for Linux (Joe Damato)
Performance tweaks and tools for Linux (Joe Damato)
 
6
66
6
 
Sherlock holmes for dba’s
Sherlock holmes for dba’sSherlock holmes for dba’s
Sherlock holmes for dba’s
 
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
 
Oracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor formatOracle dbms_xplan.display_cursor format
Oracle dbms_xplan.display_cursor format
 
Scylla Summit 2017: Cry in the Dojo, Laugh in the Battlefield: How We Constan...
Scylla Summit 2017: Cry in the Dojo, Laugh in the Battlefield: How We Constan...Scylla Summit 2017: Cry in the Dojo, Laugh in the Battlefield: How We Constan...
Scylla Summit 2017: Cry in the Dojo, Laugh in the Battlefield: How We Constan...
 
Autonomic Resource Provisioning for Cloud-Based Software
Autonomic Resource Provisioning for Cloud-Based SoftwareAutonomic Resource Provisioning for Cloud-Based Software
Autonomic Resource Provisioning for Cloud-Based Software
 
Debugging Ruby
Debugging RubyDebugging Ruby
Debugging Ruby
 
Recent my sql_performance Test detail
Recent my sql_performance Test detailRecent my sql_performance Test detail
Recent my sql_performance Test detail
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developers
 
Parallel R in snow (english after 2nd slide)
Parallel R in snow (english after 2nd slide)Parallel R in snow (english after 2nd slide)
Parallel R in snow (english after 2nd slide)
 
SQL Tuning 101 - Sep 2013
SQL Tuning 101 - Sep 2013SQL Tuning 101 - Sep 2013
SQL Tuning 101 - Sep 2013
 

Mehr von Cary Millsap

“Performance” - Dallas Oracle Users Group 2019-01-29 presentation
“Performance” - Dallas Oracle Users Group 2019-01-29 presentation“Performance” - Dallas Oracle Users Group 2019-01-29 presentation
“Performance” - Dallas Oracle Users Group 2019-01-29 presentationCary Millsap
 
Innovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and MonitoringInnovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and MonitoringCary Millsap
 
The Most Important Things You Should Know about Oracle®
The Most Important Things You Should Know about Oracle®The Most Important Things You Should Know about Oracle®
The Most Important Things You Should Know about Oracle®Cary Millsap
 
How to find and fix your Oracle-based application performance problem
How to find and fix your Oracle-based application performance problemHow to find and fix your Oracle-based application performance problem
How to find and fix your Oracle-based application performance problemCary Millsap
 
How to find and fix your Oracle-based application performance problem
How to find and fix your Oracle-based application performance problemHow to find and fix your Oracle-based application performance problem
How to find and fix your Oracle-based application performance problemCary Millsap
 
How to find and fix your Oracle application performance problem
How to find and fix your Oracle application performance problemHow to find and fix your Oracle application performance problem
How to find and fix your Oracle application performance problemCary Millsap
 
Diagnosability versus The Cloud, Redwood Shores 2011-08-30
Diagnosability versus The Cloud, Redwood Shores 2011-08-30Diagnosability versus The Cloud, Redwood Shores 2011-08-30
Diagnosability versus The Cloud, Redwood Shores 2011-08-30Cary Millsap
 
Diagnosability versus The Cloud, Toronto 2011-04-21
Diagnosability versus The Cloud, Toronto 2011-04-21Diagnosability versus The Cloud, Toronto 2011-04-21
Diagnosability versus The Cloud, Toronto 2011-04-21Cary Millsap
 

Mehr von Cary Millsap (9)

“Performance” - Dallas Oracle Users Group 2019-01-29 presentation
“Performance” - Dallas Oracle Users Group 2019-01-29 presentation“Performance” - Dallas Oracle Users Group 2019-01-29 presentation
“Performance” - Dallas Oracle Users Group 2019-01-29 presentation
 
Innovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and MonitoringInnovative Specifications for Better Performance Logging and Monitoring
Innovative Specifications for Better Performance Logging and Monitoring
 
The Most Important Things You Should Know about Oracle®
The Most Important Things You Should Know about Oracle®The Most Important Things You Should Know about Oracle®
The Most Important Things You Should Know about Oracle®
 
How to find and fix your Oracle-based application performance problem
How to find and fix your Oracle-based application performance problemHow to find and fix your Oracle-based application performance problem
How to find and fix your Oracle-based application performance problem
 
How to find and fix your Oracle-based application performance problem
How to find and fix your Oracle-based application performance problemHow to find and fix your Oracle-based application performance problem
How to find and fix your Oracle-based application performance problem
 
How to find and fix your Oracle application performance problem
How to find and fix your Oracle application performance problemHow to find and fix your Oracle application performance problem
How to find and fix your Oracle application performance problem
 
My Case for Agile
My Case for AgileMy Case for Agile
My Case for Agile
 
Diagnosability versus The Cloud, Redwood Shores 2011-08-30
Diagnosability versus The Cloud, Redwood Shores 2011-08-30Diagnosability versus The Cloud, Redwood Shores 2011-08-30
Diagnosability versus The Cloud, Redwood Shores 2011-08-30
 
Diagnosability versus The Cloud, Toronto 2011-04-21
Diagnosability versus The Cloud, Toronto 2011-04-21Diagnosability versus The Cloud, Toronto 2011-04-21
Diagnosability versus The Cloud, Toronto 2011-04-21
 

Kürzlich hochgeladen

(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 

Kürzlich hochgeladen (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Exploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the ProcessExploring iOS App Development: Simplifying the Process
Exploring iOS App Development: Simplifying the Process
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 

Cary Millsap Performance Forum Presentation on Oracle Database Tracing Techniques

  • 1. Cary Millsap @CaryMillsap Dallas Oracle Users Group Oracle Database Forum 5:00p–7:00p Thursday 25 January 2018 © 2015, 2018 Cary Millsap Performance
  • 3. @carymillsap 3 Something I need to say about performance data
  • 4. @carymillsap Surrogate measures suck. utilizations latencies samples hit ratios They’re too hard. Too error-prone. And too slow. 4
  • 5. @carymillsap The code path for measuring software belongs in your tools, not your brain. 5
  • 9. @carymillsap Relevance
 Measured durations must match experienced durations. Determinism
 The data interpretation process must be deterministic, unambiguous, devoid of magic. Integrity
 Numbers must reconcile within a report, across drill-downs, across reports, etc. Quality
 There must be no unit-mixing, no chartjunk, no longjumps, etc. 9 Some requirements for measurement tools
  • 10. @carymillsap Database Total Size Total Storage ----------------- --------------- --------------- SAD99PS 635.53 GB 1.24 TB ANGLL 9.15 TB 18.3 TB FRI_W1 2.14 TB 4.29 TB DEMO 6.62 TB 13.24 TB H111D16 7.81 TB 15.63 TB HAANT 1.1 TB 2.2 TB FSU 7.41 TB 14.81 TB BYNANK 2.69 TB 5.38 TB HDMI7 237.68 GB 476.12 GB SXXZPP 598.49 GB 1.17 TB TPAA 1.71 TB 3.43 TB MAISTERS 823.96 GB 1.61 TB p17gv_data01.dbf 800.0 GB 1.56 TB 10 Database Size (TB) Storage (TB) ---------------- --------- ------------ ANGLL 9.15 18.30 H111D16 7.81 15.63 FSU 7.41 14.81 DEMO 6.62 13.24 BYNANK 2.69 5.38 FRI_W1 2.14 4.29 TPAA 1.71 3.43 HAANT 1.10 2.20 MAISTERS .82 1.61 p17gv_data01.dbf .80 1.56 SAD99PS .64 1.24 SXXZPP .60 1.17 HDMI7 .24 .48 Example
  • 11. @carymillsap $ mrskew v11203_ora_26827.trc --rc=exp.rc --z=.05 --where='$exp_id != 0' --top=5 EXP-ID DURATION % CALLS MEAN MIN MAX ----------- --------- ------ ------ -------- -------- -------- 19537 2.212251 3.5% 807 0.002741 0.000000 0.049582 27239 2.112561 3.3% 791 0.002671 0.000000 0.048360 24213 1.927336 3.0% 267 0.007218 0.000000 0.048210 16121 1.450686 2.3% 683 0.002124 0.000000 0.049147 22279 0.997744 1.6% 643 0.001552 0.000000 0.045547 323 others 55.300800 86.4% 13,841 0.003995 0.000000 0.049996 ----------- --------- ------ ------ -------- -------- -------- TOTAL (328) 64.001378 100.0% 17,032 0.003758 0.000000 0.049996 $ mrskew v11203_ora_26827.trc --z=.05 —where='$exp_id == 19537' CALL-NAME DURATION % CALLS MEAN MIN MAX --------------------------- -------- ------ ----- -------- -------- -------- SQL*Net message from client 2.211694 100.0% 251 0.008812 0.001512 0.049582 SQL*Net message to client 0.000557 0.0% 252 0.000002 0.000001 0.000035 FETCH 0.000000 0.0% 252 0.000000 0.000000 0.000000 EXEC 0.000000 0.0% 52 0.000000 0.000000 0.000000 --------------------------- -------- ------ ----- -------- -------- -------- TOTAL (4) 2.212251 100.0% 807 0.002741 0.000000 0.049582 11 Example
  • 12. @carymillsap 12 New ways to control tracing
  • 13. @carymillsap alter session set events '10046 trace name context forever, level 12' -- Trace this session until you disable. alter session set events '10046 trace name context off' 13 The old way alter session set events 'sql_trace wait=true, bind=true, plan_stat=all_executions' -- Trace this session until you disable. alter session set events 'sql_trace off' The new11g way Better alter session syntax
  • 14. @carymillsap 14 alter system set events 'sql_trace[sql: sql_id=ds9j6z3j9n49k|95hh6uvjgspm2] wait=true, bind=true, plan_stat=adaptive'; -- Trace statements with matching SQL IDs until you disable. alter system set events 'sql_trace[sql: sql_id=ds9j6z3j9n49k|95hh6uvjgspm2] off'; alter system set events 'sql_trace{process: 9176} wait=true, bind=true, plan_stat=adaptive'; -- Trace the identified process until you disable. alter system set events 'sql_trace{process: 9176} off'; alter system set events 'sql_trace{process: orapid=75} wait=true, bind=true, plan_stat=adaptive'; -- Trace the identified process until you disable. alter system set events 'sql_trace{process: orapid=75} off'; alter system set events 'sql_trace{process: pname=smon|p0000|p0003} wait=true, bind=true, plan_stat=adaptive'; -- Trace the named processes until you disable. alter system set events 'sql_trace{process: pname=smon|p0000|p0003} off'; alter system set events 'sql_trace[sql: sql_id=4cxhkp5ckjs6s]{process:9176} wait=true, bind=true, plan_stat=adaptive'; -- Trace the specified SQL only in the specified process until you disable. alter system set events 'sql_trace[sql: sql_id=4cxhkp5ckjs6s]{process:9176} off'; More alter system options
  • 15. @carymillsap oradebug setmypid oradebug event dump system 15 Showing pending traces
  • 16. @carymillsap dbms_session.session_trace_enable(…) dbms_monitor.session_trace enable(sid, serial, …) dbms_monitor.serv_mod_act_trace_enable(serv, mod, act, …) 16 And, of course…
  • 18. @carymillsap What is the performance penalty of tracing? 18
  • 20. @carymillsap What is “if you do it right”? 20
  • 21. @carymillsap You never want anyone to perceive—fairly or not—that tracing is hurting your business. 21
  • 22. @carymillsap Respect the IOPS capacity of your storage Thumb rule: ≤ 5 simultaneous traces Make a plan for an immediate emergency trace disable Test your tracing strategy Trace at the right level 22 What is “if you do it right”?
  • 23. @carymillsap What is “the right level”? 23
  • 24. @carymillsap If you don’t have time to think about it, then use… sql_trace wait=true, bind=false, plan_stat=adaptive Using the wrong level can get you into big trouble. 24
  • 25. @carymillsap Example: A batch program is too slow. With tracing disabled, the program processes 10,000 rows in 1.222 s. However, with wait=true,bind=true tracing enabled, the same program takes 29.342 s to process the same 10,000 rows. This is a 24× performance penalty, which is horrifying. With wait=true,bind=false tracing enabled, the same program processes its 10,000 rows in 1.211 s, which is within ±1% of the trace-disabled duration. Investigation of the trace reveals that the program’s duration is dominated nearly 100% by a complicated update statement. The statement is parsed only once, which is good, but each EXEC of this statement updates only one row (this, of course, is the root of the problem). The statement’s where clause references 100 placeholders named :b001, :b002, ..., :b100. With bind tracing disabled, we can tell that each EXEC call consumes 0.000 122 s, but with bind tracing enabled, each EXEC call consumes 0.002 921 s. For each call, the tracing overhead is 95.8%! 25
  • 26. @carymillsap bind=false 122 μs/row bind=true 2,921 μs/row (2921-122)/2921 = 95.8% overhead, 2921/122 = 24× penalty 26 The problem
  • 27. @carymillsap bind=true prints 5n + 1 lines per EXEC call. Lots of placeholders (n) makes 2(5n + 1) large. Application makes way too many EXEC calls. 27 Problem is a combination of three factors…
  • 28. @carymillsap Trace with wait=true,bind=false. Now you know the application makes way too many EXEC calls. Fix the application (process sets, not rows). Now the application is faster. And now you can use wait=true,bind=true. 28 Solution
  • 29. @carymillsap Don’t use bind=true until you know it’s safe. 29
  • 30. @carymillsap Same analysis applies for plan_stat=all_executions. 30
  • 31. @carymillsap The Magic of Interposing 31
  • 34. @carymillsap 1 user running 2 kernel running 3 ready to run 4 asleep sys call or interrupt schedule process wakeup context switch permissible sleep interrupt return return interrupt [Bach 1986 (31)] 34
  • 35. @carymillsap 1 user running 2 kernel running 3 ready to run 4 asleep sys call or interrupt schedule process wakeup context switch permissible sleep interrupt return return interrupt [Bach 1986 (31)] 35 What is c?
 User running? Kernel running? Both?
  • 36. @carymillsap 1. Use strace to find out what function Oracle calls to calculate c. 2. Use function interposition to replace that function; make it return what we want. 3. Trace something. See what c is. 36 What is c? User running? Kernel running? Both?
  • 38. @carymillsap 38 Oracle OSMagic A syscall with function interposition
  • 39. @carymillsap 39 dbcall(...) { e0 = gettime; c0 = getrusage; /* execute the dbcall here */ e1 = gettime; c1 = getrusage; e = e1 - e0; c = c1 - c0; write(TRC, "%s #%d:c=%d,e=%d,...",nam,cid,c,e,...); } Millsap: The Method R Guide to Mastering Oracle Trace Data, 2nd ed., p96 The function...
  • 40. @carymillsap static int seq = 1; int getrusage(who, struct rusage *u) { int r = real_getrusage(who, u); u->ru_utime = 1 * seq; u->ru_stime = 2 * seq; ++seq; return r; } 40 c0 = getrusageseq=1: utime = 1, stime = 2, utime+stime = 3 c1 = getrusageseq=2: utime = 2, stime = 4, utime+stime = 6 c1 - c0: utime = 1, stime = 2, utime+stime = 3 calls the real getrusage,Our getrusage The interposition… but lies about what it returned.
  • 41. @carymillsap c0 = getrusageseq=1: utime = 1, stime = 2, utime+stime = 3 c1 = getrusageseq=2: utime = 2, stime = 4, utime+stime = 6 c1 - c0: utime = 1, stime = 2, utime+stime = 3 41 FETCH #31286428452191:c=3,e=42,p=1,cr=0,cu=0,mis=0,r=1,
 dep=0,og=1,plh=8211425821,tim=1400871283103972 Therefore, c = utime+stime. QED sql_trace getrusage
  • 42. @carymillsap More fun with interposing 42
  • 43. @carymillsap 43 Oracle sql_trace executes two write calls per line. Let’s fix it. Mission...
  • 45. @carymillsap 45 1. Interpose all fd = open(path,…) calls:
 if path is *.trc, then set trcfile = fd. 2. Interpose all write(fd,s) calls:
 if (fd == trcfile) then...
 if s doesn’t end with “n”, then save s;
 otherwise, write deferred content and s. A solution…
  • 46. @carymillsap 46 1. Buffer trace writes (Oracle SR 3-9616334591). 2. Write your own WAIT lines into the trace file that summarize the cost of all the sql_trace write calls. 3. Intercept unnecessary commit calls. 4. Write In-Memory DB or Exadata Storage stats from Oracle shared memory to the sql_trace file. Other things you could do…