Part 6/10: Migration Methods using RMAN

In this part we will introduce the following migration methods using RMAN:

  • RMAN Transportable Tablespace with Data Pump
  • RMAN Convert Transportable Tablespace with Data Pump
  • RMAN Cross-Platform Transportable Tablespace Backup Sets
  • RMAN Cross-Platform Transportable PDB
  • RMAN Cross-Platform Transportable PDB Inconsistent Backups
  • RMAN Duplicate from an Active Database
  • RMAN Backup & Restore

RMAN

Oracle Recovery Manager (RMAN) is the tool used for efficiently backing up and recovering the Oracle database. RMAN is also used to facilitate database migrations on-premises and from on-premise to the Cloud.

It can be used to migrate source databases from version 11g onwards. As it moves data files or their backups at the physical block level, it is a matter of physical migration methods that require access to the underlying database infrastructure. Hence, the targets are Oracle databases on Oracle Database Cloud Service (DBCS). RMAN also supports migrations across different platforms by allowing conversion between different endian formats.

After introducing Data Guard and Golden Gate in part 4 and Data Pump in part 5, now we continue our journey with further migration methods using RMAN:

7. RMAN Transportable Tablespace with Data Pump

Data Pump Transportable Tablespace (method number 5 in part 4 of this series) requires placing the tablespaces on-premise in Read-Only mode. RMAN eliminates this requirement and provides the Transportable Tablespace method while the database on-premise is still online and fully available.

The migration steps consist of:

  1. On-premise, invoke RMAN to create the transportable tablespace set.
  2. Use the scp utility to copy the tablespace data files and Data Pump dump files (containing the metadata) to the DBCS compute node in the cloud.
  3. Create the schemas on the target database in the cloud.
  4. On the DBCS compute node, invoke Data Pump import with the TRANSPORT_DATAFILES parameter.
No alt text provided for this image

For detailed steps and code examples have a look at:

8. RMAN Convert Transportable Tablespace with Data Pump

RMAN can also be used to convert the data files to a different endian format. This is also similar to Data Pump Transportable Tablespace (method number 5 in part 4 of this series), but adding a step to convert the database data files to a different endian format using the RMAN CONVERT command. You will use this method if you are running your database on-premise on a big-endian platform.

The migration steps consist of:

  1. Set the tablespaces on-premise in Read-Only mode.
  2. Invoke Data Pump export with the TRANSPORT_TABLESPACES parameter.
  3. Invoke RMAN using the CONVERT TABLESPACE command to convert the tablespace data files to the cloud platform endian format (little-endian).
  4. Copy the generated dump files along with the converted tablespace data files to the target system in the cloud.
  5. Create the schemas on the target database in the cloud.
  6. On the DBCS compute node, invoke Data Pump import with the TRANSPORT_DATAFILES parameter.
  7. Set the tablespaces on the target database in Read-Write mode.
No alt text provided for this image

For detailed steps and code examples have a look at:

9. RMAN Cross-Platform Transportable Tablespace Backup Sets

If you cannot run the CONVERT command because the data files are encrypted, use backup sets instead, which does not require the CONVERT operation. In this case, you have to backup and restore the data blocks instead of just copying the data files.

The migration steps consist of:

  1. Set the tablespaces on-premise in Read-Only mode.
  2. Invoke RMAN using the BACKUP FOR TRANSPORT command to create the backup set.
  3. Copy the generated dump files along with the backup set files to the target system in the cloud.
  4. Create the schemas on the target database in the cloud.
  5. On the DBCS compute node, invoke RMAN with the RESTORE FOREIGN TABLESPACE command to restore the data into the target database.
  6. Set the tablespaces on the target database in Read-Write mode.
No alt text provided for this image

For detailed steps and code examples have a look at:

10. RMAN Cross-Platform Transportable PDB

Pluggable databases can be transported and restored into a destination multitenant container database on a different platform than the source CDB. In addition to the backup of the PDB, RMAN also copies the metadata required to plug the PDB into the destination CDB. 

The migration steps consist of:

  1. Close the PDB on-premise.
  2. Invoke RMAN using the BACKUP FOR TRANSPORT UNPLUG INTO command to create a full database backup and generate the XML file that contains the metadata of the PDB.
  3. Copy the generated backup files along with the XML file to the target system in the cloud.
  4. On the DBCS compute node, invoke RMAN with the RESTORE USING … FOREIGN PLUGGABLE DATABASE command.
  5. Upgrade the PDB if your target DBCS has a higher release version than on-premise.
  6. Open the target PDB in Read-Write mode.
No alt text provided for this image

For detailed steps and code examples have a look at:

11. RMAN Cross-Platform Transportable PDB Inconsistent Backups

To achieve a much shorter downtime, use inconsistent backups where the PDB incremental level 0 backup is taken while the PDB is open in Read-Write mode. Thereafter, take one or more incremental level 1 backup and apply them to the target database to keep it as far in sync to the source as possible. Finally, close the PDB to perform a final incremental level 1 backup and get the PDBs’ metadata.

The downtime needed using this method is only for what is needed for the last incremental level 1 backup and recovery (and the upgrade in case of different release versions).

The migration steps consist of:

  1. On-premise, invoke RMAN using BACKUP INCREMENTAL LEVEL 0 FOR TRANSPORT ALLOW INCONSISTENT command.
  2. Copy the generated backup files to the target host in the cloud.
  3. On the DBCS compute node, invoke RMAN with the RESTORE FOREIGN PLUGGABLE DATABASE command.
  4. Create an incremental level 1 backup on-premise, copy the backups to the cloud, and apply them to the target database to keep it as close as possible to the source database. The source database on-premise is still online and fully available.
  5. Close the PDB on-premise.
  6. On-premise, invoke RMAN with the BACKUP INCREMENTAL FROM SCN … FOR TRANSPORT UNPLUG INTO command to create the final incremental level 1 backup and generate the XML file containing the PDB metadata.
  7. Copy the generated backup files along with the XML file to the target system in the cloud.
  8. On the DBCS compute node, invoke RMAN with the RECOVER USING … FOREIGN DATAFILECOPY command.
  9. Upgrade the PDB if your target DBCS has a higher release version than on-premise.
  10. Open the target PDB in Read-Write mode.
No alt text provided for this image

For detailed steps and code examples have a look at:

12. RMAN Duplicate from an Active Database

RMAN also provides the DUPLICATE command to duplicate a database on a remote server on-premise or in the cloud. The duplication can be based on a backup or an active database. Active database duplication copies the live database over the network to the auxiliary destination and then creates the duplicate database. Using this method, you can migrate an entire active CDB database to the cloud.

The very high-level migration steps consist of:

  1. Create an auxiliary instance in the cloud.
  2. On the DBCS compute node, invoke RMAN with the DUPLICATE command.
No alt text provided for this image

For detailed steps and code examples have a look at:

13. RMAN Backup & Restore

It is also possible to just use a conventional full backup and restore to migrate an Oracle database across platforms.

The very high-level migration steps consist of:

  1. Close the PDB on-premise.
  2. Create a full consistent backup.
  3. Copy the backup to OCI Object Storage.
  4. On the DBCS compute node, invoke RMAN to restore the database.
No alt text provided for this image

Oracle also provides the Oracle Database Backup Cloud Service to backup Oracle databases on-premise to OCI Object Storage.

No alt text provided for this image

You also can use the Backup Service as your main backup strategy and benefit from having your backups highly available on a different data center for disaster recovery.

Conclusion

RMAN provides different ways to migrate an Oracle database across platforms by using backup and restore scenarios, including converting the database data files for cross endian platform migrations. Using inconsistent backups you can minimize the downtime to the time needed to create and apply one last incremental level 1 backup.

As a physical migration method, it can be used to migrate your databases to Oracle Database Cloud Service (DBCS).

No alt text provided for this image

Next Blog

Part 7/10: Migration Methods using Multitenant Architecture.

Would you like to get notified when the next post is published?