I. Bcp Error
Ct_connect (): network packetLayer:Internal net library error: Net-Lib protocol driver call to connect two endpoints failed
Establishing connection failed.
Unable to connect to remote server
Cs_convert: Cslib User Api Layer: CommonLibrary error: The conversion/operation was stopped due to a syntax error in the source field.
CSLIBMessage:-L0/O0/S0/N36/1/0:
The number of columns corresponding to the import table is incorrect.
Cs_convert: Cslib User Api Layer: CommonLibrary error: The conversion/operation was stopped due to a syntax error in the source field.
The imported data has an auto-increment column, but the data source does not.
Blk_rowxfer (): blkLayer:Internal BLK-Library error: Data truncated while doing local character set conversion. col = 3
The length of fields corresponding to the import table is insufficient.
Ct_sendpassthru (): network packetLayer:Internal net library error: Net-Library operation terminated due to disconnect
CTLIB Message:-L5/O3/S5/N5/5/0:
Character Set Error
Server Message: HSUN-Msg 7415, Level 10, State 1:
The transaction log in database DBNAME is almost full. Your transaction is being
Suincluded until space is made available in the log.
When the log is full, run the dump transaction DBNAME with truncate_only command to clear the log.
Ii. Bcp import data of different character sets
When the bcp in character set is utf8, the following parameters are used to solve the problem that the java program uses the utf8 character set to view Chinese characters.
Bcp dbname .. tabname in filename-Uxx-Pxx-Sxx-Jcp936-c-Y
Iii. Considerations
1. Size of Tempdb
When Sybase executes the bcp in script, it will occupy 2 times the tempdb space for the imported data. Therefore, we must carefully estimate the maximum table size before execution to ensure sufficient tempdb space. When there is not enough space, you need to reduce the size of the table by splitting the table or deleting the old data, or increase the size of tempdb.
2. Set Database Configuration Options
When the database executes the bcp in script, a large number of logs are generated. To ensure that the bcp in process is not interrupted due to log overflow, set the database option "truncate log on chkpt" to "true ".
Although the Sybase Database is self-optimized, database fragmentation will exist as long as the database is dynamic. In OLTP applications, as the data increases, the system becomes slower and slower. When deadlocks often occur, check the database fragments and use the above methods for optimization.
In fact, we should conduct regular database fragmentation to ensure that the physical storage of the database is always in the optimal state. This is a cost-effective way to better maintain the database performance compared with the increase in hardware.