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

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

主站蜘蛛池模板: 九龙县| 合江县| 叶城县| 田阳县| 博客| 大庆市| 仙桃市| 黎城县| 赫章县| 博白县| 克什克腾旗| 榆中县| 株洲县| 曲麻莱县| 张家川| 蕉岭县| 兰考县| 漳浦县| 商都县| 五指山市| 彭阳县| 合水县| 寿光市| 依兰县| 林口县| 新余市| 达拉特旗| 鸡西市| 浦江县| 洪雅县| 荔浦县| 绥德县| 吴桥县| 海淀区| 新津县| 永善县| 正定县| 鹿泉市| 海口市| 洛扎县| 杭州市|