- Oracle Database 12c Security Cookbook
- Zoran Pavlovi? Maja Veselica
- 331字
- 2021-07-02 16:43:16
Creating a common role
Common roles are roles created in the root container and they exist in all containers. These roles can have a different set of privileges in different containers and they can be granted to either common or local users or roles.
Getting ready
To complete this recipe, you'll need an existing common user who has create role
privilege granted commonly.
How to do it...
- Connect to the root container as a common user who has
create role
privilege granted commonly (for example,c##zoran
or system user):SQL> connect c##zoran@cdb1
- Create a common role (for example,
c##role1
):SQL> create role c##role1 container=all;
How it works...
When you create a common role, that role exists in all containers in that database (including a root container and existing and future pluggable databases).

Figure 12
c##zoran@CDB1> select * from dba_roles where role='C##ROLE1'; ROLE PASSWORD AUTHENTICAT COM O ---------------- -------- ----------- --- - C##ROLE1 NO NONE YES N c##zoran@CDB1> connect c##zoran/oracle@pdb1 Connected. c##zoran@PDB1> select * from dba_roles where role='C##ROLE1'; ROLE PASSWORD AUTHENTICAT COM O ---------------- -------- ----------- --- - C##ROLE1 NO NONE YES N c##zoran@PDB1> connect c##zoran/oracle@pdb2 Connected. c##zoran@PDB2> select * from dba_roles where role='C##ROLE1'; ROLE PASSWORD AUTHENTICAT COM O ---------------- -------- ----------- --- - C##ROLE1 NO NONE YES N
There's more...
You can also create common roles by using Oracle Enterprise Manager Cloud Control (OEM) 12c.
You should connect to the root (CDB$ROOT
) as a common user who has create role
privilege granted commonly (for example, c##zoran
or system user). From the Administration menu, select Security (drop-down menu) and then Roles (see Figure 13):

Figure 13
On the Roles page, click on the Create button and the Create Role page appears (Figure 14):

Figure 14
On the Create Role page, you name the role on the General tab (for example, c##role2
). Also, you may grant other roles and privileges to c##role2
(using the tabs Roles, System Privileges, and Object Privileges). After choosing the options and granting privileges to the role, click on the OK button to create it.
- Advanced Quantitative Finance with C++
- HTML5+CSS3王者歸來
- The Android Game Developer's Handbook
- Raspberry Pi Networking Cookbook(Second Edition)
- Building Mobile Applications Using Kendo UI Mobile and ASP.NET Web API
- MySQL數(shù)據(jù)庫管理與開發(fā)實踐教程 (清華電腦學(xué)堂)
- Visual C
- Node學(xué)習(xí)指南(第2版)
- 自學(xué)Python:編程基礎(chǔ)、科學(xué)計算及數(shù)據(jù)分析(第2版)
- Natural Language Processing with Python Quick Start Guide
- Selenium WebDriver Practical Guide
- Keil Cx51 V7.0單片機高級語言編程與μVision2應(yīng)用實踐
- Test-Driven iOS Development with Swift
- 網(wǎng)絡(luò)綜合布線與組網(wǎng)實戰(zhàn)指南
- Manage Your SAP Projects with SAP Activate