克隆种子容器
克隆已有的PDB
插入一个非CDB数据库
插入一个以前拔出的PDB
1.克隆种子容器
sqlplus / as sysdba
alter session set db_create_file_dest='/opt/oradata/';
create pluggable database pdbdb admin user pdb_dba identified by oracle
alter pluggable database pdbdb open ;
2. 克隆已有的PDB
alter pluggable database q2 close ;
alter pluggable database q2 open read only ;
create pluggable database q1 from q2
storage unlimited
file_name_convert=none ;
alter pluggable database q1 open read wirte ;;
alter pluggable database q2 close ;
alter pluggable database q2 open read write ;
3. 插入一个非CDB数据库
注:如果是12c以前的版本,就必须先升级到12c, 或者使用data pump 移动该数据库
alter datbase open read only ;
exec dbms_pdb.describe('/home/oracle/to_pdb.xml')
#数据文件拷贝过去
create pluggable database p1 using '/home/oracle/to_pdb.xml';
alte session set container=p1
@noncdb_to_pdb.sql
alter pluggable database p1 open read write ;
4.插入一个以前拔出的PDB
alter pluggable database m1 close ;
alter pluggable database m1 unplug into '/home/oracle/to_pdb.xml'
#数据文件拷贝过去
#drop pluggable database m1 including datafiles ; #删除数据库和文件
#drop pluggable database pdb01 keep datafiles; #删除数据库 保存文件
create pluggable database m1 using '/home/oracle/to_pdb.xml' nocopy ;
alte pluggable database m1 open read wirte ;