Database Sync (autobcpSYB.pl) activity failed with an error
search cancel

Database Sync (autobcpSYB.pl) activity failed with an error

book

Article ID: 217483

calendar_today

Updated On:

Products

Autosys Workload Automation

Issue/Introduction

The autobcpSYB.pl script failed with the below error while following the documented procedures to synchronize the dual event servers on Sybase database.

 

autobcpSYB.pl: Checking databases...

 -------------------------------
             May 25 2021  3:39PM

(1 row affected)

 -------------------------------
             May 25 2021  3:39PM

(1 row affected)

autobcpSYB.pl:  PROCESSING TABLE ujo_afm...
autobcpSYB.pl:  Moving data from primarydb table ujo_afm to /tmp/dumpfile...
bcp autosys.dbo.ujo_afm out /tmp/dumpfile  -Uautosys -P******  -S primarydb  -n

Starting copy...

2 rows copied.
Clock Time (ms.): total = 2  Avg = 1 (1000.00 rows per sec.)
autobcpSYB.pl:  Truncating data in secondaryDB table ujo_afm...
isql -Uautosys -P******  -SsecondaryDB -Dautosys -i delete_data.sql
autobcpSYB.pl:  Moving data from /tmp/dumpfile to secondaryDB table ujo_afm...
bcp autosys.dbo.ujo_afm in /tmp/dumpfile  -Uautosys -P******  -S secondaryDB  -n

Starting copy...
Server Message: secondaryDB - Msg 4847, Level 16, State 1:
BCP insert operation is disabled when data size is changing between client and server character sets. Please use BCP's -Y option to invoke client-side conversion.

Server Message: secondaryDB - Msg 3621, Level 10, State 0:
Command has been aborted.

CTLIB Message:  - L1/O3/S0/N14/0/0:
blk_init(): blk layer: CT library error: Failed when CT_Lib routine ct_results() called.
blk_init failed.
bcp copy in failed
autobcpSYB.pl:  bcp failed.
autobcpSYB.pl:  Cannot proceed.

Environment

Workload Automation AutoSys 11.x/12.x

Cause

This error most commonly appears when the locale settings mismatch between the Sybase database and the Autosys server where the Sybase client is installed.

Resolution

The problem is the locale/charset mismatch between the Sybase server and the client installed on the autosys server. 

Ensure "locale -a" returns the same on both the Sybase server and on the autosys server where the autobcp script is being executed. 

 

Workaround - 

If the above does not resolve the problem, a workaround is to update autobcp script to include parameter "-y".

Original - 

  # Move the data from the operating system file to the target table.

    printf "${MYNAME}:  Moving data from $dumpfile to $target_server table $tableresult[$i]...\n";

 

    $temp="$BCPDIR $DBNAME.dbo.$tableresult[$i] in $dumpfile  $DESTUSRPASS -S $target_server $batch_size $bcp_format";

 

Change the line to add "-Y" 

  # Move the data from the operating system file to the target table.

    printf "${MYNAME}:  Moving data from $dumpfile to $target_server table $tableresult[$i]...\n";

 

    $temp="$BCPDIR $DBNAME.dbo.$tableresult[$i] in $dumpfile  $DESTUSRPASS -S $target_server $batch_size $bcp_format -Y";

 

Note: The workaround is to work around the problem. The solution is to resolve the locale settings mismatch between the Sybase server and the client.

 

Additional Information

autobcpDB Script -- Synchronize Databases -

https://techdocs.broadcom.com/us/en/ca-enterprise-software/intelligent-automation/workload-automation-ae-and-workload-control-center/11-3-6-SP8/administrating/ae-administration/maintain-the-event-server/configure-ca-workload-automation-ae-to-run-in-dual-event-server-mode.html