Provision Oracle Zero Downtime Migration

Install and configure Oracle Zero Downtime Migration.

About Zero Downtime Migration Prerequisites

Before running the Zero Downtime Migration utility for database migration, it needs to meet certain prerequisites.

The Zero Downtime Migration service host needs to access the source and target database servers during a database migration. With that, to perform the migration to Oracle Autonomous Database on Dedicated Exadata Infrastructure, the Zero Downtime Migration service host requires either root-user access, or SSH key-based access to one of the source database servers as well. Ensure these requirements for network route and connectivity are met before proceeding.

Install a Zero Downtime Migration Host

Oracle recommends installing Zero Downtime Migration on a separate host running on Oracle Linux 7 or 8. It could be provisioned at the source database data center, or configured in OCI. In this example, the Zero Downtime Migration service host has been configured in OCI.
  1. Provision a host on Oracle Linux with a storage minimum of 100 GB.
  2. Ensure these mandatory packages are available:
    • glibc-devel
    • expect
    • unzip
    • libaio
    • oraclelinux-developer-release-el7

    Note:

    For higher versions, such as Oracle Linux 8, the packages libnsl and ncurses-compat-libs are also required.
  3. Run the following command:
    [root@zdmhost ~]# yum install glibc-devel expect unzip libaio oraclelinux-developer-release-el7 -y
  4. Create a group called zdm, and a user called zdmuser that is added to the group, by running the commands:
    [root@zdmhost ~]# groupadd zdm
    [root@zdmhost ~]# useradd zdmuser -g zdm
    [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/
  5. Update the required environment variable for zdmuser to install ZDM on ZDM service host, by running the commands:
    echo "ORACLE_HOME=/home/zdmuser/zdmhome; export ORACLE_HOME" >> ~/.bashrc
    echo "ORACLE_BASE=/home/zdmuser/zdmbase; export ORACLE_BASE" >> ~/.bashrc
    echo "ZDM_BASE=\$ORACLE_BASE; export ZDM_BASE" >> ~/.bashrc
    echo "ZDM_HOME=/home/zdmuser/zdmhome; export ZDM_HOME" >> ~/.bashrc
    echo "ZDM_INSTALL_LOC=/home/zdmuser/zdminstall; export ZDM_INSTALL_LOC" >> ~/.bashrc

Install Additional Tools on the ZDM Host

  1. Install OCI Command Line Interface (OCI CLI) on the ZDM service host as root:
    [root@zdmhost ~]# yum install python36-oci-cli
  2. Install Oracle Database SQL client on the ZDM host to establish connectivity to the source and target databases.
  3. Ensure you have downloaded the RPM packages of Oracle Instant Client (see Download Software Packages section):
    • Basic Package (RPM)
    • SQL*Plus Package (RPM)
    • Tools Package (RPM)
  4. Install the RPM packages as a root user, in the order of Basic, SQL*Plus, then Tools, by running the commands:
    [root@zdmhost software]# yum install -y oracle-instantclient19.20-basic-19.20.0.0.0-1.x86_64.rpm
    [root@zdmhost software]# yum install -y oracle-instantclient19.20-sqlplus-19.20.0.0.0-1.x86_64.rpm
    [root@zdmhost software]# yum install -y oracle-instantclient19.20-tools-19.20.0.0.0-1.x86_64.rpm
  5. Update the environment variables for the zdmuser for TNS_ADMIN and PATH by running the commands:
    TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
    PATH=/usr/lib/oracle/19.20/client64/bin:$PATH; export PATH

Install Zero Downtime Migration on Host

Install Zero Downtime Migration once the host is ready.

  1. Ensure the binary was downloaded earlier from the Download Software Packages section, and transfer it to the Zero Downtime Migration service host.
  2. Unzip the package zdmuser on the host, by running the commands:
    • [zdmuser@zdmhost ~]$ cd $ZDM_INSTALL_LOC
    • [zdmuser@zdmhost zdminstall]$ unzip /tmp/V1037236-01.zip
    • [zdmuser@zdmhost zdminstall]$ ls -rlt
  3. Install Zero Downtime Migration as zdmuser on the host, by running the command: [zdmuser@zdmhost zdm21.4.1]$ ./zdminstall.sh setup oraclehome=$ZDM_HOME oraclebase=$ZDM_BASE ziploc=./zdm_home.zip -zdm
  4. Start the Zero Downtime Migration service on the host by running the command: [zdmuser@zdmhost ~]$ $ZDM_HOME/bin/zdmservice start
  5. Check the status by running the commands:
    • [zdmuser@zdmhost ~]$ $ZDM_HOME/bin/zdmcli -build
    • [zdmuser@zdmhost ~]$ $ZDM_HOME/bin/zdmservice status
    Running should equal true if Zero Downtime Migration is running.

Configure Zero Downtime Migration

  1. Configure the /etc/hosts file at the Zero Downtime Migration service host to ensure connectivity between Zero Downtime Migration service host and the source database by adding the source database information as a root user.
    [root@zdmhost ~]# cat /etc/hosts
    127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
    ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
    10.0.1.179 hr9246.appsubnet.exadatainfrastr.oraclevcn.com hr9246
    10.0.1.78 zdmhost.appsubnet.exadatainfrastr.oraclevcn.com zdmhost
    [root@zdmhost ~]#
  2. Configure SSH connectivity from the Zero Downtime Migration host to the source database based on SSH keys without a passphrase as the zdmuser.
    1. As the zdmuser, generate the SSH key by running the commands:
      • [zdmuser@zdmhost~]$ ssh-keygen -t rsa
      • [zdmuser@zdmhost~]$ cd ~/.ssh
      • [zdmuser@zdmhost~]$ cat id_rsa.pub>>authorized keys
      • [zdmuser@zdmhost~]$ chmod 600 authorized keys
    2. Update the authorized keys file by adding the contents of the /home/zdmuser/.ssh/id_rsa.pub file into the opc_user_home/.ssh/authorized_keys file on the source database server.
    3. Validate the SSH connectivity from the Zero Downtime Migration host to the PSFT host.

Configure API Access

  1. Generate a public key as the zdmuser by running the commands:
    [zdmuser@zdmhost ~]$ mkdir zdmhome/.oci
    [zdmuser@zdmhost ~]$ cd zdmhome/.oci
    [zdmuser@zdmhost .oci]$ openssl genrsa -out /home/zdmuser/zdmhome/.oci/oci_api_key.pem 2048
    [zdmuser@zdmhost .oci]$ openssl rsa -pubout -in /home/zdmuser/zdmhome/.oci/oci_api_key.pem -out /home/zdmuser/zdmhome/.oci/oci_api_key_public.pem
  2. Add the API key to the OCI Console.
    1. In the Oracle Cloud dashboard, click the profile icon, then click your account (email).
    2. Click API keys.
    3. Click Add API key.
    4. Select Paste a public key.
    5. In the Public key field, enter oci_api_key_public.pem
    6. Click Add.
  3. Copy the content of the configuration file for the corresponding API key.
  4. As the zdmuser, create a configuration file and update the key_file path with a private key file path.
  5. Generate an OCI Auth Token.
    Token-based authentication for the CLI enables you to create a temporary session token to authenticate a CLI command request.

Configure SSH

Configure SSH connectivity, generate an SSH key pair, and update the authorized keys file.

  1. In the Zero Downtime Migration host as the zdmuser, configure SSH connectivity to the source database host based on SSH keys without a passphrase.
  2. Generate an SSH key as the zdmuser.
    [zdmuser@zdmhost ~]$ ssh-keygen -t rsa
    [zdmuser@zdmhost ~]$ cd ~/.ssh
    [zdmuser@zdmhost .ssh]$ cat id_rsa.pub >> authorized_keys
    [zdmuser@zdmhost .ssh]$ chmod 600 authorized_keys
  3. Add the contents of the /home/zdmuser/.ssh/id_rsa.pub file into the opc_user_home/.ssh/authorized_keys file on the source database server.