Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to transfer PDB database on Linux to CDB database of windows

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article focuses on "how to transfer the PDB database on Linux to the CDB database of windows". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to transfer the PDB database on Linux to the CDB database of windows.

In order to transfer the entire PDB to different platforms, the source and target platforms must use the same byte order. The compatible parameter must be set to version 12.1 or later in the source and target CDB databases.

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 read-only

SQL > alter pluggable database all close immediate;Pluggable database altered.SQL > set long 200SQL > set linesize 200SQL > select name,open_mode from v$pdbs NAME OPEN_MODE -PDB$SEED READ ONLYJYPDB MOUNTEDTESTPDB MOUNTED

4. To back up the PDB database to be transferred, you can use one of the following methods to transfer PDB across platforms

4.1 use RMAN to connect to CDB's root container and use backup for transport... Pluggable database or backup to platform... Pluggable database command to create a cross-platform backup for PDB.

Use RMAN to connect to PDB and use the backup for transport or backup to platform command to create a cross-platform backup for PDB.

Because I want to transmit two PDB here, I choose the first method.

RMAN > backup for transport unplug into'/ ora_backup/tpdbs/metadata_jypdb.xml' pluggable database jypdb format'/ ora_backup/tpdbs/pdb_%U' 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=00014 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/users.278.962209649input datafile file number=00011 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/sysaux.316.962209649input datafile file number=00012 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/undotbs1.264.962209649input datafile file number=00013 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/ DATAFILE/undo_2.268.962209649input datafile file number=00010 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/system.271.962209649input datafile file number=00015 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/test.275.962210609input datafile file number=00022 name=+DATA/JY/5F9AC6865E87549FE053AB828A0ADE94/DATAFILE/tts.257.966380353input datafile file number=00023 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/pdb_8csqvqc5_1_1 tag=TAG20180211T173748 comment=NONEchannel ORA_DISK_1: backup set complete Elapsed time: 00:00:56Finished backup at 11-FEB-18starting full resync of recovery catalogfull resync completeRMAN > backup for transport unplug into'/ ora_backup/tpdbs/metadata_testpdb.xml' pluggable database testpdb format'/ ora_backup/tpdbs/pdb_%U' Starting backup at 11-FEB-18starting full resync of recovery catalogfull resync completeusing 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=00017 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409input datafile file number=00018 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409input datafile file number=00016 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409input datafile file Number=00019 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409input datafile file number=00021 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409input datafile file number=00020 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/pdb_8dsqvqpj_1_1 tag=TAG20180211T174458 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 1707488 metadata_jypdb.xml-rw-r--1 oracle asmadmin 11413 Feb 11 11:38 metadata_jypdb.xml-rw-r- 1 oracle asmadmin 1038368768 Feb 11 11:39 pdb_8csqvqc5_1_1-rw-r--r-- 1 oracle asmadmin 9569 Feb 11 11:45 metadata_testpdb.xml-rw-r- 1 oracle Asmadmin 710066176 Feb 11 11:45 pdb_8dsqvqpj_1_1

5. Transfer the backup sets and backup control files generated using the rman backup command on the source platform to the D:\ app\ oracle\ oradata\ pdbs directory of the target platform

6. Restore PDB (jypdb,testpdb) to the target database

RMAN > restore from platform 'Linux x86 64 Murbit' foreign pluggable database jypdb to new from backupset'D:\ app\ oracle\ oradata\ pdbs\ pdb_8csqvqc5_1_1' Starting from restore in November-February-18, replace the channel assigned by the recovery directory with the target database control file: ORA_DISK_1 channel ORA_DISK_1: SID=1522 device type = DISK channel ORA_DISK_1: starting to restore data file backup set channel ORA_DISK_1: specifying data file channel ORA_DISK_1: restoring backup fragment All external file channels ORA_DISK_1: reading backup snippet D:\ app\ oracle\ oradata\ pdbs\ pdb_8csqvqc5_1_1 channel ORA_DISK_1: restore external file 14 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1_MF_USERS_F805GPMS_.DBF channel ORA_DISK_1: restore external file 11 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1 F805GPMS_.DBF channel ORA_DISK_1: restore external file 12 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1_MF_UNDOTBS1_F805GPMS_.DBF channel ORA_DISK_1: restore external file 13 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1_MF_UNDO_2_F805GPMS_.DBF channel ORA_DISK_1: restore external file 10 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1 _ MF_SYSTEM_F805GPN8_.DBF channel ORA_DISK_1: restore external file 15 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1_MF_TEST_F805GPN8_.DBF channel ORA_DISK_1: restore external file 22 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1_MF_TTS_F805GPN8_.DBF channel ORA_DISK_1: restore external file 23 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1_MF_CS_F805GPN8_.DBF channel ORA_DISK_1: external fragment handle = D:\ app\ oracle\ oradata\ pdbs\ pdb_8csqvqc5_1_1 channel ORA_DISK_1: backup fragment 1 channel ORA_DISK_1: restore complete Usage: 00:00:36 completed restoreRMAN > restore from platform 'Linux x86 foreign pluggable database testpdb to new from backupset' D:\ app\ oracle\ oradata\ pdbs\ pdb_8dsqvqpj_1_1' from November to February to 18th. Starting from restore in November-February-18, replace the channel assigned by the recovery directory with the target database control file: ORA_DISK_1 channel ORA_DISK_1: SID=1522 device type = DISK channel ORA_DISK_1: starting to restore data file backup set channel ORA_DISK_1: specifying data file channel ORA_DISK_1: restoring backup fragment All external file channels ORA_DISK_1: reading backup fragment D:\ app\ oracle\ oradata\ pdbs\ pdb_8dsqvqpj_1_1 channel ORA_DISK_1: restore external file 17 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1_MF_SYSAUX_F806C6WT_.DBF channel ORA_DISK_1: restore external file 18 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1 F806C6WT_.DBF channel ORA_DISK_1: restore external file 16 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1_MF_SYSTEM_F806C6WT_.DBF channel ORA_DISK_1: restore external file 19 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1_MF_UNDO_2_F806C6XB_.DBF channel ORA_DISK_1: restore external file 21 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1 _ MF_TEST_F806C6XB_.DBF channel ORA_DISK_1: restore external file 20 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ O1_MF_USERS_F806C6XB_.DBF channel ORA_DISK_1: external fragment handle = D:\ app\ oracle\ oradata\ pdbs\ pdb_8dsqvqpj_1_1 channel ORA_DISK_1: restored backup fragment 1 channel ORA_DISK_1: restore completed Time: 00:00:26 completed restore from November to February to 18th

7. Modify the metadata_jypdb.xml and metadata_testpdb.xml files on the target host to change the path of the data file to the path where the restored data file is located

8. Insert the transmitted PDB (jypdb,testpdb) into CDB

SQL > create pluggable database jypdb using'D:\ app\ oracle\ oradata\ pdbs\ metadata_jypdb.xml' nocopy; plug-in database has been created. SQL > create pluggable database testpdb using'D:\ app\ oracle\ oradata\ pdbs\ metadata_testpdb.xml' nocopy; plug-in database has been created. SQL > set long 200SQL > set linesize 200SQL > select name,open_mode from v$pdbs NAME OPEN_MODE -PDB$SEED READ ONLYJYPDB MOUNTEDTESTPDB MOUNTEDSQL > alter pluggable database all open The 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 "how to transfer the PDB database on Linux to windows's CDB database". 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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report