Oracle 12c创建用户时出现“ORA-65096: invalid common user or role name”的错误

在oracle中,引入了多租户概念,以前是一个instance对应一个database(单实例),或者多个instance对应一个database(RAC),现在一个实例可以对应多个database了,除了这个CDB(Container Database):数据库容器之外,还可以有很多个PD(Pluggable Database):可插拔数据库(一般来说大部分都是一个居多,测试环境除外),所有的操作都必须在特定的database之下,CDB只是维护了instance全局的数据字典。所以,需要切换到特定的上下文才能操作。

查看当前session所在的上下文:

查看所有的pdb也可以通过show pdbs:

Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0

SQL> show pdbs;

CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 ORCLPDB READ WRITE NO
SQL>

切换PDB:

登录的时候指定PDB:

查看当前pdb:

SQL> show con_name;

CON_NAME
------------------------------
ORCLPDB

连接到PDB

当创建pdb之后,使用lsnrctl status命令可以看到多了一个以pdb为名的service,如下:

对于连接到PDB,只要指定service_name即可。

JDBC连接注意:

jdbc:oracle:thin:@//<host>:<port>/ServiceName,连接PDB就要使用这种。

jdbc:oracle:thin:@<host>:<port>:<SID>

可插接式数据库(PDB) 自动启动(这很重要,否则每次还要切换很麻烦)

默认情况下,在CDB 启动的时候,all 的PDB 都是mount状态。我们可以通过触发器来实现pdbs随cdb自动启动
[oracle@12c01 ~]$ sqlplus / as sysdba
SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL>
CREATE OR REPLACE TRIGGER open_pdbs
AFTER STARTUP ON DATABASE
BEGIN
EXECUTE IMMEDIATE 'ALTER PLUGGABLE DATABASE ALL OPEN';
END open_pdbs;
/
Trigger created.

验证 PDB 自动启动:
SQL> startup;
SQL> show pdbs

CON_ID CON_NAME  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED  READ ONLY  NO
3 PDB01  READ WRITE NO

12C cdb/pdb 配置监听

有时候动态注册不上,可以考虑静态注册:

接下来使用SID_LIST_LISTENER来进行静态注册服务。
SID_LIST_LISTENER=
(SID_LIST=
(SID_DESC =
(GLOBAL_DBNAME = ora12c) #该服务是我配置的cdb信息
(SID_NAME = ora12c)
) (SID_DESC =
(GLOBAL_DBNAME = pdborcl)#该服务是我配置的pdb信息
(SID_NAME = ora12c)
)
)
pl/sql developer连接Oracle 12c R2 PDB报错ORA-28040/ORA-01017  invalid username/password; logon denied
今日测试升到18c之后出现,我本机没有问题,经查只有11.2.0.3及以上的版本的客户端才能连接12.2版本的服务端。
Client
Version
Server Version
12.2.0#10 12.1.0 11.2.0 11.1.0 10.2.0 10.1.0 9.2.0
12.2.0 Yes Yes Yes No No No#3 No#3
12.1.0 Yes Yes Yes Was MDS #7 No#3 No#3
11.2.0 Yes#9 Yes Yes Was MDS #7 No Was #5
11.1.0 No Was Was Was Was #7 Was #6 Was #5
10.2.0 No MDS #7 MDS #7 Was #7 MDS Was Was #5
10.1.0#4 No No Was #6 Was #6 Was Was Was
9.2.0 No No#8 Was #5 Was #5 Was #5 Was Was

Key:

Yes Supported
ES Supported but fixes only possible for customers with Extended Support .
LES or MDS Supported but fixes only possible for customer with a valid Limited Extended Support or Market-Driven Support contract respectively.
Was Was a supported combination but one of the releases is no longer covered by any of Premier Support, Primary Error Correct support, Extended Support, nor Extended Maintenance Support. Fixes are no longer possible.
No Has never been Supported

Specific Notes:

#1 - See Note:207319.1#2 - An ORA-3134 error is incorrectly reported if a 10g client tries to connect to an 8.1.7.3 or lower server. See Note:3437884.8 .#3 - An ORA-3134 error is correctly reported when attempting to connect to this version.#4 - There are problems connecting from a 10g client to 8i/9i where one is EBCDIC based. See Note:3564573.8#5 - For connections between 10.2 (or higher) and 9.2 the 9.2 end MUST be at 9.2.0.4 or higher. Connections between 10.2 (or higher) and 9.2.0.1, 9.2.0.2 or 9.2.0.3 have never been supported.#6 - For connections between 11.1 (or higher) database server and 10.1 / 10.2 database server across a database link the 10g end MUST be at 10.1.0.5 / 10.2.0.2 (or higher) respectively in order to use PLSQL between those versions. (This does not apply to normal 11g clients to 10g database server only server to server and a few very specific client products, such as Oracle Forms). See Note:4511371.8 for more details.#7 - For database link connections between 11.1 (or higher) and 10.2 the 10g end MUST be at 10.2.0.2 (or higher) in order to use PLSQL between those versions. See Note:4511371.8 for more details.#8 - Attempting to connect from 9.2 to 12.1 will fail with an "ORA-28040: No matching authentication protocol" error.#9 - 11.2.0.3 or 11.2.0.4 only. We do not support any 11.2 client interoperability with Oracle Database Exadata Express Cloud Service#10 - Includes Oracle Database Exadata Express Cloud Service - see Note:2183770.1 for additional details

General Notes:

    1. For database links between different Oracle versions connections must be supported in BOTH directions in the matrix above.
      eg: As 11.2 -> 10.1 is not supported then database links between these version are not supported in either direction.

    2. Unsupported combinations may appear to work but can encounter errors for particular operations. The fact that they appear to work should not be relied upon - issues on unsupported combinations will not be investigated.

    3. Since new database servers are compatible with a limited set of older OCI clients, it may not be necessary to upgrade the client software when upgrading the database. However, some new features may not work without upgrading the client software. For example, an Oracle 10.2 client is able to connect to an 11.2 database, but is not able to take advantage of newer features such as Client Result Cache (introduced in 11.1).

    4. Oracle Applications , or other Oracle products, may have supported configurations not listed in the matrix above.

    5. The matrix above also applies between different platforms and between 32/64 bit releases of Oracle client / server except where any Oracle platform desupport notice indicates otherwise .

    6. Unix BEQUEATH (BEQ) connections are NOT supported between different releases. eg: Client 10.2 is not supported to make an Oracle Net connection to a 11.2 server using the BEQ protocol adapter regardless of the interoperability support listed above. See Note:364252.1 for more details.

oracle 12c多租户下的日常操作变化的更多相关文章

  1. Oracle 12c多租户架构浅析

    Oracle数据库12c的一大创新即是其采用的多租户架构.对于多租户这项新功能,业内的评价褒贬不一.有的声音认为,这项功能的用处不是特别大,但在某些场景或特定的环境下,多租户依然有它的用处.其最大的用 ...

  2. Oracle 12c 多租户家族(12c 18c 19c)如何在 PDB 中添加 HR 模式

    Oracle 12c 多租户家族(12c [12.2.0.1].18c [12.2.0.2].19c [12.2.0.3])如何在 PDB 中添加模式:19c (19.3) 手工添加示例 HR 用户 ...

  3. PL/SQL Developer 登录 Oracle 12c和Win10下安装Oracle 11g

    安装了Oracle 12c 后使用PL/SQL Developer怎么也不能连接到Oracle 12c.网上找一下,按照fcflying所说的操作成功了,所以做个笔记: 1)安装Oracle 12c ...

  4. Oracle 12c 多租户 CDB 与 PDB 级别 expdb 与 impdb(表、用户、全库)

    Oracle 数据库 12 c 多租户下,如何在容器数据库 (CDB) 和可插拔数据库 (PDB) 中使用 expdb 与 impdp (数据泵) 呢? 我们一起探讨下PDB 下进行表级,用户级别,全 ...

  5. oracle 12c 多租户 pdb 恢复(单个pdb数据文件、非系统pdb表空间、整个pdb数据库)

    环境:数据库版本 Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 实验准备:1.-- 数据库归 ...

  6. GoldenGate 12.2抽取Oracle 12c多租户配置过程

    linux下安装12c 重启linux之后,dbca PDB/CDB使用 SQL> select instance_name from v$instance; INSTANCE_NAME --- ...

  7. [转]Oracle 12c多租户特性详解:PDB 的创建、克隆与维护

    转自:http://chuansong.me/n/443660447865 PDB 的创建和访问 在使用 dbca 建库时,创建数据库之前,可以保存一下创建脚本,分析其具体执行过程.以自定义方式创建名 ...

  8. Oracle 12c 多租户在 CDB 中 Plug A PDB,Unplugging A PDB

    Oracle 数据库 12 c 中介绍了多租户选项允许单个容器数据库 (CDB) 来承载多个单独的可插拔数据库 (PDB).本文简单的演示了如何在 CDB 中 Plug A PDB,Unpluggin ...

  9. Oracle 12c 多租户 CDB 与 PDB 备份

    一.  CDB 备份 1.1  只备份CDB 只备份CDB数据库需要具有SYSDBA或SYSBACKUP权限用户连接到CDB的root环境下,执行backupdatabase root命令即可完成对C ...

随机推荐

  1. TextCNN

    一.什么是TextCNN? 将卷积神经网络CNN应用到文本分类任务,利用多个不同size的kernel来提取句子中的关键信息(类似于多窗口大小的ngram),从而能够更好地捕捉局部相关性. 二.Tex ...

  2. histogram 和 bar plot的区别

    最本质的区别是这样的:histogram用来描述的是numerical变量,而bar plot用来描述的是categorical类型的变量.统计学当中关于变量的分类 这可以从它们的图形上面看到: hi ...

  3. 20165321实验一 Java开发环境的熟悉

    一.idea调试: 二.实验内容: 实现学生成绩管理功能(增删改,排序,查找),并进行测试(正常情况,异常情况,边界情况). 运行截图: 代码: public class Student { Stri ...

  4. 安装python sklearn经验总结

    1. 需要安装 numpy, scipy, 和sklearn和ipython,Cython sklearn,ipython, Cython都可以通过pip来安装.但scipy,可能还有numpy必须通 ...

  5. Dockerfile详解(一)

    Dockerfile 用于自动化构建一个docker镜像.Dockerfile里有 CMD 与 ENTRYPOINT 两个功能咋看起来很相似的指令,开始的时候觉得两个互用没什么所谓,但其实并非如此: ...

  6. Asp.netCore之安装centos7 资料收集

    虚拟机的安装和centos的安装看博友的文章:https://www.cnblogs.com/zhaopei/p/netcore.html ifconfig 在centons中用终端写命令比较费劲,可 ...

  7. 46.HTML---18个学习 flexbox 的优质资源

    大家都在谈论的“flexbox”是什么呢?它能帮我们解决什么问题呢?现在你可以在你的项目中使用“flexbox”吗?这些指南.教程.网站和工具会告诉你你需要知道的关于“flexbox”的知识. Lea ...

  8. Navicat Premium 安装与激活破解版简单操作 (原)

    首先下载navicate程序以及破解文件,这里一并存到了百度网盘直接下载即可 链接:https://pan.baidu.com/s/11ptFmsV1o3B5oB00zm2NdQ 密码:yw82 解压 ...

  9. 北京时间转为时间搓 标准时间转为UTC

    int standard_to_stamp(char *str_time)  {          struct tm stm;          int iY, iM, iD, iH, iMin, ...

  10. Mongodb 文档时间字段修改

    mongo文档[tblEvent]如下: {     "_id" : ObjectId("5a0415f9bf28b684b1c7f5b2"),     &qu ...