Bo's Oracle Station

查看: 2400|回复: 0

第31次:2015-04-07星期二

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2015-4-8 10:03:00 | 显示全部楼层 |阅读模式
2015-04-07-a.sql:
  1. select  * from dba_sys_privs sp   where sp.grantee='U1';

  2. select  * from dba_tab_privs  tp where tp.grantee='U1';
  3. select * from dba_col_privs cp  where cp.grantee='U1';

  4. select  * from dba_role_privs rp where  rp.grantee='U1';

  5. select  * from role_sys_privs rsp where rsp.role='CONNECT';

  6. select * from role_tab_privs rtp where rtp.role='CONNECT';

  7. select  * from role_role_privs rrp where rrp.role='CONNECT';

  8. ----
  9. select  * from dba_objects o where o.owner='HR' and o.object_type='PROCEDURE';

  10. select * from dba_source  s where s.owner='HR' and s.name='ADD_JOB_HISTORY';

  11. select  * from hr.job_history;
  12. ----
  13. grant create procedure  to u1;
  14. ----
  15. select * from  dba_roles;

  16. select * from role_sys_privs rsp where rsp.role='RESOURCE';

  17. select  * from role_tab_privs rtp where rtp.role='RESOURCE';

  18. select * from role_role_privs rrp where rrp.role='RESOURCE';


  19. ----
  20. create user u2 identified by oracle_4U;

  21. grant connect,resource to u2;

  22. revoke resource from u2;
  23. -----

  24. revoke update on hr.employees from u1;

  25. create role role1;

  26. select * from role_sys_privs rsp where rsp.role='ROLE1';

  27. select  * from role_tab_privs rtp where rtp.role='ROLE1';

  28. select * from role_role_privs rrp where rrp.role='ROLE1';

  29. grant role1 to u1;
复制代码

2015-04-07-b.sql:
  1. select  * from dba_sys_privs sp where sp.grantee='HR';

  2. select  * from dba_tab_privs tp where tp.grantee='U1';

  3. select  * from dba_role_privs rp where rp.grantee='HR';

  4. select  * from role_sys_privs  rsp where rsp.role='RESOURCE';

  5. ---

  6. revoke   create procedure  from u1;

  7. revoke resource from u2;

  8. -----

  9. grant create procedure to hr with admin option;

  10. ---
  11. select  * from role_sys_privs where role='ROLE1';

  12. select  * from role_tab_privs where role='ROLE1';

  13. select  * from role_role_privs where role='ROLE1';

  14. ---

  15. grant role1 to u1 with admin option;

  16. revoke role1 from u1;

  17. -----

  18. revoke update on hr.employees from role1;
复制代码

2015-04-07-c.sql:
  1. grant select any table to u2;

  2. select  * from dba_role_privs rp where rp.granted_role='ROLE2';



  3. alter user u2 default role  connect,select_catalog_role;

  4. create role role2 identified by  java_4U ;

  5. grant drop any table to role2;

  6. grant role2 to u2;

  7. alter  role role2 identified by  redhat_4U;

  8. select  * from dba_role_privs rp where rp.grantee='U1';


  9. grant role2 to role1   ;
  10. ----------


  11. grant role1 to u1;

  12. ---

  13. alter user u1 default role none;
  14. ---
  15. select  * from dba_profiles p where p.profile='DEFAULT';
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-12-4 01:24 , Processed in 0.040923 second(s), 24 queries .

快速回复 返回顶部 返回列表