Part 1/5: Zero Downtime Migration (ZDM) – Introduction & Installation

Introduction

Oracle Zero Downtime Migration (ZDM) is a free to use software solution that allows you to automate your Oracle database migrations from on-premises to Oracle Cloud. Initially, ZDM supported Data Guard based migrations following the principles of Oracle Maximum Availability Architecture (MAA). To support Standard Edition migrations, ZDM uses RMAN backup and restore instead. The new ZDM version 21c adds logical migration methods using Data Pump and Oracle GoldenGate supporting zero downtime migrations to Oracle Autonomous Database.

With that, ZDM offers four different migration methods:

  1. Logical Online Migration using GoldenGate
  2. Logical Offline Migration using Data Pump
  3. Physical Online Migration using Data Guard
  4. Physical Offline Migration using RMAN

It is also possible to use GoldenGate and Data Pump targeting co-managed cloud databases.

ZDM 21c supports Oracle database release 11.2.0.4 and later. It supports single instance, Oracle RAC one node, and Oracle RAC configurations. Furthermore, ZDM can handle the conversion of a non-CDB source database to a PDB of the same version in the cloud as part of the physical migration process.

In this blog post we will install the ZDM software to be ready to use in the next four blog posts that will show each of the migration methods. The aim of these posts is to get you started with a minimal working configuration, as simple as possible.

Preparation

It is highly recommended to have a dedicated host for the ZDM software installation. The host where the ZDM software is installed is referred to as the ZDM Service Host. The following prerequisites must be met on that host:

  • Oracle Linux 7.
  • 100 GB of free storage space.
  • No Oracle Grid Infrastructure running on it.
  • Possible to connect to source and target database (servers).

The ZDM software can be:

For this blog post, I’ll continue with the manual installation to go through the steps in case you want to install it manually. In the web console, click the navigation menu in the upper left side and select Compute > Instances. Click on Create Instance. I’ll choose the name “zdmhost” and Oracle Linux 7.9. Click on “Specify a custom boot volume size” and put 200 GB as boot volume size. With that we will have the required 100 GB free space:

Fill out the remaining needed information and click Create. After very few minutes you’ll be able to login to the compute instance. In this example, the public IP address is 130.61.21.179.

ZDM Installation

Log in the to the ZDM host via ssh.

Step 1: Extend the file system to make the 200 GB available. As root user:

[opc@zdmhost ~]$ sudo su -
[root@zdmhost ~]# df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        39G  3.2G   36G   9% /
[root@zdmhost ~]# /usr/libexec/oci-growfs -y
[root@zdmhost ~]# df -h /
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3       192G  3.2G  189G   2% /

Step 2: Create a new group, user, and the needed directories. As root user:

[root@zdmhost ~]# groupadd zdm
[root@zdmhost ~]# useradd -g zdm zdmuser
[root@zdmhost ~]# mkdir -p /home/zdmuser/zdminstall
[root@zdmhost ~]# mkdir /home/zdmuser/zdmhome
[root@zdmhost ~]# mkdir /home/zdmuser/zdmbase
[root@zdmhost ~]# chown -R zdmuser:zdm /home/zdmuser/

Step 3: Install the required software packages. As root user:

[root@zdmhost ~]# yum install glibc-devel
[root@zdmhost ~]# yum install expect
[root@zdmhost ~]# yum install unzip
[root@zdmhost ~]# yum install libaio
[root@zdmhost ~]# yum install oraclelinux-developer-release-el7

Step 4: Download the ZDM software version 21c (zdm21.2.zip) and copy the zip file to the ZDM host into the /home/zdmuser/zdminstall/ directory. Change the owner of the zip file to zdmuser. As root user:

[root@zdmhost ~]# chown zdmuser:zdm /home/zdmuser/zdminstall/zdm21.2.zip

Step 5: Install the ZDM software. As zdmuser:

[zdmuser@zdmhost ~]$ cd /home/zdmuser/zdminstall/
[zdmuser@zdmhost zdminstall]$ unzip zdm21.2.zip

[zdmuser@zdmhost zdminstall]$ ZDMHOME=/home/zdmuser/zdmhome
[zdmuser@zdmhost zdminstall]$ ZDMBASE=/home/zdmuser/zdmbase
[zdmuser@zdmhost zdminstall]$ /home/zdmuser/zdminstall/zdm21.2/zdminstall.sh setup oraclehome=$ZDMHOME oraclebase=$ZDMBASE ziploc=/home/zdmuser/zdminstall/zdm21.2/zdm_home.zip -zdm
ZDM service setup finished successfully...

Add the ZDMHOME and ZDMBASE to the zdmuser .bash_profile. As zdmuser:

[zdmuser@zdmhost ~]$ vi .bash_profile
#add
ZDMHOME=/home/zdmuser/zdmhome
ZDMBASE=/home/zdmuser/zdmbase

Step 6: Start ZDM and check the status. As zdmuser:

[zdmuser@zdmhost ~]$ $ZDMHOME/bin/zdmservice start
Return code is 0
Server started successfully.
[zdmuser@zdmhost ~]$ $ZDMHOME/bin/zdmservice status
---------------------------------------
        Service Status
---------------------------------------
 Running:       true

Post Tasks

Task 1: Create an SSH key pair for zdmuser. This will be used later on to log in to the sources (and target) database server via SSH. As zdmuser:

[zdmuser@zdmhost ~]$ ssh-keygen
#keep the defaults and click ENTER
[zdmuser@zdmhost ~]$ cp -p .ssh/id_rsa .ssh/zdm_service_host.ppk

Task 2: Create an API Signing Key. This will be used to authenticate OCI CLI against the Cloud Control Plane. As zdmuser:

[zdmuser@zdmhost ~]$ mkdir ~/.oci
[zdmuser@zdmhost ~]$ openssl genrsa -out ~/.oci/oci_api_key.pem 2048
[zdmuser@zdmhost ~]$ chmod go-rwx ~/.oci/oci_api_key.pem
[zdmuser@zdmhost ~]$ openssl rsa -pubout -in ~/.oci/oci_api_key.pem -out ~/.oci/oci_api_key_public.pem
#Copy the contents of the public key to the clipboard using pbcopy
[zdmuser@zdmhost ~]$ cat ~/.oci/oci_api_key_public.pem | pbcopy

Upload the PEM public key in the Console. From your user’s page, click on API Keys and Add API Key. Select Paste Public Key, paste the output from previous command, and click Add.

The key’s fingerprint will be displayed, for example, 9f:3b:55:c1:bd:a4:3e:de:d7:e1:a1:12:eb:93:ba:3a. You’ll need this later on for the ZDM response file parameter OCIAUTHENTICATIONDETAILS_USERPRINCIPAL_FINGERPRINT.

Task 3 (optional): Install OCI CLI. As zdmuser:

[zdmuser@zdmhost ~]$ bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
[zdmuser@zdmhost ~]$ oci setup config
Do you want to generate a new API Signing RSA key pair? [Y/n]: n
#use the once created i Task 2

Task 4: Check the CLI by configuration by creating an Object Storage bucket that we will need anyway. As zdmuser:

[zdmuser@zdmhost ~]$ COMPARTMENT_OCID=ocid1.compartment.oc1...
[zdmuser@zdmhost ~]$ oci os bucket create --compartment-id $COMPARTMENT_OCID --name zdmbucket
{
  "data": {
  ...
}

Task 5: Make sure port 1521 is open on your source and target database servers. As user root:

[root@onpremdb ~]# firewall-cmd --permanent --add-port=1521/tcp
success
[root@onpremdb ~]# firewall-cmd --reload
success

Conclusion

ZDM 12c supports both physical and logical migrations. The automation enables you to test your migration multiple times as needed, and when you are ready, ensure that you are executing the same steps and reduce human error.

Further Reading

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