2 Setting Up Zero Downtime Migration Software

When you install Zero Downtime Migration software, read this section carefully as there may have been changes since the last time you performed an installation.

The Zero Downtime Migration software kit supports both physical and logical migrations. You only need to install one kit to get all of the functionality.

Always see the Zero Downtime Migration Release Notes for the latest information about known issues. Also, see the README file included with the downloaded Zero Downtime Migration software for any additional information about software installation and updates.

If you already have Zero Downtime Migration software installed on a host, you should always make sure it is the latest available release. Zero Downtime Migration software updates give you the latest features and fixes while retaining existing job information, metadata, and log files. Always check the version and determine if it is the latest by comparing it with what's available on the downloads page.

For information about updating existing software to the latest release, removing the software, and starting and stopping the Zero Downtime Migration service, see Managing the Zero Downtime Migration Service.

2.1 Prepare a Host for Zero Downtime Migration Software Installation

If a host has not had Zero Downtime Migration software installed on it previously, verify that it complies with the requirements and perform any pre-installation tasks, then download and install the software. Once the software is installed, the host is referred to as the Zero Downtime Migration service host.

Provision a host with the following prerequisites and complete the following pre-installation tasks before installing Zero Downtime Migration software on it.

  • The Zero Downtime Migration service host should be a dedicated system, but it can be shared for other purposes.

    However, if the Zero Downtime Migration service is installed on the same host where RHP server is deployed, see Running RHP and Zero Downtime Migration Service on the Same Host for more info.

  • Zero Downtime Migration software requires a standalone Linux host running on any one of the following platforms:

    Oracle Linux 7, Oracle Linux 8, or Red Hat Enterprise Linux 8.

  • The Zero Downtime Migration service host must be able to connect to the source and the target database servers.

  • Ensure that the Linux host has 100 GB of free storage space.

  • You may use an existing user, or, on the Zero Downtime Migration service host, as root user, create a zdm group and add zdmuser user to the group.

    For example,

    root> groupadd zdm
    root> useradd –g zdm zdmuser
  • Verify that the glibc-devel and expect packages are installed.

    For Oracle Linux 8, or Red Hat Enterprise Linux 8 installations with Base Environment "Minimal Install" you also need to install the packages unzip libaio oraclelinux-developer-release-el7 libnsl and ncurses-compat-libs.
    - Minimum OS version Oracle Linux 7
     - Ensure Packages 'glibc-devel' and 'expect' are installed
     - For higher versions such as Oracle Linux 8:
     - Ensure Packages 'libnsl' and 'ncurses-compat-libs' are also installed
     - glibc-devel' and 'expect are a must for either versions
     - unzip libaio oraclelinux-developer-release-el7 libnsl and ncurses-compat-libs are required for Oracle Linux 8 and Red Hat Enterprise Linux 8
  • Verify that the /etc/hosts entry for the host name and IP address are configured as expected, so that the host selected for Zero Downtime Migration software installation resolves to the correct IP address and the IP address is reachable with ping.

  • During the installation, the script might report any missing packages and instructions for setting appropriate values for kernel parameters. Be sure to install the missing packages and set the kernel parameters before the Zero Downtime Migration software installation.

  • Optionally, set a ZDM_HOME environment variable to the absolute path of the directory where the Zero Downtime Migration software will be installed. All of the examples in this document use $ZDM_HOME.

    zdmuser> export ZDM_HOME=absolute_path_to_zdm_home

2.2 Install Zero Downtime Migration Software

All commands are run as zdmuser.

  1. Download the Zero Downtime Migration software kit from https://www.oracle.com/database/technologies/rac/zdm-downloads.html to the Zero Downtime Migration service host.

    Note:

    Review for new patches if required, by reviewing the Patch 33509650: ZDM PATCH USING MOS.
  2. Create home and base directories.

    The home directory is where the Zero Downtime Migration software will be installed.

    The base directory is where all of the Zero Downtime Migration configuration files, logs, and other artifacts are stored.

    For example:

    /u01/app/zdmhome

    /u01/app/zdmbase

  3. Install the Zero Downtime Migration software as a non-root user.

    In this example the installation user is zdmuser.

    1. Change to the directory to where Zero Downtime Migration software is downloaded and unzip the software.
      zdmuser> cd zdm_download_directory
      zdmuser> unzip zdmversion.zip 
    2. Run the Zero Downtime Migration installation script.
      zdmuser>./zdminstall.sh setup oraclehome=zdm_oracle_home oraclebase=zdm_base_directory
              ziploc=zdm_software_location
      • zmdinstall.sh is the installation script
      • oraclehome is the absolute path to the Oracle Home directory where the Zero Downtime Migration software will be installed
      • oraclebase is the absolute path to the base directory where all of the Zero Downtime Migration configuration files, logs, and other artifacts are stored
      • ziploc is the location of the compressed software file (zip) included in the Zero Downtime Migration kit

      For example,

      zdmuser>./zdminstall.sh setup oraclehome=/u01/app/zdmhome
              oraclebase=/u01/app/zdmbase ziploc=/u01/app/oracle/zdm/shiphome/zdm_home.zip
              

    Note that the Zero Downtime Migration service host requires PERL to run the install script.

    Hereafter, the oraclehome value is referred to as ZDM_HOME, and the oraclebase value is referred to as ZDM_BASE.

    Ignore the following messages which are displayed on the terminal at the end of installation. There is no need to run these scripts.

    As a root user, execute the following script(s):
            1. $ZDM_HOME/inventory/orainstRoot.sh
            2. $ZDM_HOME/root.sh
    
  4. Start the Zero Downtime Migration service as user zdmuser.
    zdmuser> $ZDM_HOME/bin/zdmservice start
    

    You must start zdmservice before you can migrate your databases using Zero Downtime Migration.

    If you must stop the Zero Downtime Migration service, run the following command.

    zdmuser> $ZDM_HOME/bin/zdmservice stop
  5. Verify that the Zero Downtime Migration service installation is successful.
    When you run the following command, the output should be similar to that shown here.
    zdmuser> $ZDM_HOME/bin/zdmservice status
    ---------------------------------------
            Service Status
    ---------------------------------------
    Running:       true
    Tranferport:   5000-7000
    Conn String:   jdbc:mysql://localhost:8899/
    RMI port:      8897
    HTTP port:     8898
    Wallet path:   /u01/app/zdmbase/crsdata/fopds/security
  6. If necessary, change the default MySQL port.

    Zero Downtime Migration uses MySQL internally, configuring it by default on port 8897, as shown in the above zdmservice status example output. If you want to change this port number, see Setting the MySQL Port.

2.3 Installing Zero Downtime Migration on VM in Oracle Cloud Infrastructure

You can install ZDM on a VM in OCI by performing the following steps:

2.3.1 To install Zero Downtime Migration on VM in OCI

  1. Create your VM instance in OCI and download the private and public keys.
  2. Connect to your VM instance through SSH by using your downloaded private key.
  3. Download the ZDM image from Oracle Zero Downtime Migration.
  4. Install the following software for ZDM:
    • expect
    • glibc-devel
    • ncurses-compat-libs
    • libnsl
  5. Run the following command:
    sudo yum install oraclelinux-developer-release-el8 libnsl perl unzip glibc-devel expect libaio ncurses-compat-libs ncurses-devel numactl-libs openssl mlocate bind-utils
  6. Create a directory to store the ZDM home and base.
    For example, mkdir /home/opc/zdm
  7. Unzip the ZDM image.
    For example, [opc@zdminstance20230201 zdm]$ unzip ZDMKIT.zip
  8. Run the ZDM installer:
    [opc@zdminstance20230201 zdm]$ /home/opc/zdm/zdmkit/zdminstall.sh setup oraclehome=/home/opc/zdm/home oraclebase=/home/opc/zdm/base ziploc=/home/opc/zdm/zdmkit/zdm_home.zip
  9. Start the ZDM service:
    [opc@zdminstance20230201 zdm]$ home/bin/zdmservice start
  10. Verify the installed version.
    Example:
    
    [opc@zdminstance20230201 zdm]$ home/bin/zdmcli -build 
    version: 21.0.0.0.0 
    full version: 21.4.0.0.0 
    patch version: N/A 
    label date: 221207.1 
    ZDM kit build date: Dec 16 2022 23:20:28 PST 
    CPAT build version: 22.10.0 
  11. When ZDM is configured on a compute VM provisioned in OCI, you may need to update /etc/hosts to resolve the source and/or target database systems. If the ZDM compute VM is rebooted for some reason, the custom entries in /etc/hosts are not saved. To save these custom entries, edit /etc/oci-hostname.conf as follows:
    # This configuration file controls the hostname persistence behavior for Oracle Linux 
    
    # compute instance on Oracle Cloud Infrastructure (formerly Baremetal Cloud Services) 
    
    # Set PRESERVE_HOSTINFO to one of the following values 
    
    #   0 -- default behavior to update hostname, /etc/hosts and /etc/resolv.conf to 
    
    #        reflect the hostname set during instance creation from the metadata service 
    
    #   1 -- preserve user configured hostname across reboots; update /etc/hosts and 
    
    #           /etc/resolv.conf from the metadata service 
    
    #   2 -- preserve user configured hostname across instance reboots; no custom 
    
    #        changes to /etc/hosts and /etc/resolv.conf from the metadata service, 
    
    #        but dhclient will still overwrite /etc/resolv.conf 
    
    #   3 -- preserve hostname and /etc/hosts entries across instance reboots; 
    
    #        update /etc/resolv.conf from instance metadata service 
    
    PRESERVE_HOSTINFO=2      ==> Set this to at least 2.  
    Entries in /etc/hosts will now be saved across instance reboots for ZDM running on a provisioned compute instance or VM in OCI.

2.4 Installing Zero Downtime Migration on Red Hat Enterprise Linux 8 in an Oracle Cloud Infrastructure Instance

You can install ZDM on a Red Hat Enterprise Linux 8 in an OCI instance by performing the following steps:

2.4.1 To install Zero Downtime Migration on Red Hat Enterprise Linux 8

  1. Obtain Red Hat Enterprise Linux 8.8 KVM Guest Image from here.
  2. Upload the image to a new OCI bucket.
  3. Import the image as custom image.
  4. Create an instance from the image.
  5. Generate new SSH keys.
  6. Connect to the RHEL8 OCI instance.
Perform the following steps:
  1. Configure yum repositories by running the following command:
    $ sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
    $ sudo yum-config-manager --add-repo http://yum.oracle.com/repo/OracleLinux/OL8/baseos/latest/x86_64
    $ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
    $ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-8
    $ sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta
  2. Enable swap by running the following commands:
    $ sudo swapon --show
    $ sudo fallocate -l 1G /swapfile
    $ sudo chmod 600 /swapfile
    $ sudo mkswap /swapfile
    $ sudo swapon /swapfile
    $ sudo swapon --show
  3. Install the required Red Hat Enterprise Linux 8 packages as follows:
    $ sudo yum install zip.x86_64 --nogpgcheck 
    $ sudo yum install expect.x86_64 --nogpgcheck 
    $ sudo yum install glibc-devel.x86_64 --allowerasing --nogpgcheck
    $ sudo yum install libnsl.x86_64 --allowerasing --nogpgcheck
    $ sudo yum install ncurses-compat-libs.x86_64 --allowerasing --nogpgcheck
    $ sudo yum install libaio.x86_64 --allowerasing --nogpgcheck
  4. Install Zero Downtime Migration.