Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to prevent users using toad and sqlplus from their client
Simo Silmu wrote:
> "DA Morgan" <damorgan_at_psoug.org> wrote in message
> news:1158499972.933788_at_bubbleator.drizzle.com...
>> Sybrand Bakker wrote: >>> On Sun, 17 Sep 2006 10:03:31 GMT, "Simo Silmu" <kalle_at_nospam.com> >>> wrote: >>> >>>> Well, >>>> >>>> the subject tells it all but how would you prevent users using toad and >>>> sqlplus from their client (and perhaps getting nice denial message). >>>> >>>> Cheers >>>> SS >>> create an after logon trigger (assuming you are on a version >= 8.1), >>> and determine the program using the sys_context function. >>> Rest should be peanuts. >>> However: if you have proper security set up, I don't think sql*plus >>> access (which of course is readonly) should be a problem. >>> >>> >>> -- >>> Sybrand Bakker, Senior Oracle DBA >> One can also deal with SQL*Plus access using PRODUCT_USER_PROFILE. >> >> A demo can be found in Morgan's Library at www.psoug.org. >> -- >> Daniel Morgan >> University of Washington >> Puget Sound Oracle Users Group
Tongue in cheek here you get today's award for using a technique because you know it no matter that it is totally irrelevant and, in fact, harmful.
This is absolutely no place to use a cursor. In fact unless you are in a version of Oracle prior to 8.1.7 using a cursor with an explicit fetch is just plain bad practice.
In this case you are fetching a single row into a variable so the most efficient way would be to just do it.
Given that users of TOAD are on windows I think you will find it likley that your result set, though, looks more like this.
SQL> SELECT program, schemaname FROM v$session
2 WHERE audsid=sys_context('USERENV','SESSIONID');
PROGRAM
And I would suggest you query gv$session not v$session just to get into the habit.
-- Daniel Morgan University of Washington Puget Sound Oracle Users GroupReceived on Mon Sep 18 2006 - 22:19:55 CDT
![]() |
![]() |