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、将公共角色授权给公共用户
grant c##r1 to c##u1;
grant c##r1 to c##u2;
- 创建本地角色
conn sys/[email protected] 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;