Bo's Oracle Station

查看: 1940|回复: 0

课程第46次:2016-07-11星期一

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2016-7-12 09:37:32 | 显示全部楼层 |阅读模式
【上完1Z0-052的第7章】表空间
【开始1Z0-052的第8章】用户和权限
【上完1Z0-051】:共12章0 1 2 3 4 5 6 7 8 9 10 11
【1Z0-052】:共14章(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
【1Z0-053】:共15章(0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
表示已经上过的,表示还没上的。
完全按照上课顺序:
https://www.botangdb.com/mytrain/201601/00000028.html

2016-07-11a.sql:
  1. select  * from dba_segments s where s.owner='HR'
  2.   and s.segment_name='EMPLOYEES';
  3.   
  4.   select  * from dba_extents e where e.owner='HR' and
  5.   e.segment_name='EMPLOYEES';
  6.   
  7.   select  * from sys_dba_segs  s where s.owner='HR'
  8.     and s.segment_name='EMPLOYEES';
  9.    
  10.     ---
  11.    
  12.     select  * from database_properties;
  13.    
  14.     alter database default tablespace users;
  15.    
  16.     alter tablespace users2 rename to users;
  17.     ---
  18.    
  19.     select  * from dba_profiles  where profile='DEFAULT';
  20.    ---
  21.    select  * from dba_roles r where r.role='CONNECT';
  22.    
  23.    select * from role_sys_privs  rsp where rsp.role='CONNECT';
  24.    
  25.    select  * from role_tab_privs rtp where rtp.role='CONNECT';
  26.    
  27.    select * from role_role_privs rrp where rrp.role='CONNECT';
  28.    
  29.    ----
  30.    grant connect to user1 identified by oracle_4U;
  31.    
  32.    grant create session to user2 identified by oracle_4U;
  33.    
  34.    ---
  35.    select  * from dba_users  where username='USER1';
  36.    
  37.    alter user user1 password expire;
  38.    
  39.    alter user user1 account lock;
  40.    
复制代码

2016-07-11b.sql:
  1. select  count( distinct  sp.privilege  )
  2.   from dba_sys_privs  sp;
  3.   
  4. select   distinct  sp.privilege  
  5.   from dba_sys_privs  sp  order by sp.privilege;
  6.   
  7.   select * from dba_tab_privs tp where tp.grantee='SH';
  8.   
  9.      select * from dba_col_privs tp where tp.grantee='SH';
  10.      alter user user1 account unlock;
  11.      ---
  12.      
  13.      revoke select  on hr.employees from sh;
  14.      
  15.      select  * from dba_sys_privs  where grantee='SH' ;
  16.      
  17.      grant select  any table to sh with admin option;
  18.      
  19.      ---
  20.      
  21.      select  * from dba_sys_privs  where grantee='USER1' ;
  22.      
  23.      revoke select  any table from user1;
  24.      
  25.      grant select any table to public;
  26.      
  27.       revoke select  any table from user1;
  28.       
  29.       revoke select any table from public;
复制代码

2016-07-11c.sql:
  1. select  * from role_role_privs  rrp where rrp.role='ROLE2';

  2. select  * from role_sys_privs  rrp where rrp.role='ROLE1';


  3. select  * from role_tab_privs  rrp where rrp.role='ROLE1';


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

  5. revoke select  on hr.employees from role1;

  6. select * from dba_sys_privs sp where sp.grantee='HR';


  7. select * from dba_ts_quotas;

  8. alter user user1 quota 1M on users;

  9. alter user user1 quota 0  on users;

  10. grant resource to user1;

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

  12. revoke resource from user1;
复制代码

Screenshot.png

回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-12-5 10:11 , Processed in 0.053410 second(s), 27 queries .

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