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

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.

主站蜘蛛池模板: 建平县| 滨州市| 牡丹江市| 台中市| 嘉荫县| 秦皇岛市| 囊谦县| 丹寨县| 东安县| 绥棱县| 哈巴河县| 大渡口区| 牟定县| 双流县| 福安市| 买车| 宜黄县| 山阴县| 龙胜| 大田县| 宜良县| 阿拉善盟| 绥江县| 绥德县| 长阳| 铅山县| 平乐县| 射阳县| 延津县| 乐业县| 沙湾县| 曲阳县| 洞头县| 安丘市| 利辛县| 大竹县| 沁源县| 石景山区| 双城市| 万荣县| 比如县|