• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 683
  • Last Modified:

restricting multiple sessions in oracle 10g


we have been migrated to 10g forms and want to know how to setup multiple sessions restrictions since the user is opening n number of sessions .

1 Solution
- you can set using the following command. n is number of session that you want to restrict per user:

alter profile default limit SESSIONS_PER_USER n;

- refer to the doc:
venu3108Author Commented:

i am not asking at the database level since users are logging with userid separately at application level not at database .

eg: a user KKK is having access to application . he is logging with kkk once.
again he is logging in the new browser with same id.

i want to restrict application level session limit.

- i'm not a form developer, however i can think of a few ways:

1- create a session column in your user table. update session=1 when user login. always check for this column value in the login page, if 1 means user cannot login again. reset that column = 0 on exit / user logout from the form.

2- grant the oracle user to query to v$session. you can make use of OSUSER, MACHINE/TERMINAL data in v$session to restrict only 1OS user or 1terminal is allowed to login.

3- there are some suggestion that you can look into the following thread such as DBMS_APPLICATION_INFO.SET_CLIENT_INFO, set_context and etc
Geert GOracle dbaCommented:
why would the multiple sessions be a problem ?
why would you want to restrict it ?

if the database can handle it without any problems, then it shouldn't be restricted
slightwv (䄆 Netminder) Commented:
You might also be able to handle this with an 'AFTER LOGON' trigger to check v$session and take appropriate action.

Examples are out there on this.

Here is one that limits access based on program:

BE CAREFUL:  With this type of a trigger, you can easily keep everyone from connecting if you don't get it right.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now