- Overview of Cross-Platform Data Transport Using Backup Sets
RMAN does not catalog backup sets created for cross-platform transport in the control file. This ensures that backup sets created for cross-platform transport are not used during regular restore operations.
To perform cross-platform data transport using backup sets, the version of the destination database must be Oracle Database 12c Release 1 (12.1) or later. 但注意源库没有版本要求
Although the TO PLATFORM and FOR TRANSPORT clauses are not supported in Oracle Database 10g Release 2 (10.2) or Oracle Database 11g, you can transport data from these versions of the database to Oracle Database 12c Release 1 (12.1). On the source database, you first create backup sets of the tablespaces to be transported and then create the Data Pump export dump file by using the expdp command. To restore these backups on the destination database, you perform a restore operation using the RESTORE command and then use the impdp command to import the Data Pump export dump file.
- Basic Terms Used in Cross-Platform Data Transport Using Backup Sets
- Foreign Data File 即对于目标库来说外来数据文件
Data files that do not belong to the destination database are called foreign data files. These data files are being plugged in to the destination database as part of a data transfer to the destination database. In the source database, this data file is identified by its original data file number.
- Foreign Tablespace 即对于目标库来说外来表空间
A foreign tablespace is a set of foreign data files that comprise a tablespace in the source database. These foreign data files do not belong to the destination database, but are being transported into the destination database and are identified by the original tablespace name in the source database.
- Using BACKUP Command with For Transport or To Platform on the Source database
FOR TRANSPORT表示备份时不进行数据文件转化而是在目标库RESTORE时进行,所以备份可用于不同目标库。如果目标库与源库endian不同,在RESTORE后需要手动CONVERT
When you use FOR TRANSPORT, the backup set that is created can be transported to any destination database. If the destination database uses an endian format that is different from that of the source database, then the required endian format conversion is performed on the destination database. The benefit of this method is that the processing overhead of the conversion operation is offloaded to the destination database.
TO PLATFORM表示在备份时数据转化,要求目标库与源库enian相同
When you use TO PLATFORM, the endian format conversion is performed on the source database. The target platform specified by the TO PLATFORM clause must be a supported platform for cross-platform transport. The V$TRANSPORTABLE_PLATFORM view contains the list of supported platforms.
如果需要在目标库进行转化需要在RESTORE中使用FROM PLATFORM子句
Use FROM PLATFORM to specify the name of the source platform on which the backup sets were created. The platform name must exactly match the name specified while creating the backup set. If there is a difference in the platform names, the restore operation fails.
- Data Pump Export Dump File Used for Cross-Platform Tablespace Transport
使用备份的传输表空间需要在备份时使用DATAPUMP子句,它同样会存于备份集中
On the source database, use the DATAPUMP clause in the BACKUP command to create the metadata required to plug tablespaces in to the target database. The metadata is stored in a Data Pump export dump file as a separate backup set. Use this backup set to plug the transported tablespaces in to the target database.
如果未指定DATAPUMP的FORMAT将使用BACKUP的FORMAT指定export dump file,如果均未指定则使用默认
You can specify how the backup set containing the tablespace metadata is named by using the FORMAT option with the DATAPUMP clause. If you omit the FORMAT option, then the format specified in the BACKUP command is used to name the export dump file. When no FORMAT option is specified in the BACKUP command, the default format is used.
RESTORE时使用DUMP FILE ... FROM BACKUPSET选项指定哪个备份集中包含export dump file
使用DATAPUMP选项可以指定还原export dump file的位置
Use the DATAPUMP clause in the RESTORE command to specify the location on the destination host to which the export dump file is restored. If you omit this clause, the dump file is restored to a default operating system-specific location.
默认dump file是自动导入的,也可使用NOIMPORT选项来手动导入
By default, RMAN automatically imports the export dump file after all the required foreign data files are restored. You can choose not to import the export dump file by specifying the NOIMPORT clause. If you do not import the export dump file as part of the restore operation, then you must manually import the dump file when you want to plug the tablespaces in to the destination database.
Note: If the export dump file is automatically imported (that is, the NOIMPORT clause is not used), then the destination database must be open in read/write mode.