- 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.
推薦閱讀
- JBoss Weld CDI for Java Platform
- 大學計算機應用基礎實踐教程
- Drupal 8 Blueprints
- SpringMVC+MyBatis快速開發與項目實戰
- Mastering matplotlib
- 新編Premiere Pro CC從入門到精通
- Mastering C# Concurrency
- SQL Server 2012數據庫管理與開發項目教程
- Mathematica Data Analysis
- Instant Ext.NET Application Development
- Visual Basic程序設計實驗指導(第二版)
- Quantum Computing and Blockchain in Business
- Web性能實戰
- 跟戴銘學iOS編程:理順核心知識點
- Java高并發編程詳解:深入理解并發核心庫