oracle 12c多租户下的日常操作变化
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:
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.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.
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).
Oracle Applications , or other Oracle products, may have supported configurations not listed in the matrix above.
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 .
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多租户下的日常操作变化的更多相关文章
- Oracle 12c多租户架构浅析
Oracle数据库12c的一大创新即是其采用的多租户架构.对于多租户这项新功能,业内的评价褒贬不一.有的声音认为,这项功能的用处不是特别大,但在某些场景或特定的环境下,多租户依然有它的用处.其最大的用 ...
- 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 用户 ...
- PL/SQL Developer 登录 Oracle 12c和Win10下安装Oracle 11g
安装了Oracle 12c 后使用PL/SQL Developer怎么也不能连接到Oracle 12c.网上找一下,按照fcflying所说的操作成功了,所以做个笔记: 1)安装Oracle 12c ...
- Oracle 12c 多租户 CDB 与 PDB 级别 expdb 与 impdb(表、用户、全库)
Oracle 数据库 12 c 多租户下,如何在容器数据库 (CDB) 和可插拔数据库 (PDB) 中使用 expdb 与 impdp (数据泵) 呢? 我们一起探讨下PDB 下进行表级,用户级别,全 ...
- oracle 12c 多租户 pdb 恢复(单个pdb数据文件、非系统pdb表空间、整个pdb数据库)
环境:数据库版本 Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production 实验准备:1.-- 数据库归 ...
- GoldenGate 12.2抽取Oracle 12c多租户配置过程
linux下安装12c 重启linux之后,dbca PDB/CDB使用 SQL> select instance_name from v$instance; INSTANCE_NAME --- ...
- [转]Oracle 12c多租户特性详解:PDB 的创建、克隆与维护
转自:http://chuansong.me/n/443660447865 PDB 的创建和访问 在使用 dbca 建库时,创建数据库之前,可以保存一下创建脚本,分析其具体执行过程.以自定义方式创建名 ...
- Oracle 12c 多租户在 CDB 中 Plug A PDB,Unplugging A PDB
Oracle 数据库 12 c 中介绍了多租户选项允许单个容器数据库 (CDB) 来承载多个单独的可插拔数据库 (PDB).本文简单的演示了如何在 CDB 中 Plug A PDB,Unpluggin ...
- Oracle 12c 多租户 CDB 与 PDB 备份
一. CDB 备份 1.1 只备份CDB 只备份CDB数据库需要具有SYSDBA或SYSBACKUP权限用户连接到CDB的root环境下,执行backupdatabase root命令即可完成对C ...
随机推荐
- js 数组里面任意两个数的和与目标值
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- iOS 正则表达式(一)
在iOS开发中,正则一直是最常用的,但也是一直记不住的,现在做一些简单的总结 我们在网上找的正则,要有'\',这个在iOS是转义符,需要'\\'这样 int main(int argc, const ...
- shell基础:输入输出重定向
输出重定向将命令输出存入到文件,类似日志.便于查看.2和>>间没空格.但这种方法没用 ,命令执行时并不知道对错. /dev/null下的null就是一个垃圾箱,脚本中的一些命令并不需要保存 ...
- nodejs发送邮件
这里我主要使用的是 nodemailer 这个插件 第一步 下载依赖 cnpm install nodemailer --save 第二步 建立email.js 'use strict'; const ...
- Mysql重连错误
Caused by: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully rec ...
- 使用淘宝npm镜像
我们都知道淘宝大量采用了Nodej技术,所以它的镜像还是值得肯定的!更多相关可查看:淘宝NPM镜像 npm的官方镜像在国内访问是比较慢的,所以替代方法是使用淘宝npm镜像! 淘宝 NPM 镜像是一个完 ...
- RobotFrameWork(十三)RobotFramework与loadrunner性能测试结合(基于Remote库)
一般我们进行完功能测试,都需要进行下性能测试,那么这章我来介绍下,RobotFramework与loadrunner性能测试的融合,即运行完自动化功能测试,借助RobotFramework的Remot ...
- Runtime(IV) - 序列化与反序列化
准备条件 父类 Biology Biology.h #import <Foundation/Foundation.h> @interface Biology : NSObject { NS ...
- Python学习记录之-----类
面向过程 VS 面向对象 编程范式 编程是 程序 员 用特定的语法+数据结构+算法组成的代码来告诉计算机如何执行任务的过程 , 一个程序是程序员为了得到一个任务结果而编写的一组指令的集合,正所谓条条大 ...
- MySql 学习参考目录
[1]< MySql 数据类型> [2]< MySql 基础 > [3]< MySql 存储过程 > PS:个人认为,如上总结超值. Good Good Study ...