报错: ORA-65096: invalid common user or role name
1.登录
- [root@oracle-db-19c ~]# su - oracle
- [oracle@oracle-db-19c ~]$ sqlplus / as sysdba
-
- SQL*Plus: Release 19.0.0.0.0 - Production on Wed Nov 16 12:45:27 2022
- Version 19.3.0.0.0
-
- Copyright (c) 1982, 2019, Oracle. All rights reserved.
-
-
- Connected to:
- Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
- Version 19.3.0.0.0
-
- SQL> show user;
- USER is "SYS"
- SQL>
2.核查当前环境所在的容器
- SQL> select sys_context ('USERENV', 'CON_NAME') from dual;
-
- SYS_CONTEXT('USERENV','CON_NAME')
- --------------------------------------------------------------------------------
- CDB$ROOT
-
- SQL> set pagesize 200
- SQL> set linesize 200
- SQL> select con_id,dbid,NAME,OPEN_MODE from v$pdbs;
-
- CON_ID DBID NAME OPEN_MODE
- ---------- ---------- -------------------------------------------------------------------------------------------------------------------------------- ----------
- 2 2760955567 PDB$SEED READ ONLY
- 3 2714456025 PDB1 READ WRITE
-
- SQL> alter session set container=PDB1;
-
- Session altered.
-
- SQL> select sys_context ('USERENV', 'CON_NAME') from dual;
-
- SYS_CONTEXT('USERENV','CON_NAME')
- --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- PDB1
-
- SQL> create user pstest identified by pstest;
-
- User created.
-
- SQL>