Username: Password:

通过创建用户profile文档, 限制用户对数据库资源使用-数据库专栏,SQL Server
来源:作者: 发布时间:2007-12-25 13:46:58


能够限制的资源列表




在下面的例子中,创建一个供用户testuser使用的test_profile环境文档:



create profile test_profile limit



failed_login_attempts 3;



create user testuser identified by abcd1234



profile test_profile;



grant create session to testuser;



假如连续3次和testuser账户的连接失败,该账户将自动被oracle锁定。此后当输入testuser账户的正确口令时,会收到一条错误信息:



error:ora-28000: the account is locked



环境文档是通过“create profile”命令创建的,能够用“alter profile”命令修改。下例所示的“alter profile”命令用于修改现有的环境文档。在这个例子中,数据库的缺省环境文档被修改成允许最大空闲时间为1小时:



alter profile default 或 profile文档名   limit idle_time 60;

--设定用户的资源配置文档
1.配置初始化参数  resource_limit=true
2./*建立资源配置文档*/
create profile prfile_name limit session_per_user 2 cpu_per_session 10000 idle_time 60 connect_time 480;

3.alter user user_name profile profile_name;    --将创建的profile文档分配给用户

4.用命令修改资源配置文档
alter profile default 或 profile文档名   limit idle_time 60;

5.drop profile profile_name;    --删除profile

/*建立了profile后,且指定给某个用户,则必须用cascade才能删除*/
drop profile profile_name cascade;

alter system set resource_limit=true;---启用自愿限制,缺省是false










喜欢本文,那就收藏到:

    Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网
相关评论  我也要评论
还没有关于此文章的相关评论!
  • 昵称: (为空则显示guest)
  • 评论分数: ★ ★ ★★★ ★★★★ ★★★★★
  • 评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
  • 导航
    赞助商
    文章类别
    订阅