pdb的plug、unplug、drop---oracle 12c 學習(2)
---將pdb plug到新cdb中
1.在源資料庫建立pdb的xml檔案
BEGIN
DBMS_PDB.DESCRIBE(
pdb_descr_file => '/home/oracle/xjny.xml',
pdb_name => 'XJNY');
END;
/
2.在目標資料庫檢查pdb的xml是否與目標庫相容
SET SERVEROUTPUT ON
DECLARE
compatible CONSTANT VARCHAR2(3) :=
CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY(
pdb_descr_file => '/home/oracle/xjny.xml',
pdb_name => 'SALESPDB')
WHEN TRUE THEN 'YES'
ELSE 'NO'
END;
BEGIN
DBMS_OUTPUT.PUT_LINE(compatible);
END;
/
3. 將pdb資料庫plug到新的cdb中,在新cdb中執行
CREATE PLUGGABLE DATABASE ebs USING '/home/oracle/xjny.xml'
NOCOPY
TEMPFILE REUSE;
4.開啟新的pdb
alter pluggable database ebs open;
------將pdb從cdb中unplug
SQL> alter pluggable database ebs close;
Pluggable database altered.
SQL> ALTER PLUGGABLE DATABASE ebs UNPLUG INTO '/home/oracle/ebs.xml';
Pluggable database altered.
SQL> select pdb_id,pdb_name,dbid,con_uid,status,con_id from dba_pdbs;
PDB_ID PDB_NAME DBID CON_UID STATUS CON_ID
---------- ---------- ---------- ---------- --------- ----------
3 XJNY 3977202490 3977202490 NORMAL 3
2 PDB$SEED 4264868981 4264868981 NORMAL 2
4 WAPDB 4211777660 4211777660 NORMAL 4
5 MBS 1281880106 1281880106 NORMAL 5
6 EBS 1440704945 1440704945 UNPLUGGED 6
如果不再需要pdb,或者要將pdb plug到新的cdb中,需要drop 掉cdb
SQL> DROP PLUGGABLE DATABASE ebs INCLUDING DATAFILES;
Pluggable database dropped.
SQL> select pdb_id,pdb_name,dbid,con_uid,status,con_id from dba_pdbs;
PDB_ID PDB_NAME DBID CON_UID STATUS CON_ID
---------- ---------- ---------- ---------- --------- ----------
3 XJNY 3977202490 3977202490 NORMAL 3
2 PDB$SEED 4264868981 4264868981 NORMAL 2
4 WAPDB 4211777660 4211777660 NORMAL 4
5 MBS 1281880106 1281880106 NORMAL 5
1.在源資料庫建立pdb的xml檔案
BEGIN
DBMS_PDB.DESCRIBE(
pdb_descr_file => '/home/oracle/xjny.xml',
pdb_name => 'XJNY');
END;
/
2.在目標資料庫檢查pdb的xml是否與目標庫相容
SET SERVEROUTPUT ON
DECLARE
compatible CONSTANT VARCHAR2(3) :=
CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY(
pdb_descr_file => '/home/oracle/xjny.xml',
pdb_name => 'SALESPDB')
WHEN TRUE THEN 'YES'
ELSE 'NO'
END;
BEGIN
DBMS_OUTPUT.PUT_LINE(compatible);
END;
/
3. 將pdb資料庫plug到新的cdb中,在新cdb中執行
CREATE PLUGGABLE DATABASE ebs USING '/home/oracle/xjny.xml'
NOCOPY
TEMPFILE REUSE;
4.開啟新的pdb
alter pluggable database ebs open;
------將pdb從cdb中unplug
SQL> alter pluggable database ebs close;
Pluggable database altered.
SQL> ALTER PLUGGABLE DATABASE ebs UNPLUG INTO '/home/oracle/ebs.xml';
Pluggable database altered.
SQL> select pdb_id,pdb_name,dbid,con_uid,status,con_id from dba_pdbs;
PDB_ID PDB_NAME DBID CON_UID STATUS CON_ID
---------- ---------- ---------- ---------- --------- ----------
3 XJNY 3977202490 3977202490 NORMAL 3
2 PDB$SEED 4264868981 4264868981 NORMAL 2
4 WAPDB 4211777660 4211777660 NORMAL 4
5 MBS 1281880106 1281880106 NORMAL 5
6 EBS 1440704945 1440704945 UNPLUGGED 6
如果不再需要pdb,或者要將pdb plug到新的cdb中,需要drop 掉cdb
SQL> DROP PLUGGABLE DATABASE ebs INCLUDING DATAFILES;
Pluggable database dropped.
SQL> select pdb_id,pdb_name,dbid,con_uid,status,con_id from dba_pdbs;
PDB_ID PDB_NAME DBID CON_UID STATUS CON_ID
---------- ---------- ---------- ---------- --------- ----------
3 XJNY 3977202490 3977202490 NORMAL 3
2 PDB$SEED 4264868981 4264868981 NORMAL 2
4 WAPDB 4211777660 4211777660 NORMAL 4
5 MBS 1281880106 1281880106 NORMAL 5
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10972173/viewspace-1361997/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 12c系列(九) | 通過unplug與plug方式升級pdb資料庫Oracle資料庫
- Oracle12c多租戶資料庫 - PDB資料庫的unplug及plug 2Oracle資料庫
- Oracle12c多租戶資料庫 - PDB資料庫的unplug及plug 1Oracle資料庫
- Oracle12c多租戶資料庫 - PDB資料庫的unplug及plug 3Oracle資料庫
- Oracle 12c 多租戶在 CDB 中 Plug A PDB,Unplugging A PDBOracle
- Oracle12c多租戶資料庫 - PDB資料庫的unplug及plug 參考Oracle資料庫
- 12c RAC 和 CDB/PDB 學習
- 建立、克隆pdb---oracle 12c 學習(1)Oracle
- Oracle 12C -- 使用seed PDB建立新的pdbOracle
- 12c pdb基本操作
- Oracle 12c Relocate PDBOracle
- Oracle 12c系列(二)|PDB的建立Oracle
- 當12C PDB遇上JDBCJDBC
- Oracle 12c PDB淺析Oracle
- oracle 12c PDB隨CDB啟動和連結PDB的方式Oracle
- EM Cloud Control 12c OMS 及 OMA 都需要部署Plug-in的原因 - 2Cloud
- Oracle 12C RMAN transport tablespace from PDB of RAC CDB to remote PDBOracleREM
- Oracle 12c PDB遷移(一)Oracle
- Oracle 12c系列(六)|Relocate a PDBOracle
- Oracle 12c系列(五)|PDB RefreshOracle
- oracle 12c rman備份pdbOracle
- Oracle 12c PDB淺析(二)Oracle
- 使用12c PDB整合環境的總結
- Oracle 12c PDB中碰到的DG問題Oracle
- 12c中新增PDB後GoldenGate的配置Go
- Oracle 12c 多租戶 手工建立 pdb 與 手工刪除 pdbOracle
- ORACLE 12C pdb受限解決思路Oracle
- ORACLE 12C新特性——CDB與PDBOracle
- oracle 12c使用dblink克隆pdbOracle
- Oracle 12c PDB的資料備份恢復Oracle
- Oracle 12C RMAN Duplicating Tablespaces Within a PDBOracle
- Oracle 12C RMAN Duplicating the PDB to remote CDBOracleREM
- Oracle 12c CDB&PDB 基本維護Oracle
- Oracle 12C R1 OR R2監聽相關配置包含pdbOracle
- 12c跨平臺完成PDB的備份遷移
- Oracle 18c bug 執行 DBMS_PDB.CHECK_PLUG_COMPATIBILITY報錯Oracle
- Oracle 12c RMAN Cross-Platform Transport of a Closed PDBOracleROSPlatform
- ORACLE 12C PDB 維護基礎介紹Oracle