你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle权限总结

[日期:2013-01-24] 来源:Linux社区  作者:Linux [字体:大 中 小]

三、对象权限管理

1、对象权限分类:select,update, insert, alter, index, delete, all //all包括所有权限

execute //执行存储过程权限

 

user01:

SQL> grant select, update, insert onproduct to user02;

SQL> grant all on product to user02;

 

user02:

SQL> select * from user01.product;

 

// 此时user02查user_tables,不包括user01.product这个表,但如果查all_tables则可以查到,因为他可以访问。

 

2. 将表的操作权限授予全体用户:

SQL> grant all on product topublic;  // public表示是所有的用户,这里的all权限不包括drop。

 

[对象权限数据字典]:

SQL> select owner, table_name fromall_tables; // 用户可以查询的表

SQL> select table_name fromuser_tables;  // 用户创建的表

SQL> select grantor, table_schema,table_name, privilege from all_tab_privs; // 获权可以存取的表(被授权的)

SQL> select grantee, owner, table_name,privilege from user_tab_privs;  // 授出权限的表(授出的权限)

 

3. DBA用户可以操作全体用户的任意基表(无需授权,包括删除):

DBA用户:

SQL> Create table stud02.product(

 idnumber(10),

 namevarchar2(20));

SQL> drop table stud02.emp;

 

SQL> create table stud02.employee

 as

 select * from scott.emp;

 

4. 对象权限传递(with grantoption):

user01:

 

SQL> grant select, update on product touser02 with grant option; // user02得到权限,并可以传递。

 

5. 对象权限回收:

user01:

SQL>Revoke select, update on productfrom user02;  //传递的权限将全部丢失。

 

说明

 

1)如果取消某个用户的对象权限,那么对于这个用户使用WITH GRANT OPTION授予权限的用户来说,同样还会取消这些用户的相同权限,也就是说取消授权时级联的。

linux
相关资讯       Oracle权限 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款