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

使用已有PDB克隆PDB

时间:2017-09-16 20:49:58      阅读:186      评论:0      收藏:0      [点我收藏+]

标签:ble   alt   lap   name   ted   pre   克隆   connected   1.0   

技术分享
使用已有PDB克隆PDB

$ sqlplus ‘/as sysdba‘

SQL*Plus: Release 12.1.0.1.0 Production on Tue Jun 23 13:46:53 2015

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> show con_name;

CON_NAME
------------------------------
CDB$ROOT
SQL> select con_id,name,open_mode,restricted from v$pdbs order by 1;

    CON_ID NAME                           OPEN_MODE  RES
---------- ------------------------------ ---------- ---
         2 PDB$SEED                       READ ONLY  NO
         3 YB                             MOUNTED
         4 YB1                            MOUNTED

SQL> alter session set container=yb;

Session altered.

#用来克隆的pdb必须是以read only模式打开
SQL> startup open read only;
Pluggable Database opened.
SQL> alter session set container=CDB$ROOT;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT

SQL> create pluggable database clonedb from yb file_name_convert=(‘/u12/app/oracle/oradata/ora12/yb/‘,‘/u12/app/oracle/oradata/ora12/clonedb/‘);

Pluggable database created.

SQL>  select con_id,name,open_mode,restricted from v$pdbs order by 1;

    CON_ID NAME                           OPEN_MODE  RES
---------- ------------------------------ ---------- ---
         2 PDB$SEED                       READ ONLY  NO
         3 YB                             READ ONLY  NO
         4 YB1                            MOUNTED
         5 CLONEDB                        MOUNTED

SQL> 
技术分享

使用已有PDB克隆PDB

标签:ble   alt   lap   name   ted   pre   克隆   connected   1.0   

原文地址:http://www.cnblogs.com/wangchaoyuana/p/7532012.html

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