Using
Suggest editsAfter you have configured your EDB Postgres Distribution, as stated in the Configuring section, you will be able to then use Precisely CDC's Replication functionality. For the examples in this guide, the replication functionality is demonstrated using EDB Postgres Advanced Server.
- Configure Postgres Distribution as a Source Instance in Connect CDC Director
- Setup and configuration of EDB Postgres Advanced Server as a source instance for Connect CDC Director.
- Configure Postgres Distribution as a Target Instance in Connect CDC Director
- Setup and configuration of EDB Postgres Advanced Server as a target instance to Connect CDC Director.
- Create Distribution on Connect CDC Director
- Define how data will be replicated from source to target in a Model.
- Save the Model
- Save, validate and commit the Model created for Replication.
- Execute Copy Replication using Connect CDC MonCon
- Execute the Copy Replication to copy all the data from the Source Tables to the Target Tables.
- Create Replication Distribution using Connect CDC Director
- Replicate all the changes made on the Source Tables to the Target Tables.
- Execute Replication using Connect CDC MonCon
- Replication distribution will replicate all the changes done on the Source Tables to the Target Tables.
With Precisely Connect CDC you also have the ability to “Transform” your data as you replicate it from a source to target using Data Transformation. See the section on “Data Transformation” on how to enable this feature.
- Data Transformation
- Modify the source data you are distributing or even create or derive the data you distribute to the target system.
Configure Postgres Distribution as a Source Instance in Connect CDC Director
The following steps demonstrate the setup and configuration of EDB Postgres Advanced Server as a source instance for Connect CDC Director.
Open Connect CDC Director.
Click
New
option.Right click
Hosts, Servers, Tables
and selectNew Host
.Enter information for the
Host
,Host
is the machine where Connect CDC Director is running.
Right Click on the newly added
Host
and selectTest Connection
, a success message will be displayed.Right Click on the newly added
Host
and selectNew Server
.Enter Connection Information for EDB Postgres Advanced Server as
Source
Instance (Server name is where the database name is given).
Right Click on the newly added
Server
and selectInstall Source Metabase
.Provide EDB Postgres Advanced Server Source Instance User and Password on
User ID and Password
Screen.Provide password of
rpuser
(refer to the user name and password given onNew Server
Screen) when prompted on the User ID and Password screen.
Note
rpuser
is the replication user added by default by Precisely Connect CDC.
Click Ok on
Install Source Metabase
screen.A success message will be displayed once the
Source Metabase
is created on the EDB Postgres Advanced ServerSource
Instance.Open pgAdmin and connect to your EDB Postgres Advanced Server Source instance, navigate to Schemas and under the Schemas
rpuser
Schema has been created.
Navigate back to Connect CDC Director and right Click on the newly added Server and select
Test Connection
. A success message will be displayed.Right Click on the newly added
Server
and selectPrepare User Database
, this will add the replication user to the public database.On
Database/Schema name
Screen provide the schema name for the schema you wish to replicate. In our example we are using schemapublic
.On the
User ID and Password
Screen, provide EDB Postgres Advanced Server Source InstanceUser
andPassword
.Click Ok on
Prepare User Database
Screen.A success message will be displayed once the
Prepare User Database
operation is successful.Right Click on the newly added
Server
and selectRefresh Available Tables
.Click on the Refresh list and then select schema
public
and click ok.
- To display the available tables click newly added
Server
—>Tables
—>Available Tables
—>Public
(Schema name), a list of available tables will be displayed.
Configure Postgres Distribution as a Target Instance in Connect CDC Director
The following steps demonstrate the setup and configuration of EDB Postgres Advanced Server as a target instance to Connect CDC Director.
Right click
DBMS Servers
andNew Server
.Provide Connection Information for the EDB Postgres Advanced Server Target Instance.
Right Click on the newly added
Server
and selectInstall Target Only Metabase
.Provide EDB Postgres Advanced Server Target Instance User and Password on
User ID and Password
Screen.Provide password of
rpuser
(refer to the user name and password given onNew Server
Screen) when prompted on theUser ID and Password
screen.Click Ok on
Install Target Only Metabase
screen.A success message will be displayed once the
Target Only Metabase
is created.Open pgAdmin and connect to EDB Postgres Advanced Server
Target
Instance, and under Schemasrpuser
Schema is created.
Right Click on the newly added
Server
and selectPrepare User Database
, this will add the replication user to EDB Postgres Advanced Server Target Instance.On
Database/Schema Name
provide schema namepublic
.On
User ID and Password
Screen, provide EDB Postgres Advanced Server Target Instance user and password.Click Ok on the
Prepare User Database
screen.A success message will be displayed once the
Prepare User Database
is successful.
Create Distribution on Connect CDC Director
The following steps demonstrate the creation of Distribution which will define how data will be replicated from source to target. In our case from EDB Postgres Advanced Server source to EDB Postgres Advanced Server target.
Open Connect CDC Director.
Right click on
Distributions
and selectNew Distribution
.Enter Distribution information e.g
distribution name
,description
etc and click ok.
Go to Source DBMS
Server
—>Tables
—>Available Tables
—>Public
(Schema name).Select the table(s) to replicate using the checking box in front of them and right click and select
Select for Distribution
—>All Checked Tables
.
- On the
Distributed Tables
Screen, select theTarget Server
underSelect one or more target servers
and selectCreate tables on target
option and select the distribution underSelect a Distribution
option and click ok.
On Connect CDC Director Screen, select Yes.
On the
Target Tables
Screen, enter the Target Schema against each table and Click Next.
- On
Target Server Login Details
Screen, enter EDB Postgres Advanced Server Target Instance user and password and click test connect. Once successful, click Add and then clickCreate
.
Once done, click
Finish
.To confirm the tables are created on
Target Server
, click theTarget DBMS Server
—>Tables
—>Receiving Tables
, the list of the tables will be displayed which are available onSource DBMS Server
.
- Open pgAdmin and connect to EDB Postgres Advanced Server Target Instance, and under Schema
public
, the tables will be created.
- Mappings of tables setup for replication from EDB Postgres Advanced Server Source Instance to EDB Postgres Advanced Server Target Instance will be created under
Distributions
—>Mappings
.
Open
Distributions
—>Newly Created Distribution
—>Requests
—>New Request
—>Copy
. Copy will copy/replicate all the data in tables from EDB Postgres Advanced Server Source Instance to EDB Postgres Advanced Server Target Instance.Provide required information and click Ok on
Copy Request Properties
Screen.
Save the Model
The Model created in the above steps needs to be saved, validated and committed before the Replication can be performed.
To save the Model, click
File
and selectSave
option and provide the name for theModel
.Right Click
Enterprise Data Movement Model
and selectValidate
to validate the Model.No error will be displayed if the Model is valid.
- Right Click
Enterprise Data Movement Model
and selectCommit
—>Full
.
- Click Ok on
Commit Model
Screen. This will create theModel
files.
Execute Copy Replication using Connect CDC MonCon
Connect CDC MonCon is a GUI application, separate from the Connect CDC Director, that you use for monitoring and control functions. We will use Connect CDC MonCon to execute the Copy Replication. Copy Replication will copy all the data from the Source Tables to the Target Tables.
Open Connect CDC MonCon.
Click
Model
—>New Model
from Menu.Provide
Hostname/IP
and select the savedModel
from the drop down list.
- In the
Request
Section, select theDistribution Model
that was created for copying data created in the above steps and right click and selectstart
.
Click on
Process
to see the progress.Open pgAdmin once the copy operation is completed successfully and connect the EDB Postgres Advanced Server Target Instance and check the tables and the data is copied to the tables.
Create Replication Distribution using Connect CDC Director
Once the Copy replication operation is successful then a Replication option will be executed which will replicate all the changes made on the Source Tables to the Target Tables.
Open Connect CDC Director.
Create the
Replication Request
fromDistributions
—>Newly Created Distribution
—>Requests
—>New Request
—>Replication
.Enter the name and press
Ok
.
Save the changes in the
Model
.Right Click
Enterprise Data Movement Model
and selectValidate
to validate the Model.Right Click
Enterprise Data Movement Model
and selectCommit
—>Full
.Click Ok on
Commit Model
Screen. This will create the Model files.
Execute Replication using Connect CDC MonCon
Replication distribution will replicate all the changes done on the Source Tables to the Target Tables.
Open Connect CDC MonCon.
As the Model is updated in the Connect CDC Director to add the
Replication Distribution
, click on theModel Update
, this will add theReplication Distribution
to the Connect CDC MonCon Interface.The replication request will be displayed once the
Model
is updated successfully.In the
Request
Section, select theDistribution Model
created for Replication and right click and selectStart
.
On the
Source Instance
, update the data to be replicated in theSource Tables
.On the
Target Instance
, check data in theTarget Tables
, data will be updated there.
Data Transformation
Precisely Connect CDC has options that let you modify the source data you are distributing or even create or derive the data you distribute. You can use predefined functions to accomplish these data transformations or you can construct your own operations or functions.
For example, to express source currency values in terms of a different currency, you specify the transformation algorithm to use for that column mapping. For some common transformations, the algorithm is supplied as a predefined Connect CDC function.
The algorithms you specify are known in the Connect CDC Director as expressions. The Connect CDC Expression Handler parses them and then creates runtime code that calculates the result for the expressions.
In addition to or instead of calls to predefined functions, expressions may have an arbitrary number of constants, column references, and calculations on those constants and columns and functions. Their results must be compatible in type and length with the target column.
Steps to demonstrate data transformations
The following steps demonstrate data transformations.
Open Connect CDC Director.
Go to
Source DBMS Server
—>Tables
—>Sending Tables
.Select the table(s) to perform data transformation using the checking box in front of them and right click and select
Properties
—>Mappings
.On the
Mapping
tab, you define the column mappings for each of your target tables with respect to the source tables. TheMapping
tab displays the corresponding columns in theTarget Column
andSource Data
columns in each row. Connect CDC Director automatically mapped target columns to source columns that have the same name.
When the Connect CDC Director maps a source table to a same-named target table, it also associates individual source table columns with same-named target table columns. You then select which of these column pairings you want to include in your data distribution, which additional column pairings you want to arrange, and what type of data transformation, if any, you want to assign to each column pairing.
Mappings Tab has the following options
The Mapping tab grid displays each target table column and its datatype as well as its default corresponding source column, if any. Copy column under Method in the grid means the source column value is to be distributed without any special handling or transformation.
- In our example, click on
Method
drop down list for the target column loc and select lower case, this data transformation will convert the data in loc column of target table to lower case after the replication is done.
Perform the replication from Connect CDC MonCon.
On the Target Instance, check data in the Target Table dept, data will be transformed for column loc and it will be stored as lower case.
- On this page
- Configure Postgres Distribution as a Source Instance in Connect CDC Director
- Configure Postgres Distribution as a Target Instance in Connect CDC Director
- Create Distribution on Connect CDC Director
- Save the Model
- Execute Copy Replication using Connect CDC MonCon
- Create Replication Distribution using Connect CDC Director
- Execute Replication using Connect CDC MonCon
- Data Transformation
Could this page be better? Report a problem or suggest an addition!