- 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.
推薦閱讀
- C++案例趣學
- Mastering Adobe Captivate 2017(Fourth Edition)
- 簡單高效LATEX
- 深入淺出Spring Boot 2.x
- Java EE 7 Development with NetBeans 8
- Learning Selenium Testing Tools(Third Edition)
- 軟件架構:Python語言實現
- Redis Essentials
- Apache Spark 2.x for Java Developers
- Flutter跨平臺開發入門與實戰
- CoffeeScript Application Development Cookbook
- Android傳感器開發與智能設備案例實戰
- 數據分析與挖掘算法:Python實戰
- Python編程入門(第3版)
- Java Web動態網站開發(第2版·微課版)