Database Administration (MOSC)

MOSC Banner

Trigger to audit DML and DDL not working

edited Mar 31, 2013 8:48PM in Database Administration (MOSC) 1 commentAnswered
Requirement: Application team complains that everyday within a fixed timeframe, 1 entry from a particular table is being deleted. They are unable to track it, which particular job is it doing it.

DBA: We had 3 solutions: 1. AUDIT_TRAIL
                                    2. FGA
                                    3. Customized TRIGGER to track the DML and DDL.
After discussion, option 3 has been implemented. Here is the code.

DML Trigger
=======
CREATE OR REPLACE TRIGGER SLCPROD.STORE_TERM_ID_HST_TRG
BEFORE  INSERT OR UPDATE OR DELETE
   ON SLCPROD.STORE_TERM_ID    FOR EACH ROW
BEGIN

   IF INSERTING THEN
  
   INSERT INTO STORE_TERM_ID_HIST
   ( STR_NUM,
     TERM_ID,
     HOST_ENV,
     USR_TERMINAL,

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center