[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

oracle 11g

Posted on 2014-03-05
4
Medium Priority
?
513 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 11

Accepted Solution

by:
HuaMinChen earned 600 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 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 400 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

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

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

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…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
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…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
Suggested Courses
Course of the Month18 days, 15 hours left to enroll

834 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