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

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博客 ” ,链接:http://blog.itpub.net/936/viewspace-60614/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/936/viewspace-60614/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值