12c之后用户分为公共用户和本地用户
    1.添加公共用户

    1. # 公用用户的创建语法
    2. create user c##lhr identified by lhr;
    3. create user c##lhr identified by lhr default tablespace users temporary tablespace temp;
    4. create user c##lhr identified by lhr container=all;
    5. #给公用用户赋权
    6. grant dba to c##lhr container=all;
    7. #连接,可以连接到cdb,也可以连接到pdb
    8. conn C##LHR/lhr@localhost/PDBPROD2.example.com

    2.添加本地用户

    1. create user xxt identified by lhr container=current;
    2. grant dba to xxt container=current;
    3. --视图查询
    4. SELECT A.USERNAME,
    5. A.CON_ID,
    6. A.COMMON,
    7. A.DEFAULT_TABLESPACE,
    8. A.TEMPORARY_TABLESPACE
    9. FROM CDB_users a
    10. where a.username = 'XXT';

    3.取消12C创建用户”c##”限制

    1. alter system set common_user_prefix='' scope=spfile;
    2. 重启数据库