6 Performing a Hybrid Offline Migration
ZDM introduces hybrid, cross-platform Transportable Tablespace (XTTS) database migration support for cross-platform and cross-version migration using RMAN transportable tablespaces and Data Pump metadata import/export.
You can perform a hybrid offline migration to Oracle Base Database Service, Oracle Exadata Database Service on Dedicated Infrastructure, Oracle Exadata Database Service on Cloud@Customer Service, and Oracle Exadata Database Machine On-Premises Databases.
6.1 Overview
Hybrid migration follows ZDM's proven methodology of pre-check, data transfer, synchronization, and post-check. While there are manually several phases that ZDM goes through for a hybrid Migration, the overall workflow is summarized as follows:
- ZDM connects to the source database and target database and performs the following validations:
- ZDM_VALIDATE_TGT phase: ZDM connects to the target database and performs validations.
- ZDM_VALIDATE_SRC phase: ZDM connects to the source database and performs validations.
- ZDM_SETUP_XTTS_SRC phase: ZDM configures required helper modules at the source level.
- ZDM_SETUP_XTTS_TGT phase: ZDM configures required helper modules at the target level.
- ZDM orchestrates the tablespace-level backups:
- Performs a full backup of the tablespaces.
- Performs an incremental backup of the tablespaces.
- Copies the wallet files as required.
- ZDM performs a full restore of tablespaces as foreign tablespaces.
- ZDM sets the source tablespaces as read-only and performs the following steps:
- Performs an incremental backup of the tablespaces and metadata export of the tablespaces using RMAN.
- Copies the wallet files as required.
- ZDM exports the metadata via Data Pump. The export includes:
- Metadata
- PL/SQL objects
- Non-tablespaces data
- ZDM imports the metadata and performs an incremental restore as follows:
- Import of the user metadata from Data Pump.
- Incremental restore with RMAN + import of tablespace metadata generated by RMAN.
- Import of all the other metadata (objects and non-tablespace data).
- ZDM performs post actions, cleans up, and finalizes.
6.2 Pre-requisites
Zero Downtime Migration Service Host Requirements
For ZDM's service host requirements, installation, and overall configuration related information, refer to the Setting Up Zero Downtime Migration Software topic.
6.3 Source Database Requirements
- The source and target databases must have the same time zone.
- The source and target databases must have the same character set and NLS character set.
- The source compatible version must be set to the same or a lower version than the target database.
6.4 Target Database Requirements
- The target container database must not have any tablespaces sharing the same name as tablespaces at the source database. If a source database tablespace exists at the target level, then Data Pump will throw an error. Following are the other pre-requisites:
- The source database must be at least Oracle Database 11.2.0.4.
- This feature will only be available in Oracle Database 19c (19.24).
For the target database, ensure that it contains the fix available in 35564253.
Any source tablespace to be migrated should not exist on the target database, otherwise the Data Pump import will fail.
- SYSDBA is needed for hybrid migration source and target database users. This is because ZDM uses RMAN to run tablespace metadata import/export.
6.5 Encryption Requirements
- For TDE encrypted source databases, with encrypted tablespaces, configure TDE at the target level as well.
- To provide the source and target TDE passwords, you can::
- Use the ZDMCLI command line with zdmcli migrate database
-tdekeystorepasswd
for the source database- -
tgttdekeystorepasswd
for the target database
- Use the following response file parameters:
-
- WALLET_TDEKEYSTORE for the source database.
- WALLET_TGTTDEKEYSTORE for the target database.
-
- Use the ZDMCLI command line with zdmcli migrate database
- Migrated unencrypted source databases will not result in an encrypted target database, you must perform the encryption at the target level post migration.
6.6 Intermediate Storage Requirements
The NFS or shared storage between the source and the target database should have sufficient storage to hold all the RMAN backups and Data Pump dump files. You can specify the compression for the RMAN backups which should result in space reduction, however, conservatively, ensure that the space should be at-least as large as the size of the source database. You can specify the RMAN compression using the RMANSETTINGS_COMPRESSIONALGORITHM parameter.
6.7 Connectivity Requirements
The connectivity requirements for hybrid migration are same as physical and logical migration. You must have SSH connectivity for the source and target databases. You must have the SQL*Net connectivity between ZDM server and the source and the target database.
For SQL*Net setup, refer to the Physical and Logical Migration with SSH Access topic.
6.8 Preparing for a Hybrid Offline Migration
Create a response file after following the pre-requsites. Following is a sample file with the minimum required parameters. You can replace the parameters with values pertaining to your environment:
MIGRATION_METHOD=OFFLINE_XTTS DATA_TRANSFER_MEDIUM=NFS SOURCEDATABASE_ADMINUSERNAME= source database admin username SOURCEDATABASE_CONNECTIONDETAILS_HOST= hostname or ip address SOURCEDATABASE_CONNECTIONDETAILS_SERVICENAME= source service name or alias SOURCEDATABASE_CONNECTIONDETAILS_PORT= listener port number TARGETDATABASE_ADMINUSERNAME= source database admin username TARGETDATABASE_CONNECTIONDETAILS_HOST= hostname or ip address TARGETDATABASE_CONNECTIONDETAILS_PORT= listener port number TARGETDATABASE_CONNECTIONDETAILS_SERVICENAME= target service name or alias DATAPUMPSETTINGS_EXPORTDIRECTORYOBJECT_NAME= name of the directory object DATAPUMPSETTINGS_EXPORTDIRECTORYOBJECT_PATH= path of the directory object DATAPUMPSETTINGS_IMPORTDIRECTORYOBJECT_NAME= name of the directory object DATAPUMPSETTINGS_IMPORTDIRECTORYOBJECT_PATH= path of the directory object WALLET_TARGETADMIN= wallet path WALLET_SOURCEADMIN= wallet path
6.9 Migrating the Database
After following the pre-requsisites and after creating a response file, follow this sample migration command with the minimum required options and replace it with the values pertaining to your environment:
$ZDM_HOME/bin/zdmcli migrate database -sourcesid source_oracle_sid (use this parameter if the source is a single instance DB without Grid Infrasctructure) otherwise use -sourcedb source_db_unique_name_value (use this parameter is the source is configured with Grid Infrastructure) -sourcenode source-db-host-name -srcauth zdmauth -srcarg1 user:source_database_server_login_user_name -srcarg2 identity_file:ZDM_installed_user_private_key_file_location -srcarg3 sudo_location:/bin/sudo -targetnode target-db-host-name -rsp /home/zdmuser/hybrid_online.rsp -tgtauth zdmauth -tgtarg1 user:target_database_server_login_user_name -tgtarg2 identity_file:ZDM_installed_user_private_key_file_location -tgtarg3 sudo_location:/usr/bin/sudo
6.10 Troubleshooting
For troubleshooting, review the following logs:
- ZDM Server Logs:
$ZDM_BASE/crsdata//rhp/zdmserver.log.XYZ
- ZDM perl logs on source:
$ORACLE_BASE/zdm_<db_unique_name_<zdm job id>/log/
- ZDM perl logs on target:
$ORACLE_BASE/zdm_<db_unique_name_<zdm job id>/log/
- Export log file from the location specified for the entry
DATAPUMPSETTINGS_EXPORTDIRECTORYOBJECT_PATH
in the response file - Import log file from the location specified for the entry
DATAPUMPSETTINGS_IMPORTDIRECTORYOBJECT_PATH
in the response file
Following are the workflow phases as well as their brief description in order of their execution:
Phase name | Description |
---|---|
ZDM_VALIDATE_TGT | Performs validations at the target |
ZDM_VALIDATE_SRC | Perform validations at the source |
ZDM_SETUP_XTTS_SRC | Sets up Zero Downtime Migration helper modules on the source server |
ZDM_SETUP_XTTS_TGT | Sets up Zero Downtime Migration helper modules on the target server |
ZDM_VALIDATE_DATAPUMP_SETTINGS_SRC | Validates the export directory object (if applicable), and checks for sufficient space and permission for specified user in the source database to export dumps. |
ZDM_VALIDATE_DATAPUMP_SETTINGS_TGT | Verifies that the Data Pump import directory object exists. |
ZDM_VALIDATE_XTTS_SRC | Performs XTTS related validations at the source such as self-containment of tablespaces |
ZDM_VALIDATE_XTTS_TGT | Performs XTTS related validations at the target such as ensuring tabelspaces names are not in use already which are part of migration |
ZDM_XTTS_BACKUP_FULL_SRC | Performs full backup of the sourcetablespaces (Initial L0) |
ZDM_XTTS_BACKUP_INCR_SRC | Second backup of the source tablespaces (First L1) |
ZDM_XTTS_COPYFILES | Copies files needed to perform restore at target such as source discovery file, transport xml, any TDE wallets. |
ZDM_XTTS_RESTORE_FULL_TGT | Performs Initial restore of the tablespaces at the target |
ZDM_XTTS_BACKUP_INCR_RO_SRC | Sets the tablespaces to read only and takes the third & final backup of the tablesapces (Second L1). Additionally RMAN exports the datapump dump of the metadata of tablespaces |
ZDM_XTTS_COPYFILES_RO | Copies files needed to perform restore at target such as the latest transport xml and TDE wallets to account for any changes to the wallet |
ZDM_PREPARE_DATAPUMP_SRC | Creates a new directory object for Data Pump, if required. |
ZDM_PREPARE_DATAPUMP_TGT | Creates a new directory object for Data Pump, if required. |
ZDM_DATAPUMP_EXPORT_METADATA_SRC | Performs export any additional source meta data other than the tablespace meta data exported by RMAN datapump execution such as Users, PL/SQL, Triggers, and so on. |
ZDM_TRANSFER_DUMPS_METADATA_SRC | |
ZDM_DATAPUMP_IMPORT_USER_TGT | Imports Users and Profiles as the first import so that the subsequent tablespace import can succeed |
ZDM_XTTS_RESTORE_INCR_TGT | Executes RMAN to perform the final restore and import of the tablespace metadata exported by RMAN during ZDM_XTTS_BACKUP_INCR_RO_SRC phase |
ZDM_DATAPUMP_IMPORT_TGT | Imports any additional metadata other than users, profiles & tablespaces not performed in previous imports |
ZDM_POST_DATAPUMP_SRC | Removes any Data Pump directory object created by Zero Downtime Migration |
ZDM_POST_DATAPUMP_TGT | Fixes any invalid objects in the target database. |
ZDM_REFRESH_MVIEW_TGT | |
ZDM_POST_ACTIONS | |
ZDM_CLEANUP_SRC | Performs clean up at the source such as removing helper modules copied during the setup phase |
ZDM_CLEANUP_TGT | Performs clean up at the target such as removing helper modules copied during the setup phase |
MIGRATION_METHOD=OFFLINE_XTTS
DATA_TRANSFER_MEDIUM=NFS
SOURCEDATABASE_CONNECTIONDETAILS_HOST
SOURCEDATABASE_CONNECTIONDETAILS_PORT
SOURCEDATABASE_CONNECTIONDETAILS_SERVICENAME
SOURCEDATABASE_ADMINUSERNAME
TARGETDATABASE_CONNECTIONDETAILS_HOST
TARGETDATABASE_CONNECTIONDETAILS_PORT
TARGETDATABASE_CONNECTIONDETAILS_SERVICENAME
TARGETDATABASE_ADMINUSERNAME
DATAPUMPSETTINGS_EXPORTDIRECTORYOBJECT_NAME
DATAPUMPSETTINGS_EXPORTDIRECTORYOBJECT_PATH
DATAPUMPSETTINGS_IMPORTDIRECTORYOBJECT_NAME
DATAPUMPSETTINGS_IMPORTDIRECTORYOBJECT_PATH
DATAPUMPSETTINGS_DATAPUMPPARAMETERS_EXPORTPARALLELISMDEGREE
DATAPUMPSETTINGS_DATAPUMPPARAMETERS_IMPORTPARALLELISMDEGREE
DATAPUMPSETTINGS_DATAPUMPPARAMETERS_NOCLUSTER=FALSE
DATAPUMPSETTINGS_EXPORTVERSION
DUMPTRANSFERDETAILS_PUBLICREAD=FALSE
IGNOREEXPORTERRORS
IGNOREIMPORTERRORS
RMANSETTINGS_BACKUPTAG
RMANSETTINGS_COMPRESSIONALGORITHM=MEDIUM
RMANSETTINGS_PUBLICREAD=FALSE
RMANSETTINGS_RETENTIONWINDOW
RMANSETTINGS_SECTIONSIZE=64G
RMANSETTINGS_SRCCHANNELS=10
RMANSETTINGS_TGTCHANNELS=10
SOURCEDATABASE_CONNECTIONDETAILS_BASTIONDETAILS_IDENTITYFILE
SOURCEDATABASE_CONNECTIONDETAILS_BASTIONDETAILS_IP
SOURCEDATABASE_CONNECTIONDETAILS_BASTIONDETAILS_PORT
SOURCEDATABASE_CONNECTIONDETAILS_BASTIONDETAILS_REMOTEHOSTIP
SOURCEDATABASE_CONNECTIONDETAILS_BASTIONDETAILS_USERNAME
SOURCEDATABASE_CONNECTIONDETAILS_PROXYDETAILS_HOSTNAME
SOURCEDATABASE_CONNECTIONDETAILS_PROXYDETAILS_PORT
SOURCEDATABASE_CONNECTIONDETAILS_PROXYDETAILS_PROTOCOL
SOURCEDATABASE_ENVIRONMENT_DBTYPE=ORACLE
SOURCEDATABASE_ENVIRONMENT_NAME=ORACLE
TABLESPACEDETAILS_EXCLUDE=
TARGETDATABASE_CONNECTIONDETAILS_BASTIONDETAILS_IDENTITYFILE
TARGETDATABASE_CONNECTIONDETAILS_BASTIONDETAILS_IP
TARGETDATABASE_CONNECTIONDETAILS_BASTIONDETAILS_PORT
TARGETDATABASE_CONNECTIONDETAILS_BASTIONDETAILS_REMOTEHOSTIP
TARGETDATABASE_CONNECTIONDETAILS_BASTIONDETAILS_USERNAME
TARGETDATABASE_CONNECTIONDETAILS_PROXYDETAILS_HOSTNAME
TARGETDATABASE_CONNECTIONDETAILS_PROXYDETAILS_PORT
TARGETDATABASE_CONNECTIONDETAILS_PROXYDETAILS_PROTOCOL
TARGETDATABASE_DBTYPE
WALLET_DATAPUMPENCRYPTION
WALLET_SOURCEADMIN
WALLET_TARGETADMIN
WALLET_TDEKEYSTORE
WALLET_TGTTDEKEYSTORE
WALLET_USERACTION