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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: DB Trigger to keep record of DDL

Re: DB Trigger to keep record of DDL

From: Stephane Faroult <sfaroult_at_oriole.com>
Date: Thu, 04 Apr 2002 13:33:28 -0800
Message-ID: <F001.0043BFD8.20020404133328@fatcity.com>


Read carefully :-)

com.banilejas_at_codetel.net.do wrote:
>
> I did that trigger, it works if the only is logged in just once.
> It gives me the errors of more rows returned 1422.
>
> How can I know in what session he is.
>
> CREATE OR REPLACE TRIGGER CONTROL_DDL
> BEFORE DDL ON DATABASE
> DECLARE
> NOMBRE_MAQUINA VARCHAR2(20);
> USUARIO_MAQUINA VARCHAR2(20);
> BEGIN
> SELECT MACHINE, OSUSER INTO NOMBRE_MAQUINA, USUARIO_MAQUINA
> FROM V$SESSION
> WHERE
LOOK HERE ===> AUDSID = SYS_CONTEXT('USERENV', 'SESSIONID')
>
> INSERT INTO CONTROL_OBJETOS (USUARIO, BASE_DATOS,
> HORA, OPERACION,
> ESQUEMA, TIPO_OBJETO,
> OBJETO, MAQUINA,
> USUARIO_OS)
> VALUES
> (ORA_LOGIN_USER, ORA_DATABASE_NAME,
> SYSDATE, ORA_SYSEVENT,
> ORA_DICT_OBJ_OWNER, ORA_DICT_OBJ_TYPE,
> ORA_DICT_OBJ_NAME, NOMBRE_MAQUINA,
> USUARIO_MAQUINA);
> END;
>
>
> TIA
>
> Ramon E. Estevez
>
> /

HTH, Stephane Faroult
Oriole Software

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Stephane Faroult
  INET: sfaroult_at_oriole.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Thu Apr 04 2002 - 15:33:28 CST

Original text of this message

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