In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article focuses on "how to achieve cross-platform transmission of PDB by Oracle". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next let the editor to take you to learn "Oracle how to achieve cross-platform transmission of PDB" bar!
PDB can be transferred and inserted into a target CDB database that is different from the source platform. In addition to creating a backup of the PDB, you need to insert the PDB into the metadata required in the target CDB. The compatible parameter in the source CDB and the target CDB must be set to 12.2, and the source platform and the target platform have the same byte order.
The following example transfers the PDB database (jypdb and testpdb) from RAC CDB on the Linux platform to a single instance CDB database on the windows platform. The operations to perform cross-platform transmission are as follows:
1. Check whether the compatible parameter of the source and target databases is set to 12.0.0 or later
Source database
SQL > show parameter compatibleNAME TYPE VALUE-- compatible string 12.2.0noncdb_compatible boolean FALSE
Target database
SQL > show parameter compatibleNAME TYPE VALUE-- compatible string 12.2.0noncdb_compatible boolean FALSE
two。 Check the byte order of the source and target platforms
Source platform
SQL > select d.platformnamename endianned 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
Target platform
SQL > select d.platformnamename endianned 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. The pdb (jypdb,testpdb) to be transmitted is set to be turned off
SQL > alter pluggable database jypdb close immediate;Pluggable database altered.SQL > alter pluggable database testpdb close immediate;Pluggable database altered.SQL > select name,open_mode from v$pdbs NAME OPEN_MODE -PDB$SEED READ ONLYJYPDB MOUNTEDTESTPDB MOUNTED
4. Use the backup pluggable database command to create a cross-platform full backup for PDB (jypdb,testpdb)
The following example is to create a cross-platform transport backup for PDB (jypdb,testpdb) whose target platform is Microsoft Windows x86 64-bit. Using the unplug into clause generates the metadata XML file needed to insert PDB into the target CDB.
RMAN > backup to platform='Microsoft Windows x86 64 Murbit 'unplug into' / ora_backup/tpdbs/metadata_jypdb.xml' pluggable database jypdb format'/ ora_backup/tpdbs/transport_jypdb.bck' Starting backup at 11-FEB-18using channel ORA_DISK_1running UNPLUG on the specified pluggable database: JYPDBUNPLUG file path: / ora_backup/tpdbs/metadata_jypdb.xmlchannel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setinput datafile file number=00028 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.278.962209649input datafile file number=00025 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.316.962209649input datafile file number=00026 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.264.962209649input datafile file number=00027 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/ DATAFILE/undo_2.268.962209649input datafile file number=00024 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.271.962209649input datafile file number=00029 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.275.962210609input datafile file number=00030 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/tts.257.966380353input datafile file number=00031 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/cs.294.966380783channel ORA_DISK_1: starting piece 1 at 11-FEB-18channel ORA_DISK_1: finished piece 1 at 11-FEB-18piece handle=/ora_backup/tpdbs/transport_jypdb.bck tag=TAG20180211T223539 comment=NONEchannel ORA_DISK_1: backup set complete Elapsed time: 00:00:55Finished backup at 11-FEB-18starting full resync of recovery catalogfull resync completeRMAN > backup to platform='Microsoft Windows x86 64 murbit 'unplug into' / ora_backup/tpdbs/metadata_testpdb.xml' pluggable database testpdb format'/ ora_backup/tpdbs/transport_testpdb.bck' Starting backup at 11-FEB-18using channel ORA_DISK_1running UNPLUG on the specified pluggable database: TESTPDBUNPLUG file path: / ora_backup/tpdbs/metadata_testpdb.xmlchannel ORA_DISK_1: starting full datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setinput datafile file number=00033 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409input datafile file number=00034 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409input datafile file number=00032 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409input datafile file number=00035 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/ DATAFILE/undo_2.266.962469409input datafile file number=00037 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409input datafile file number=00036 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409channel ORA_DISK_1: starting piece 1 at 11-FEB-18channel ORA_DISK_1: finished piece 1 at 11-FEB-18piece handle=/ora_backup/tpdbs/transport_testpdb.bck tag=TAG20180211T223830 comment=NONEchannel ORA_DISK_1: backup set complete Elapsed time: 00:00:35Finished backup at 11-FEB-18starting full resync of recovery catalogfull resync complete [oracle@jytest1 tpdbs] $ls-lrttotal 1707044 transport_jypdb.bck-rw-r--r--: RW transport_jypdb.bck-rw-r--r---1 oracle asmadmin 11417 Feb 11 16:36 metadata_jypdb.xml-rw-r- 1 oracle asmadmin 1038204928 Feb 11 16:37 transport_jypdb.bck-rw-r--r-- 1 oracle asmadmin 9575 Feb 11 16:38 metadata_testpdb.xml-rw-r- 1 oracle asmadmin 709779456 Feb 11 16:39 transport_testpdb.bck
5. Transfer the backup file and XML file generated in step 4 to the D:\ app\ oracle\ oradata\ pdbs directory on the target host
6. Ensure that the state of the target CDB database is read-write
SQL > select open_mode from vested database and open door model read WRITE
7. The dbms_pdb.check_plug_compatibility process is executed to determine whether the transmitted PDB is compatible with the target CDB.
SQL > declare 2 c boolean; 3 begin 4 c:=dbms_pdb.check_plug_compatibility ('D:\ app\ oracle\ oradata\ pdbs\ metadata_jypdb.xml','JYPDB'); 5 if (c) then dbms_output.put_line ('True'); 6 else dbms_output.put_line (' False'); 7 end if; 8 end; 9 / PL/SQL process completed successfully. SQL > declare 2 c boolean; 3 begin 4 c:=dbms_pdb.check_plug_compatibility ('D:\ app\ oracle\ oradata\ pdbs\ metadata_testpdb.xml','TESTPDB'); 5 if (c) then dbms_output.put_line ('True'); 6 else dbms_output.put_line (' False'); 7 end if; 8 end; 9 / PL/SQL process completed successfully.
8. Restore PDB backup
Use the using clause to store the name of the XML file where the metadata needed to insert the source PDB into the destination CDB is located. To copy the data file to a different location than that described in the XML file, use the file_name_ convert clause.
RMAN > restore using'D:\ app\ oracle\ oradata\ pdbs\ metadata_jypdb.xml' foreign pluggable database JYPDB format'D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\% U'from backupset'D:\ app\ oracle\ oradata\ pdbs\ transport_jypdb.bck' Using channel ORA_DISK_1 channel ORA_DISK_1 from November to February-18th restore: starting to restore data file backup set channel ORA_DISK_1: specifying data file channel to restore from backup set ORA_DISK_1: restoring all external file channels in backup fragment ORA_DISK_1: reading backup fragment D:\ app\ oracle\ oradata\ Pdbs\ transport_jypdb.bck channel ORA_DISK_1: restore external file 28 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-USERS_FNO-28_IASR0EH6 channel ORA_DISK_1: restore external file 25 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-SYSAUX_FNO-25_EGSR0EH6 channel ORA_DISK_1: restore external text Item 26 restore to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-26_TESR0EH6 channel ORA_DISK_1: restore external file 27 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-UNDO_2_FNO-27_D2SR0EH6 channel ORA_DISK_1: restore external file 24 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-SYSTEM_FNO-24_FFSR0EH6 channel ORA_DISK_1: restore external files 29 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-TEST_FNO-29_OMSR0EH6 channel ORA_DISK_1: restore external files 30 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-TTS_FNO-30_SUSR0EH6 Tao ORA_DISK_1: restore external file 31 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-CS_FNO-31_7LSR0EH6 channel ORA_DISK_1: external fragment handle = D:\ app\ oracle\ oradata\ pdbs\ transport_jypdb.bck channel ORA_DISK_1: restored backup fragment 1 channel ORA_DISK_1: restore complete Time: 00:00:36 channel ORA_DISK_1: inserting file 24 channel ORA_DISK_1 for + DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.271.962209649 ORA_DISK_1: inserting file 25 channel ORA_DISK_1: inserting file 26 channel ORA_DISK_1: inserting file 26 channel ORA_DISK_1: + DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/TEMPFILE/temp .258.967837571 insert file 5-channel ORA_DISK_1: inserting file 27-channel ORA_DISK_1 for + DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undo_2.268.962209649: inserting file 28-channel ORA_DISK_1 for + DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.278.962209649: inserting file 29-channel ORA_DISK_1: inserting file 29-channel ORA_DISK_1: + DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE / tts.257.966380353 insert file 30 channel ORA_DISK_1: inserting file 31RMAN-00571 for + DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/cs.294.966380783: = RMAN-00569: = ERROR MESSAGE STACK FOLLOWS = RMAN-00571: = RMAN-03002: the restore command at 02 restore 11max 2018 23:22:50 failed RMAN-00600: internal error Arguments [5302] [] RMAN > restore using'D:\ app\ oracle\ oradata\ pdbs\ metadata_testpdb.xml' foreign pluggable database testpdb format'D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\% U'from backupset'D:\ app\ oracle\ oradata\ pdbs\ transport_testpdb.bck' Using channel ORA_DISK_1 channel ORA_DISK_1 from November to February-18th restore: starting to restore data file backup set channel ORA_DISK_1: specifying data file channel to restore from backup set ORA_DISK_1: restoring all external file channels in backup fragment ORA_DISK_1: reading backup fragment D:\ app\ oracle\ oradata\ Pdbs\ transport_testpdb.bck channel ORA_DISK_1: restore external file 33 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-SYSAUX_FNO-33_N4SR0EOK channel ORA_DISK_1: restore external file 34 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-34_S1SR0EOK channel ORA_DISK_1: restore external text Restore piece 32 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-SYSTEM_FNO-32_KTSR0EOK channel ORA_DISK_1: restore external file 35 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-UNDO_2_FNO-35_PGSR0EOK channel ORA_DISK_1: restore external file 37 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-TEST_FNO-37_1MSR0EOK channel ORA_DISK_1: restore external file 36 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-USERS_FNO-36_9ASR0EOK channel ORA_DISK_1: external fragment handle = D:\ app\ oracle\ oradata\ pdbs\ transport_testpdb.bck channel ORA_DISK_1: restored backup fragment 1 channel ORA_DISK_1: restore complete Time: 00:00:16 channel ORA_DISK_1: inserting file 32 channel ORA_DISK_1 for + DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409 ORA_DISK_1: inserting file 33 channel ORA_DISK_1: inserting file 34 channel ORA_DISK_1: inserting file 34 channel ORA_DISK_1: + DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/TEMPFILE/temp .276.967837623 insert file 6-channel ORA_DISK_1: inserting file for + DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409 35-channel ORA_DISK_1: inserting file 36-channel ORA_DISK_1 for + DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409: inserting file 37RMAN-00571: = = RMAN-00569: = ERROR MESSAGE STACK FOLLOWS = RMAN-00571: = RMAN-03002 : restore command failed at 23:26:28 on 2018 at 02Uniple 11amp RMAN-00600: internal error Arguments [5302] []
The above error is because the data file name described in the XMl file is the file name in the source database, manually modify the data file name in the XML file to the data file name in the target database, and execute the following command to create the PDB
SQL > create pluggable database jypdb using'D:\ app\ oracle\ oradata\ pdbs\ metadata_jypdb.xml'; plug-in database has been created. SQL > create pluggable database testpdb using'D:\ app\ oracle\ oradata\ pdbs\ metadata_testpdb.xml'; plug-in database has been created. SQL > alter pluggable database all open; plug-in database has changed. SQL > select name,open_mode from v$pdbs NAME OPEN_MODE -PDB$SEED READ ONLYJYPDB READ WRITETESTPDB READ WRITE
9. Query the data in tts.t1 and cs.t2 tables to verify whether the cross-platform transfer PDB operation is successful
SQL > select count (*) from tts.t1; COUNT (*)-90SQL > select count (*) from cs.t2; COUNT (*)-92 so far, I believe you have a deeper understanding of "Oracle how to achieve cross-platform transmission PDB". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.