Re: PLSQL beginners question

  • From: Gints Plivna <gints.plivna@xxxxxxxxx>
  • To: paul@xxxxxxxxxxxxx, Oracle Mailing List <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 9 Dec 2005 13:00:18 +0200

> Would be real convenient of SOME_VALUE could be set independend from the
> the trigger.
it is like some config value. There are at least 2 possibilities -
store them in some config table or in package header variable. First
one shortage - need query  config table each time a user logins,
second one shortage - you have to recompile package if you want to
change SOME_VALUE and most probably it would be impossible if at least
one (other than you) "user_of_interest" is connected.

And sharing counter between multiple sessions -  probably you can just
query  v$session for logged in usernames? Because otherwise you have
to decrement your counter as well when "user of interest" disconnects
and if my memory are correct on logoff trigger fires only if user
disconnects in a correct way, for example in database crash it
wouldn't fire. For example, after crash you'd have to manually
decrement counter to 0.

Don't know how much impact of querying v$session would be though. But
if your logins/logouts aren't for each transaction (a very bad
solution anyway) then probably impact would be minimal.

Gints

On 12/9/05, Paul van den Bogaard <paul@xxxxxxxxxxxxx> wrote:
> I have a logon trigger that enables event 10046 for certain users.
> However there are too many users with this same name.
> If I want to reduce the amount of sessions that have 10046 enabled, how
> to extend this in the trigger.
>
> Current idea is:
>
> ....
>
> if user = "USER_OF_INTEREST"
> then
>
> if counter < SOME_VALUE
>        enable event
>        counter = counter + 1;
> end if
>
> end if
>
> Of course this counter needs to be shared between multiple sessions.
> Would be real convenient of SOME_VALUE could be set independend from the
> the trigger.
>
> Thanks
> Paul
> --
> //www.freelists.org/webpage/oracle-l
>
>
>
--
//www.freelists.org/webpage/oracle-l


Other related posts: