Solved

oracle 11g

Posted on 2014-03-05
4
495 Views
Last Modified: 2014-04-02
Hi,

I would like to create a oracle sequence number as primary key in a log table.
Many applications are using this log table.
So if 2 or more applications try to update this table on "same time", then is different squence number ( seqname.nextval )   is allocated always for all the applications? or is there any chance that same sequence number allocated to 2 or more applicatinos which are trying to update same time?
0
Comment
Question by:GouthamAnand
4 Comments
 
LVL 10

Accepted Solution

by:
HuaMinChen earned 150 total points
ID: 39908597
There should be only one unique sequence number being allocated to each application, as there must be still one time gap like few milliseconds when 2 application are struggling with each other at the same time.
0
 
LVL 142

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 100 total points
ID: 39908615
I concur. sequence object will not return "duplicates" during operations.
to ensure, you shall have a primary key constraint on the column, and handle the case if the duplicate key error would occur.
this would happen if the sequence object is "restarted", so a new start value is given to the sequence object.
0
 

Author Closing Comment

by:GouthamAnand
ID: 39908660
Thank you.
0
 

Expert Comment

by:manny17
ID: 39973408
The sequence number is cached in the instance. There is no way that a same sequence number can be allocated to two different transactions. In a RAC system, the range of number cached is different on each of instance. This way oracle avoids such scenarios.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
How to Unravel a Tricky Query Introduction If you browse through the Oracle zones or any of the other database-related zones you'll come across some complicated solutions and sometimes you'll just have to wonder how anyone came up with them.  …
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
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…

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now