设为首页收藏本站

Botang唐波's Oracle Station

查看: 1077|回复: 0

(52-25)第42次:2016-01-27星期二

[复制链接]

745

主题

1118

帖子

8120

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
8120
发表于 2016-1-27 10:26:14 | 显示全部楼层 |阅读模式
本帖最后由 botang 于 2016-1-29 09:43 编辑

(52-25)上完1Z0-052第8章
2016-01-26a.sql:
  1. grant connect to user1 identified by oracle_4U;

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

  3. grant select  on hr.employees to user1;

  4. select  * from dba_tab_privs tp where tp.grantee='USER1';

  5. revoke select  on hr.employees  from user1;

  6. select  * from dba_tab_privs tp where tp.grantee='USER1';

  7. grant create procedure to user1;



  8. ---
  9. select * from dba_roles;

  10. create role role1 ;

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

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

  13. select  * from role_role_privs rrp where rrp.role='ROLE2';

  14. ---
  15. grant select  on hr.employees to  role1;

  16. grant role1 to user1;

  17. revoke role1 from user1;

  18. revoke execute on hr.proc05208_b  from user1;

  19. revoke create procedure from user1;

  20. select  * from dba_role_privs rp where rp.grantee='USER1';

  21. select  * from dba_tab_privs tp where tp.grantee='USER1';

  22. select  * from dba_sys_privs tp where tp.grantee='USER1';

  23. select  * from dba_col_privs tp where tp.grantee='USER1';
  24. ---
  25. grant select any table to user1 with admin option;

  26. ---
  27. create user user2 identified by oracle_4U ;

  28. grant connect to user2;
  29. ---
  30. select  * from dba_role_privs rp where rp.grantee='USER2';

  31. select  * from dba_tab_privs tp where tp.grantee='USER2';

  32. select  * from dba_sys_privs tp where tp.grantee='USER2';

  33. select  * from dba_col_privs tp where tp.grantee='USER2';

  34. ---
  35. revoke select  any table from user1;

  36. revoke select  any table from user2;

  37. ---

  38. grant role1 to user1 with admin option;

  39. ----
  40. revoke role1 from user1;
  41. ---

  42. revoke role1 from user2;

  43. grant select  on hr.employees  to public;

  44. ---
  45. revoke  select  on hr.employees   from public;
  46. ----
  47. db2 --XML

  48. ---

  49. create role role2;


  50. grant role1 to role2;
  51. ---
  52. grant role2 to role1;
  53. ----

  54. grant connect to user3 identified by oracle_4U;

  55. grant role2 to user3;

  56. ---
  57. revoke select  on hr.employees from role1;

  58. grant select  on hr.employees  to role1;
  59. ---

  60. select  * from dba_roles;


  61. create role role3 identified by oracle_4U;

  62. ---

  63. select  * from dba_role_privs  rp where rp.grantee='USER3';

  64. alter user user3 default role connect;

  65. revoke role2 from user3;

  66. grant role2 to role3 ;

  67. grant role3 to user3;

  68. alter user user3 default role  connect;
复制代码

2016-01-26b.sql:

  1. select  * from dba_profiles  where profile='DEFAULT';

  2. create profile profile1 limit CPU_PER_SESSION 100;

  3. select  * from dba_users where username='HR';

  4. alter user hr profile profile1;

  5. alter profile profile1 limit  CPU_PER_SESSION  default;

  6. select * from dba_users where username='HR';

  7. ---
  8. select  * from dba_profiles  where profile='PROFILE1'  and resource_type <>'KERNEL';
  9. ---
  10. alter user  hr account unlock;

  11. ----
  12. ALTER PROFILE "PROFILE1" LIMIT PASSWORD_REUSE_MAX 1
  13. PASSWORD_REUSE_TIME 1;

复制代码



Screenshot.png
回复

使用道具 举报

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

本版积分规则

QQ|手机版|Botang唐波's Oracle Station   

GMT+8, 2018-12-13 11:52 , Processed in 0.102934 second(s), 27 queries .

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