在oracle执行:create user tff identified by tff 的
时候报错了:ORA-65096: invalid common user or role name

SQL> create user tff identified by tff;
create user tff identified by tff
ERROR at line 1:
ORA-65096: invalid common user or role name

报错:ORA-65096: invalid common user or role name(公用用户名或角色名无效).

错误原因:用户想在PDBORCL中创建tff用户,却未设置会话container到PDB,而在CDB中创建公有用户因无法通过名称或角色验证出错.

解决方法:
1、查看Oracle 12c的版本

SQL> select * from v$version;
select sys_context ('USERENV', 'CON_NAME') from dual;

image.png

2、我们可以通过ALTER SESSION SET CONTAINER 指定其他容器

SQL> alter pluggable database PDB19 open;

image.png
4、查看容器

SQL>select con_id,dbid,NAME,OPEN_MODE from v$pdbs;

image.png
5、切换容器到PDB19
image.png
6、查看当前使用容器

SQL>select sys_context ('USERENV', 'CON_NAME') from dual;

image.png
7、创建用户

create user tff identified by tff;
grant dba to tff

image.png

以上问题就可以解决了.


杨花落尽子规啼
9 声望1 粉丝

黑夜里展翅翱翔的恐怖,1H5B一头独狼