Friday, September 01, 2006

Discover what SQL a database user is running - Logon Trigger

Okay, first of the "handy techie" posts. TRACING Oracle users activity: (This is handy if you are trying to see what a third party app is doing and have no access to the code!) NB: This will log all future sessions for that user, so make sure you're the only one on the system for the schema:

sqlplus /nolog
connect / as sysdba;
create or replace trigger APPSTRACE
after logon on  apps.schema
begin   
  execute immediate 'ALTER SESSION SET SQL_TRACE TRUE';
end;
/

REM To disable once finshed:
alter trigger appstrace disable;

No comments: