Bo's Oracle Station

查看: 2225|回复: 0

第42次:2016-01-04星期一

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2016-1-5 16:29:03 | 显示全部楼层 |阅读模式
2016-01-04a.sql:
  1. select  * from dba_users where username='HR';

  2. alter user hr identified by oracle_4U account unlock;

  3. select sysdate+180 from dual;

  4. select  * from user$ u where u.name='SYS';
  5. --48DF04E7BAB11018
  6. alter user hr identified by oracle_4U;
  7. --A586E74A0FA6A0BC

  8. grant sysoper to hr ;

  9. select  * from dba_sys_privs  sp where sp.grantee='OPS$ORACLE'  order by 2;

  10. select  * from dba_tab_privs  tp where tp.grantee='OPS$ORACLE'  ;

  11. select  * from dba_col_privs  cp where cp.grantee='OPS$ORACLE';

  12. select * from dba_role_privs  rp where rp.grantee='OPS$ORACLE';

  13. ---



  14.   select  count(distinct  sp.privilege)      from dba_sys_privs sp;

  15. select  distinct  sp.privilege from dba_sys_privs sp order by 1 ;

  16. grant create table  to u1;

  17. select  * from dba_sys_privs  sp where sp.grantee='U1'  order by 2;

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

  19. select  * from dba_col_privs  cp where cp.grantee='U1';

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

  21. select  * from dba_ts_quotas;

  22. alter user u1 quota 0 on example;

  23. select * from dba_roles;

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

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

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

  27. select  * from role_wm_privs  rwp where rwp.role='RESOURCE';

  28. grant resource to ops$oracle;

  29. --
  30. revoke create table from u1;

  31. revoke resource  from ops$oracle;

  32. ---
  33. select * from role_sys_privs  rsp  where rsp.role='CONNECT';

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

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

  36. create user u2 identified by oracle_4U ;
  37. ---
  38. grant create session to u3 identified by oracle_4U ;

  39. grant connect to u4 identified by oracle_4U;

  40. --

  41. select username from dba_users order by 1 desc ;




复制代码

2016-01-04b.sql:
  1. select  * from dba_users where username='HR';

  2. alter user hr identified by oracle_4U account unlock;

  3. select sysdate+180 from dual;

  4. select  * from user$ u where u.name='SYS';
  5. --48DF04E7BAB11018
  6. alter user hr identified by oracle_4U;
  7. --A586E74A0FA6A0BC

  8. grant sysoper to hr ;

  9. select  * from dba_sys_privs  sp where sp.grantee='OPS$ORACLE'  order by 2;

  10. select  * from dba_tab_privs  tp where tp.grantee='OPS$ORACLE'  ;

  11. select  * from dba_col_privs  cp where cp.grantee='OPS$ORACLE';

  12. select * from dba_role_privs  rp where rp.grantee='OPS$ORACLE';

  13. ---



  14.   select  count(distinct  sp.privilege)      from dba_sys_privs sp;

  15. select  distinct  sp.privilege from dba_sys_privs sp order by 1 ;

  16. grant create table  to u1;

  17. select  * from dba_sys_privs  sp where sp.grantee='U1'  order by 2;

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




  19. select  * from dba_col_privs  cp where cp.grantee='U1';

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

  21. select  * from dba_ts_quotas;

  22. alter user u1 quota 0 on example;

  23. select * from dba_roles;

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

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

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

  27. select  * from role_wm_privs  rwp where rwp.role='RESOURCE';

  28. grant resource to ops$oracle;

  29. --
  30. revoke create table from u1;

  31. revoke resource  from ops$oracle;

  32. ---
  33. select * from role_sys_privs  rsp  where rsp.role='CONNECT';

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

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

  36. create user u2 identified by oracle_4U ;
  37. ---
  38. grant create session to u3 identified by oracle_4U ;

  39. grant connect to u4 identified by oracle_4U;

  40. --

  41. select username from dba_users order by 1 desc ;

  42. --------
  43. --------
  44. grant select any table to u1;
  45. grant select_catalog_role to ops$oracle;

  46. ---

  47. select  * from dba_sys_privs  sp where sp.grantee='HR'  order by 2;

  48. select  * from dba_tab_privs  tp where tp.grantee='HR'  ;

  49. select  * from dba_col_privs  cp where cp.grantee='HR';

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

  51. ---

  52. grant select_catalog_role to hr;

  53. ---

  54. select  * from dba_tab_privs  tp where tp.grantee='PUBLIC'   and tp.grantor='HR' ;

  55. grant create procedure to u3;
  56. ---
  57. create role role1;

  58. grant select  on hr.employees to role1;

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

  60. grant role1 to u4;

  61. grant create procedure to u4;

  62. --
  63. select  * from role_role_privs rrp where rrp.role='SELECT_CATALOG_ROLE';
  64. ---
  65. select * from dba_users where username='HR';






复制代码



回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-19 01:09 , Processed in 0.038777 second(s), 24 queries .

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