Oracle AWR Report – How to Use ‘Latch Statistics’ Section in Analysis

awroracleperformance

Latch statistics in AWR report contain following sections

1.Latch Activity
2.Latch Sleep Breakdown
3.Latch Miss Sources
4.Parent Latch Statistics
5.Child Latch Statistics

How can I use these sections of AWR report for useful insights to improve Oracle performance?

Best Answer

Usually, latches are used to optimize SQL. Latches are what provide concurrent access to Oracle's internals. You always want a high hit ratio, although occasionally a high hit ratio isn't indicative of everything running well. Always see if latch "latch free" is in your top wait events: if it is, you might want to look closely at your latches.

Actually using these statistics can be difficult if your new to SQL tuning. A common latch in transaction heavy databases (the ones that I work in are) is the "In memory undo latch" which allows you to rollback. If you ever noticed a high miss rate on this type of latch, you would want to examine not only the total number of SQL events that are rolling back during your AWR window, but you might examine any culprits that are might be issuing rollbacks when there is actually nothing to roll back at all (relatively common in nested loops and recursive function calls).

Thats just one example, and to be honest if you have the time to be researching your latch performance then your DB is running pretty smoothly (unless its on your top 5 wait events). Use them to examine your SQL and you should start to see some benefit in your CPU wait times.

Here are links for more information from people who know far more about this than I do:

http://www.dba-oracle.com/oracle10g_tuning/t_latch_statistics.htm

http://www.dba-oracle.com/m_latch_hit_ratio.htm