ITPub博客

首页 > Linux操作系统 > Linux操作系统 > (转)使用product_user_profile表来实现用户权限的设定

(转)使用product_user_profile表来实现用户权限的设定

原创 Linux操作系统 作者:renjiubao 时间:2010-05-26 14:00:41 0 删除 编辑

我们要利用这张表来限制SCOTT用户不能执行DROP命令,即使SCOTT用户拥有DROP TABLE的权限。
  SQL> insert into product_user_profile (
   2 product, userid, attribute, char_value)
   3 values (
   4 'SQL*Plus','SCOT%','DROP','DISABLED');
  
  1 row inserted
  
  Executed in 0.01 seconds
  
  SQL> commit;
  
  Commit complete
  
  Executed in 0 seconds
  
  然后退出SYSTEM用户,用SCOTT用户登录,作个测试:
  SQL> create table t_test_profile(
   2 id number);
  
  Table created.
  
  Elapsed: 00:00:00.10
  
  SQL> drop table t_test_profle;
  SP2-0544: invalid command: drop
  
  这就是product_user_profile的作用,回顾一下:
  1。如果我们把DROP改成CREATE或者UPDATE那么就对用户禁止了这些命令。
  2。从上面的insert语句,我们可以看到对于用户的限制支持通配符,所有以SCOT开头的用户都不能执行指定的命令。
  3。修改了product_user_profile内容,用户必须重新登录SQL*Plus,修改才会生效,也就是只有在登录的时候,SQL*Plus才会检查一遍product_user_profile表中的内容。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8541256/viewspace-663768/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-05-20

  • 博文量
    28
  • 访问量
    29470