Thanks for the Memory
Upcoming SlideShare
Loading in...5
×
 

Thanks for the Memory

on

  • 2,784 views

Presentation on Oracle memory optimization. Presented at Perth AUSOUG 20/20 Conference November 2009.

Presentation on Oracle memory optimization. Presented at Perth AUSOUG 20/20 Conference November 2009.

Statistics

Views

Total Views
2,784
Views on SlideShare
2,775
Embed Views
9

Actions

Likes
1
Downloads
66
Comments
0

1 Embed 9

http://www.slideshare.net 9

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • Apologies, I’m a database type.....
  • As a result of this architecture, you can only really expect to take a handful of items out of a powerpoint presentation. I’ll list the take aways at the end....

Thanks for the Memory Thanks for the Memory Presentation Transcript

  • Thanks for the Memory
    Guy Harrison
    Director, Melbourne R&D
    guy.harrison@quest.com
    www.guyharrison.net
  • Introductions
    Buy Quest Products
  • Human memory is complex
    Short Term Sensory Store: ~ 1 second uncompressed raw memory
    Working memory: Limited capacity, requires attention
    Long term memory: physically stored in brain structure; large capacity; indexed strangely
    Beyond Bullets Points:
    By: Cliff Atkinson
  • Oracle memory is much simpler
    • Buffer cache memory caches segment data to avoid read IO.
    • PGA is used for program working memory such as sorting and hashing
    • Other areas are less performance critical
  • Sort IO can easily dominate datafile IO
  • What consumes PGA memory
    Sorts:
    ORDER BY
    SORT-MERGE JOIN
    UNION, INTERSECT, MINUS
    Pre-10GR2 GROUP BY , DISTINCT
    Analytic functions: OVER(), LEAD(), LAG(), etc
    Hash Operations:
    Hash join
    Hash GROUP BY, DISTINCT
    PL/SQL variables
    Collections
    BULK COLLECT
    Parameter passing without NOCOPY
  • PGA Aggregate Target and session memory
  • Optimal, one-pass, multi-pass
    Multi-pass
    Single Pass
    Optimal
  • Sort merge and hash joins
  • Estimated SQL memory
  • Actual SQL Memory
  • PGA advice - manual
  • PGA advice - OEM
  • PGA and Sorts – Spotlight on Oracle
  • Opting out of PGA Aggregate Target
    Default workarea sizing policies only allow for a session to get 10-20% of the PGA
    If a single large sort is in progress, it makes sense to “opt out” of automatic workarea sizing
  • Shared Memory
  • Modified LRU mechanism
    Oracle Session
    Buffer Cake
    Buffer Cache
  • Modified LRU mechanism: Table Scans
    Oracle Session
    Buffer Cake
    Buffer Cache
  • Impact of direct path IO
    http://guyh.textdriven.com/OPSGSamples/Ch18/temporary_direct.sql
  • The buffer cache “hit rate”
    http://guyh.textdriven.com/OPSGSamples/Ch18/hit_rate.sql
  • Multiple buffer pools
  • Buffer Cache advisory: manual
  • Buffer cache advisory: OEM
  • Automatic Shared Memory management (ASMM)
    Default in 10g and recommended (with caveats):
    Set Minimum values for key pools (buffer pools, shared pool)
    Manually size non-default pools using V$DB_CACHE_ADVICE
    Monitor for memory starvation
    Monitor for memory thrashing
    Waits on “SGA: allocation forcing component growth”
  • Memory starvation and thrashing
  • Optimizing overall memory
    Optimizing between PGA and SGA are often more significant than allocating within each area
    In 10g optimization is difficult:
    Compare PGA and Buffer Cache advisories
    Adjust based on IO types (direct read temp vs. physical reads)
    In 11g can use Automatic Memory Management
    Risk of thrashing and starvation is greater than with ASMM
    Set minimum values for all pools
    Manually configure non-default buffer pools
  • Worst case scenario
    Trivial memory allocations from PL/SQL programs can steal vital memory from buffer cache
    Situation can become worse if MTS is enabled
    Setting minimum values is virtually mandatory
  • Spotlight on Oracle memory management
  • Spotlight on Oracle memory management
  • 11g Result Set Cache
    Can provide massive improvements for expensive queries on static tables
    In memory dynamic materialized view?
  • Result set cache
    Caveats:
    Single latch on modifications
    Any modification to a dependent table flushes the result sets
    Can select statements only at the table level or by inserting a hint
    Bottom line:
    Limited effectiveness
    Unique candidate SQLs must be low frequency
    Tables must be static
  • Things we didn’t talk about
    Shared pool
    Redo buffer
    Large Pool
    Flashback buffer
  • Key take aways
    Don’t emphasize buffer cache tuning at the expense of PGA
    Consider opting out of PGA Aggregate Target for large sorts
    ASMM and ASM are fine, but set minimums for important memory pools
    Result set cache is promising, but right now is of limited applicability
  • End of Presentation