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

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.

主站蜘蛛池模板: 普兰店市| 资源县| 新和县| 华亭县| 东台市| 巴塘县| 陵川县| 平乡县| 泰来县| 凤阳县| 通城县| 玉山县| 凤凰县| 平塘县| 浦县| 沐川县| 呈贡县| 万盛区| 绵竹市| 惠水县| 西华县| 安丘市| 睢宁县| 宣化县| 喀什市| 广汉市| 许昌市| 鄱阳县| 若羌县| 呼图壁县| 威信县| 万荣县| 县级市| 高安市| 阿克陶县| 钟山县| 广昌县| 乌兰县| 三台县| 灵寿县| 彩票|