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: How do I konw the last time a table get modified.

Re: How do I konw the last time a table get modified.

From: Hakan <heren_at_erpdbo.com>
Date: Thu, 01 Apr 1999 20:31:51 -0500
Message-ID: <37041E07.EE7290A1@erpdbo.com>


Dong

You can add a new field to the tables that you would like to know last update. OR you can keep a seperate table for that. Then you can write triggers which will fill up this table. An example:

SQLWKS> CREATE TABLE stop_milosevic
     2>  (empno NUMBER(4),
     3>   comment_line VARCHAR2(60),
     4>   update_date DATE DEFAULT SYSDATE)
     5> /

Statement processed.
SQLWKS> CREATE OR REPLACE TRIGGER update_of_emp
     2>   BEFORE UPDATE ON emp
     3>   FOR EACH ROW
     4>       BEGIN
     5>         INSERT INTO stop_milosevic(empno, comment_line)
     6>           VALUES(:OLD.empno, 'EMP Updated');
     7> END;
     8> /

Statement processed.
SQLWKS> UPDATE emp
     2>   SET sal = 10000
     3> /

12 rows processed.
SQLWKS> COMMIT
Statement processed.
SQLWKS> /
SQLWKS> SELECT * FROM stop_milosevic
     2> /
EMPNO      COMMENT_LINE

UPDATE_DATE
---------- ------------------------------------------------------------
--------------------
      7369 EMP Updated
04/01/1999
      7499 EMP Updated
04/01/1999
      7521 EMP Updated
04/01/1999
      7566 EMP Updated
04/01/1999
      7654 EMP Updated
04/01/1999
      7698 EMP Updated
04/01/1999
      7782 EMP Updated
04/01/1999
      7839 EMP Updated
04/01/1999
      7844 EMP Updated
04/01/1999
      7900 EMP Updated
04/01/1999
      7902 EMP Updated
04/01/1999
      7934 EMP Updated

04/01/1999
12 rows selected.
SQLWKS> DROP TABLE stop_milosevic

     2> /
Statement processed.

Dong Tang wrote:

> So does it means the database will flip the status of the flag after a
> record inserted, modified or deleted from a table so that it will know this
> table should be exported or not ?
>
> Dong Tang
>
> Andrew Babb wrote in message <3702DBAD.E93730F7_at_mail.com>...
> >I don't believe that Oracle records the time, but it does have a flag on
> the
> >DBA_TABLES.BACKED_UP.
> >
> >Rgds
> >Andrew
> >
> >Dong Tang wrote:
> >
> >> Hi:
> >>
> >> As I am reading Oracle 8 Documantation about Export, I find out Oracle
> can
> >> do incremental and cumulative export, which is only exporting tables
> >> modified since last time export.
> >>
> >> That means somewhere in Oracle, the last modifed time in a time are
> >> recorded. Can any guru tell me where I can find this information?
> >>
> >> Please e-mail at tangd_at_ctcdist.com
> >>
> >> Thanks ahead
> >>
> >> Dong Tang
> >
Received on Thu Apr 01 1999 - 19:31:51 CST

Original text of this message

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