版权声明:原创手打 转载请注明来源 https://blog.csdn.net/qq_42774325/article/details/82117474
1、创建公共角色
conn / as sysdba
create role c##r1 container=all;
2、给公共角色授权
grant create any table to c##r1;
grant create session to c##r1;
3、将公共角色授权给公共用户
扫描二维码关注公众号,回复:
2912788 查看本文章
grant c##r1 to c##u1;
grant c##r1 to c##u2;
- 创建本地角色
conn sys/oracle@pdb2 as sysdba
create role r1;
select role,common from dba_roles where common='NO';
- 给本地角色授权
grant create table to r1;
grant create session to r1;
- 把本地角色授权给本地用户
select username,common from cdb_users where common='NO';
grant r1 to user2;
- 把公共角色授权给本地用户
grant C##R1 to u2;
grant C##R1 to admin2;