可以使用不一致與一致備份來(lái)傳輸PDB并將其插入到不同平臺(tái)的CDB中。不一致備份能減少停機(jī)時(shí)間因?yàn)楫?dāng)PDB為open狀態(tài)時(shí)可以創(chuàng)建跨平臺(tái)不一致備份。第一次備份為增量0級(jí)備份。后續(xù)備份為增量1級(jí)備份它包含自上次增量備 份以來(lái)所有發(fā)生的改變。對(duì)于不一致1級(jí)備份的次數(shù)沒(méi)有限制。最后關(guān)閉PDB,創(chuàng)建最終一致的增量1級(jí)備份與插入PDB到目標(biāo)CDB中所需要的元數(shù)據(jù)XML文件。
站在用戶(hù)的角度思考問(wèn)題,與客戶(hù)深入溝通,找到臨桂網(wǎng)站設(shè)計(jì)與臨桂網(wǎng)站推廣的解決方案,憑借多年的經(jīng)驗(yàn),讓設(shè)計(jì)與互聯(lián)網(wǎng)技術(shù)結(jié)合,創(chuàng)造個(gè)性化、用戶(hù)體驗(yàn)好的作品,建站類(lèi)型包括:成都網(wǎng)站設(shè)計(jì)、成都網(wǎng)站制作、企業(yè)官網(wǎng)、英文網(wǎng)站、手機(jī)端網(wǎng)站、網(wǎng)站推廣、域名與空間、網(wǎng)絡(luò)空間、企業(yè)郵箱。業(yè)務(wù)覆蓋臨桂地區(qū)。
源CDB與目標(biāo)CDB的compatible參數(shù)必須設(shè)置為12.2。源CDB與目標(biāo)CDB必須有相同的字節(jié)序。
下面的例子將Linux平臺(tái)上的RAC CDB中的PDB數(shù)據(jù)庫(kù)(jypdb與testpdb)傳輸?shù)絯indows平臺(tái)上的單實(shí)例CDB數(shù)據(jù)庫(kù)中。 執(zhí)行跨平臺(tái)傳輸?shù)牟僮魅缦?
1.檢查源數(shù)據(jù)庫(kù)與目標(biāo)數(shù)據(jù)庫(kù)的compatible參數(shù)是否設(shè)置為12.0.0或更高版本
源數(shù)據(jù)庫(kù)
SQL> show parameter compatible NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ compatible string 12.2.0 noncdb_compatible boolean FALSE
目標(biāo)數(shù)據(jù)庫(kù)
SQL> show parameter compatible NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ compatible string 12.2.0 noncdb_compatible boolean FALSE
2.檢查源平臺(tái)與目標(biāo)平臺(tái)的字節(jié)序
源平臺(tái)
SQL> select d.platform_name,endian_format from v$transportable_platform tp,v$database d where tp.platform_name=d.platform_name; PLATFORM_NAME ENDIAN_FORMAT ----------------------------------------------------------------------------------------------------- -------------- Linux x86 64-bit Little
目標(biāo)平臺(tái)
SQL> select d.platform_name,endian_format from v$transportable_platform tp,v$database d where tp.platform_name=d.platform_name; PLATFORM_NAME ENDIAN_FORMAT -------------------------------------------------------------------------------- -------------- Microsoft Windows x86 64-bit Little
3.確保被傳輸?shù)腜DB(testpdb)為讀寫(xiě)狀態(tài)
SQL> select name,open_mode from v$pdbs; NAME OPEN_MODE -------------------------------------------------------------------------------------------------------------------------------- ---------- TESTPDB READ WRITE
4.在創(chuàng)建0級(jí)增量備份之前記錄數(shù)據(jù)庫(kù)的SCN
SQL> SELECT CHECKPOINT_CHANGE# FROM V$DATABASE; CHECKPOINT_CHANGE# ------------------ 21580167
5.對(duì)傳輸PDB(testpdb)創(chuàng)建不一致的跨平臺(tái)的增量0級(jí)備份
RMAN> backup incremental level 0 for transport allow inconsistent pluggable database testpdb format '/ora_backup/tpdbs/testpdb_level0.bck'; Starting backup at 12-FEB-18 starting full resync of recovery catalog full resync complete allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=1525 instance=jy1 device type=DISK channel ORA_DISK_1: starting incremental level 0 datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00047 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409 input datafile file number=00048 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409 input datafile file number=00046 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409 input datafile file number=00049 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409 input datafile file number=00051 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409 input datafile file number=00050 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409 channel ORA_DISK_1: starting piece 1 at 12-FEB-18 channel ORA_DISK_1: finished piece 1 at 12-FEB-18 piece handle=/ora_backup/tpdbs/testpdb_level0.bck tag=TAG20180212T001250 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35 Finished backup at 12-FEB-18 [oracle@jytest1 tpdbs]$ ls -lrt total 693420 -rw-r----- 1 oracle asmadmin 710049792 Feb 11 18:13 testpdb_level0.bck
6.關(guān)閉PDB
SQL> alter pluggable database testpdb close immediate; Pluggable database altered. SQL> select name,open_mode from v$pdbs; NAME OPEN_MODE -------------------------------------------------------------------------------------------------------------------------------- ---------- PDB$SEED READ ONLY JYPDB READ WRITE TESTPDB MOUNTED
7.創(chuàng)建一致的跨平臺(tái)增量備份。增量備份的時(shí)間點(diǎn)就是步驟4記錄的SCN號(hào)。使用unplug into子句來(lái)生成插入PDB到目標(biāo)CDB中所需要的元數(shù)據(jù)XML文件。
RMAN> backup incremental from scn 21580167 for transport unplug into '/ora_backup/tpdbs/metadata_testpdb.xml' pluggable database testpdb format '/ora_backup/tpdbs/testpdb_level1_con.bck'; Starting backup at 12-FEB-18 starting full resync of recovery catalog full resync complete using channel ORA_DISK_1 running UNPLUG on the specified pluggable database: TESTPDB UNPLUG file path : /ora_backup/tpdbs/metadata_testpdb.xml channel ORA_DISK_1: starting full datafile backup set channel ORA_DISK_1: specifying datafile(s) in backup set input datafile file number=00047 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409 input datafile file number=00048 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409 input datafile file number=00046 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409 input datafile file number=00049 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409 input datafile file number=00051 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409 input datafile file number=00050 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409 channel ORA_DISK_1: starting piece 1 at 12-FEB-18 channel ORA_DISK_1: finished piece 1 at 12-FEB-18 piece handle=/ora_backup/tpdbs/testpdb_level1_con.bck tag=TAG20180212T002650 comment=NONE channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15 Finished backup at 12-FEB-18 starting full resync of recovery catalog full resync complete
8.將在源平臺(tái)上使用rman backup命令生成的備份集與備份的控制文件傳輸?shù)侥繕?biāo)平臺(tái)的D:\app\oracle\oradata\pdbs目錄中
9.確保目標(biāo)CDB為讀寫(xiě)狀態(tài)
SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- -------------------- JY READ WRITE
10.還原不一致的跨平臺(tái)增量0級(jí)備份
RMAN> restore foreign pluggable database testpdb format 'D:\APP\ORACLE\ORADATA\JY\DATAFILE\%U' from backupset 'D:\app\oracle\oradata\pdbs\testpdb_level0.bck'; 從位于 12-2月 -18 的 restore 開(kāi)始 使用目標(biāo)數(shù)據(jù)庫(kù)控制文件替代恢復(fù)目錄 分配的通道: ORA_DISK_1 通道 ORA_DISK_1: SID=2654 設(shè)備類(lèi)型=DISK 通道 ORA_DISK_1: 正在開(kāi)始還原數(shù)據(jù)文件備份集 通道 ORA_DISK_1: 正在指定從備份集還原的數(shù)據(jù)文件 通道 ORA_DISK_1: 正在還原備份片段中的所有外部文件 通道 ORA_DISK_1: 正在讀取備份片段 D:\app\oracle\oradata\pdbs\testpdb_level0.bck 通道 ORA_DISK_1: 將外部文件 47 還原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSAUX_FNO-47_4USR0JDU 通道 ORA_DISK_1: 將外部文件 48 還原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-48_01SR0JDU 通道 ORA_DISK_1: 將外部文件 46 還原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSTEM_FNO-46_5ESR0JDU 通道 ORA_DISK_1: 將外部文件 49 還原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDO_2_FNO-49_2JSR0JDU 通道 ORA_DISK_1: 將外部文件 51 還原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-TEST_FNO-51_9RSR0JDU 通道 ORA_DISK_1: 將外部文件 50 還原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-USERS_FNO-50_EKSR0JDU 通道 ORA_DISK_1: 外部片段句柄 = D:\app\oracle\oradata\pdbs\testpdb_level0.bck 通道 ORA_DISK_1: 已還原備份片段 1 通道 ORA_DISK_1: 還原完成, 用時(shí): 00:00:16 在 12-2月 -18 完成了 restore
11.給步驟10所還原的外部數(shù)據(jù)文件應(yīng)用一致的跨平臺(tái)增量1級(jí)備份
RMAN> recover using 'D:\app\oracle\oradata\pdbs\metadata_testpdb.xml' foreign datafilecopy 'D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSAUX_FNO-47_4USR0JDU','D:\APP \ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-48_01SR0JDU','D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA _D-JY_I-979425723_TS-SYSTEM_FNO-46_5ESR0JDU','D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDO_2_FNO-49_2JSR0JDU','D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I- 979425723_TS-TEST_FNO-51_9RSR0JDU','D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-USERS_FNO-50_EKSR0JDU' 2> from backupset 'D:\app\oracle\oradata\pdbs\testpdb_level1_con.bck'; 從位于 12-2月 -18 的 restore 開(kāi)始 使用通道 ORA_DISK_1 通道 ORA_DISK_1: 正在開(kāi)始還原數(shù)據(jù)文件備份集 通道 ORA_DISK_1: 正在指定從備份集還原的數(shù)據(jù)文件 通道 ORA_DISK_1: 正在還原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSAUX_FNO-47_4USR0JDU 通道 ORA_DISK_1: 正在還原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-48_01SR0JDU 通道 ORA_DISK_1: 正在還原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSTEM_FNO-46_5ESR0JDU 通道 ORA_DISK_1: 正在還原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDO_2_FNO-49_2JSR0JDU 通道 ORA_DISK_1: 正在還原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-TEST_FNO-51_9RSR0JDU 通道 ORA_DISK_1: 正在還原外部文件 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-USERS_FNO-50_EKSR0JDU 通道 ORA_DISK_1: 正在讀取備份片段 D:\app\oracle\oradata\pdbs\testpdb_level1_con.bck 通道 ORA_DISK_1: 將外部文件 47 還原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSAUX_FNO-47_4USR0JDU 通道 ORA_DISK_1: 將外部文件 48 還原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-48_01SR0JDU 通道 ORA_DISK_1: 將外部文件 46 還原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-SYSTEM_FNO-46_5ESR0JDU 通道 ORA_DISK_1: 將外部文件 49 還原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-UNDO_2_FNO-49_2JSR0JDU 通道 ORA_DISK_1: 將外部文件 51 還原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-TEST_FNO-51_9RSR0JDU 通道 ORA_DISK_1: 將外部文件 50 還原到 D:\APP\ORACLE\ORADATA\JY\DATAFILE\DATA_D-JY_I-979425723_TS-USERS_FNO-50_EKSR0JDU 通道 ORA_DISK_1: 外部片段句柄 = D:\APP\ORACLE\ORADATA\PDBS\TESTPDB_LEVEL1_CON.BCK 通道 ORA_DISK_1: 已還原備份片段 1 通道 ORA_DISK_1: 還原完成, 用時(shí): 00:00:02 通道 ORA_DISK_1: 正在為 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409 插入文件 46 通道 ORA_DISK_1: 正在為 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409 插入文件 47 通道 ORA_DISK_1: 正在為 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409 插入文件 48 通道 ORA_DISK_1: 正在為 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/TEMPFILE/temp.258.967852409 插入文件 4 通道 ORA_DISK_1: 正在為 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409 插入文件 49 通道 ORA_DISK_1: 正在為 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409 插入文件 50 通道 ORA_DISK_1: 正在為 +DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409 插入文件 51 RMAN-00571: =========================================================== RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== RMAN-00571: =========================================================== RMAN-03002: 位于 02/12/2018 01:00:33 的 restore 命令失敗 RMAN-00600: internal error, arguments [5304] [+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/TEMPFILE/temp.258.967852409] [] [] []
上面的錯(cuò)誤是因?yàn)閄Ml文件所描述的數(shù)據(jù)文件名是源數(shù)據(jù)庫(kù)中的文件名,手功修改XML文件中的數(shù)據(jù)文件名為目標(biāo)數(shù)據(jù)庫(kù)中的數(shù)據(jù)文件名,并執(zhí)行下面的命令來(lái)創(chuàng)建PDB
SQL> create pluggable database testpdb using 'D:\app\oracle\oradata\pdbs\metadata_testpdb.xml'; 插接式數(shù)據(jù)庫(kù)已創(chuàng)建。 SQL> select name,open_mode from v$pdbs; NAME OPEN_MODE -------------------------------------------------------------------------------------------------------------------------------- ---------- PDB$SEED READ ONLY JYPDB READ WRITE TESTPDB MOUNTED SQL> alter pluggable database testpdb open; 插接式數(shù)據(jù)庫(kù)已變更。 SQL> select name,open_mode from v$pdbs; NAME OPEN_MODE -------------------------------------------------------------------------------------------------------------------------------- ---------- PDB$SEED READ ONLY JYPDB READ WRITE TESTPDB READ WRITE
12.查詢(xún)tts.t1與cs.t2表中的數(shù)據(jù)來(lái)驗(yàn)證跨平臺(tái)傳輸PDB是否操作成功
SQL> select count(*) from tts.t1; COUNT(*) ---------- 90 SQL> select count(*) from cs.t2; COUNT(*) ---------- 92
到此,跨平臺(tái)傳輸PDB就完成了。
文章題目:Oracle12cRMANPerformingCross-PlatformTransportofaPDBUsingInconsistent
轉(zhuǎn)載注明:http://aaarwkj.com/article8/pegsip.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)、響應(yīng)式網(wǎng)站、商城網(wǎng)站、ChatGPT、網(wǎng)站策劃、自適應(yīng)網(wǎng)站
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶(hù)投稿、用戶(hù)轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話(huà):028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)