PDB插拔操作手冊
環境描述
源端:
資料庫版本 |
資料庫架構 |
作業系統版本 |
遷移的 pdb |
19.3.0.0.0 |
單機 |
RHEL7.5 |
PDB1 |
資料庫版本 |
資料庫架構 |
作業系統版本 |
遷移的 pdb |
19.3.0.0.0 |
單機 |
RHEL7.5 |
PDB2 |
目標端:
資料庫版本 |
資料庫架構 |
作業系統版本 |
遷移後的 pdb |
19.3.0.0.0 |
單機 |
RHEL7.4 |
PDBNEW |
資料庫版本 |
資料庫架構 |
作業系統版本 |
遷移後的 pdb |
19.3.0.0.0 |
單機 |
RHEL7.4 |
PDBNEW2 |
先決條件
1 當前使用者必須具有SYSDBA 或SYSOPER 的許可權。使用者必須使用AS SYSDBA 或AS SYSOPER 連線。
2 PDB 必須至少開啟一次。
3 確保當前容器是PDB 的根。
如果將PDB 插入CDB 根目錄,則當前容器必須是CDB 根目錄。如果PDB 已插入應用程式根目錄,則當前容器必須是應用程式根目錄。
如果要拔出應用程式容器,則當前容器必須是CDB 根目錄,並且該應用程式容器中不得插入任何應用程式PDB 。
關閉PDB 。
在Oracle Real Application Clusters (Oracle RAC )環境中,必須在所有例項上關閉PDB 。
執行ALTER PLUGGABLE DATABASE 帶有UNPLUG INTO 子句的語句,並指定要拔出的PDB 以及PDB 的XML 後設資料檔案或.pdb 檔案的名稱和位置。
XML 檔案
一個XML 檔案(副檔名為.xml )包含有關PDB 的資料,在拔出該檔案後。該後設資料包含使CREATE PLUGGABLE DATABASE 目標CDB 上的語句插入PDB 所需的資訊。
.pdb 檔案
.pdb 檔案包含XML 檔案的壓縮歸檔檔案,該檔案描述了PDB 和PDB 使用的檔案(例如資料檔案和錢包檔案)。.pdb 檔案使您可以將單個壓縮檔案(而不是多個檔案)複製到新位置,以將PDB 插入CDB 。
資訊收集
確認要拔出的pdb show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- -------------------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB1 READ WRITE NO 4 PDB2 READ WRITE NO alter session set container=PDB1; Session altered. show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 3 PDB1 READ WRITE NO select file_name from dba_data_files; FILE_NAME ------------------------------------------------------------------- /oracle/app/oradata/ORCL/pdb1/system01.dbf /oracle/app/oradata/ORCL/pdb1/sysaux01.dbf /oracle/app/oradata/ORCL/pdb1/undotbs01.dbf /oracle/app/oradata/ORCL/pdb1/users01.dbf alter pluggable database pdb1 close; Pluggable database altered. Pdb2: alter session set container=PDB2; Session altered. show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 4 PDB2 MOUNTED select name from v$datafile; NAME --------------------------------------------------------------------- /oracle/app/oradata/ORCL/pdb2/system01.dbf /oracle/app/oradata/ORCL/pdb2/sysaux01.dbf /oracle/app/oradata/ORCL/pdb2/undotbs01.dbf /oracle/app/oradata/ORCL/pdb2/users01.dbf
拔出pdb :
方法一:XML 方式
alter pluggable database pdb1 unplug into '/oracle/backup/pdb1.xml'; Pluggable database altered. [oracle@pdbprimary backup]$ pwd /oracle/backup [oracle@pdbprimary backup]$ ls -rtl total 8 -rw-r--r-- 1 oracle oinstall 7556 Jul 9 04:24 pdb1.xml
方法二:pdb 方式
alter pluggable database pdb2 unplug into '/oracle/backup/pdb2.pdb'; Pluggable database altered. [oracle@pdbprimary backup]$ pwd /oracle/backup [oracle@pdbprimary backup]$ ls -rtl total 131016 -rw-r--r-- 1 oracle oinstall 7556 Jul 9 04:24 pdb1.xml -rw-r--r-- 1 oracle oinstall 92856320 Jul 9 04:44 pdb2.pdb BACKUP FOR TRANSPORT PLUGGABLE DATABASE 'PDB1' FORMAT '/oracle/backup/pdb1_%U'; Starting backup at 10-JUL-20 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=41 device type=DISK channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00010 name=/oracle/app/oradata/ORCL/pdb1/sysaux01.dbf input datafile file number=00009 name=/oracle/app/oradata/ORCL/pdb1/system01.dbf input datafile file number=00011 name=/oracle/app/oradata/ORCL/pdb1/undotbs01.dbf input datafile file number=00012 name=/oracle/app/oradata/ORCL/pdb1/users01.dbf channel ORA_DISK_1: starting piece 1 at 10-JUL-20 channel ORA_DISK_1: finished piece 1 at 10-JUL-20 piece handle=/oracle/backup/pdb1_0lv4tr76_1_1 tag=TAG20200710T014406 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:45 Finished backup at 10-JUL-20 [oracle@pdbprimary pdb1]$ scp system01.dbf ora19c@192.168.238.14:/ora19c/app/oracle/oradata/ORA19C/pdbnew [oracle@pdbprimary pdb1]$ scp sysaux01.dbf ora19c@192.168.238.14:/ora19c/app/oracle/oradata/ORA19C/pdbnew [oracle@pdbprimary pdb1]$ scp undotbs01.dbf ora19c@192.168.238.14:/ora19c/app/oracle/oradata/ORA19C/pdbnew [oracle@pdbprimary pdb1]$ scp users01.dbf ora19c@192.168.238.14:/ora19c/app/oracle/oradata/ORA19C/pdbnew [oracle@pdbprimary backup]$ scp pdb1.xml ora19c@192.168.238.14:/ora19c [oracle@pdbprimary backup]$ scp pdb2.pdb ora19c@192.168.238.14:/ora19c
插入pdb
相容性確認
確認/ora19c/pdb1.xml 檔案描述的PDB 是否與當前CDB 是否相容
SET SERVEROUTPUT ON DECLARE compatible CONSTANT VARCHAR2(3) := CASE DBMS_PDB.CHECK_PLUG_COMPATIBILITY( pdb_descr_file => '/ora19c/pdb1.xml', pdb_name => 'PDBNEW') WHEN TRUE THEN 'YES' ELSE 'NO' END; BEGIN DBMS_OUTPUT.PUT_LINE(compatible); END; /
方法一:XML 方式
create pluggable database pdbnew using '/ora19c/pdb1.xml' source_file_name_convert=('/oracle/app/oradata/ORCL/pdb1/', '/ora19c/app/oracle/oradata/ORA19C/pdbnew/'); Pluggable database created. show pdbs CON_ID CON_NAME OPEN MODE RESTRICTED ---------- ------------------------------ ---------- ---------- 2 PDB$SEED READ ONLY NO 3 PDB1 READ WRITE NO 5 PDBNEW MOUNTED alter pluggable database pdbnew open; Pluggable database altered. select con_id, dbid, guid, name , open_mode from v$pdbs; CON_ID DBID GUID NAME OPEN_MODE ---------- ---------- -------------------------------- -------------------- ---------- 2 3860893708 A598EE1CD2A21C73E0530EEEA8C0108A PDB$SEED READ ONLY 3 1945262453 A59931254B643126E0530EEEA8C05005 PDB1 READ WRITE 5 238100001 A8964753BA696B12E05388EEA8C052C2 PDBNEW READ WRITE alter session set container=PDBNEW; Session altered. select name from v$datafile; NAME ------------------------------------------------------------------------------------------------------------------------------- /ora19c/app/oracle/oradata/ORA19C/ORA19C/A8964753BA696B12E05388EEA8C052C2/datafile/o1_mf_system_hjj9y93p_.dbf /ora19c/app/oracle/oradata/ORA19C/ORA19C/A8964753BA696B12E05388EEA8C052C2/datafile/o1_mf_sysaux_hjj9y940_.dbf /ora19c/app/oracle/oradata/ORA19C/ORA19C/A8964753BA696B12E05388EEA8C052C2/datafile/o1_mf_undotbs1_hjj9y94b_.dbf /ora19c/app/oracle/oradata/ORA19C/ORA19C/A8964753BA696B12E05388EEA8C052C2/datafile/o1_mf_users_hjj9y94h_.dbf
方法二:pdb 方式
CREATE PLUGGABLE DATABASE PDBNEW2 USING '/ora19c/pdb2.pdb' STORAGE (MAXSIZE 5G); Pluggable database created. alter pluggable database PDBNEW2 open; Pluggable database altered. select con_id, dbid, guid, name , open_mode from v$pdbs; CON_ID DBID GUID NAME OPEN_MODE ---------- ---------- -------------------------------- ------------------------------------ 2 3860893708 A598EE1CD2A21C73E0530EEEA8C0108A PDB$SEED READ ONLY 3 1945262453 A59931254B643126E0530EEEA8C05005 PDB1 MOUNTED 4 1185232805 A8964D946BE26C58E05388EEA8C0D806 PDBNEW2 READ WRITE 5 238100001 A8964753BA696B12E05388EEA8C052C2 PDBNEW MOUNTED 6 3758621293 AA61E583B5EF3661E0530EEEA8C0EB84 TESTPDB MOUNTED alter session set container=PDBNEW2; Session altered. select name from v$datafile; NAME -------------------------------------------------------------------------------------------------------------------------- /ora19c/app/oracle/oradata/ORA19C/ORA19C/A8964D946BE26C58E05388EEA8C0D806/datafile/o1_mf_system_hjzxdo86_.dbf /ora19c/app/oracle/oradata/ORA19C/ORA19C/A8964D946BE26C58E05388EEA8C0D806/datafile/o1_mf_sysaux_hjzxdo9f_.dbf /ora19c/app/oracle/oradata/ORA19C/ORA19C/A8964D946BE26C58E05388EEA8C0D806/datafile/o1_mf_undotbs1_hjzxdo9j_.dbf /ora19c/app/oracle/oradata/ORA19C/ORA19C/A8964D946BE26C58E05388EEA8C0D806/datafile/o1_mf_users_hjzxdo9r_.dbf
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23825935/viewspace-2934644/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 1.3.2.2.1. 插拔方式建立PDB
- jquery操作手冊jQuery
- DHorse操作手冊
- GIt tag 操作手冊Git
- rman duplicate操作手冊
- kraken軟體操作手冊
- mpaas-springboot-base操作手冊Spring Boot
- 列印交易票功能操作手冊
- wps+ps 寫操作手冊
- 資料載入操作手冊
- kettl連線oracle12c 可插拔資料庫pdbOracle資料庫
- 【BUILD_ORACLE】在Oracle cloud資料庫“插拔”PDB的方法UIOracleCloud資料庫
- ORACLE基礎運維命令操作手冊Oracle運維
- MySQL5.7.26 MHA叢集部署操作手冊MySql
- [原創] Frida操作手冊-Android環境準備Android
- Centos7安裝MySQL8.0 - 操作手冊CentOSMySql
- iOS應用釋出操作手冊-應用釋出篇iOS
- 【PDB】 為Oracle pdb新增服務(pdb add service)Oracle
- ENVI新機器學習:隨機森林遙感分類工具操作手冊機器學習隨機森林
- Oracle 建立PDB-Plugging In an Unplugged PDBOracle
- 軟體開發專案文件系列之十三如何撰寫使用者操作手冊
- 【PDB】pdb閃回,Oracle還原點Oracle
- 【PDB】Oracle跨PDB檢視查詢Oracle
- 【PDB】Oracle PDB資源管理參考Oracle
- 【PDB】Oracle pdb維護常用sql命令OracleSQL
- 【PDB】Oracle 建立pdb說明(create pluggable database)OracleDatabase
- Oracle 12.2 新特性: Online PDB relocate (PDB hot move)Oracle
- Spring如何實現可插拔配置?Spring
- kubernetes之PDB
- noncdb轉pdb
- 1.3.2.2 Creation of a PDB by Plugging In(通過插入的方式建立PDB)
- Z001-001 從 PDB$SEED 種子容器建立 PDB
- Oracle 12.2新特性: PDB級閃回資料庫(Flashback PDB)Oracle資料庫
- 使用 minitouch 遠端操作手機時,手動操作手機後 minitouch 執行命令就失效了
- 2.6.2 Overview of Flashback PDB in a CDBView
- 2.2.7 Overview of PDB Lockdown ProfilesView
- 2.1.3. PDB型別型別
- pdb受限解決思路