• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1006
  • Last Modified:

oracle 10g Latch waits too high

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
0
jose_rijos
Asked:
jose_rijos
  • 5
  • 3
1 Solution
 
sdstuberCommented:
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.
0
 
jose_rijosAuthor Commented:
thanks a lot sdstuber. I'll try that.
0
 
jose_rijosAuthor 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
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
sdstuberCommented:
it will take effect immediately.

alter system flush shared_pool  to get rid of any already parsed cursors
0
 
schwertnerCommented:
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;

0
 
jose_rijosAuthor 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?
0
 
jose_rijosAuthor 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?
0
 
sdstuberCommented:
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.
0
 
jose_rijosAuthor 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.
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

  • 5
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now