- Oracle Database 12c Security Cookbook
- Zoran Pavlovi? Maja Veselica
- 277字
- 2021-07-02 16:43:16
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...
- Connect to PDB (for example,
pdb1
) as a common or local user who hascreate role
privilege in that PDB (for example,c##maja
):SQL> connect c##maja@pdb1
- 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.

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.
推薦閱讀
- Android Wearable Programming
- 騰訊iOS測試實踐
- Java EE框架整合開發入門到實戰:Spring+Spring MVC+MyBatis(微課版)
- JavaScript+jQuery網頁特效設計任務驅動教程(第2版)
- 華為HMS生態與應用開發實戰
- Cassandra Design Patterns(Second Edition)
- 精通軟件性能測試與LoadRunner實戰(第2版)
- Java面向對象程序開發及實戰
- Java Web程序設計
- Java Web基礎與實例教程
- Kotlin Standard Library Cookbook
- Linux操作系統基礎案例教程
- Hands-On Full Stack Development with Go
- R數據科學實戰:工具詳解與案例分析
- Android傳感器開發與智能設備案例實戰