Install Attunity Replicate on Linux

Recently I have done a lot of work on Attunity products, especially Attunity Replicate. Similar to Oracle GoldenGate, Attunity Replicate is a data replication tool. I used Oracle GoldenGate for many years and pretty familiar with the architecture and configuration of Oracle GoldenGate. Oracle GoldenGate is literally the gold standard for data replication and used by many enterprises worldwide. There are also many data replication tools out there in the market. But whether they can really complete with Oracle GoldenGate is questionable. So when I first learned about Attunity product, my first reaction was “what is that”? Can it compete with Oracle GoldenGate? After several months’ intensive feature testing and benchmarking, I am quite impressive with Attunity Replicate product and feel this is a good product I can recommend in my blog. I am going to write a few blogs about how to install, and configure Attunity Replicate product. This blog is the first one of the series.

Attunity Replicate is the flagship product from Attunity, which started in 1988 and changed the name to Attunity in 2000. The company mainly focuses on providing the products for data replication, change data capture (CDC), and data connectivity. The Attunity Replicate supports a broad range of source and targets. The environment the product supports including:
RDBMS: Oracle, SQL, DB2, MySQL, Sybase, PostgreSQL
Data warehouses: Exadata, Teradata, IBM Netezza, Vertica, Pivotal, SQL Data Warehouse
Hadoop: Hortonworks, Cloudera, MapR
Cloud: AWS, Azure, Google Cloud
Streaming platforms: Apache Kafka and Confluent Platform
Applications: e.g., SAP
Legacy: IMS/DB, DB2 z/OS, RMS, VSAM

For data replication and CDC tools, my first question is always whether the product is mature enough to support real production load. After some discussions and research, I was surprised to know that Attunity Replicate product is actually the foundation component in the Microsoft’s database migration tools and I will discuss this piece in the future blogs. From what I noticed is that there is a lot of demands to use Attunity Replicate to do the CDC type work from relational databases (like Oracle, DB2 and MySQL) to Kafka. I am going to discuss the configuration of this topic in the next blog. Ok, let me go back to the topic of installation steps for Attunity Replicate.

Installation Environment
I use a VM with CentOS Linux 7.5, 4 CPU, 16GB memory. Copy all of the software binary to a stage area on the Attunity Replicate Server. For this blog, I use /tmp for quick configuration without worrying about creating additional data disk. The Attunity software will be installed at /opt/attunity directory.

Software Required
Here are the software required:

  • Attunity Replicate Software

areplicate-6.3.0-351.x86_64.rpm.
Unfortunately I don’t believe there is an URL that open to public without Attunity Sales people. You have to make the request and they will provide the download URL and trial license file.

  • Database Connection Tools

For Oracle database, I use Oracle Instant Client. For other databases, you have to download the required ODBC tools. If you plan to use Oracle database as the CDC source, here are some of the files you need.
instantclient-basic-linux.x64-12.2.0.1.0.zip
instantclient-sqlplus-linux.x64-12.2.0.1.0.zip

Create Attunity Users/Groups
If not using AD user and group, then need to create a local group and user.

[root@cdc-att-vm1 ~]# groupadd attunity
[root@cdc-att-vm1 ~]# useradd -m -s /bin/bash -g attunity attunity -p attunity123
[root@cdc-att-vm1 ~]# id attunity
uid=1001(attunity) gid=1001(attunity) groups=1001(attunity)

Create Installation Directories

[root@cdc-att-vm1 ~]# mkdir /opt/attunity
[root@cdc-att-vm1 ~]# mkdir /opt/oracle

Install Oracle Client
Unzip oracle client’s zip files

[root@cdc-att-vm1 ~]# unzip /tmp/instantclient-basic-linux.x64-12.2.0.1.0.zip -d /opt/oracle
Archive:  /tmp/instantclient-basic-linux.x64-12.2.0.1.0.zip
  inflating: /opt/oracle/instantclient_12_2/adrci  
  inflating: /opt/oracle/instantclient_12_2/BASIC_README  
  inflating: /opt/oracle/instantclient_12_2/genezi  
  inflating: /opt/oracle/instantclient_12_2/libclntshcore.so.12.1  
  inflating: /opt/oracle/instantclient_12_2/libclntsh.so.12.1  
  inflating: /opt/oracle/instantclient_12_2/libipc1.so  
  inflating: /opt/oracle/instantclient_12_2/libmql1.so  
  inflating: /opt/oracle/instantclient_12_2/libnnz12.so  
  inflating: /opt/oracle/instantclient_12_2/libocci.so.12.1  
  inflating: /opt/oracle/instantclient_12_2/libociei.so  
  inflating: /opt/oracle/instantclient_12_2/libocijdbc12.so  
  inflating: /opt/oracle/instantclient_12_2/libons.so  
  inflating: /opt/oracle/instantclient_12_2/liboramysql12.so  
  inflating: /opt/oracle/instantclient_12_2/ojdbc8.jar  
  inflating: /opt/oracle/instantclient_12_2/uidrvci  
  inflating: /opt/oracle/instantclient_12_2/xstreams.jar  
[root@cdc-att-vm1 ~]# unzip /tmp/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip -d /opt/oracle
Archive:  /tmp/instantclient-sqlplus-linux.x64-12.2.0.1.0.zip
  inflating: /opt/oracle/instantclient_12_2/glogin.sql  
  inflating: /opt/oracle/instantclient_12_2/libsqlplusic.so  
  inflating: /opt/oracle/instantclient_12_2/libsqlplus.so  
  inflating: /opt/oracle/instantclient_12_2/sqlplus  
  inflating: /opt/oracle/instantclient_12_2/SQLPLUS_README 

Change the ownership to attunity user.

[root@cdc-att-vm1 ~]# chown -R attunity:attunity /opt/oracle
[root@cdc-att-vm1 ~]# ls -l /opt/oracle
total 4
drwxr-xr-x. 2 attunity attunity 4096 May 27 01:07 instantclient_12_2

Configure Oracle Client
After installing Oracle instant client, I need to create a tnsnames.ora file for the oracle client.

[root@cdc-att-vm1 instantclient_12_2]# mkdir -p /opt/oracle/instantclient_12_2/network/admin
[root@cdc-att-vm1 instantclient_12_2]# cd /opt/oracle/instantclient_12_2/network/admin
[root@cdc-att-vm1 admin]# vi tnsnames.ora
[root@cdc-att-vm1 admin]# cat tnsnames.ora
pdb1= 
(DESCRIPTION = 
  (ADDRESS = (PROTOCOL = TCP)(HOST = 10.21.2.12 )(PORT = 1521))
  (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = pdb1)
  )
)

Configure Attunity User Environment

[attunity@cdc-att-vm1 ~]$ vi .bash_profile
[attunity@cdc-att-vm1 ~]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# User specific environment and startup programs
export ORACLE_INSTANT_HOME=/opt/oracle/instantclient_12_2
export TNS_ADMIN=$ORACLE_INSTANT_HOME/network/admin
export ATTUNITY_HOME=/opt/attunity

export LD_LIBRARY_PATH=$ORACLE_INSTANT_HOME:$LD_LIBRARY_PATH
export PATH=$PATH:$ORACLE_INSTANT_HOME


PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH
[attunity@cdc-att-vm1 ~]$ . .bash_profile
[attunity@cdc-att-vm1 ~]$ sqlplus sys@pdb1 as sysdba
SQL> show con_id;
CON_ID
------------------------------
3

SQL> select name, open_mode from v$database;
NAME	  OPEN_MODE
--------- --------------------
MYDB1	  READ WRITE

SQL> exit

Install Attunity Replicate
Make sure to logon as root user and run the following command:

[root@cdc-att-vm1 tmp]# nocredentials=true verbose=true rpm -ivh --prefix /opt /tmp/areplicate-6.3.0-351.x86_64.rpm
Preparing...                          ################################# [100%]
pre install ...
new installation ...
nocredentials set to true - skipping check for user/group
user=attunity
group=attunity
Updating / installing...
   1:areplicate-6.3.0-351             ################################# [100%]
post install ...
creating /opt/attunity/replicate/bin/site_arep_login.sh
changing ownership of /opt/attunity/replicate to attunity:attunity
installing areplicate as a service ...
/opt/attunity/replicate/bin/arep.sh: running as root
/opt/attunity/replicate/bin/arep.sh: installation directory is /etc/init.d
/opt/attunity/replicate/bin/arep.sh: sourcing /opt/attunity/replicate/bin/arep_login.sh
/opt/attunity/replicate/bin/arep.sh: the Attunity Replicate root directory is to /opt/attunity/replicate
/opt/attunity/replicate/bin/arep.sh: sourcing /opt/attunity/replicate/bin/site_arep_login.sh
/opt/attunity/replicate/bin/arep.sh: created /etc/init.d/areplicate
/opt/attunity/replicate/bin/arep.sh: created symlink /opt/attunity/replicate/bin/areplicate and run level symlinks
/opt/attunity/replicate/bin/arep.sh: created empty instance specific settings file /opt/attunity/replicate/data/areplicate_arep_login.sh
/opt/attunity/replicate/bin/arep.sh: installed /etc/init.d/areplicate
/opt/attunity/replicate/bin/arep.sh: root directory = /opt/attunity/replicate
/opt/attunity/replicate/bin/arep.sh: internal port  = 3550
/opt/attunity/replicate/bin/arep.sh: rest port      = 3552
/opt/attunity/replicate/bin/arep.sh: data directory = /opt/attunity/replicate/data
/opt/attunity/replicate/bin/arep.sh: installed by   = root
starting service(s) ...
starting service areplicate ...

Check out the processes.

[root@cdc-att-vm1 tmp]# ps -ef|grep attunity
attunity  38431      1  0 01:40 ?        00:00:00 /opt/attunity/replicate/bin/repctl -d /opt/attunity/replicate/data service start port=3550 rest_port=3552
attunity  38432  38431  1 01:40 ?        00:00:01 /opt/attunity/replicate/bin/repctl -d /opt/attunity/replicate/data service start port=3550 rest_port=3552
root      38554   1214  0 01:42 pts/0    00:00:00 grep --color=auto attunity

Change root user Environment
Modify .bash_profile file for root user.

[root@cdc-att-vm1 ~]# vi .bash_profile
[root@cdc-att-vm1 ~]# cat .bash_profile 
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
	. ~/.bashrc
fi

# User specific environment and startup programs
export PATH=/opt/attunity/replicate/bin:/opt/oracle/instantclient_12_2:.:$PATH
export LD_LIBRARY_PATH=/opt/attunity/replicate/lib:/opt/oracle/instantclient_12_2:$LD_LIBRARY_PATH

PATH=$PATH:$HOME/bin

export PATH
[root@cdc-att-vm1 ~]# . .bash_profile
[root@cdc-att-vm1 ~]# areplicate status
running: /opt/attunity/replicate/bin/repctl -d /opt/attunity/replicate/data service start port=3550 rest_port=3552

Change Attunity admin User Password
Need to change the default password for admin user. Otherwise, you can not logon to the Attunity Replicate UI.

[root@cdc-att-vm1 ~]# repctl
Enter a command or quit
SETSERVERPASSWORD cdcatt
[SETSERVERPASSWORD command] Succeeded
Enter a command or quit
quit
[prompt command] Succeeded

After change the admin password, need to bounce the replicate server.

[root@cdc-att-vm1 ~]# areplicate stop
[root@cdc-att-vm1 ~]# areplicate start
[root@cdc-att-vm1 ~]# areplicate status
running: /opt/attunity/replicate/bin/repctl -d /opt/attunity/replicate/data service start port=3550 rest_port=3552

Access Attunity Replicate
The Attunity Replicate UI is located at http://:3552/attunityreplicate. After logon, you should see the following screen.


Ok, it’s done for the installation part. In the next blog, I am going to discuss how to configure source Oracle database and a Kafka target.