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: Sequences CYCLEing -- was RE: How do you genrate primary

Re: Sequences CYCLEing -- was RE: How do you genrate primary

From: Carel-Jan Engel <cjpengel.dbalert_at_xs4all.nl>
Date: Sun, 09 Nov 2003 07:49:25 -0800
Message-ID: <F001.005D6239.20031109074925@fatcity.com>


I've seen several of them on projects I worked on: People converted older data-models - if model is the right name ;-) - and stuck to the small key-fields they had.

One particlaur example got a nice :-( algorithm replaced by this nice lick Oracle feature called 'sequence'. Of course increasing marketing success caused an increasing need for unique keys, causing exact the cycling problem described.

Lesson learned: make a calculation in advance: Most of the time 9 digits will do the job: it will let you generate 1 key per second, 86400 seconds a day, 11574 days. This is approx. 31 years and 8 months, and that migh be sufficient. If not, simply add some extra digits. Just get some proof that your choise is right!

Of course this will not work out when you insert 6000 rows per second, all day long, but then you might have other problems ;-).

It's amazing how people (calling themself programmers) are putting together some code, without any idea of some future behaviour of their code! (I remember some Y2K problem a few years ago. I hate to say this, but all my code, as from where I started working in IT back in 1982) was Y2K proof. However, I must admit, my older C-code won't survive the next 'millenium'-problem, when the unix-date-format can't follow the 'seconds + 01-01-1970' format. Maybe 64-bit compilers will resolve that problem. But, mark my words ;-) there will be some concern, dataconversion and other familiar stuff which will us, elderly and bitter software veterans give some deja-vu feelings right then!

Carel-Jan

At 07:04 9-11-03 -0800, you wrote:

>So, let's start another thread.
>
>How many of you have actually seen Sequences implemented in the manner I
>described
>and Mladen demonstrated below ?
>
>Hemant
>

DBA!ert, Independent Oracle Consultancy
Kastanjelaan 61C
2743 BX Waddinxveen
The Netherlands

tel.    +31 (0) 182 640 428
fax     +31 (0) 182 640 429
mobile  +31 (0) 653 911 950

e-mail info.dbalert_at_xs4all.nl
-- 
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 - 09:49:25 CST

Original text of this message

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