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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: PLSQL beginners question

Re: PLSQL beginners question

From: Gints Plivna <gints.plivna_at_gmail.com>
Date: Fri, 9 Dec 2005 13:00:18 +0200
Message-ID: <6e49b6d00512090300p1d0be1d9tdd949197d99fc243@mail.gmail.com>


> 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_at_vdbogaard.com> 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
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Fri Dec 09 2005 - 05:00:35 CST

Original text of this message

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