|
报错现象:
SQL> alter user scott account unlock identified by tiger;
alter user scott account unlock identified by tiger
*
第 1 行出现错误:
ORA-01918: 用户 'SCOTT' 不存在
查询是否有SCOTT用户
SQL> select username from dba_users where username like 'SCOTT';
未选定行
创建SCOTT用户
SQL> create user scott identified by tiger;
create user scott identified by tiger
*
第 1 行出现错误:
ORA-65096: 公用用户名或角户
其实是oracle 12c在结构上做出了调整,引入了CDB和PDB的概念。我刚才的操作是在CDB中的操作,用sys默认登录的是CDB,但是如果想在CDB中创建用户(可以理解为公共用户)的话,
那么必须在用户名前面加上“c##”或“C##”:
SQL> create user c##wangjia identified by wangjia;
用户已创建
SQL> select ename,empno,job from emp offset 5 rows fetch next 5 rows only;
ENAME EMPNO JOB
---------- ---------- ---------
BLAKE 7698 MANAGER
CLARK 7782 MANAGER
SCOTT 7788 ANALYST
KING 7839 PRESIDENT
TURNER 7844 SALESMAN
|
|