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

Oracle 12c RMAN Performing Cross-Platform Transport of a PDB Using Inconsistent

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

Share

Shulou(Shulou.com)06/01 Report--

Inconsistent and consistent backups can be used to transfer PDB and insert it into CDB on different platforms. Inconsistent backups can reduce downtime because cross-platform inconsistent backups can be created when PDB is in open state. The first backup is an incremental level 0 backup. Subsequent backups are incremental level 1 backups that contain all changes that have occurred since the last incremental backup. There is no limit to the number of inconsistent level 1 backups. Finally, close PDB and create a consistent incremental level 1 backup and the metadata XML file needed to insert PDB into the target CDB.

The compatible parameter for the source CDB and destination CDB must be set to 12.2. The source CDB and the destination CDB must 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. Ensure that the transmitted PDB (testpdb) is read-write

SQL > select name,open_mode from v$pdbs NAME OPEN_MODE -TESTPDB READ WRITE

4. Record the SCN of the database before creating a level 0 incremental backup

SQL > SELECT CHECKPOINT_CHANGE# FROM Venture DataseX CheckPOINTCHANGEN-21580167

5. Create inconsistent cross-platform incremental level 0 backups of transport PDB (testpdb)

RMAN > backup incremental level0 for transport allow inconsistent pluggable database testpdb format'/ ora_backup/tpdbs/testpdb_level0.bck' Starting backup at 12-FEB-18starting full resync of recovery catalogfull resync completeallocated channel: ORA_DISK_1channel ORA_DISK_1: SID=1525 instance=jy1 device type=DISKchannel ORA_DISK_1: starting incremental level 0 datafile backup setchannel ORA_DISK_1: specifying datafile (s) in backup setinput datafile file number=00047 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409input datafile file number=00048 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409input datafile file number=00046 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409input datafile file number=00049 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_ 2.266.962469409input datafile file number=00051 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409input datafile file number=00050 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409channel ORA_DISK_1: starting piece 1 at 12-FEB-18channel ORA_DISK_1: finished piece 1 at 12-FEB-18piece handle=/ora_backup/tpdbs/testpdb_level0.bck tag=TAG20180212T001250 comment=NONEchannel ORA_DISK_1: backup set complete Elapsed time: 00:00:35Finished backup at 12-FEB-18 [oracle@jytest1 tpdbs] $ls-lrttotal 693420 RWMurr-1 oracle asmadmin 710049792 Feb 11 18:13 testpdb_level0.bck

6. Close 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 ONLYJYPDB READ WRITETESTPDB MOUNTED

7. Create consistent cross-platform incremental backups. The point in time of the incremental backup is the SCN number recorded in step 4. Use the unplug into clause to generate the metadata XML file needed to insert PDB into the target CDB.

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-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=00047 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/sysaux.259.962469409input datafile file number=00048 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undotbs1.265.962469409input datafile file number=00046 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409input datafile file Number=00049 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409input datafile file number=00051 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/test.269.962469409input datafile file number=00050 name=+DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409channel ORA_DISK_1: starting piece 1 at 12-FEB-18channel ORA_DISK_1: finished piece 1 at 12-FEB-18piece handle=/ora_backup/tpdbs/testpdb_level1_con.bck tag=TAG20180212T002650 comment=NONEchannel ORA_DISK_1: backup set complete Elapsed time: 00:00:15Finished backup at 12-FEB-18starting full resync of recovery catalogfull resync complete

8. 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

9. Make sure the target CDB is read-write

SQL > select name,open_mode from vested database * name OPEN_MODE--JY READ WRITE

10. Restore inconsistent cross-platform incremental level 0 backups

RMAN > restore foreign pluggable database testpdb format'D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\% U'from backupset'D:\ app\ oracle\ oradata\ pdbs\ testpdb_level0.bck' Starting from restore located in December-February-18, replace the channel assigned by the recovery directory with the target database control file: ORA_DISK_1 channel ORA_DISK_1: SID=2654 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\ testpdb_level0.bck channel ORA_DISK_1: restore external file 47 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-SYSAUX_FNO-47_4USR0JDU channel ORA_DISK_1: restore external file 48 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE \ DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-48_01SR0JDU channel ORA_DISK_1: restore external file 46 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-SYSTEM_FNO-46_5ESR0JDU channel ORA_DISK_1: restore external file 49 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-UNDO_2_FNO-49 _ 2JSR0JDU channel ORA_DISK_1: restore external file 51 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-TEST_FNO-51_9RSR0JDU channel ORA_DISK_1: restore external file 50 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-USERS_FNO-50_EKSR0JDU channel ORA_DISK_1: external fragment handle = D: \ app\ oracle\ oradata\ pdbs\ testpdb_level0.bck channel ORA_DISK_1: restored backup fragment 1 channel ORA_DISK_1: restore completed Time: 00:00:16 completed restore from December to February to 18th

11. Apply a consistent cross-platform incremental level 1 backup to the external data files restored in step 10

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' Use channel ORA_DISK_1 channel ORA_DISK_1 from restore located in December-February-18th: starting to restore data file backup set channel ORA_DISK_1: specifying data file channel to restore from backup set ORA_DISK_1: restoring external files D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-SYSAUX_FNO-47_4USR0JDU channel ORA_DISK_1: restoring external files D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-48_01SR0JDU channel ORA_DISK_1: restoring external files D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-SYSTEM_FNO-46_5ESR0JDU channel ORA_DISK_1: restoring external files D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-UNDO_2_FNO-49_2JSR0JDU channel ORA_DISK_1: restoring external files D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-TEST_FNO-51_9RSR0JDU channel ORA_DISK_1: restoring external files D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-USERS_ FNO-50_EKSR0JDU channel ORA_DISK_1: reading backup fragment D:\ app\ oracle\ oradata\ pdbs\ testpdb_level1_con.bck channel ORA_DISK_1: restore external file 47 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-SYSAUX_FNO-47_4USR0JDU channel ORA_DISK_1: restore external file 48 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE \ DATA_D-JY_I-979425723_TS-UNDOTBS1_FNO-48_01SR0JDU channel ORA_DISK_1: restore external file 46 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-SYSTEM_FNO-46_5ESR0JDU channel ORA_DISK_1: restore external file 49 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-UNDO_2_FNO-49 _ 2JSR0JDU channel ORA_DISK_1: restore external file 51 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-TEST_FNO-51_9RSR0JDU channel ORA_DISK_1: restore external file 50 to D:\ APP\ ORACLE\ ORADATA\ JY\ DATAFILE\ DATA_D-JY_I-979425723_TS-USERS_FNO-50_EKSR0JDU channel ORA_DISK_1: external fragment handle = D: \ APP\ ORACLE\ ORADATA\ PDBS\ TESTPDB_LEVEL1_CON.BCK channel ORA_DISK_1: restored backup fragment 1 channel ORA_DISK_1: restore completed Time: 00:00:02 channel ORA_DISK_1: inserting file 46 channel ORA_DISK_1 for + DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/system.260.962469409 ORA_DISK_1: inserting file 47 channel ORA_DISK_1: inserting file 48 channel ORA_DISK_1: inserting file 48 channel ORA_DISK_1: + DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/TEMPFILE/temp .258.967852409 insert file 4-channel ORA_DISK_1: inserting file for + DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/undo_2.266.962469409 49-channel ORA_DISK_1: inserting file for + DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/DATAFILE/users.267.962469409 50-channel ORA_DISK_1: inserting file 51RMAN-00571: = = RMAN-00569: = ERROR MESSAGE STACK FOLLOWS = RMAN-00571: = RMAN-03002 : the restore command at 01:00:33 on 2018 at 02 RMAN-00600: internal error 12 amp failed. Arguments [5304] [+ DATA/JY/600D6F56DEB669CCE053AB828A0AAB7E/TEMPFILE/temp.258.967852409] []

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 testpdb using'D:\ app\ oracle\ oradata\ pdbs\ metadata_testpdb.xml'; plug-in database has been created. SQL > select name,open_mode from v$pdbs NAME OPEN_MODE -PDB$SEED READ ONLYJYPDB READ WRITETESTPDB MOUNTEDSQL > alter pluggable database testpdb 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

twelve。 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

At this point, the cross-platform transmission of PDB is complete.

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