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

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.

主站蜘蛛池模板: 水城县| 连州市| 田东县| 城固县| 凤阳县| 贵州省| 胶州市| 上林县| 昌乐县| 屏东市| 青川县| 奉新县| 柘荣县| 广州市| 徐汇区| 冀州市| 石柱| 光山县| 浑源县| 德庆县| 民勤县| 金湖县| 重庆市| 乌兰浩特市| 木里| 南安市| 贵港市| 棋牌| 铁岭县| 庆云县| 卓资县| 安徽省| 黄石市| 牟定县| 长武县| 藁城市| 苏尼特左旗| 亳州市| 达日县| 达尔| 万盛区|