官术网_书友最值得收藏!

Creating a local role

Local roles are roles created in PDB and they exist only in that PDB. These roles can be granted only locally to either common or local users or roles.

Getting ready

For this recipe, a pluggable database (in our case, pdb1) should be open. You'll need an existing user (either common or local) who has create role privilege in that pluggable database.

How to do it...

  1. Connect to PDB (for example, pdb1) as a common or local user who has        create role privilege in that PDB (for example, c##maja):
    SQL> connect c##maja@pdb1
    
  2. Create a local role (for example, local_role1):
    c##maja@PDB1> create role local_role1 container=current;
    

How it works...

When you create a local role, that role exists only in the pluggable database in which it is created. Local roles cannot be created in the root container. These roles are traditional roles.

How it works...

Figure 15

c##maja@CDB1> select * from dba_roles where role='LOCAL_ROLE1'; 
 no rows selected 
 c##maja@CDB1> connect c##maja/oracle@pdb1 
 Connected. 
 c##maja@PDB1> select * from dba_roles where role='LOCAL_ROLE1'; 
 ROLE PASSWORD AUTHENTICAT COM O
------------------- -------- ----------- --- -
LOCAL_ROLE1 NO NONE NO N 
 c##maja@PDB1> connect c##maja/oracle@pdb2 
 Connected. 
 c##maja@PDB2> select * from dba_roles where role='LOCAL_ROLE1'; 
 no rows selected

There's more...

You can also create local roles by using Oracle Enterprise Manager Cloud Control (OEM) 12c.

How to create a local role using OEM 12c

You should connect to PDB (for example, pdb1) as a common or local user who has     create role privilege in that PDB (for example, c##maja). All the remaining steps are done in the same way as in the How to create a common role using OEM 12c section.

主站蜘蛛池模板: 巍山| 池州市| 察雅县| 浪卡子县| 醴陵市| 霍山县| 彰武县| 库车县| 镇赉县| 京山县| 宁城县| 资溪县| 昔阳县| 新化县| 南华县| 阿克| 法库县| 密山市| 通许县| 镇康县| 天祝| 军事| 溧水县| 邹平县| 融水| 沙雅县| 临夏市| 息烽县| 上思县| 淳化县| 饶平县| 临邑县| 富阳市| 涿州市| 若尔盖县| 凤阳县| 渭源县| 浪卡子县| 来安县| 始兴县| 邢台市|