O objetivo deste post é demonstrar o passo a passo para a instalação e configuração do software Oracle Zero Downtime Migration (ZDM), assim como do OCI Command Line (OCI Cli). Este exemplo usa uma máquina com Oracle Linux 7.9 com instalação “minimal” sendo a máquina “ZDM Host”. Abaixo a etapas que iremos cobrir neste post:
- Download
- Pré requisitos
- Instalação
- Criando API Key para o OCI Cli
- OCI Command Line (OCI Cli)
- Criando chave SSH para o ZDM
- [OPCIONAL] Gerando Auth Token
1) Download
O ZDM é um software gratuito e pode ser baixado direto do site OTN, sendo necessário possuir uma conta Oracle para realizar o download.
Faça o download da última versão do ZDM aqui.

Copie o arquivo .zip para o servidor Linux que será o “ZDM Host”.
No caso da versão sendo utilizada neste post é 21c (21.2), o arquivo baixo é zdm21.2.zip.
2) Pré requisitos
As etapas de pré requisitos devem ser executadas com usuário root ou com algum usuário que tenha permissão “sudo”.
2.1) Instale os pacotes necessários:
sudo yum -y install \
glibc-devel \
expect \
unzip \
libaio \
kernel-uek-devel-$(uname -r) \
perl \
python36
2.2) Crie um grupo e usuário para o ZDM (definir a senha para esse usuário é opcional):
sudo groupadd zdm
sudo useradd -g zdm zdmuser
passwd zdmuser
2.3) Crie o diretório para instalação do ZDM, neste exemplo, estamos usando a partição /u01:
mkdir -p /u01
chown -R zdmuser.zdm /u01
3) Instalação
3.1) alterne para o usuário “zdmuser”:
su - zdmuser
3.2) Defina as variáveis de ambiente para o ZDM. Neste exemplo, estamos instalando o ZDM versão 21c:
echo "INVENTORY_LOCATION=/u01/app/oraInventory; export INVENTORY_LOCATION" >> ~/.bashrc
echo "ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE" >> ~/.bashrc
echo "ZDM_BASE=\$ORACLE_BASE; export ZDM_BASE" >> ~/.bashrc
echo "ZDM_HOME=\$ZDM_BASE/zdm21; export ZDM_HOME" >> ~/.bashrc
echo "ZDM_INSTALL_LOC=/u01/zdm21-inst; export ZDM_INSTALL_LOC" >> ~/.bashrc
echo "export PATH=\$ZDM_HOME/bin:\$PATH" >> ~/.bashrc
3.3) Carregue as variáveis de ambiente:
source ~/.bashrc
3.4) Crie os diretórios referente a cada variável de ambiente:
mkdir -p $ORACLE_BASE $ZDM_BASE $ZDM_HOME $ZDM_INSTALL_LOC
3.5) Descompacte o instalador do ZDM:
unzip -j /home/zdmuser/zdm21.2.zip -d $ZDM_INSTALL_LOC
Exemplo:
[zdmuser@zdmhost ~]$ unzip -j /home/zdmuser/zdm21.2.zip -d $ZDM_INSTALL_LOC
Archive: /home/zdmuser/zdm21.2.zip
inflating: /u01/zdm21-inst/README
inflating: /u01/zdm21-inst/zdminstall.sh
inflating: /u01/zdm21-inst/CredentialsDriver.class
extracting: /u01/zdm21-inst/zdm_home.zip
extracting: /u01/zdm21-inst/zdm.build
inflating: /u01/zdm21-inst/schema_operations.sh
3.6) Acesse o diretório ZDM_INSTALL_LOC e inicie a instalação:
cd $ZDM_INSTALL_LOC
./zdminstall.sh setup oraclehome=$ZDM_HOME oraclebase=$ZDM_BASE ziploc=./zdm_home.zip -zdm
Exemplo:
[zdmuser@zdmhost ~]$ cd $ZDM_INSTALL_LOC
[zdmuser@zdmhost zdm21-inst]$ ./zdminstall.sh setup oraclehome=$ZDM_HOME oraclebase=$ZDM_BASE ziploc=./zdm_home.zip -zdm
ZDM kit home: /u01/zdm21-inst
/u01/zdm21-inst
---------------------------------------
Unzipping shiphome to ZDM home...
---------------------------------------
Unzipping shiphome...
Shiphome unzipped successfully..
---------------------------------------
##### Performing GridHome Software Only Installation #####
---------------------------------------
Installation log location: /u01/app/oracle/crsdata/zdmhost/rhp/logs/runInstaller_1637970155.out
making dir /u01/app/oracle/crsdata/zdmhost/rhp/conf
---------------------------------------
Generating Preference file
---------------------------------------
/u01/app/oracle/crsdata/zdmhost/rhp/conf/rhp.pref
Using port 8897 for MySQL
---------------------------------------
Generating Root Certificate
---------------------------------------
Cluster root certificate generated successfully.
---------------------------------------
Generating CA CERTS file
---------------------------------------
spawn /u01/app/oracle/zdm21/bin/crskeytoolctl -copycacerts -filestore /u01/app/oracle/crsdata/zdmhost/security
Enter JRE cacerts truststore password:
JRE cacerts copied to file [/u01/app/oracle/crsdata/zdmhost/security/cacerts].
---------------------------------------
Generating nogi.enabled file
---------------------------------------
nogi.enabled file generated sucessfully
---------------------------------------
Generating standalone_config.properties file
---------------------------------------
Setting base folder permissions
---------------------------------------
Copying service script to bin folder in Oracle Home
---------------------------------------
Storing to wallet
---------------------------------------
cacerts crskeytoolctl.log cwallet.sso cwallet.sso.lck
---------------------------------------
Generating random password
---------------------------------------
-rw-------. 1 zdmuser zdm 4325 Nov 26 20:42 /u01/app/oracle/crsdata/zdmhost/security/cwallet.sso
-rw-------. 1 zdmuser zdm 4325 Nov 26 20:42 /u01/app/oracle/crsdata/zdmhost/security/cwallet.sso
RHP_PT.ZDM21_LINUX.X64_210812.1
rhpctl working
label_date is: 210812.1
---------------------------------------
Setting up MySQL...
---------------------------------------
spawn /u01/app/oracle/zdm21/mysql/server/bin/mysqladmin --defaults-file=/u01/app/oracle/crsdata/zdmhost/rhp/conf/my.cnf -u root -p ping
---------------------------------------
Storing to wallet
---------------------------------------
cacerts crskeytoolctl.log cwallet.sso cwallet.sso.lck
---------------------------------------
Generating random password
---------------------------------------
-rw-------. 1 zdmuser zdm 4437 Nov 26 20:42 /u01/app/oracle/crsdata/zdmhost/security/cwallet.sso
-rw-------. 1 zdmuser zdm 4437 Nov 26 20:42 /u01/app/oracle/crsdata/zdmhost/security/cwallet.sso
spawn /u01/app/oracle/zdm21/mysql/server/bin/mysql --socket=/u01/app/oracle/crsdata/zdmhost/rhp/mysql/metadata/mysql.sock -u root
---------------------------------------
Creating MySQL DB and user...
---------------------------------------
spawn /u01/app/oracle/zdm21/mysql/server/bin/mysql --socket=/u01/app/oracle/crsdata/zdmhost/rhp/mysql/metadata/mysql.sock -u root -p -e CREATE DATABASE IF NOT EXISTS GHSUSER21;
spawn /u01/app/oracle/zdm21/mysql/server/bin/mysql --socket=/u01/app/oracle/crsdata/zdmhost/rhp/mysql/metadata/mysql.sock -u root -p
spawn /u01/app/oracle/zdm21/mysql/server/bin/mysql --socket=/u01/app/oracle/crsdata/zdmhost/rhp/mysql/metadata/mysql.sock -u root -p -e GRANT ALTER, CREATE, CREATE TEMPORARY TABLES, CREATE VIEW, DELETE, DROP, INDEX, INSERT, LOCK TABLES, REFERENCES, SELECT, SHOW VIEW, UPDATE ON GHSUSER21.* TO 'GHSUSER21'@'localhost';
current node is active node
spawn /u01/app/oracle/zdm21/mysql/server/bin/mysqladmin --defaults-file=/u01/app/oracle/crsdata/zdmhost/rhp/conf/my.cnf -u root -p shutdown
---------------------------------------
Adding Certs to ZDM
---------------------------------------
ZDM service setup finished successfully...
[zdmuser@zdmhost zdm21-inst]$
3.7) Inicie o serviço do ZDM:
zdmservice start
Exemplo:
[zdmuser@zdmhost zdm21-inst]$ zdmservice start
No instance detected, starting zdmservice
spawn /u01/app/oracle/zdm21/mysql/server/bin/mysqladmin --defaults-file=/u01/app/oracle/crsdata/zdmhost/rhp/conf/my.cnf -u root -p ping
WARNING: oracle.jwc.jmx does not exist in the configuration file. It will be TRUE by default.
[jwcctl debug] Environment ready to start JWC
[jwcctl debug] Return code of initialization: [0]
[jwcctl debug] ... BEGIN_DEBUG [Action= start] ...
Start JWC
[jwcctl debug] Loading configuration file: /u01/app/oracle/crsdata/zdmhost/rhp/conf/jwc.properties
[jwcctl debug] oracle.jmx.login.credstore = CRSCRED
[jwcctl debug] oracle.jmx.login.args = DOMAIN=rhp CACHE_ENABLED=true CACHE_EXPIRATION=180
[jwcctl debug] oracle.rmi.url = service:jmx:rmi://{0}:{1,number,#}/jndi/rmi://{0}:{1,number,#}/jmxrmi
[jwcctl debug] oracle.http.url = http://{0}:{1,number,#}/rhp/gridhome
[jwcctl debug] oracle.jwc.tls.clientauth = false
[jwcctl debug] oracle.jwc.tls.rmi.clientfactory = RELOADABLE
[jwcctl debug] oracle.jwc.lifecycle.start.log.fileName = JWCStartEvent.log
[jwcctl debug] oracle.jwc.http.connector.ssl.protocols = TLSv1.2,TLSv1.3
[jwcctl debug] Get JWC PIDs
[jwcctl debug] Done Getting JWC PIDs
[jwcctl debug] ... JWC containers not found ...
[jwcctl debug] Start command:-server -Xms2048M -Xmx4096M -Djava.awt.headless=true -Ddisable.checkForUpdate=true -Djava.util.logging.config.file=/u01/app/oracle/crsdata/zdmhost/rhp/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -DTRACING.ENABLED=true -DTRACING.LEVEL=2 -Doracle.wlm.dbwlmlogger.logging.level=FINEST -Duse_scan_IP=true -Djava.rmi.server.hostname=localhost -Doracle.http.port=8896 -Doracle.jmx.port=8895 -Doracle.tls.enabled=false -Doracle.jwc.tls.http.enabled=false -Doracle.rhp.storagebase=/u01/app/oracle -Djava.security.manager -Djava.security.policy=/u01/app/oracle/crsdata/zdmhost/rhp/conf/catalina.policy -Djava.security.egd=file:/dev/urandom -Doracle.jwc.wallet.path=/u01/app/oracle/crsdata/zdmhost/security -Doracle.jmx.login.credstore=WALLET -Doracle.rest.enabled=false -Doracle.jmx.enabled=true -Dcatalina.home=/u01/app/oracle/zdm21/tomcat -Dcatalina.base=/u01/app/oracle/crsdata/zdmhost/rhp -Djava.io.tmpdir=/u01/app/oracle/crsdata/zdmhost/rhp/temp -Doracle.home=/u01/app/oracle/zdm21 -Doracle.jwc.mode=STANDALONE -classpath /u01/app/oracle/zdm21/jlib/cryptoj.jar:/u01/app/oracle/zdm21/jlib/oraclepki.jar:/u01/app/oracle/zdm21/jlib/osdt_core.jar:/u01/app/oracle/zdm21/jlib/osdt_cert.jar:/u01/app/oracle/zdm21/tomcat/lib/tomcat-juli.jar:/u01/app/oracle/zdm21/tomcat/lib/bootstrap.jar:/u01/app/oracle/zdm21/jlib/jwc-logging.jar org.apache.catalina.startup.Bootstrap start
[jwcctl debug] Get JWC PIDs
[jwcctl debug] Done Getting JWC PIDs
[jwcctl debug] ... JWC Container (pid=24048) ...
[jwcctl debug] ... JWC Container running (pid=24048) ...
[jwcctl debug] Check command:-Djava.net.preferIPv6Addresses=true -Dcatalina.base=/u01/app/oracle/crsdata/zdmhost/rhp -Doracle.wlm.dbwlmlogger.logging.level=FINEST -Doracle.jwc.client.logger.file.name=/u01/app/oracle/crsdata/zdmhost/rhp/logs/jwc_checker_stdout_err_%g.log -Doracle.jwc.client.logger.file.number=10 -Doracle.jwc.client.logger.file.size=1048576 -Doracle.jwc.wallet.path=/u01/app/oracle/crsdata/zdmhost/security -Doracle.jmx.login.credstore=WALLET -Doracle.tls.enabled=false -Doracle.jwc.tls.http.enabled=false -classpath /u01/app/oracle/zdm21/jlib/jwc-logging.jar:/u01/app/oracle/zdm21/jlib/jwc-security.jar:/u01/app/oracle/zdm21/jlib/jwc-client.jar:/u01/app/oracle/zdm21/jlib/jwc-cred.jar:/u01/app/oracle/zdm21/jlib/srvm.jar:/u01/app/oracle/zdm21/jlib/srvmhas.jar:/u01/app/oracle/zdm21/jlib/cryptoj.jar:/u01/app/oracle/zdm21/jlib/oraclepki.jar:/u01/app/oracle/zdm21/jlib/osdt_core.jar:/u01/app/oracle/zdm21/jlib/osdt_cert.jar:/u01/app/oracle/zdm21/tomcat/lib/tomcat-juli.jar oracle.cluster.jwc.tomcat.client.JWCChecker localhost 8896 -1
[jwcctl debug] ... JWC Container is ready ...
[jwcctl debug] ... START - Return code = 0 ...
[jwcctl debug] ... END_DEBUG [Action=start] ...
[jwcctl debug] Return code of AGENT: [0]
Return code is 0
Server started successfully.
3.8) Consulte o status do serviço:
zdmservice status
Exemplo:
[zdmuser@zdmhost zdm21-inst]$ zdmservice status
---------------------------------------
Service Status
---------------------------------------
Running: true
Tranferport:
Conn String: jdbc:mysql://localhost:8897/
RMI port: 8895
HTTP port: 8896
Wallet path: /u01/app/oracle/crsdata/zdmhost/security
3.9) Valide a instalação consultando a versão do ZDM:
[zdmuser@zdmhost ~]$ zdmcli -build
version: 21.0.0.0.0
full version: 21.1.0.0.0
label date: 210812.1
ZDM kit build date: Aug 24 2021 17:37:18 PDT
CPAT build version: 22.2.0
4) Criando API Key para o OCI Cli
Uma API Key é requerida para configuração OCI Command Line (próxima etapa). Siga os passos abaixo para criar uma API Key, gerando um novo par de chaves PEM.
4.1) Acesse a página do seu usuário OCI:

4.2) Siga esses passos:
- Clique em “API Keys”
- Clique em “Add API key”
- Selecione “Generate API Key Par”
- Baixa a chave chave privada (oci_private.pem)
- Baixa a chave pública (oci_public.pem)
- Clique em “Add”

4.3) Na tela seguinte é exibido um exemplo de configuração do arquivo “~/.oci/config”, você pode copiar ele agora ou posteriormente. Iremos usar esse conteúdo posteriormente na configuração do OCI Cli.

Caso precise copiar o conteúdo posteriormente:

Copie as chaves para o servidor do ZDM (arquivos oci_private.pem e oci_public.pem)
5) OCI Command Line (OCI Cli)
5.1) Download e instalação automática:
bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
Aceite o padrão para todas as configurações solicitadas (ENTER, ENTER, ENTER). Exemplo:
[zdmuser@zdmhost zdm21-inst]$ bash -c "$(curl -L https://raw.githubusercontent.com/oracle/oci-cli/master/scripts/install/install.sh)"
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 17112 100 17112 0 0 26270 0 --:--:-- --:--:-- --:--:-- 26245
******************************************************************************
You have started the OCI CLI Installer in interactive mode. If you do not wish
to run this in interactive mode, please include the --accept-all-defaults option.
If you have the script locally and would like to know more about
input options for this script, then you can run:
./install.sh -h
If you would like to know more about input options for this script, refer to:
https://github.com/oracle/oci-cli/blob/master/scripts/install/README.rst
******************************************************************************
Downloading Oracle Cloud Infrastructure CLI install script from https://raw.githubusercontent.com/oracle/oci-cli/v3.2.1/scripts/install/install.py to /tmp/oci_cli_install_tmp_HreF.
######################################################################## 100.0%
Running install script.
python3 /tmp/oci_cli_install_tmp_HreF
-- Verifying Python version.
-- Python version 3.6.8 okay.
===> In what directory would you like to place the install? (leave blank to use '/home/zdmuser/lib/oracle-cli'):
-- Creating directory '/home/zdmuser/lib/oracle-cli'.
-- We will install at '/home/zdmuser/lib/oracle-cli'.
===> In what directory would you like to place the 'oci' executable? (leave blank to use '/home/zdmuser/bin'):
-- Creating directory '/home/zdmuser/bin'.
-- The executable will be in '/home/zdmuser/bin'.
===> In what directory would you like to place the OCI scripts? (leave blank to use '/home/zdmuser/bin/oci-cli-scripts'):
-- Creating directory '/home/zdmuser/bin/oci-cli-scripts'.
-- The scripts will be in '/home/zdmuser/bin/oci-cli-scripts'.
===> Currently supported optional packages are: ['db (will install cx_Oracle)']
What optional CLI packages would you like to be installed (comma separated names; press enter if you don't need any optional packages)?:
-- The optional packages installed will be ''.
-- Trying to use python3 venv.
-- Executing: ['/bin/python3', '-m', 'venv', '/home/zdmuser/lib/oracle-cli']
-- Executing: ['/home/zdmuser/lib/oracle-cli/bin/pip', 'install', '--upgrade', 'pip']
Collecting pip
Downloading https://files.pythonhosted.org/packages/a4/6d/6463d49a933f547439d6b5b98b46af8742cc03ae83543e4d7688c2420f8b/pip-21.3.1-py3-none-any.whl (1.7MB)
100% |████████████████████████████████| 1.7MB 880kB/s
Installing collected packages: pip
Found existing installation: pip 9.0.3
Uninstalling pip-9.0.3:
Successfully uninstalled pip-9.0.3
Successfully installed pip-21.3.1
-- Executing: ['/home/zdmuser/lib/oracle-cli/bin/pip', 'install', '--cache-dir', '/tmp/tmpsem4n76r', 'wheel', '--upgrade']
Collecting wheel
Downloading wheel-0.37.0-py2.py3-none-any.whl (35 kB)
Installing collected packages: wheel
Successfully installed wheel-0.37.0
-- Executing: ['/home/zdmuser/lib/oracle-cli/bin/pip', 'install', '--cache-dir', '/tmp/tmpsem4n76r', 'oci_cli', '--upgrade']
Collecting oci_cli
Downloading oci_cli-3.3.1-py3-none-any.whl (23.2 MB)
|████████████████████████████████| 23.2 MB 240 kB/s
Collecting oci==2.51.0
Downloading oci-2.51.0-py2.py3-none-any.whl (11.7 MB)
|████████████████████████████████| 11.7 MB 26.3 MB/s
Collecting python-dateutil<3.0.0,>=2.5.3
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
|████████████████████████████████| 247 kB 85.8 MB/s
Collecting six>=1.15.0
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting cryptography<=3.4.7,>=3.2.1
Downloading cryptography-3.4.7-cp36-abi3-manylinux2014_x86_64.whl (3.2 MB)
|████████████████████████████████| 3.2 MB 82.9 MB/s
Collecting arrow>=1.0.0
Downloading arrow-1.2.1-py3-none-any.whl (63 kB)
|████████████████████████████████| 63 kB 2.7 MB/s
Collecting pytz>=2016.10
Downloading pytz-2021.3-py2.py3-none-any.whl (503 kB)
|████████████████████████████████| 503 kB 84.5 MB/s
Collecting pyOpenSSL==19.1.0
Downloading pyOpenSSL-19.1.0-py2.py3-none-any.whl (53 kB)
|████████████████████████████████| 53 kB 2.9 MB/s
Collecting certifi
Downloading certifi-2021.10.8-py2.py3-none-any.whl (149 kB)
|████████████████████████████████| 149 kB 106.0 MB/s
Collecting jmespath==0.10.0
Downloading jmespath-0.10.0-py2.py3-none-any.whl (24 kB)
Collecting PyYAML<6,>=5.4
Downloading PyYAML-5.4.1-cp36-cp36m-manylinux1_x86_64.whl (640 kB)
|████████████████████████████████| 640 kB 89.3 MB/s
Collecting click==7.1.2
Downloading click-7.1.2-py2.py3-none-any.whl (82 kB)
|████████████████████████████████| 82 kB 1.4 MB/s
Collecting terminaltables==3.1.0
Downloading terminaltables-3.1.0.tar.gz (12 kB)
Preparing metadata (setup.py) ... done
Collecting circuitbreaker<2.0.0,>=1.3.1
Downloading circuitbreaker-1.3.2.tar.gz (7.9 kB)
Preparing metadata (setup.py) ... done
Collecting typing-extensions
Downloading typing_extensions-4.0.0-py3-none-any.whl (22 kB)
Collecting cffi>=1.12
Downloading cffi-1.15.0-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (405 kB)
|████████████████████████████████| 405 kB 109.9 MB/s
Collecting pycparser
Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
|████████████████████████████████| 118 kB 112.5 MB/s
Building wheels for collected packages: terminaltables, circuitbreaker
Building wheel for terminaltables (setup.py) ... done
Created wheel for terminaltables: filename=terminaltables-3.1.0-py3-none-any.whl size=15354 sha256=26f98ff9c67ffdb47d25d96c81918cf3fb7a862ae52f06d2510d4e191c6e928f
Stored in directory: /tmp/tmpsem4n76r/wheels/86/1b/58/c23af2fe683acd8edc15d5a1268f0242be1ff2cf827fe34737
Building wheel for circuitbreaker (setup.py) ... done
Created wheel for circuitbreaker: filename=circuitbreaker-1.3.2-py3-none-any.whl size=6017 sha256=7df898cfbb212110d6756383010edb4b779bf7fc1e14b2e85cfab10da46e95b7
Stored in directory: /tmp/tmpsem4n76r/wheels/2b/54/c2/70629ee4335118768dceec192e138df3636ecf02973fa2c1f0
Successfully built terminaltables circuitbreaker
Installing collected packages: pycparser, cffi, six, cryptography, typing-extensions, pytz, python-dateutil, pyOpenSSL, circuitbreaker, certifi, terminaltables, PyYAML, oci, jmespath, click, arrow, oci-cli
Successfully installed PyYAML-5.4.1 arrow-1.2.1 certifi-2021.10.8 cffi-1.15.0 circuitbreaker-1.3.2 click-7.1.2 cryptography-3.4.7 jmespath-0.10.0 oci-2.51.0 oci-cli-3.3.1 pyOpenSSL-19.1.0 pycparser-2.21 python-dateutil-2.8.2 pytz-2021.3 six-1.16.0 terminaltables-3.1.0 typing-extensions-4.0.0
===> Modify profile to update your $PATH and enable shell/tab completion now? (Y/n): y
===> Enter a path to an rc file to update (file will be created if it does not exist) (leave blank to use '/home/zdmuser/.bashrc'):
-- Backed up '/home/zdmuser/.bashrc' to '/home/zdmuser/.bashrc.backup'
-- Tab completion set up complete.
-- If tab completion is not activated, verify that '/home/zdmuser/.bashrc' is sourced by your shell.
--
-- ** Run `exec -l $SHELL` to restart your shell. **
--
-- Installation successful.
-- Run the CLI with /home/zdmuser/bin/oci --help
Configuração
Crie um arquivo de texto no servidor como “/home/zdmuser/.oci/config” e cole o conteúdo exibido em “Configuration File Preview” na etapa anterior. Na última linha, altere para o caminho no qual será colocado a chave privada.
5.2) Crie o diretório de configuração do OCI Cli:
mkdir -p ~/.oci
5.3) Crie o arquivo “config” com vi, cole a configuração gerada na console OCI e salve o arquivo:
vi ~/.oci/config
Exemplo de como deve ficar o arquivo final:
[zdmuser@zdmhost ~]$ cat ~/.oci/config
[DEFAULT]
user=ocid1.user.oc1..aaaaaaaaksxxxxxxxxxxxxxxxxxxxxxxxxxxxx
fingerprint=cb:51:19:73:16:98:42:f3:47:c3:42:7a:45:bd:2f:ab
tenancy=ocid1.tenancy.oc1..aaaaaaaa6eds6hllkxxxxxxxxxxxxxxxxxxxxx
region=sa-saopaulo-1
key_file=/home/zdmuser/.oci/oci_private.pem
5.4) Copie a chave privada para o diretório “~/.oci” :
cp oci_private.pem ~/.oci/oci_private.pem
5.5) Ajuste as permissões do arquivo de configuração e da chave privada:
chmod 600 ~/.oci/config
chmod 600 ~/.oci/oci_private.pem
5.6) Testando a configuração do OCI Cli:
oci os ns get
Caso retorne um JSON, significa que a configuração está correta e o OCI Cli está acessando o seu Tenancy.
[zdmuser@zdmhost ~]$ oci os ns get
{
"data": "abcdefghij"
}
6) Criando chave SSH para o ZDM
6.1) Crie um par de chaves sem senha com ssh-keygen:
ssh-keygen -t rsa -P ""
Exemplo:
[zdmuser@zdmhost ~]$ ssh-keygen -t rsa -P ""
Generating public/private rsa key pair.
Enter file in which to save the key (/home/zdmuser/.ssh/id_rsa):
Created directory '/home/zdmuser/.ssh'.
Your identification has been saved in /home/zdmuser/.ssh/id_rsa.
Your public key has been saved in /home/zdmuser/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:NKRv5cvQJBb0qqBWpoC4G9qa2aEOjMCtUXURtANsqiU zdmuser@zdmhost
The key's randomart image is:
+---[RSA 2048]----+
| .o.** |
| .ooo.o |
| .o .o= + |
|+Eoo +.O |
|=o+.+ S o |
|++o= . o o . |
|=o= . o |
|oX . |
|Ooo |
+----[SHA256]-----+
6.2) Crie uma cópia da chave privada como “<hostname>.ppk”, um padrão requerido pelo ZDM:
cp ~/.ssh/id_rsa ~/.ssh/$(hostname).ppk
6.3) Crie o arquivo “authorized_keys” adicionando a chave pública que acabou de gerar:
cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys
6.4) Altere a permissão do arquivo:
chmod 600 ~/.ssh/authorized_keys
6.5) O diretório ~/.ssh deve ficar dessa forma:
[zdmuser@zdmhost ~]$ ls -l ~/.ssh
total 16
-rw-------. 1 zdmuser zdm 397 Nov 26 23:03 authorized_keys
-rw-------. 1 zdmuser zdm 1679 Nov 26 23:01 id_rsa
-rw-r--r--. 1 zdmuser zdm 397 Nov 26 23:01 id_rsa.pub
-rw-------. 1 zdmuser zdm 1679 Nov 26 23:02 zdmhost.ppk
7) [OPCIONAL] Gerando Auth Token
Esse token será usado como uma “senha” do seu usuário da OCI pelo ZDM a cada operação de migração que envolva Object Storage.
7.1) Acesse a página do seu usuário novamente:

7.2) Na página do usuário, siga esses passos:
- Clique em “Auth Tokens”
- Clique em “Generate Token”
- Informe uma descrição que ajude a identificar o uso desse Token
- Clique em “Generate Token”
- Copie o Token gerado e salve em um local seguro
- Clique em close

IMPORTANTE: Você precisa copiar o token antes de clicar em “Close”, não é possível consultar o token depois de fechar esta janela.

Pingback: Oracle Zero Downtime Migration (ZDM) vs Database Migration Service (DMS) – GGBR