SlideShare une entreprise Scribd logo
1  sur  15
Sampling

            Kyle Hailey
   Embarcadero Technologies
    http://oraclemonitor.com
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
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
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
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
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
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
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
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
What SQL ?
 SQL> select count(*), p1 filen, p2 blockn , sql_hash_value
 2 from v$ash
 3 where event='buffer busy waits'
 4 group by p1, p2, hash_value;

 COUNT(*)     FILEN    BLOCKN SQL_HASH_VALUE
 ---------- -------- -------- ----------
          3        1    94609 558666863
          2       11    81163 558666863
          2       11    87123 558666863
          1       11    90644 558666863
          2       11    90651 558666863
          3       11    98233 558666863
          1       11   104767 558666863
          3       11   113291 558666863
          1       11   119842 558666863
          1       11   119856 558666863
          3       11   121632 558666863
          1       11   126334 558666863

 All the same SQL , SQL_HASH_VALUE= 558666863

                             Copyright 2006 Kyle Hailey
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
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
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
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
DB Optimizer shows it all




               Copyright 2006 Kyle Hailey

Contenu connexe

Tendances

SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeSCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeJeff Frost
 
監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜Michitoshi Yoshida
 
MySQL Document Store
MySQL Document StoreMySQL Document Store
MySQL Document StoreI Goo Lee
 
Automating Disaster Recovery PostgreSQL
Automating Disaster Recovery PostgreSQLAutomating Disaster Recovery PostgreSQL
Automating Disaster Recovery PostgreSQLNina Kaufman
 
Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Kyle Hailey
 
glance replicator
glance replicatorglance replicator
glance replicatoririx_jp
 
FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GN/A
 
你所不知道的Oracle后台进程Smon功能
你所不知道的Oracle后台进程Smon功能你所不知道的Oracle后台进程Smon功能
你所不知道的Oracle后台进程Smon功能maclean liu
 
Basic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationBasic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationN/A
 
了解Oracle rac brain split resolution
了解Oracle rac brain split resolution了解Oracle rac brain split resolution
了解Oracle rac brain split resolutionmaclean liu
 
DataStax: An Introduction to DataStax Enterprise Search
DataStax: An Introduction to DataStax Enterprise SearchDataStax: An Introduction to DataStax Enterprise Search
DataStax: An Introduction to DataStax Enterprise SearchDataStax Academy
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneDeepti Singh
 
Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7I Goo Lee
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterI Goo Lee
 
Fatkulin presentation
Fatkulin presentationFatkulin presentation
Fatkulin presentationEnkitec
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from Anar Godjaev
 
还原Oracle中真实的cache recovery
还原Oracle中真实的cache recovery还原Oracle中真实的cache recovery
还原Oracle中真实的cache recoverymaclean liu
 

Tendances (20)

SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade DowntimeSCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
SCALE 15x Minimizing PostgreSQL Major Version Upgrade Downtime
 
監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜監査ログをもっと身近に!〜統合監査のすすめ〜
監査ログをもっと身近に!〜統合監査のすすめ〜
 
MySQL Document Store
MySQL Document StoreMySQL Document Store
MySQL Document Store
 
Automating Disaster Recovery PostgreSQL
Automating Disaster Recovery PostgreSQLAutomating Disaster Recovery PostgreSQL
Automating Disaster Recovery PostgreSQL
 
Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle Ash masters : advanced ash analytics on Oracle
Ash masters : advanced ash analytics on Oracle
 
glance replicator
glance replicatorglance replicator
glance replicator
 
FIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11GFIXING BLOCK CORRUPTION (RMAN) on 11G
FIXING BLOCK CORRUPTION (RMAN) on 11G
 
你所不知道的Oracle后台进程Smon功能
你所不知道的Oracle后台进程Smon功能你所不知道的Oracle后台进程Smon功能
你所不知道的Oracle后台进程Smon功能
 
Basic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition PresentationBasic - Oracle Edition Based Redefinition Presentation
Basic - Oracle Edition Based Redefinition Presentation
 
了解Oracle rac brain split resolution
了解Oracle rac brain split resolution了解Oracle rac brain split resolution
了解Oracle rac brain split resolution
 
MySQL 5.5 Guide to InnoDB Status
MySQL 5.5 Guide to InnoDB StatusMySQL 5.5 Guide to InnoDB Status
MySQL 5.5 Guide to InnoDB Status
 
DataStax: An Introduction to DataStax Enterprise Search
DataStax: An Introduction to DataStax Enterprise SearchDataStax: An Introduction to DataStax Enterprise Search
DataStax: An Introduction to DataStax Enterprise Search
 
Oracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid cloneOracle applications 11i hot backup cloning with rapid clone
Oracle applications 11i hot backup cloning with rapid clone
 
Rac nonrac clone
Rac nonrac cloneRac nonrac clone
Rac nonrac clone
 
Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7Optimizer Cost Model MySQL 5.7
Optimizer Cost Model MySQL 5.7
 
Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden Gate
 
Introduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB ClusterIntroduction to MySQL InnoDB Cluster
Introduction to MySQL InnoDB Cluster
 
Fatkulin presentation
Fatkulin presentationFatkulin presentation
Fatkulin presentation
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from
 
还原Oracle中真实的cache recovery
还原Oracle中真实的cache recovery还原Oracle中真实的cache recovery
还原Oracle中真实的cache recovery
 

En vedette

Oracle 10g Performance: chapter 04 new features
Oracle 10g Performance: chapter 04 new featuresOracle 10g Performance: chapter 04 new features
Oracle 10g Performance: chapter 04 new featuresKyle Hailey
 
Oracle 10g Performance: chapter 00 statspack
Oracle 10g Performance: chapter 00 statspackOracle 10g Performance: chapter 00 statspack
Oracle 10g Performance: chapter 00 statspackKyle Hailey
 
Oracle 10g Performance: chapter 01 ash
Oracle 10g Performance: chapter 01 ashOracle 10g Performance: chapter 01 ash
Oracle 10g Performance: chapter 01 ashKyle Hailey
 
Oracle 10g Performance: chapter 00 intro live_short
Oracle 10g Performance: chapter 00 intro live_shortOracle 10g Performance: chapter 00 intro live_short
Oracle 10g Performance: chapter 00 intro live_shortKyle Hailey
 
SQL Tuning and VST
SQL Tuning and VST SQL Tuning and VST
SQL Tuning and VST Kyle Hailey
 
Oracle 10g Performance: chapter 05 waits intro
Oracle 10g Performance: chapter 05 waits introOracle 10g Performance: chapter 05 waits intro
Oracle 10g Performance: chapter 05 waits introKyle Hailey
 

En vedette (6)

Oracle 10g Performance: chapter 04 new features
Oracle 10g Performance: chapter 04 new featuresOracle 10g Performance: chapter 04 new features
Oracle 10g Performance: chapter 04 new features
 
Oracle 10g Performance: chapter 00 statspack
Oracle 10g Performance: chapter 00 statspackOracle 10g Performance: chapter 00 statspack
Oracle 10g Performance: chapter 00 statspack
 
Oracle 10g Performance: chapter 01 ash
Oracle 10g Performance: chapter 01 ashOracle 10g Performance: chapter 01 ash
Oracle 10g Performance: chapter 01 ash
 
Oracle 10g Performance: chapter 00 intro live_short
Oracle 10g Performance: chapter 00 intro live_shortOracle 10g Performance: chapter 00 intro live_short
Oracle 10g Performance: chapter 00 intro live_short
 
SQL Tuning and VST
SQL Tuning and VST SQL Tuning and VST
SQL Tuning and VST
 
Oracle 10g Performance: chapter 05 waits intro
Oracle 10g Performance: chapter 05 waits introOracle 10g Performance: chapter 05 waits intro
Oracle 10g Performance: chapter 05 waits intro
 

Similaire à Oracle 10g Performance: chapter 00 sampling

Oracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersOracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersKyle Hailey
 
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsYour tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsJohn Kanagaraj
 
Kyle Hailey Oracle Performance IO Waits
Kyle Hailey  Oracle Performance IO WaitsKyle Hailey  Oracle Performance IO Waits
Kyle Hailey Oracle Performance IO Waitscookie1969
 
Redo logfile addition in oracle rac 12c
Redo logfile addition in oracle rac 12cRedo logfile addition in oracle rac 12c
Redo logfile addition in oracle rac 12cDebasish Nayak
 
Wait Events 10g
Wait Events 10gWait Events 10g
Wait Events 10gsagai
 
Thomas+Niewel+ +Oracletuning
Thomas+Niewel+ +OracletuningThomas+Niewel+ +Oracletuning
Thomas+Niewel+ +Oracletuningafa reg
 
AWR, ADDM, ASH, Metrics and Advisors.ppt
AWR, ADDM, ASH, Metrics and Advisors.pptAWR, ADDM, ASH, Metrics and Advisors.ppt
AWR, ADDM, ASH, Metrics and Advisors.pptbugzbinny
 
Informix Warehouse Accelerator (IWA) features in version 12.1
Informix Warehouse Accelerator (IWA) features in version 12.1Informix Warehouse Accelerator (IWA) features in version 12.1
Informix Warehouse Accelerator (IWA) features in version 12.1Keshav Murthy
 
Direct SGA access without SQL
Direct SGA access without SQLDirect SGA access without SQL
Direct SGA access without SQLKyle Hailey
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01Karam Abuataya
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11gfcamachob
 
br_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.docbr_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.docLucky Ally
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersConnor McDonald
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTanel Poder
 
Drizzle to MySQL, Stress Free Migration
Drizzle to MySQL, Stress Free MigrationDrizzle to MySQL, Stress Free Migration
Drizzle to MySQL, Stress Free MigrationAndrew Hutchings
 
Oracle Database 12c Application Development
Oracle Database 12c Application DevelopmentOracle Database 12c Application Development
Oracle Database 12c Application DevelopmentSaurabh K. Gupta
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersConnor McDonald
 
Troubleshooting Complex Oracle Performance Problems with Tanel Poder
Troubleshooting Complex Oracle Performance Problems with Tanel PoderTroubleshooting Complex Oracle Performance Problems with Tanel Poder
Troubleshooting Complex Oracle Performance Problems with Tanel PoderTanel Poder
 

Similaire à Oracle 10g Performance: chapter 00 sampling (20)

Oracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmastersOracle Open World Thursday 230 ashmasters
Oracle Open World Thursday 230 ashmasters
 
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and AdvisorsYour tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
Your tuning arsenal: AWR, ADDM, ASH, Metrics and Advisors
 
Intro to ASH
Intro to ASHIntro to ASH
Intro to ASH
 
ash-1-130820122404-phpapp01.pdf
ash-1-130820122404-phpapp01.pdfash-1-130820122404-phpapp01.pdf
ash-1-130820122404-phpapp01.pdf
 
Kyle Hailey Oracle Performance IO Waits
Kyle Hailey  Oracle Performance IO WaitsKyle Hailey  Oracle Performance IO Waits
Kyle Hailey Oracle Performance IO Waits
 
Redo logfile addition in oracle rac 12c
Redo logfile addition in oracle rac 12cRedo logfile addition in oracle rac 12c
Redo logfile addition in oracle rac 12c
 
Wait Events 10g
Wait Events 10gWait Events 10g
Wait Events 10g
 
Thomas+Niewel+ +Oracletuning
Thomas+Niewel+ +OracletuningThomas+Niewel+ +Oracletuning
Thomas+Niewel+ +Oracletuning
 
AWR, ADDM, ASH, Metrics and Advisors.ppt
AWR, ADDM, ASH, Metrics and Advisors.pptAWR, ADDM, ASH, Metrics and Advisors.ppt
AWR, ADDM, ASH, Metrics and Advisors.ppt
 
Informix Warehouse Accelerator (IWA) features in version 12.1
Informix Warehouse Accelerator (IWA) features in version 12.1Informix Warehouse Accelerator (IWA) features in version 12.1
Informix Warehouse Accelerator (IWA) features in version 12.1
 
Direct SGA access without SQL
Direct SGA access without SQLDirect SGA access without SQL
Direct SGA access without SQL
 
11thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp0111thingsabout11g 12659705398222 Phpapp01
11thingsabout11g 12659705398222 Phpapp01
 
11 Things About11g
11 Things About11g11 Things About11g
11 Things About11g
 
br_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.docbr_test_lossof-datafile_10g.doc
br_test_lossof-datafile_10g.doc
 
OpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developersOpenWorld Sep14 12c for_developers
OpenWorld Sep14 12c for_developers
 
Troubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contentionTroubleshooting Complex Performance issues - Oracle SEG$ contention
Troubleshooting Complex Performance issues - Oracle SEG$ contention
 
Drizzle to MySQL, Stress Free Migration
Drizzle to MySQL, Stress Free MigrationDrizzle to MySQL, Stress Free Migration
Drizzle to MySQL, Stress Free Migration
 
Oracle Database 12c Application Development
Oracle Database 12c Application DevelopmentOracle Database 12c Application Development
Oracle Database 12c Application Development
 
OpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer DisastersOpenWorld 2018 - Common Application Developer Disasters
OpenWorld 2018 - Common Application Developer Disasters
 
Troubleshooting Complex Oracle Performance Problems with Tanel Poder
Troubleshooting Complex Oracle Performance Problems with Tanel PoderTroubleshooting Complex Oracle Performance Problems with Tanel Poder
Troubleshooting Complex Oracle Performance Problems with Tanel Poder
 

Plus de Kyle Hailey

Hooks in postgresql by Guillaume Lelarge
Hooks in postgresql by Guillaume LelargeHooks in postgresql by Guillaume Lelarge
Hooks in postgresql by Guillaume LelargeKyle Hailey
 
Performance insights twitch
Performance insights twitchPerformance insights twitch
Performance insights twitchKyle Hailey
 
History of database monitoring
History of database monitoringHistory of database monitoring
History of database monitoringKyle Hailey
 
Successfully convince people with data visualization
Successfully convince people with data visualizationSuccessfully convince people with data visualization
Successfully convince people with data visualizationKyle Hailey
 
Virtual Data : Eliminating the data constraint in Application Development
Virtual Data :  Eliminating the data constraint in Application DevelopmentVirtual Data :  Eliminating the data constraint in Application Development
Virtual Data : Eliminating the data constraint in Application DevelopmentKyle Hailey
 
DBTA Data Summit : Eliminating the data constraint in Application Development
DBTA Data Summit : Eliminating the data constraint in Application DevelopmentDBTA Data Summit : Eliminating the data constraint in Application Development
DBTA Data Summit : Eliminating the data constraint in Application DevelopmentKyle Hailey
 
Accelerate Develoment with VIrtual Data
Accelerate Develoment with VIrtual DataAccelerate Develoment with VIrtual Data
Accelerate Develoment with VIrtual DataKyle Hailey
 
Delphix and Pure Storage partner
Delphix and Pure Storage partnerDelphix and Pure Storage partner
Delphix and Pure Storage partnerKyle Hailey
 
Mark Farnam : Minimizing the Concurrency Footprint of Transactions
Mark Farnam  : Minimizing the Concurrency Footprint of TransactionsMark Farnam  : Minimizing the Concurrency Footprint of Transactions
Mark Farnam : Minimizing the Concurrency Footprint of TransactionsKyle Hailey
 
Dan Norris: Exadata security
Dan Norris: Exadata securityDan Norris: Exadata security
Dan Norris: Exadata securityKyle Hailey
 
Martin Klier : Volkswagen for Oracle Guys
Martin Klier : Volkswagen for Oracle GuysMartin Klier : Volkswagen for Oracle Guys
Martin Klier : Volkswagen for Oracle GuysKyle Hailey
 
Data as a Service
Data as a Service Data as a Service
Data as a Service Kyle Hailey
 
Data Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloningData Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloning Kyle Hailey
 
BGOUG "Agile Data: revolutionizing database cloning'
BGOUG  "Agile Data: revolutionizing database cloning'BGOUG  "Agile Data: revolutionizing database cloning'
BGOUG "Agile Data: revolutionizing database cloning'Kyle Hailey
 
Denver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationDenver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationKyle Hailey
 
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]Kyle Hailey
 
Jonathan Lewis explains Delphix
Jonathan Lewis explains Delphix Jonathan Lewis explains Delphix
Jonathan Lewis explains Delphix Kyle Hailey
 
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseOaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseKyle Hailey
 
Profiling the logwriter and database writer
Profiling the logwriter and database writerProfiling the logwriter and database writer
Profiling the logwriter and database writerKyle Hailey
 

Plus de Kyle Hailey (20)

Hooks in postgresql by Guillaume Lelarge
Hooks in postgresql by Guillaume LelargeHooks in postgresql by Guillaume Lelarge
Hooks in postgresql by Guillaume Lelarge
 
Performance insights twitch
Performance insights twitchPerformance insights twitch
Performance insights twitch
 
History of database monitoring
History of database monitoringHistory of database monitoring
History of database monitoring
 
Successfully convince people with data visualization
Successfully convince people with data visualizationSuccessfully convince people with data visualization
Successfully convince people with data visualization
 
Virtual Data : Eliminating the data constraint in Application Development
Virtual Data :  Eliminating the data constraint in Application DevelopmentVirtual Data :  Eliminating the data constraint in Application Development
Virtual Data : Eliminating the data constraint in Application Development
 
DBTA Data Summit : Eliminating the data constraint in Application Development
DBTA Data Summit : Eliminating the data constraint in Application DevelopmentDBTA Data Summit : Eliminating the data constraint in Application Development
DBTA Data Summit : Eliminating the data constraint in Application Development
 
Accelerate Develoment with VIrtual Data
Accelerate Develoment with VIrtual DataAccelerate Develoment with VIrtual Data
Accelerate Develoment with VIrtual Data
 
Delphix and Pure Storage partner
Delphix and Pure Storage partnerDelphix and Pure Storage partner
Delphix and Pure Storage partner
 
Mark Farnam : Minimizing the Concurrency Footprint of Transactions
Mark Farnam  : Minimizing the Concurrency Footprint of TransactionsMark Farnam  : Minimizing the Concurrency Footprint of Transactions
Mark Farnam : Minimizing the Concurrency Footprint of Transactions
 
Dan Norris: Exadata security
Dan Norris: Exadata securityDan Norris: Exadata security
Dan Norris: Exadata security
 
Martin Klier : Volkswagen for Oracle Guys
Martin Klier : Volkswagen for Oracle GuysMartin Klier : Volkswagen for Oracle Guys
Martin Klier : Volkswagen for Oracle Guys
 
What is DevOps
What is DevOpsWhat is DevOps
What is DevOps
 
Data as a Service
Data as a Service Data as a Service
Data as a Service
 
Data Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloningData Virtualization: Revolutionizing data cloning
Data Virtualization: Revolutionizing data cloning
 
BGOUG "Agile Data: revolutionizing database cloning'
BGOUG  "Agile Data: revolutionizing database cloning'BGOUG  "Agile Data: revolutionizing database cloning'
BGOUG "Agile Data: revolutionizing database cloning'
 
Denver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualizationDenver devops : enabling DevOps with data virtualization
Denver devops : enabling DevOps with data virtualization
 
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
Oracle Open World 2014: Lies, Damned Lies, and I/O Statistics [ CON3671]
 
Jonathan Lewis explains Delphix
Jonathan Lewis explains Delphix Jonathan Lewis explains Delphix
Jonathan Lewis explains Delphix
 
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuseOaktable World 2014 Toon Koppelaars: database constraints polite excuse
Oaktable World 2014 Toon Koppelaars: database constraints polite excuse
 
Profiling the logwriter and database writer
Profiling the logwriter and database writerProfiling the logwriter and database writer
Profiling the logwriter and database writer
 

Oracle 10g Performance: chapter 00 sampling

  • 1. Sampling Kyle Hailey Embarcadero Technologies http://oraclemonitor.com
  • 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
  • 10. What SQL ? SQL> select count(*), p1 filen, p2 blockn , sql_hash_value 2 from v$ash 3 where event='buffer busy waits' 4 group by p1, p2, hash_value; COUNT(*) FILEN BLOCKN SQL_HASH_VALUE ---------- -------- -------- ---------- 3 1 94609 558666863 2 11 81163 558666863 2 11 87123 558666863 1 11 90644 558666863 2 11 90651 558666863 3 11 98233 558666863 1 11 104767 558666863 3 11 113291 558666863 1 11 119842 558666863 1 11 119856 558666863 3 11 121632 558666863 1 11 126334 558666863 All the same SQL , SQL_HASH_VALUE= 558666863 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
  • 15. DB Optimizer shows it all Copyright 2006 Kyle Hailey