[comp.databases] Detecting changes to Oracle tables

csa09@seq1.keele.ac.uk (P. Singleton) (05/29/91)

In long-running processes which frequently access particular UNIX files
(e.g. the password file), I am accustomed to 'caching' the file's
contents within the process and noting it's time-of-last-modification (TOLM).

Subsequent accesses to the file need only check the file's current TOLM
(cheap, if the inode is incore), and use the cached data if the file is
(apparently) unmodified (else they re-cache the data and timestamp).

I want to do a similar thing with some Oracle tables which I must frequently
refer to from within a (Prolog and C) program, but I can't find an equivalent
of TOLM (which, with one-second granularity, is not strictly reliable - what
I really need is some update sequence number).  My application would benefit
enormously from this caching - at present, I use files rather than Oracle
tables to keep this frequently accessed data in, purely so that I can exploit
caching.

Does *any* RDBMS support this practice?  Does anyone else ever want to
do this?
--
  __   __    Paul Singleton (Mr)            JANET E-mail: paul@uk.ac.keele.cs
 |__) (__    Computer Science Dept.         other E-mail: paul@cs.keele.ac.uk
 |  .  __).  Keele University, Newcastle,            tel: +44 782 621111 x 3355
             Staffs ST5 5BG, ENGLAND                 fax: +44 782 713082

L.Carl.Pedersen@dartmouth.edu (L. Carl Pedersen) (05/30/91)

In article <1213@keele.keele.ac.uk>
csa09@seq1.keele.ac.uk (P. Singleton) writes:

> In long-running processes which frequently access particular UNIX files
> (e.g. the password file), I am accustomed to 'caching' the file's
> contents within the process and noting it's time-of-last-modification (TOLM).
> 
> Subsequent accesses to the file need only check the file's current TOLM
> (cheap, if the inode is incore), and use the cached data if the file is
> (apparently) unmodified (else they re-cache the data and timestamp).
> 
> I want to do a similar thing with some Oracle tables which I must frequently
> refer to from within a (Prolog and C) program

This is a terrible kludge, and requires DBA privileges, but you could
do an ALTER TABLE BACKUP every time you refresh your cache, and then
check BACKED_UP in USER_TABLES, to see if it's been modified since the
last time.  This may degrade performance, but probably only slightly. 
Also, of course, you will need to make allowances for this kludge if
you are using INCTYPE=CUMULATIVE or INCTYPE=INCREMENTAL with EXPort.