Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re[2]: Sequences CYCLEing -- was RE: How do you genrate

Re[2]: Sequences CYCLEing -- was RE: How do you genrate

From: Carel-Jan Engel <cjpengel.dbalert_at_xs4all.nl>
Date: Sun, 09 Nov 2003 12:09:25 -0800
Message-ID: <F001.005D6242.20031109120925@fatcity.com>


Slightly OT: Way before AR was available, we built a set of triggers to do the replication job (Oracle 7.0.something). Of course synchronisation of sequences was a hell of a job. Lucky for us, the system was more DSS than OLTP: approx. 3000 - 10.000 transactions/day. Furthermore there was a real Master/Slave database architecture, the slave would only be queried, and wasn't allowed to be updated from ordinary users. This was enforced by pre-DML triggers, which prevented any DML to be executed except those coming form the replication process. Because this was a flight information display system, running on several airports, high availabilty was the goal.

All primary keys were meaningless, a 9 digit number, and generated from a sequence by a pre-insert trigger. Because of some home-grown GUI program, used in the project, the key needed to be unique in the whole set of tables, so onde qequence was used. Ordering was important, gaps were no problem. The same pre-insert-trigger would find a non-null primary key when the record came from the replication process. If a non-null primary key was found, it would start a loop hammering the sequence until it reached the same id as the id just received. So we enforced synchronisation between both sequences, without the need of having them started at different offsets, which would have violated the 'ordered constraint' needed by the GUI-stuff.

Carel-Jan

--

Please see the official ORACLE-L FAQ: http://www.orafaq.net
--

Author: Carel-Jan Engel
  INET: cjpengel.dbalert_at_xs4all.nl

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in the message BODY, include a line containing: UNSUB ORACLE-L (or the name of mailing list you want to be removed from). You may also send the HELP command for other information (like subscribing). Received on Sun Nov 09 2003 - 14:09:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US