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.1.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.1.zip

Step 5: Install the ZDM software. As zdmuser:

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

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

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

Task 2: Create an Authentication Token for your OCI user. From the user’s details page, click on Auth Tokens and then on Generate Token. Enter a Description and click on Generate TokenCopy this token for your records. It will not be shown again.

Task 3: Install the OCI CLI command line tool. This will be used later on to access the OCI resources, e.g. copy Data Pump dump file into Object Storage. As zdmuser:

[zdmuser@zdmhost ~]$ bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
#keep the defaults and click ENTER
#check 
[zdmuser@zdmhost ~]$ oci --help
#configure
[zdmuser@zdmhost ~]$ oci setup config
#Keep the default location for the config file: /home/zdmuser/.oci/config
#Enter a user OCID: ocid1.user.oc1...
#Enter a tenancy OCID: ocid1.tenancy.oc1...
#Enter a region: eu-frankfurt-1 (or choose one from the list)
#Do you want to generate a new API Signing RSA key pair? Y
#Keep the default location for the keys: /home/zdmuser/.oci
#Keep the default name for the key: oci_api_key
#empty for no passphrase: click ENTER

Upload the API Signing public key to your OCI user in the cloud console. As zdmuser:

[zdmuser@zdmhost ~]$ cat /home/zdmuser/.oci/oci_api_key_public.pem
-----BEGIN PUBLIC KEY-----
xxxMIIBIjANBgkxxx
-----END PUBLIC KEY-----

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 fingerpring generated and displayed on the console must be the same as the one in the config file on the ZDM host. As zdmuser:

[zdmuser@zdmhost ~]$ cat /home/zdmuser/.oci/config | grep fingerprint
fingerprint=9f:3b:55:c1:bd:a4:3e:de:d7:e1:a1:12:eb:93:ba:3a

Let’s 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": {
  ...
}

Now we are ready to use the ZDM host for Oracle database migrations into Oracle Cloud.

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?