restricting multiple sessions in oracle 10g

Posted on 2012-08-15
Last Modified: 2012-11-12

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 .

Question by:venu3108
    LVL 23

    Expert Comment

    - 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:

    Author Comment


    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.

    LVL 23

    Expert Comment

    - 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
    LVL 36

    Expert Comment

    by:Geert Gruwez
    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
    LVL 76

    Accepted Solution

    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.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    PRTG Network Monitor: Intuitive Network Monitoring

    Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

    Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
    From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
    Via a live example, show how to take different types of Oracle backups using RMAN.
    This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now