Académique Documents
Professionnel Documents
Culture Documents
www.enkitec.com
Intro:
About
me
Tanel
Pder
Former
Oracle
Database
Performance
geek
Present
Exadata
Performance
geek
;-)
My
Exadata
experience
I
have
had
the
luck
to
work
with
all
possible
Exadata
conguraSons
out
there
Exadata
V1
X3
MulS-rack
Exadatas
Even
a
mixed
rack
Exadata
(V2
<->
X2-2
:)
About
Enkitec
Enkitec
LP
North America
Enkitec
Europe
EMEA
90+ sta
In
US,
Europe
Consultants
with
Oracle
experience
of
15+
years
on
average
Exadata-specic services
Everything
Exadata
Planning/PoC
ImplementaSon
ConsolidaSon
MigraSon
Backup/Recovery
Patching
TroubleshooSng
Performance
Capacity
Training
Agenda
1. Finding
non-Exadata
friendly
SQL
2. A
li=le
bit
of
Smart
Scan
internals
3. Reading
a
SQL
Monitoring
report
on
Exadata
www.enkitec.com
OLTP
www.enkitec.com
Intro
www.enkitec.com
OpSon
2:
Find
SQLs
doing
the
most
disk
reads
without
Smart
Scans
Highest
MB
read
or
highest
IOPS
a)
ASH!
b)
SUM(DELTA_READ_IO_REQUESTS)
SUM(DELTA_READ_IO_BYTES)
SUM(PHYSICAL_READ_REQUESTS_DELTA)
SUM(PHYSICAL_READ_BYTES_DELTA)
www.enkitec.com
Heres
an
analogy:
1. Want
to
deliver
a
single
parcel
to
a
desSnaSon
Use a Ferrari
Use a truck
Brute
force
scanning
with
relaSvely
high
inerSa
to
get
started,
not
a
few
quick
(buered)
I/O
operaSons
done
with
surgical
precision
www.enkitec.com
Demo
exafriendly.sql
Drill
down
into
ASH
wait
data:
SQL> @exadata/exafriendly.sql gv$active_session_history
SESSION WAIT_CLASS
EVENT
SECONDS
PCT
------- -------------------- ---------------------------------------- ---------- ------
ON CPU
192356
34.6
WAITING User I/O
cell single block physical read
191838
34.5
WAITING User I/O
db file parallel read
40577
7.3
WAITING User I/O
cell smart table scan
28593
5.1
WAITING User I/O
cell multiblock physical read
19424
3.5
WAITING User I/O
direct path read temp
18398
3.3
WAITING Application
enq: RO - fast object reuse
8690
1.6
WAITING User I/O
direct path read
5812
1.0
...
PLAN_LINE
USERNAME
EVENT
SECONDS
PCT
------------------------------------- ------------ ---------------------------------- --------- ------
TABLE ACCESS BY LOCAL INDEX ROWID
USER_104
cell single block physical read
40954
21.3
TABLE ACCESS BY INDEX ROWID
USER_779
cell single block physical read
32129
16.7
INDEX RANGE SCAN
USER_104
cell single block physical read
25272
13.2
TABLE ACCESS STORAGE FULL
USER_49
cell single block physical read
9258
4.8
INDEX RANGE SCAN
USER_779
cell single block physical read
4118
2.1
TABLE ACCESS STORAGE FULL
USER_783
cell single block physical read
3641
1.9
UPDATE
USER_104
cell single block physical read
3509
1.8
TABLE ACCESS BY INDEX ROWID
USER_420
cell single block physical read
3341
1.7
MERGE
USER_962
www.enkitec.com
2910
1.5
Demo
mon_topsql.sql
TOP
Time-consuming
SQLs
with
IO
&
execuSon
counts
That
way
well
separate
the
Ferraris
from
Freight
Trains!
The
Ferraris
arent
Exadata
smart
scan
friendly
www.enkitec.com
10
www.enkitec.com
11
Exadata
Architecture
All
DB
nodes
talk
to
all
(congured)
cells
-
ASM
striped
data
A
cell
never
talks
to
another
cell
!!!
DB Node 1
Cell 1
Cell 2
DB Node 2
Cell 3
DB Node 3
Cell 4
www.enkitec.com
Cell 5
DB Node 4
Cell 6
Cell 7
12
13
Cell Layer
Database Layer
A
large
table
Smart
Scan
Cell 1
Cell 2
Cell 3
Cell 4
www.enkitec.com
Cell 5
Cell 6
Cell 7
14
Im
leaving
ash
cache
out
for
simplicity
for
now
However,
Index
scans
can
read
only
a
subset
of
data
15
????
www.enkitec.com
?
16
Processing
Stage
Temp IO
Flash Reads
Disk Read MB
Reads avoided
SorSng,
aggregaSon,
joins
etc
Bugs,
chained
rows,
migrated
rows,
read
consistency
Storage
indexes
Compressed
Data
Uncompressed
Data
Data
Volume
www.enkitec.com
17
www.enkitec.com
18
Why 6 GB?
2 + 2 = 4 GB
19
@exadata/exasnap.sql
Beta
quality
Meant
to
complement
ASH
and
SQL
Monitoring
reports,
not
replace
them
www.enkitec.com
20
www.enkitec.com
21
22
www.enkitec.com
23
ExecuSon
plan!
Where
is
most
of
the
response
Sme
spent
(retrieval
vs.
subsequent
processing)
Are
smart
scans
used
for
data
retrieval?
IO
MB
read
from
disks
vs
data
returned
from
the
cells
(also
called
the
ooad
eciency
raSo
but
knowing
the
underlying
numbers
is
way
be=er)
2. ExaSnapper
www.enkitec.com
24
www.enkitec.com
25
www.enkitec.com
26
www.enkitec.com
27
Smart
scan
will
help!
www.enkitec.com
28
www.enkitec.com
29
www.enkitec.com
30
Checkpoint
Smart
Scans
make
the
data
retrieval
from
storage
faster
Any
other
problems
require
the
usual
SQL
&
DB
opSmizaSon
www.enkitec.com
31
Smart Scans do not make any of these things faster (by design):
*
A
prerequisite
for
smart
scans
is
a
full
segment
scan
anyway
32
www.enkitec.com
33
FAST ~ 2 seconds
-----------------------------------------------
| Id | Operation
| Name
|
-----------------------------------------------
| 0 | SELECT STATEMENT
|
|
| 1 | SORT AGGREGATE
|
|
|* 2 |
TABLE ACCESS STORAGE FULL| CUSTOMERS |
-----------------------------------------------
-----------------------------------------------
Predicate Information
---------------------------------------------
2 - storage("CUST_FIRST_NAME" LIKE 'j%')
filter("CUST_FIRST_NAME" LIKE 'j%')
Predicate Information
----------------------------------------------
2 - filter(NLSSORT
("OWNER",'nls_sort=''BINARY_CI''')
>HEXTORAW('7300) )
Wheres
the
storage
predicate?
www.enkitec.com
34
FAST 2 seconds
Case3:
SLOW 14 seconds
www.enkitec.com
35
h=p://blog.tanelpoder.com/seminar/
Well
go
very
deep!
Enkitec
Extreme
Exadata
Expo
(E4)
August
5-6
2013
-
lots
of
great
speakers!
->
h=p://enkitec.com/e4
www.enkitec.com
36