1.查看数据库的创建模式
SQL> select name,cdb,con_id from v$database;
NAME CDB CON_ID
--------- --------- ----------
ORA12C YES 0
显示yes为数据库为CDB模式
2.查看ROOT容器名字
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL> select sys_context(‘userenv‘,‘con_name‘) from dual;
SYS_CONTEXT(‘USERENV‘,‘CON_NAME‘)
--------------------------------------------------------------------------------
CDB$ROOT