This document discusses using sampling to diagnose buffer busy wait issues in an Oracle database. It provides an example of using the v$session_wait view to identify the specific buffer busy wait type, file, and block number involved. This allows finding the impacted object and SQL statement. The example identifies an insert statement on a table with a single freelist as the cause. It recommends adding more freelists to improve concurrency for inserts on that table.
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeJeff Frost
Let's face it, major version upgrades can be a pain. Most people are familiar with the dump/restore method, but if your database happens to be larger than a few GB, the downtime required for dump/restore is likely going to exceed your maximum maintenance window.
We'll briefly explore upgrade options including dump/restore, pg_upgrade and logical replication tools like Slony and why I think Slony is currently the best option. Then we'll run through a tutorial on how to use slony for a major version upgrade with minimal downtime.
You can find the scripts used in the demos here:
https://github.com/jfrost/scale-15x-talk
MySQL exposes a collection of tunable parameters and indicators that is frankly intimidating. But a poorly tuned MySQL server is a bottleneck for your PHP application scalability. This session shows how to do InnoDB tuning and read the InnoDB status report in MySQL 5.5.
DataStax: An Introduction to DataStax Enterprise SearchDataStax Academy
1) Why We Built DSE Search
2) Basics of the Read and Write Paths
3) Fault-tolerance and Adaptive Routing
4) Analytics with Search and Spark
5) Live Indexing
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeJeff Frost
Let's face it, major version upgrades can be a pain. Most people are familiar with the dump/restore method, but if your database happens to be larger than a few GB, the downtime required for dump/restore is likely going to exceed your maximum maintenance window.
We'll briefly explore upgrade options including dump/restore, pg_upgrade and logical replication tools like Slony and why I think Slony is currently the best option. Then we'll run through a tutorial on how to use slony for a major version upgrade with minimal downtime.
You can find the scripts used in the demos here:
https://github.com/jfrost/scale-15x-talk
MySQL exposes a collection of tunable parameters and indicators that is frankly intimidating. But a poorly tuned MySQL server is a bottleneck for your PHP application scalability. This session shows how to do InnoDB tuning and read the InnoDB status report in MySQL 5.5.
DataStax: An Introduction to DataStax Enterprise SearchDataStax Academy
1) Why We Built DSE Search
2) Basics of the Read and Write Paths
3) Fault-tolerance and Adaptive Routing
4) Analytics with Search and Spark
5) Live Indexing
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsJohn Kanagaraj
Oracle Database 10g brought in a slew of tuning and performance related tools and indeed a new way of dealing with performance issues. Even though 10g has been around for a while, many DBAs haven’t really used many of the new features, mostly because they are not well known or understood. In this Expert session, we will look past the slick demos of the new tuning and performance related tools and go “under the hood”. Using this knowledge, we will bypass the GUI and look at the views and counters that matter and quickly understand what they are saying. Tools covered include AWR, ADDM, ASH, Metrics, Tuning Advisors and their related views. Much of information about Oracle Database 10g presented in this paper has been adapted from my book and I acknowledge that with gratitude to my publisher - SAMS (Pearson).
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTanel Poder
From Tanel Poder's Troubleshooting Complex Performance Issues series - an example of Oracle SEG$ internal segment contention due to some direct path insert activity.
OpenWorld 2018 - Common Application Developer DisastersConnor McDonald
Two of the critical requirements of a database are:
- run fast
- data integrity
The database can achieve these things, but only as long as you understand the mechanisms correctly. If you don't, then things can go downhill fast.
Troubleshooting Complex Oracle Performance Problems with Tanel PoderTanel Poder
Troubleshooting Complex Oracle Performance Problems hacking session & presentation by Tanel Poder.
This presentation is about a complex performance issue where the initial symptoms pointed somewhere else than the root cause. Only when systematically following through the troubleshooting drilldown method, we get to the root cause of the problem. This session aims to help you understand (and reason about) the Oracle’s multi-process & multi-layer system behavior, preparing you for independent troubleshooting of such complex performance issues in the future.
Video recordings of this presentation are in my YouTube channel:
1) Hacking Session: https://www.youtube.com/watch?v=INQewGJMdCI
2) Presentation: https://www.youtube.com/watch?v=aaHZ8A8Ygdg
Tanel's blog and training information: https://blog.tanelpoder.com/seminar
Similar to Oracle 10g Performance: chapter 00 sampling (20)
Successfully convince people with data visualizationKyle Hailey
Successfully convince people with data visualization
video of presentation available at https://www.youtube.com/watch?v=3PKjNnt14mk
from Data by the Bay conference
2. Example on 9i
Slowdown on Database
Look at Statspack:
Top 5 Timed Events
~~~~~~~~~~~~~~~~~~ % Total
Event Waits Time (s) Call Time
--------------------------- ----------- ---------
buffer busy waits 2,748 250 78.72
CPU time 32 10.16
free buffer waits 1,588 15 4.63
write complete waits 10 8 2.51
log buffer space 306 5 1.51
-------------------------------
Copyright 2006 Kyle Hailey
3. What do we do?
How do we solve “buffer busy wait”
Need:
SQL
Sessions
Objects
Wait details
Type of buffer busy wait
File and block numbers
How do we get that information?
Not from Statspack
But from v$session_wait
And v$session starting in 10g
Copyright 2006 Kyle Hailey
4. V$session_wait
Shows who is waiting
Forexample lists who is waiting on “buffer busy waits”
Data only exists while waits are happening
Data includes
Type of buffer busy wait
File and block involved in buffer busy wait
Problem: Once waits are over, data is gone
Solution: Sample data all the time
Copyright 2006 Kyle Hailey
5. Sample Query
select
nvl(s.username,s.program) username,
s.sid sid,
s.serial# serial,
s.sql_hash_value sql_hash_value, SQL identifier
substr(decode(w.wait_time,
0, w.event, Waiting or on CPU?
'ON CPU'),1,15) event ,
w.p1 p1,
w.p2 p2,
w.p3 p3
from v$session s,
v$session_wait w
where w.sid=s.sid
and s.status='ACTIVE'
and s.type='USER';
This query works since v7
Copyright 2006 Kyle Hailey
6. Sampling Output
USERNAME SID SERIAL SQL_HASH_V EVENT P1 P2 P3
---------- ----- -------- ---------- -------------------- -------- -------- ----
SYS 64 8717 4116021597 PL/SQL lock timer 300 0 0
SYS 58 19467 961168820 ON CPU 16508152 1 0
STARGUS 71 6251 1311875676 direct path write 201 2155902 127
(CJQ0) 9 1 0 rdbms ipc message 500 0 0
Run sample query every second and
save into a table “v$ash”
Copyright 2006 Kyle Hailey
7. Buffer busy wait type
SQL> Select count(*), p3
from v$ash
where event = 'buffer busy waits'
group by p3;
COUNT(*) P3
---------- ----
3423 220
On 9i
P3 < 200 read problem
P3 >= 200 write problem
On 10g P3 is the block class which is better
for diagnostics
Copyright 2006 Kyle Hailey
8. File and Block #s
select count(*), p1 filen, p2 blockn
from v$ash
where event='buffer busy waits'
group by p1, p2, hash_value;
COUNT(*) FILEN BLOCKN
---------- -------- --------
1 11 90644
2 11 90651
3 11 98233
1 11 104767
3 11 113291
1 11 119842
1 11 119856
3 11 121632
1 11 126334
Pick a File and Block to find object
Copyright 2006 Kyle Hailey
9. Sampling Output
COUNT(*) FILEN BLOCKN
column segment_name format a30 ---------- -------- --------
1 11 126334
select
owner,
segment_name,
segment_type,
block_id, blocks+block_id
from dba_extents
where file_id = 11
and 126334 between block_id AND block_id + blocks-1;
OWNER SEGMENT_NAME SEGMENT_TY BLOCK_ID BLOCKS+BLOCK_ID
---------- ------------------ ---------- ---------- ---------------
SYSTEM TOTO1 TABLE 125201 127249
Data block ( not header block )
Copyright 2006 Kyle Hailey
11. SQL Statement ?
select sql_text
from v$sqltext
where hash_value=558666863;
SQL_TEXT
-----------------------------------------------------
INSERT into toto1 values (:b1,lpad('a',1000,'a'))
Insert statement getting write type buffer busy waits:
problem with users inserting data into same block.
Solution : configure inserts to uses different blocks
with Freelists or ASSM
Copyright 2006 Kyle Hailey
12. ASSM ?
select FREELISTS, TABLESPACE_NAME
from dba_tables
where table_name='TOTO1' and owner='SCOTT';
FREELISTS TABLESPACE_NAME
---------- ------------------------------
1 USERS
Table only has 1 freelist
The table is in tablespace Users
Is it an ASSM tablespace ?
Copyright 2006 Kyle Hailey
13. Sampling Output
select tablespace_name, SEGMENT_SPACE_MANAGEMENT
from dba_tablespaces;
TABLESPACE_NAME SEGMEN
------------------------------ ------
SYSTEM MANUAL
UNDOTBS1 MANUAL
TEMP MANUAL
USERS MANUAL
TOOLS AUTO
USERS tablespace is not in ASSM mode
Copyright 2006 Kyle Hailey
14. Let’s add Freelists
How many freelists?
select count(*), sid, serial
from v$ash
where event='buffer busy waits‘
group by sid, serial;
COUNT(*) SID SERIAL
---------- ----- --------
7 12 79
4 14 99
4 19 770
8 20 176
Max Concurrency is 4
Freelists >= 4
Copyright 2006 Kyle Hailey