在12c中建立使用者--避免ORA-65096 or ORA-65049錯誤
來源於:
Creating users in 12c - avoiding ORA-65096 or ORA-65049. (文檔 ID 1572404.1)
適用於:
Oracle Database - Enterprise Edition - Version 12.1.0.1 and later
Information in this document applies to any platform.
當使用之前版本的sql文法在12c中建立user時,若時使用pluggable database,an ORA-65096 or ORA-65049會遇到。
目標:
在pluggable database中建立立一個user。
解決方案:
首先,要確定的是這個新user是 COMMON_USERS 還是 LOCAL_USERS 。sqlplus / as sysdba
對於COMMON_USERS,使用者名稱務必以C##開頭
SQL>create user scott identified by tiger;ORA-65096: invalid common user or role nameSQL>create user c##scott identified by tiger;User created.
v$services 會顯示可用的pdb
SQL>select PDB from v$services;PDB--------------------------PDBORCLCDB$ROOTCDB$ROOTCDB$ROOTCDB$ROOTshow con_nameCON_NAME-----------------CDB$ROOT
若是為一個pluggable database建立一個local user,那麼必須在建立該user之前,選擇該pluggable database
SQL> alter session set container=PDBORCL;SQL> show con_nameCON_NAME-----------------PDBORCLSQL>create user scott1 identified by tiger1;User created.