Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Is there a way to do this?
There is the possibility of using a database event trigger (LOGON) in conjuction with V$SESSION, a view that holds information like the name of the executable program currently connected as demonstrated below:
CREATE OR REPLACE Trigger WatchDog after logon on database
declare
num_sid v$session.sid%type;
num_serial# v$session.serial#%type;
var_program v$session.program%type;
begin
select sid, serial#, program
into num_sid, num_serial#, var_program
from v$session
where audsid = sys_context('USERENV', 'SESSIONID');
If lower(var_program) = 'ciccio.exe' then
Raise_application_error(-20999, 'Cannot logon using this application');
End if;
end;
This must be compiled as user SYS.
In this fashion, a client user running ciccio.exe, will receive an error upon connecting.
You may want to build a list of allowed programs instead, so you won't have to know in advance the name of the forbidden application, the example given is just to test the functionality of the trigger.
Bye,
Flavio
Received on Fri May 09 2003 - 04:03:09 CDT
![]() |
![]() |