SlideShare ist ein Scribd-Unternehmen logo
1 von 13
Downloaden Sie, um offline zu lesen
Understanding the Oracle Direct
Path Read Temp Wait Event
Dean Richards
Senior DBA
Confio Software
8/27/2013 1
About Direct Path Read Temp
• Closely related to direct path write temp
• Direct path read temp waits occur when a session
reads buffers from disk directly into the PGA
– If I/O subsystem doesn’t support asynchronous I/O
• Each wait corresponds to a physical read request
– If I/O subsystem supports asynchronous I/O:
• The process overlaps read requests with processing the
blocks already in the PGA
• When the process attempts to access a block in the PGA that
hasn’t been read from disk, it issues a wait call and updates
the statistics
• The number of waits is not always the same as the number
of read requests
8/27/2013 2
About Direct Path Write Temp
• Direct path write temp (and direct path write) waits occur when a
session writes buffers directly from the PGA
• The process waits on this event for the write call to complete
• Operations that perform direct path writes include:
– When a sort goes to disk
– Parallel DML operations
– Direct-path INSERTs
– Parallel create table as select
– Some LOB operations
• If I/O subsystem supports asynchronous I/O
– The number of waits is not always the same as the number of write
calls
– The session will wait if it has processed the buffers in the PGA and
can’t continue work until and I/O request complete
8/27/2013 3
Diagnosing
Direct Path Read Temp
• Check the v$session_wait view:
SELECT p1 “file#”, p2 “block#”, p3 “class#”
FROM v$session_wait
WHERE event = ‘direct path read temp’;
where
– p1 represents the file_ID for the read call
– p2 represents the start block_ID for the read call
– p3 is the number of blocks in the read call
• Check file_ID to see if it is for temp:
SELECT relative_fno, owner, segment_name, segment_type
FROM dba_extents
WHERE file_id = &file
AND &block BETWEEN block_id AND block_id + &blocks – 1
;
8/27/2013 4
Understand Causes of
Direct Path Read Temp
• High disk sorts
– When sorts are too large to fit in memory, they get sent to disk
• Parallel slaves
– When parallel slaves are used for scanning data or parallel DML are used to
create and populate objects
• Direct path loads
– When the direct path API is used to pass data to the load engine in the server
• Server process ahead of I/O
– If the server process is processing buffers faster than the I/O system can return
THEM, this can indicate an overloaded I/O system
• Data warehouse sorts
– These sorts may always go to disk, which can lead to high waits on direct path
read temp and/or direct path write temp
• Hash area size
– For query plans that call for a hash join, excessive I/O could result from having
HASH_AREA_SIZE too small
8/27/2013 5
Tuning for Direct Path Read Temp
• Direct path read temp waits often occur:
– When the PGA can’t support the size of the sorts
• Direct path read, direct path write temp,
direct path write waits can occur:
– Parallel operations, direct path inserts or
overloaded I/O
8/27/2013 6
Check for High Disk Sorts
• To check for high disk sorts:
select a.instance_number,to_char(a.snap_time,’dd/mon/
yyyy hh24:mi’) meas_date, b.value
from stats$snapshot a, stats$sysstat b, v$statname c
where c.name=’sorts (disk)’
and a.snap_time>sysdate-7
and c.statistic#=b.statistic#
and b.snap_id=a.snap_id
order by a.instance_number,a.snap_time
8/27/2013 7
If High Disk Sorts Confirmed…
• If high disk sorts are confirmed, use
pga_aggregate_target:
– Total work area cannot exceed 200 MB RAM
• This is because of the default setting for the hidden
parameter_pga_max_size.
– No RAM sort may use more than 5% of
pga_aggregate_target or _pga_max_size, whichever is
smaller.
– No task may use more than 200 megabytes for sorting
or hash joins.
• Note that Oracle does not recommend changing
hidden parameters, but the result can be
beneficial for certain environments.
8/27/2013 8
Tune the Sorts
• Find the cause of the sorts:
– Find the session experiencing the waits; look at
the SQL statement currently being run.
• Query V$TEMPSEG_USAGE to find the SQL
statement generating the sort
• Query V$SESSTAT for the session to determine
the size of the sort
• Is it possible to reduce the sorting by tuning
the SQL statement?
8/27/2013 9
If Full Table Scans Are the Cause,
Consider Disk Striping
• If tables are defined with a high degree of
parallelism, the optimizer leans towards using
full table scans with parallel slaves:
– Locate the object being loaded
– Consider using disk striping or Automatic Storage
Management (ASM) which can stripe for you
8/27/2013 10
Optimize for Parallel DML
• Check the I/O distribution across the disks
• Make sure I/O is configured for the parallelism
being used. V
• erify that the parameter DISK_ASYNCH_IO is
set to TRUE.
8/27/2013 11
Learn More About
Oracle Performance Tuning
• Go to confio.com/logicalread
• Free performance tuning tips for Oracle,
including:
– Tips on tuning for specific wait types and response
time analysis
– Indexing strategies that can improve performance
– Much more, from database professionals, industry
experts and Oracle ACEs
8/27/2013 12
Finally, Confio Ignite Can Help,
Too
• Confio Ignite can help:
– Identify queries with large amounts of waits and
many other database issues
– Install in minutes
– Find issues in 5 clicks or less
Download Ignite trial at
www.confio.com/freetrial
8/27/2013 13

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 

Kürzlich hochgeladen (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 

Empfohlen

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Empfohlen (20)

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 

Oracle Direct Path Read Temp Wait Event Explained

  • 1. Understanding the Oracle Direct Path Read Temp Wait Event Dean Richards Senior DBA Confio Software 8/27/2013 1
  • 2. About Direct Path Read Temp • Closely related to direct path write temp • Direct path read temp waits occur when a session reads buffers from disk directly into the PGA – If I/O subsystem doesn’t support asynchronous I/O • Each wait corresponds to a physical read request – If I/O subsystem supports asynchronous I/O: • The process overlaps read requests with processing the blocks already in the PGA • When the process attempts to access a block in the PGA that hasn’t been read from disk, it issues a wait call and updates the statistics • The number of waits is not always the same as the number of read requests 8/27/2013 2
  • 3. About Direct Path Write Temp • Direct path write temp (and direct path write) waits occur when a session writes buffers directly from the PGA • The process waits on this event for the write call to complete • Operations that perform direct path writes include: – When a sort goes to disk – Parallel DML operations – Direct-path INSERTs – Parallel create table as select – Some LOB operations • If I/O subsystem supports asynchronous I/O – The number of waits is not always the same as the number of write calls – The session will wait if it has processed the buffers in the PGA and can’t continue work until and I/O request complete 8/27/2013 3
  • 4. Diagnosing Direct Path Read Temp • Check the v$session_wait view: SELECT p1 “file#”, p2 “block#”, p3 “class#” FROM v$session_wait WHERE event = ‘direct path read temp’; where – p1 represents the file_ID for the read call – p2 represents the start block_ID for the read call – p3 is the number of blocks in the read call • Check file_ID to see if it is for temp: SELECT relative_fno, owner, segment_name, segment_type FROM dba_extents WHERE file_id = &file AND &block BETWEEN block_id AND block_id + &blocks – 1 ; 8/27/2013 4
  • 5. Understand Causes of Direct Path Read Temp • High disk sorts – When sorts are too large to fit in memory, they get sent to disk • Parallel slaves – When parallel slaves are used for scanning data or parallel DML are used to create and populate objects • Direct path loads – When the direct path API is used to pass data to the load engine in the server • Server process ahead of I/O – If the server process is processing buffers faster than the I/O system can return THEM, this can indicate an overloaded I/O system • Data warehouse sorts – These sorts may always go to disk, which can lead to high waits on direct path read temp and/or direct path write temp • Hash area size – For query plans that call for a hash join, excessive I/O could result from having HASH_AREA_SIZE too small 8/27/2013 5
  • 6. Tuning for Direct Path Read Temp • Direct path read temp waits often occur: – When the PGA can’t support the size of the sorts • Direct path read, direct path write temp, direct path write waits can occur: – Parallel operations, direct path inserts or overloaded I/O 8/27/2013 6
  • 7. Check for High Disk Sorts • To check for high disk sorts: select a.instance_number,to_char(a.snap_time,’dd/mon/ yyyy hh24:mi’) meas_date, b.value from stats$snapshot a, stats$sysstat b, v$statname c where c.name=’sorts (disk)’ and a.snap_time>sysdate-7 and c.statistic#=b.statistic# and b.snap_id=a.snap_id order by a.instance_number,a.snap_time 8/27/2013 7
  • 8. If High Disk Sorts Confirmed… • If high disk sorts are confirmed, use pga_aggregate_target: – Total work area cannot exceed 200 MB RAM • This is because of the default setting for the hidden parameter_pga_max_size. – No RAM sort may use more than 5% of pga_aggregate_target or _pga_max_size, whichever is smaller. – No task may use more than 200 megabytes for sorting or hash joins. • Note that Oracle does not recommend changing hidden parameters, but the result can be beneficial for certain environments. 8/27/2013 8
  • 9. Tune the Sorts • Find the cause of the sorts: – Find the session experiencing the waits; look at the SQL statement currently being run. • Query V$TEMPSEG_USAGE to find the SQL statement generating the sort • Query V$SESSTAT for the session to determine the size of the sort • Is it possible to reduce the sorting by tuning the SQL statement? 8/27/2013 9
  • 10. If Full Table Scans Are the Cause, Consider Disk Striping • If tables are defined with a high degree of parallelism, the optimizer leans towards using full table scans with parallel slaves: – Locate the object being loaded – Consider using disk striping or Automatic Storage Management (ASM) which can stripe for you 8/27/2013 10
  • 11. Optimize for Parallel DML • Check the I/O distribution across the disks • Make sure I/O is configured for the parallelism being used. V • erify that the parameter DISK_ASYNCH_IO is set to TRUE. 8/27/2013 11
  • 12. Learn More About Oracle Performance Tuning • Go to confio.com/logicalread • Free performance tuning tips for Oracle, including: – Tips on tuning for specific wait types and response time analysis – Indexing strategies that can improve performance – Much more, from database professionals, industry experts and Oracle ACEs 8/27/2013 12
  • 13. Finally, Confio Ignite Can Help, Too • Confio Ignite can help: – Identify queries with large amounts of waits and many other database issues – Install in minutes – Find issues in 5 clicks or less Download Ignite trial at www.confio.com/freetrial 8/27/2013 13