We help IT Professionals succeed at work.

oracle 10g Latch waits too high

jose_rijos
jose_rijos asked
on
Medium Priority
1,014 Views
Last Modified: 2013-12-18
I am having some performance problems sporadicallly on my database.

The only indicators of problems activated by Quest Spotlight are latch waits and lock waits.

So far I have read that the real solution for this is to re-use sql code more effectively, but I need to find a solution as fast as possible. Changing the applicaion will take a lot of time and money.

Below is the line of statistics for the library cache:

Latch name      Latches      Gets/s      % gets      Sleeps/s      % sleeps      Sleep rate
library cache        54      2,887.29      27.53      1.20      100.00      0.04

Misses/s      % misses      Miss rate
1.53      88.46      0.05
Comment
Watch Question

Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012

Commented:
you can "try" to set cursor_sharing = similar or cursor_sharing = force

these will force binding of all literals in your sql.  Even ones you don't want it to (like constants)
however it may let you limp along  until you can get your code fixed.

Author

Commented:
thanks a lot sdstuber. I'll try that.

Author

Commented:
sdstuber:

I issued the command alter system set cursor_sharing=force;

Do you know if this will take effect imediately or do i have to bounce the db?

Thanks
Database Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012
Commented:
it will take effect immediately.

alter system flush shared_pool  to get rid of any already parsed cursors

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
CERTIFIED EXPERT
Top Expert 2008

Commented:
About LATCHES on library cache additionally to above suggestion you can try to increase the shared pool size.

About LOCKS:

Query V$LOCK to find the sessions holding the lock. For every session waiting for the event enqueue, there is a row in V$LOCK with REQUEST <> 0. Use one of the following two queries to find the sessions holding the locks and waiting for the locks.

If there are enqueue waits, you can see these using the following statement:

SELECT * FROM V$LOCK WHERE request > 0;


To show only holders and waiters for locks being waited on, use the following:

SELECT DECODE(request,0,'Holder: ','Waiter: ') ||
          sid sess, id1, id2, lmode, request, type
   FROM V$LOCK
 WHERE (id1, id2, type) IN (SELECT id1, id2, type FROM V$LOCK WHERE request > 0)
   ORDER BY id1, request;

Author

Commented:
alter system flush shared_pool fix the problem for the moment. I also altered the cursor sharing parameter.

For a long term solution should I look at the application, or there are other tuning options for the db regarding this particular kind of wait?

Author

Commented:
Thank you schwertner for the lock contention information?

In regards to latch free waits, what you suggest of increasing the shared pool, I tried once to do that and couldn't put a value > 2G, got the error out of memory. My server is Linux 32 bit. Is there a way to incerase the shared pool on a 32 bit linux server beyond 2Gb?
Sean StuberDatabase Developer & Administrator
CERTIFIED EXPERT
Most Valuable Expert 2011
Top Expert 2012

Commented:
actually, for system that does not use binds increasing your shared pool might even make it worse since you'll have more statements that you do not want to use in the pool.

with binds, a larger pool will let you store more statements that are useful.

yes, you should definitely look at the application.

Author

Commented:
Thanks again sdstuber. What you suggested so far have solved the problem in terms of what I could do as a dba.
I will close this thread and will have to open another prbably to address other issues.
Thanks again to sdstuber and schwertner.
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.