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.
Workload Automation AutoSys 11.x/12.x
This error most commonly appears when the locale settings mismatch between the Sybase database and the Autosys server where the Sybase client is installed.
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.
autobcpDB Script -- Synchronize Databases -