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

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.

主站蜘蛛池模板: 桃江县| 马山县| 巴塘县| 哈巴河县| 五台县| 辽宁省| 林州市| 水富县| 安岳县| 盐源县| 崇信县| 阿勒泰市| 元谋县| 高阳县| 宁晋县| 康马县| 于都县| 同江市| 静海县| 陇西县| 湘潭县| 惠水县| 诏安县| 昌平区| 贺州市| 班玛县| 平湖市| 昂仁县| 林甸县| 昭通市| 东至县| 长顺县| 沿河| 漳浦县| 潜江市| 皮山县| 平潭县| 宜阳县| 道孚县| 永兴县| 平舆县|