Common roles are roles created in the root container and they exist in all containers. These roles can have a different set of privileges in different containers and they can be granted to either common or local users or roles.
To complete this recipe, you'll need an existing common user who has create role
privilege granted commonly.
Connect to the root container as a common user who has
create role
privilege granted commonly (for example,c##zoran
or system user):SQL> connect c##zoran@cdb1
Create a common role (for example,
c##role1
):SQL> create role c##role1 container=all;
When you create a common role, that role exists in all containers in that database (including a root container and existing and future pluggable databases).
c##zoran@CDB1> select * from dba_roles where role='C##ROLE1'; ROLE PASSWORD AUTHENTICAT COM O ---------------- -------- ----------- --- - C##ROLE1...