- Oracle Database 12c Security Cookbook
- Zoran Pavlovi? Maja Veselica
- 471字
- 2021-07-02 16:43:15
Creating a common user
A common user is a user created in the root container, which has the same identity across all containers. The main purpose of a common user is to perform "infrastructure" administrative tasks, such as starting up a CDB, plugging and unplugging PDBs, and opening PDBs. There are two types of common users: Oracle-supplied (for example, SYS
and SYSTEM
) and user-created common users.
Getting ready
To complete this recipe, you'll need an existing common user who has create user
privilege granted commonly.
How to do it...
- Connect to the root container as a common user who has
create user
privilege granted commonly (for example,c##zoran
or system user):SQL> connect c##zoran@cdb1
- Create a common user (for example,
c##maja
):c##zoran@CDB1> create user c##maja identified by oracle1 container=all;
How it works...
c##maja
is actually not a single user, but each container has a user named c##maja
and the passwords must be the same.

Figure 4
There are a few rules you should be aware of:
- The name of a common user must be unique across all containers. In version 12.1.0.1, it must begin with
c##
orC##
unless you change the internal parametercommon_user_prefix
(which you shouldn't do on a production system without approval from Oracle Support) and, in version 12.1.0.2, it is best practice to use a prefix (default valuec##
orC##
). However, you can choose it by changing the value of thecommon_user_prefix
parameter (this naming convention doesn't apply to Oracle-supplied users in either version). - A common user can have different privileges in different containers.
- The schemas for a common user may contain different objects in different containers.
The column oracle_maintained
(in DBA_USERS
) provides information as to whether a user is created and maintained by Oracle-supplied scripts:
c##zoran@CDB1> select username, oracle_maintained from dba_users where username='SYSTEM' or username='C##ZORAN';
USERNAME O --------------- - SYSTEM Y C##ZORAN N
There's more...
You can also create common users by using Oracle Enterprise Manager Cloud Control (OEM) 12c.
- Start OEM 12c and log in using user
SYSMAN
orSYSTEM
. - From the Databases page, select the root database in which you want to create a common user. The database home page appears.
- From the Administration menu, select Security (a drop-down menu) and then Users (see Figure 5):
Figure 5
- If prompted, log in to the root as a common user who has a
create user
privilege (for example,c##zoran
; see Figure 6):Figure 6
- Click on the Create button (see Figure 7):
Figure 7
- To create a common user, it is enough to fill out the following fields on the General tab: Name (for example,
c##john
), Enter Password, and Confirm Password (see Figure 8) and then click on the OK button:Figure 8
- Mastering Concurrency Programming with Java 8
- Dynamics 365 for Finance and Operations Development Cookbook(Fourth Edition)
- Git Version Control Cookbook
- Linux C/C++服務(wù)器開發(fā)實(shí)踐
- Web Application Development with MEAN
- Django 3.0入門與實(shí)踐
- Raspberry Pi Robotic Blueprints
- 零基礎(chǔ)學(xué)Python編程(少兒趣味版)
- JavaScript機(jī)器人編程指南
- Flask Web開發(fā):基于Python的Web應(yīng)用開發(fā)實(shí)戰(zhàn)(第2版)
- Arduino機(jī)器人系統(tǒng)設(shè)計(jì)及開發(fā)
- Python編程入門(第3版)
- LabVIEW入門與實(shí)戰(zhàn)開發(fā)100例(第4版)
- 少兒編程輕松學(xué)(全2冊)
- Learning QGIS(Second Edition)