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

Home -> Community -> Usenet -> c.d.o.server -> Re: Retrieving records in order they were placed.

Re: Retrieving records in order they were placed.

From: Oliver Willandsen <fafnyr_at_my-deja.com>
Date: Fri, 09 Jul 1999 14:18:28 GMT
Message-ID: <7m50b8$bf8$1@nnrp1.deja.com>


In article <7m4rcj$9gd$1_at_nnrp1.deja.com>,   b_rich2_at_my-deja.com wrote:
> I have to put records into a table, and later retrieve them in the
order
> in which they were placed. I have a very very large number of entries
to
> be placed in a live system. The records are logs of important events
in
> the system.
>
> My first thought was to use the unix time stamp to place as the field
to
> order on, but there will probably be many entries entered in rapid
> succession. Thus many entries could be entered at the same time stamp
> interval.
>
> I then though of having a sequence number associated with each record,
> increasing one by one with each record stored. This will work well
until
> the sequence numbers begin to wrap. If they are retrieved in order of
> sequence number, and then they wrap, the records entered after the
wrap
> (sequences 1,2,3,4 etc) will all of a sudden be pulled out before the
> earlier records with high sequence numbers.
>
> Another idea is to just use the sequence numbers, and re-boot the box
> every few weeks when the sequence numbers get high, but this is really
> unacceptable in the environment where this will be run.
>
> Does anyone know how to get around this problem? Any help would be
> GREATLY appreciated.
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>

Well, I would think it depends on the granularity of the timestamp, you should be alright if you include seconds. If these are logs you will probably never delete any entries - in that case create the corresponding table in its own tablespace and use rowid. Alternatively, use a combination of both timestamp and sequence numbers per daily/hourly period.

HTH
--
Oliver Willandsen - [ European Commission - http://europa.eu.int ]

All comments represent my own opinion and may not in any circumstance be regarded as stating an official position of the European Commission

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Fri Jul 09 1999 - 09:18:28 CDT

Original text of this message

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