Solved

lock wait on sequence

Posted on 2001-09-11
3
1,810 Views
Last Modified: 2006-11-17
Oracle version 7.3.4
Sun Solaris 2.6 6 CPUs lots of memory
application type OLTP
concurent users: 400

One a day or more I get a lock wait on the following:
"select seq_name.nextval from dual;"

This happens when around 30 users are concurently requesting the seuence. The lock is for around 4 minutes.
There is also lots of buffer gets.

V$lock tables shows one row with blocking=1 but ID1 or ID2 are not to be found in OBJ$.

The sequence cash is 300.
Init.ora parameters:
sequence_cash_entries=3500
sequence_cash_hash_buckets=50

Has any one encountered this in the passed?
Any Id on a possible solution?

Thanks
Peled Alon
0
Comment
Question by:peledc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
balasubram earned 200 total points
ID: 6473841
hi,
I think u could try caching the sequence by specifying the cache key word while creating the sequence.
Cache is the number of sequence numbers u want to be cached.
Hope this helps
Bala
0
 
LVL 5

Expert Comment

by:FBIAGENT
ID: 6474910
PELEDC,

I don't think the lock wait is on "select seq_name.nextval from dual;"
You must be looking at the wrong place.  First of all, the statement is a SELECT statement; it only fetches the next sequence number; no lock is required.

It must have been some other SQL statement which utilizes the sequence.

I would search through the application for places (stored procedures/functions, PL/SQL blocks, etc.) which uses the sequence.

Good luck
0
 
LVL 3

Expert Comment

by:Wadhwa
ID: 6474981
I guess you are using seq_name.nextval with for update

for example
if session A issues command
select seq_name.nextval from dual for update;



session B
select seq_name.nextval from dual for update;

Session B will wait till the session A commits or rollback. Once session A issues commit or rollback session B gets the result.Session B is locked till then.

So do not use for update with the sequence at all. Otherwise you will face the same problem

Goodluck
Sam




0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question