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: New audit trigger question

Re: New audit trigger question

From: Mark C. Stock <mcstockX_at_Xenquery>
Date: Fri, 19 Mar 2004 20:05:44 -0500
Message-ID: <_-2dnbORss2fBMbdRVn-jg@comcast.com>

"Teresa Redmond" <XKEAAGIPVIEZ_at_spammotel.co> wrote in message news:50436416098279773204644f263a2823_at_news.teranews.com...
| On Fri, 19 Mar 2004 15:07:24 +0100, in comp.databases.oracle.server,
| Frank van Bortel <fvanbortel_at_netscape.net> scribbled:
|
| >Teresa Redmond wrote:
| >
| >> Hello again;
| >>
| >> Here is my trigger:
| >>
| >> CREATE OR REPLACE TRIGGER AUDIT_TRIGGER
| >> AFTER UPDATE OR DELETE
| >> ON TABLE_X
| >> BEGIN
| >> if updating then
| >> INSERT INTO audit_table
| >> SELECT 'TABLE_X', USER, SYSDATE,
| >> s.osuser, s.program, 'UPDATING', s.terminal
| >> FROM v$session s, v$sql sq
| >> WHERE (S.SQL_ADDRESS = sq.ADDRESS
| >> AND S.osuser IS NOT NULL
| >> and s.osuser not like '%SYSTEM%');
| >> else
| >> if deleting then
| >> INSERT INTO audit_table
| >> SELECT 'TABLE_X', USER, SYSDATE,
| >> s.osuser, s.program, 'DELETING', s.terminal
| >> FROM v$session s, v$sql sq
| >> WHERE (S.SQL_ADDRESS = sq.ADDRESS
| >> AND S.osuser IS NOT NULL
| >> and s.osuser not like '%SYSTEM%');
| >> end if;
| >> end if;
| >> END audit_trigger;
| >>
| >> Today's issue: User is developing in Forms 6i, not updating data.
| >> Trigger is firing and adding rows to audit_table in the "updating"
| >> part of the trigger above. Why would that happen?
| >>
| >> Thanks so much!
| >>
| >
| >Define "user is developing" in forms, not updating".
| >If forms allows updates, doesn't it do a select for update
| >when the record is selected and changed?
|
| As in, user has opened Forms Designer, opened a form, connected to the
| database, but has not selected any records, he's just working on the
| form. The form doesn't load any records automatically, either; you
| have to select from a record number from a LOV to get a record before
| one opens in the form. Does that make sense? I know it's hard to get
| the idea across.
|
| --
| Teresa Redmond
| Programmer/Analyst III
| Anteon Corporation
| tredmond at anteon dot com

teresa, your description makes sense, but in order for your trigger to fire, someone must be issuing an update -- if you think it's the form, run it in trace mode (see runtime options, i'm sure there's one in there, or check V$SQL for update statements

;-{ mcs Received on Fri Mar 19 2004 - 19:05:44 CST

Original text of this message

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