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

Home -> Community -> Usenet -> c.d.o.server -> Re: accessing SQLPlus variables.................

Re: accessing SQLPlus variables.................

From: Daniel Morgan <dmorgan_at_exesolutions.com>
Date: Tue, 06 Aug 2002 23:06:01 GMT
Message-ID: <3D505656.C3D613EA@exesolutions.com>


Parag wrote:

> Hello All,
>
> I want to restrict users to use application instead of using sqlplus.
> To do that using logon trigger and some reading from various sites /
> groups I got it to work.
>
> The trigger is as follows:
>
> create or replace trigger connect_restriction after logon on database
> when (user != 'SYSTEM' and user != 'VVVVVV' and user != 'MMMMMM')
> declare v_username number;
> Begin
> select count(*) into v_username from v$session
> where upper(username) = user and status='ACTIVE' and upper(program)
> like 'SQLPLUS%' and appinfo like '%SQL%';
> if v_username > 0 then raise_application_error(-20002,'no sqlplus
> please'); end if;
> end connect_restriction;
> /
>
> If I rename my sqlplus.exe as test.exe, the trigger is fooled.
> Now if I could access sqlplus environment variable appinfo
> (sqlplus> show appinfo) in the PL/SQL block I could get the thing
> done.
>
> How do I ?
>
> Thanks in advance.
> Parag

I'm not sure that you can.

But unless you run around telling people what you have done (for example your error message) ... it will likely never occur to them to rename the application or its icon.

Why not change your error message to something that won't direct them to a work-around. How about:

"This Application Can Only Be Accessed Using proper_tool_name_here"

Daniel Morgan Received on Tue Aug 06 2002 - 18:06:01 CDT

Original text of this message

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