码迷,mamicode.com
首页 > 数据库 > 详细

oracle 12c 学习之三 nocdb 转换成pdb

时间:2015-03-18 17:59:57      阅读:265      评论:0      收藏:0      [点我收藏+]

标签:

01:23:06 sys@orcl> select name, decode(cdb, 'YES', 'Multitenant Option enabled', 'Regular 12c Database: ') "Multitenant Option" , open_mode, con_id from v$database; 

NAME Multitenant Option OPEN_MODE CON_ID 
--------- -------------------------- -------------------- ------------- 
ORCL Regular 12c Database: READ WRITE 0

可见该数据库是传统的数据库,不是cdb
下面我们把这个数据库转换成cdb
01:27:24 sys@orcl> select name from v$datafile; 

NAME 
---------------------------------------------------------------------------------------------------------------------------------- 
+DATA/ORCL/DATAFILE/system.354.874717421 
+DATA/ORCL/DATAFILE/undotbs2.352.874718065 
+DATA/ORCL/DATAFILE/sysaux.322.874717327 
+DATA/ORCL/DATAFILE/undotbs1.326.874717527 
+DATA/ORCL/DATAFILE/kiwi.328.874718845 
+DATA/ORCL/DATAFILE/users.329.874717527 

6 rows selected. 

Elapsed: 00:00:00.01 
01:27:33 sys@orcl> shutdown immediate; 
Database closed. 
Database dismounted. 
ORACLE instance shut down. 
01:28:46 sys@orcl> startup restrict mount exclusive; 
ORACLE instance started. 

Total System Global Area 2488635392 bytes 
Fixed Size 2291424 bytes 
Variable Size 721422624 bytes 
Database Buffers 1744830464 bytes 
Redo Buffers 20090880 bytes 
Database mounted.

01:29:11 sys@orcl> alter database open read only; 

Database altered. 

Elapsed: 00:00:04.42 
01:30:28 sys@orcl> begin 
01:32:27 2 dbms_pdb.describe(PDB_DESCR_FILE => '/u02/noncdb/orcl.xml'); 
01:32:27 3 end; 
01:32:27 4 /

create pluggable database orcl using '/u02/noncdb/orcl.xml' copy;

alter session set container=orcl;
在执行这个脚本转换成pdb
@?/rdbms/admin/noncdb_to_pdb.sql

oracle 12c 学习之三 nocdb 转换成pdb

标签:

原文地址:http://blog.csdn.net/kiwi_kid/article/details/44417803

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!