- 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
- Advanced Machine Learning with Python
- Getting Started with React
- Redis Applied Design Patterns
- Boost C++ Application Development Cookbook(Second Edition)
- Python 3網(wǎng)絡(luò)爬蟲(chóng)實(shí)戰(zhàn)
- Drupal 8 Configuration Management
- HTML5入門(mén)經(jīng)典
- 高級(jí)語(yǔ)言程序設(shè)計(jì)(C語(yǔ)言版):基于計(jì)算思維能力培養(yǎng)
- Linux C編程:一站式學(xué)習(xí)
- Test-Driven Machine Learning
- Frank Kane's Taming Big Data with Apache Spark and Python
- Python Machine Learning Cookbook
- JavaScript全棧開(kāi)發(fā)
- Python算法交易實(shí)戰(zhàn)
- C#編程魔法書(shū)