设为首页收藏本站

Botang唐波's Oracle Station

查看: 267|回复: 0

课程第48次(2018-05-21星期一)

[复制链接]

731

主题

1102

帖子

8002

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
8002
发表于 2018-5-21 20:22:37 | 显示全部楼层 |阅读模式
CDB2:
  1. select  con_id , username,common from cdb_users
  2. order by 2;

  3. create user c##_user2 identified by x ;

  4. grant create session to c##_user2;

  5. DROP USER c##_user2;

  6. create role c##_role;

  7. select  con_id,r.ROLE, r.COMMON
  8. from cdb_roles r  order by 2;

  9. grant c##_role to c##_user;

  10. select  * from cdb_role_privs p
  11.   where p.GRANTEE='C##_USER';

  12. grant c##_role to c##_user container=all;

  13. select  * from cdb_role_privs p
  14.   where p.GRANTEE='C##_USER';
  15.   
  16.   revoke c##_role from c##_user;
  17.   
  18.     revoke c##_role from c##_user  container=all;
  19.    
  20.    
  21.     select * from role_sys_privs  sp
  22.      where sp.role='C##_ROLE';
  23.      
  24.        select * from role_tab_privs  sp
  25.      where sp.role='C##_ROLE';
  26.      
  27.      
  28.      select  * from role_role_privs rrp
  29.       where rrp.role='C##_ROLE';
  30.       
  31.       grant  select  any table  to c##_role  container=all ;
复制代码

PDB2:
  1. create user local_user_pdb2 identified by x CONTAINER=current;

  2. grant create session to local_user_pdb2;


  3. create role local_role_PDB2;

  4. select  * from cdb_roles;

  5. grant c##_role to local_user_pdb2;

  6. select * from cdb_role_privs rp
  7. where rp.grantee='LOCAL_USER_PDB2';

  8. -----

  9. grant local_role_pdb2 to c##_role;

  10. select  * from role_role_privs rrp
  11.       where rrp.role='C##_ROLE';
  12.       
  13.     select * from role_sys_privs  sp
  14.      where sp.role='C##_ROLE';
复制代码

  1. select  * from cdb_container_data;

  2. CREATE USER c##jfv IDENTIFIED BY oracle_4U;

  3. GRANT CREATE SESSION, SET CONTAINER TO c##jfv  CONTAINER=ALL;

  4. GRANT SELECT ON sys.v_$session TO c##jfv CONTAINER=ALL;

  5. select   con_id , username , terminal
  6. from v$session where username <> 'DBSNMP';

  7. -----------------------
复制代码

在根容器上的dba与普通的dba的区别:
  1. alter user c##jfv set container_data=(cdb$root,  pdb1_1, pdb2_2)
  2. for v_$session
  3. container=current;
复制代码


回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2018-10-22 03:03 , Processed in 0.157386 second(s), 24 queries .

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