Replicate database LOB replication issues

Adaptive Server Enterprise uses a text pointer to identify the location of text and image column data. The text pointer is passed to system functions that perform the actual updates to data in these large columns. The same technique is used internally in Replication Server to apply LOB datatypes. Replication Server obtains a text pointer, and data server function calls are made to apply the data to replicate databases.

Replication Server default function strings are designed for an Adaptive Server replicate database. Replication Server executes an rs_textptr_init or rs_get_textptr function string, followed by one or more rs_writetext function strings to apply the LOB data to a replicate database. The default function strings supplied in Replication Server for most non-Sybase data servers do not support LOB replication.

When a non-Sybase database is the replicate database, the database gateway used to communicate with the replicate database must be able to emulate the Adaptive Server text pointer processing. The ECDA Option for ODBC and the Mainframe Connect DirectConnect for z/OS Option gateways provide this feature.

ECDA Option for ODBC

ECDA option for ODBC provides support for LOB replication into Microsoft SQL Server databases. For more information, see “Microsoft SQL Server replicate data servers”.

In the case of a replicate database in DB2 for IBM z/OS, you can use the Mainframe Connect DirectConnect for z/OS option to provide a “gatewayless” connection to the replicate database, and use modified rs_get_textptr and rs_writetext function strings to support LOB replication into DB2. For more information, see “IBM DB2 Universal Database replicate data servers”.

You might be able to remove the dependency on text pointers from the Replication Server (or the ECDA database gateway) by modifying the Replication Server text pointer function strings and creating a stored procedure in the replicate database.

Remote procedure call (RPC) method

Each text (LOB) column to be processed by Replication Server has a unique rs_writetext function string created to issue a writetext function call to the replicate database. You can modify the rs_writetext function string to replace the default writetext function call with a remote procedure call (RPC) to a stored procedure you create in the replicate database.

Replicating LOB datatypes to DB2 Universal Database on Linux, UNIX, and Windows platforms requires the RPC method, with a separate stored procedure in the replicate database for each LOB column.

Replicating LOB datatypes to DB2 for IBM z/OS requires the writetext method, in which the Mainframe Connect DB2 UDB Option for CICS and IMS language handler facilitates replication of LOB datatypes to DB2. For more information about the rs_writetext function string, see the Replication Server Reference Manual.

Implement an RPC workaround

To implement an RPC workaround, you must create one or more stored procedures in the replicate database (depending on the types of primary keys processed), and you must create one Replication Server function string for each text or image (LOB) column to be replicated.

The stored procedure must perform the following processing:

The ECDA gateway for the replicate database must support RPC processing. For more information about RPC handling, refer to the appropriate ECDA documentation.

For more information about Replication Server processing of text and image columns and the rs_writetext system function, see the Replication Server Administration Guide and the Replication Server Reference Manual.