首页 > Linux操作系统 > Linux操作系统 > How to restrict your users to only one Oracle session ? [akadia]

How to restrict your users to only one Oracle session ? [akadia]

原创 Linux操作系统 作者:jlandzpa 时间:2019-06-29 15:15:08 0 删除 编辑

How can I make sure the end user has only one session in the database?

This can be a requirement of an application, well, we have not found a good reason for limiting people in this way. However, people want to do it and when they do, they usually do it the hard way. For example, they will have a batch job run by the operating system that will look at the V$SESSION table and arbitrarily kill sessions of users who have more then 1 session. Alternatively, they will create their own tables and have the application insert a row when a user logs in, and remove the row when they log out. This implementation invariably leads to lots of calls to the help desk because when the application 'crashes', the row never gets removed. There are lots of other 'creative' ways to do this, but none is as easy as:

SQL> create profile one_session limit sessions_per_user 1;
Profile created.

SQL> alter user scott profile one_session;
User altered.

SQL> alter system set resource_limit=true;
System altered.

That's it now any user with the ONE_SESSION profile can log on only once.

来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录


  • 博文量
  • 访问量