Upgrade a Non-CDB To a PDB on CDB
1、Stop the cluster database and start database on one node with read noly
[oracle@raca1 admin]$ srvctl stop database -d racdb
[oracle@raca1 admin]$
[oracle@raca1 admin]$
[oracle@raca1 admin]$ sqlplus / as sysdba SQL*Plus: Release 12.2.0.1.0 Production on Wed Apr 19 10:58:17 2017 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount;
ORACLE instance started. Total System Global Area 7.8920E+10 bytes
Fixed Size 12169704 bytes
Variable Size 7516196376 bytes
Database Buffers 4.5366E+10 bytes
Redo Buffers 256262144 bytes
In-Memory Area 2.5770E+10 bytes
Database mounted.
SQL> alter database open read only; Database altered. 2、Create XML for PDB,and you can choose any path to locate you XML file,this XML depends on you source database.
SQL> exec DBMS_PDB.DESCRIBE('/home/oracle/racdb.xml'); PL/SQL procedure successfully completed. 3、close your source database.
SQL> shutdown immediate 4、change the environment to new cdb,and check the pdb is or not compatible
[oracle@raca1 ~]$ export ORACLE_SID=raca1
[oracle@raca1 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.2.0.1.0 Production on Wed Apr 19 16:18:36 2017 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production SQL> show con_name CON_NAME
------------------------------
CDB$ROOT SQL> set serveroutput on
SQL> DECLARE
2 compatible CONSTANT VARCHAR2(3) :=
3 CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY(
4 pdb_descr_file => '/home/oracle/racdb.xml',
5 pdb_name => 'RACDB')
6 WHEN TRUE
7 THEN 'YES'
8 ELSE 'NO'
9 END;
10 BEGIN
11 DBMS_OUTPUT.PUT_LINE(compatible);
12 END;
13 /
YES PL/SQL procedure successfully completed. 5、Then,create the pluggable database, and to plug the database into the CDB
###ERROE
SQL> CREATE PLUGGABLE DATABASE racdb USING '/home/oracle/racdb.xml' NOCOPY TEMPFILE REUSE;
CREATE PLUGGABLE DATABASE racdb USING '/home/oracle/racdb.xml' NOCOPY TEMPFILE REUSE
*
ERROR at line 1:
ORA-65139: Mismatch between XML metadata file and data file
+DATA/racdb/datafile/system01.dbf for value of fcpsb (180939629 in the plug XML
file, 181038820 in the data file) 6、Some metadata file and data file is not correct,I prefer to generate a new XML:
[oracle@raca1 ~]$ export ORACLE_SID=racdb1
[oracle@raca1 ~]$ echo $ORACLE_SID
racdb1
[oracle@raca1 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.2.0.1.0 Production on Wed Apr 19 16:47:51 2017 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount;
ORACLE instance started. Total System Global Area 7.8920E+10 bytes
Fixed Size 12169704 bytes
Variable Size 7516196376 bytes
Database Buffers 4.5366E+10 bytes
Redo Buffers 256262144 bytes
In-Memory Area 2.5770E+10 bytes
Database mounted.
SQL> alter database open read only; Database altered. SQL> exec DBMS_PDB.DESCRIBE('/home/oracle/racdb.xml'); PL/SQL procedure successfully completed. SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down. 7、change the environment to new ORACLE_HOME and ORACLE_SID,Use the following command syntax to create the pluggable database, and to plug the database into the CDB:
[oracle@raca1 ~]$ export ORACLE_SID=raca1
[oracle@raca1 ~]$ sqlplus / as sysdba
SQL> CREATE PLUGGABLE DATABASE racdb USING '/home/oracle/racdb.xml' NOCOPY TEMPFILE REUSE; Pluggable database created. SQL> alter session set container=racdb; Session altered. SQL> @$ORACLE_HOME/rdbms/admin/noncdb_to_pdb.sql 8、remove the source non-cdb from crs,you must use root account
[grid@racd2 ~]$ srvctl remove database -d racdb
Remove the database racdb? (y/[n]) y
PRKO-3077 : Failed to remove database racdb: PRCD-1032 : Failed to remove database resource racdb
PRCR-1028 : Failed to remove resource ora.racdb.db
PRCR-1072 : Failed to unregister resource ora.racdb.db
CRS-0245: User does not have enough privilege to perform the operation
[grid@racd2 ~]$ exit
logout
[root@racd2 ~]# cd /u01/grid/app/12.2.0/bin/
[root@racd2 bin]# ./srvctl remove database -d racdb [root@racd2 bin]# su - grid
Last login: Thu Apr 20 15:35:31 CST 2017
[grid@racd2 ~]$ crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora....SM.lsnr ora....er.type ONLINE ONLINE racd1
ora.DATA.dg ora....up.type ONLINE ONLINE racd1
ora....ER.lsnr ora....er.type ONLINE ONLINE racd1
ora....AF.lsnr ora....er.type OFFLINE OFFLINE
ora....N1.lsnr ora....er.type ONLINE ONLINE racd1
ora.MGMT.dg ora....up.type ONLINE ONLINE racd1
ora.MGMTLSNR ora....nr.type ONLINE ONLINE racd1
ora.VOTE.dg ora....up.type ONLINE ONLINE racd1
ora.asm ora.asm.type ONLINE ONLINE racd1
ora.chad ora.chad.type ONLINE ONLINE racd1
ora.cvu ora.cvu.type ONLINE ONLINE racd1
ora.mgmtdb ora....db.type ONLINE ONLINE racd1
ora....network ora....rk.type ONLINE ONLINE racd1
ora.ons ora.ons.type ONLINE ONLINE racd1
ora.qosmserver ora....er.type ONLINE ONLINE racd1
ora.racd.db ora....se.type ONLINE ONLINE racd1
ora....D1.lsnr application ONLINE ONLINE racd1
ora.racd1.ons application ONLINE ONLINE racd1
ora.racd1.vip ora....t1.type ONLINE ONLINE racd1
ora....D2.lsnr application ONLINE ONLINE racd2
ora.racd2.ons application ONLINE ONLINE racd2
ora.racd2.vip ora....t1.type ONLINE ONLINE racd2
ora.scan1.vip ora....ip.type ONLINE ONLINE racd1 [oracle@racd2 ~]$ echo $ORACLE_SID
racdb2
[oracle@racd2 ~]$ export ORACLE_SID=racd2
[oracle@racd2 ~]$ sqlplus / as sysdba SQL*Plus: Release 12.2.0.1.0 Production on Thu Apr 20 15:46:33 2017 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production SQL> alter session set container=racdb; Session altered. SQL> select instance_name,status from gv$instance; INSTANCE_NAME STATUS
---------------- ------------
racd2 MOUNTED
racd1 MOUNTED SQL> alter pluggable database racdb open; Pluggable database altered. SQL> alter pluggable database racdb save state; Pluggable database altered.
Upgrade a Non-CDB To a PDB on CDB的更多相关文章
- CDB中plug PDB
CDB中plug PDB 先决条件: ·CDB要能够访问之前被unplugged 的pdb的xml文件.如果不能访问,需要使用dbms_pdb.recover创建一个xml文件 ·CDB要能够访问到该 ...
- oracle 12c 创建PDB用户即Local User (PDB与CDB)
Oracle 12C用户创建与表空间分配 数据库安装完成后,首先用系统用户链接数据库容器(CDB), 在数据库容器(CDB)中创建表空间‘imei’ SQL>create tablespace ...
- jdbc-connect-oracle12c-pdb/cdb(jdbc连接oracle12c的pdb和cdb)
1 本文简介: 通过特意引发问题,聚焦问题,解决问题,并循序渐进 最后总结jdbc连接oracle12c中cdb和pdb的条件. 软件环境:Redhat7.1+orcacle12c 2 ...
- Oracle 12C -- plug unplugged PDB into CDB
connetct to CDB as a common user and verify that pdb_test is closed SQL> select con_id,dbid,name, ...
- Oracle12c多租户如何连接到CDB或PDB、CDB与PDB容器切换
Oracle 数据库 12 c 多租户选项允许单个容器数据库 (CDB) 来承载多个单独的可插拔数据库 (PDB).那么我们如何连接到容器数据库 (CDB) 和可插拔数据库 (PDB). 1. V$S ...
- Oracle 12c PDB和CDB全局用户权限问题
Oracle12c版本中引入了新的CDB和PDB 默认登陆CDB后创建的用户为全局用户必须以c##开头 如果要访问CDB中的表,可以用GRANT命令赋权 但是上面的赋权并不会再PDB中生效 如果要这个 ...
- Oracle 12c 多租户配置和修改 CDB 和 PDB 参数
1. 配置CDB 实例参数,影响CDB与所有 PDB为CDB配置例程参数相对于对于非CDB的数据库是变化不太.ALTER SYSTEM命令用于设置初始化参数,与使用ALTER DATABASE命令修改 ...
- 理解 Oracle 多租户体系中(12c,18c,19c)创建用户作用域范围
本篇探讨以下几个问题:你可提前猜测下面6个场景语句中,哪几个可以成功创建用户? 1. 在CDB级别中创建公共用户,不带 container 子句的效果: 2. 在CDB级别中创建公共用户,带 cont ...
- Oracle12cr1新特性之容器数据库(CDB)和可插拔数据库(PDB) 的启动和关闭
Oracle12c中引入的多宿主选项(multitenant option)允许一个容器数据库容纳多个独立的可插拔数据库(PDB).本文将说明如何启动和关闭容器数据库(CDB)和可插拔数据库(PDB) ...
随机推荐
- IDEA 多线程Debug
一.问题描述 在idea中的进行调试时,代码中有多线程,想对线程中的代码进行跟踪,代码如下: for (int i = 0; i < 5; i++) { final int index = i; ...
- 使用Boolean类型同步锁引起异常的分析
原文地址 http://topic.csdn.net/u/20080710/19/f61cb4db-ddff-4457-a26a-4ea578b0cc6c.html?87447500 http://w ...
- 检测鼠标指针的改变(使用GetCursorInfo API函数)
第一步:定义全局变量用于状态改变时的对比 var Form1: TForm1; OldCI:HICON; 第二步:添加Timer组件,Interval设置随意一般50就可以了. 增加Memo组件用于记 ...
- C#中的反射总结
= 导航 顶部 什么是反射 为什么要使用反射 C#反射相关的命名空间 通过反射创建类型的实例 通过反射调用类的方法 查看类中成员 查看类的构造函数 查看类中属性 查看类中字段 反射实现的接口 ...
- memcache redis mogodb 分别适用在什么样的场景?
memcache 与 redis 都是key-value存储系统,相对来说redis可能比memcache适应场景多些,存储的value类型也更多些,而redis也支持主从同步.而mongo是一种文档 ...
- Struts2——(1)Struts2入门
1.Struts2历史,与Struts1的关系 两者的内部基于的原理完全不同,Struts2是基于WebWork发展而来的框架. 两者都是基于MVC实现的框架. Struts1是Apach推出的. W ...
- Android中使用JUnit测试
package com.meritit.lottery.test; import java.util.List; import android.test.AndroidTestCase; import ...
- hadoop编程技巧(6)---处理大量的小型数据文件CombineFileInputFormat申请书
代码测试环境:Hadoop2.4 应用场景:当需要处理非常多的小数据文件,这种技术的目的,可以被应用到实现高效的数据处理. 原理:申请书CombineFileInputFormat,能够进行切片合并的 ...
- RabbitMq核心概念和术语
简介 越来越多的消息中间件很容易让人产生混淆,在学习一种消息中间件的时候,最好先了解他的几种抽象概念,方便你理解,明白了这些概念,你学习起来的时候也就得心应手,同时也是使用好RabbitMQ的基础. ...
- 「两」创建一个带 ssh 镜座服务(修订版)--采用 Dockerfile 创
创建目录 首先,创建一个叫做 sshd_ubuntu 的目录,用于存放我们的 Dockerfile .脚本文件.以及其它文件. $ mkdir sshd_ubuntu $ ls sshd_ubuntu ...