Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Fw: recording SQLPlus activity
RE: recording SQLPlus activity
Hi Johanna, Richard
First you have to create a table to keep the records, excuse me for the spanish :-)
CREATE TABLE CONTROL_OBJETOS
( USUARIO VARCHAR2(25), BASE_DATOS VARCHAR2(10), HORA DATE, OPERACION VARCHAR2(30), ESQUEMA VARCHAR2(20), TIPO_OBJETO VARCHAR2(30), OBJETO VARCHAR2(30)
Later create the trigger that will insert a record for each DDL operation in the DB
CREATE OR REPLACE TRIGGER CONTROL_DDL
BEFORE DDL ON DATABASE
DECLARE
NOMBRE_MAQUINA VARCHAR2(20); USUARIO_MAQUINA VARCHAR2(20);
USERNAME = ORA_LOGIN_USER AND AUDSID=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;
/
HTH Good luck !!!
Ramon
Please sned this to me as well!
Thanks,
Hannah
-----Original Message-----
From: root_at_fatcity.com_at_SUNGARD On Behalf Of "Ramon E. Estevez" <com.banilejas_at_codetel.net.do>
Sent: Tuesday, June 25, 2002 4:04 PM
To: Multiple recipients of list ORACLE-L Subject: Re: recording SQLPlus activity
Ray,
You can make ddl trigger at db level and capture the computer name and the osuser from the v$session and insert into a table the result of this.
I have a little example of this if you want it I can send you directly.
Ramon
> Craig,
> This relates to SQLPLUS. A majority of our developers use sqlplus.
>
> There are 2 choices:
> (a) separate environments for each developer using GRANTS, etc.
> (b) one single application owner account, where all the developers work.
>
> Now, (b) is several hundred times more efficient, and I am looking for
input
> on how to make (b) work for me, not (a).
>
> What I would like, ideally speaking:
> 1. Users log into SQLPlus into the same account. They get tagged. All
> actions are recorded, especially DDL. Who, When, What SQL,
> 2. No direct SQLPlus access, i.e. not without being tagged.
> 3. Restrictions: Only specific users (identified by tags) are to be
allowed
> alter/drop table, etc.
>
> Thus, everyone works in the same area, but I'm watching and controlling.
>
>
> 1. PUPBLD does not cut it since its not at the object level
> 2. Redo logs: One problem is that if everyone is working in the same
user,
> we cant tell "who".
> 3. Audit: what audit can I turn on?
>
> thanks.
>
> Ray
>
>
>
>
>
> From : "Craig Munday" <Craig.Munday_at_ecard.com.au>
> Reply-To : ORACLE-L_at_fatcity.com
> To : Multiple recipients of list ORACLE-L <ORACLE-L_at_fatcity.com>
> Subject : RE: recording SQLPlus activity
> Date : Mon, 24 Jun 2002 18:08:20 -0800
>
>
> Ray,
>
> Why would you want to record every SQL statement that your developers
issue?
> Are they just using SQL*Plus or some other language?
>
> Cheers,
> Craig.
>
>
>
> -----Original Message-----
> Sent: Tuesday, 25 June 2002 10:53 AM
> To: Multiple recipients of list ORACLE-L
>
>
>
> I have just been moved to a group with several hundred developers, and to
> say the least the environment is chaotic.
>
> Without putting limits on my developers (such as via READONLY user, etc.),
> is there some way that every command that a developer executes using
SQLPlus
> gets recorded (by userid and time)?
>
> Ray
>
>
>
>
>
> _________________________________________________________________
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Ray Gordon
> INET: rgordon_1_at_hotmail.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).
--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Ramon E. Estevez
INET: com.banilejas_at_codetel.net.do
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).
-- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Ramon E. Estevez INET: com.banilejas_at_codetel.net.do 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 Tue Jun 25 2002 - 17:09:35 CDT
![]() |
![]() |