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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Is there a way to do this?

Re: Is there a way to do this?

From: FC <flavio_at_tin.it>
Date: Fri, 09 May 2003 16:57:15 GMT
Message-ID: <L5Rua.68801$3M4.1634348@news1.tin.it>

"FC" <flavio_at_tin.it> wrote in message
news:h9Kua.66220$3M4.1599946_at_news1.tin.it...
>
> 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
>
>

I forgot to delete a couple of variables, leftovers of a previous version of the trigger, just delete any reference to num_sid and num_serial#, they are not necessary.

Bye,
Flavio Received on Fri May 09 2003 - 11:57:15 CDT

Original text of this message

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