Oracle用户、权限、角色管理

发表于:2013-5-17 12:45

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:未知    来源:51Testing软件测试网采编

  三、实体权限管理

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

  execute  //执行存储过程权限

  user01:

  SQL> grant select, update, insert on product 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 to public;  // public表示是所有的用户,这里的all权限不包括drop。

  [实体权限数据字典]:

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

  SQL> select table_name from user_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(

  id number(10),

  name varchar2(20));

  SQL> drop table stud02.emp;

  SQL> create table stud02.employee

  as

  select * from scott.emp;

  4. 实体权限传递(with grant option):

  user01:

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

  5. 实体权限回收:

  user01:

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

  说明

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

 

42/4<1234>
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号