Oracle 12c 多租户在 CDB 中 Plug A PDB,Unplugging A PDB

Posted 张冲andy

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle 12c 多租户在 CDB 中 Plug A PDB,Unplugging A PDB相关的知识,希望对你有一定的参考价值。

Oracle 数据库 12 c 中介绍了多租户选项允许单个容器数据库 (CDB) 来承载多个单独的可插拔数据库 (PDB)。
本文简单的演示了如何在 CDB 中 Plug A PDB,Unplugging A PDB 操作。


一、 plugged PDB into Unplugged PDB
SQL> show pdbs
    CON_ID CON_NAME  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED  READ ONLY  NO
3 PDB01  READ WRITE NO
SQL>alter pluggable database pdb01 close immediate;
SQL>alter pluggable database pdb01 unplug into ‘/home/oracle/pdb01.xml‘;
[[email protected] ~]$ pwd
/home/oracle
[[email protected] ~]$ ll pdb01.xml 
-rw-r--r--. 1 oracle oinstall 7758 May  7 05:09 pdb01.xml
[[email protected] ~]$ cat pdb01.xml 
<?xml version="1.0" encoding="UTF-8"?>
<PDB>
  <xmlversion>1</xmlversion>
  <pdbname>PDB01</pdbname>
  <cid>3</cid>
  <byteorder>1</byteorder>
  <vsn>203424000</vsn>
  <vsns>
    <vsnnum>12.2.0.1.0</vsnnum>
    <cdbcompt>12.2.0.0.0</cdbcompt>
    <pdbcompt>12.2.0.0.0</pdbcompt>
    <vsnlibnum>0.0.0.0.24</vsnlibnum>
    <vsnsql>24</vsnsql>
    <vsnbsv>8.0.0.0.0</vsnbsv>
  </vsns>
  <dbid>2550500229</dbid>
...省略
SQL> show pdbs   
    CON_ID CON_NAME  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED   READ ONLY  NO
3 PDB01   MOUNTED
SQL> drop pluggable database pdb01 keep datafiles;
Pluggable database dropped.
SQL> show pdbs    
    CON_ID CON_NAME  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED   READ ONLY  NO


二、 Plug Unplugged PDB into CDB

SQL> SELECT NAME,CDB FROM V$DATABASE;
NAME  CDB
--------- ---
ANDYCDB   YES
SQL> create  pluggable  database  pdb01  using  ‘/home/oracle/pdb01.xml‘;
Pluggable database created.
SQL> show pdbs
    CON_ID CON_NAME  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED  READ ONLY  NO
3 PDB01  MOUNTED
SQL> alter pluggable database pdb01 open;
Pluggable database altered.
SQL> show pdbs
    CON_ID CON_NAME  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED  READ ONLY  NO
3 PDB01  READ WRITE NO

































































以上是关于Oracle 12c 多租户在 CDB 中 Plug A PDB,Unplugging A PDB的主要内容,如果未能解决你的问题,请参考以下文章

Oracle 12c 多租户 CDB 与 PDB 备份

Oracle 12c 多租户配置和修改 CDB 和 PDB 参数

Oracle12c多租户如何连接到CDB或PDBCDB与PDB容器切换

Oracle12c多租户管理用户角色权限

Oracle 12c 多租户 CDB 与 PDB之 shared undo 与 Local undo 切换

多租户:在Oracle12.2中 从Non-CDB迁移到PDB,从PDB迁移另一个CDB中