官术网_书友最值得收藏!

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...

  1. 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 
    
  2. 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.

How it works...

Figure 4

Rules/guidelines for creating and managing common users

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## or C## unless you change the internal parameter common_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 value c## or C##). However, you can choose it by changing the value of the common_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.

How to create a common user using OEM 12c

  1. Start OEM 12c and log in using user SYSMAN or SYSTEM.
  2. From the Databases page, select the root database in which you want to create a common user. The database home page appears.
  3. From the Administration menu, select Security (a drop-down menu) and then Users (see Figure 5):
    How to create a common user using OEM 12c

    Figure 5

  4. If prompted, log in to the root as a common user who has a create user privilege (for example, c##zoran; see Figure 6):
    How to create a common user using OEM 12c

    Figure 6

  5. Click on the Create button (see Figure 7):
    How to create a common user using OEM 12c

    Figure 7

  6. 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:
    How to create a common user using OEM 12c

    Figure 8

主站蜘蛛池模板: 宣汉县| 乌拉特中旗| 澄迈县| 柏乡县| 饶河县| 维西| 丁青县| 马鞍山市| 利津县| 丰宁| 兴城市| 连江县| 镇沅| 鹤峰县| 大同市| 威远县| 清水河县| 曲麻莱县| 石城县| 页游| 定南县| 武宣县| 常德市| 彭阳县| 会理县| 鄂托克前旗| 乌鲁木齐市| 麦盖提县| 芮城县| 滨州市| 福泉市| 朝阳区| 本溪市| 鄂伦春自治旗| 钟山县| 康乐县| 丹凤县| 夏邑县| 新丰县| 四川省| 巴塘县|