Files Related to bcp

Each execution of bcp uses a format file (bcp.tablename.fmt) and a data file (bcppipe.tablename) as input.

As a result of the bulk loading process, bcp produces a log file (load_nnn.log) for each table. If there are any records that cannot be loaded due to data errors, bcp also produces a discard file (load_nnn.bad).

Log files and discard files are sometimes overwritten as a result of successive bcp executions during segmented bulk load operations. To prevent this from occurring, DATABridge Client uses the bcp log and discard files as temporary files, as follows:

  • At the end of the first load segment, the DATABridge Client copies the temporary log file to the permanent log file (bcp.tablename.log). If a discard file was produced, the DATABridge Client also copies the temporary discard file to the permanent discard file (bcp.tablename.bad).
  • At the end of every subsequent load segment, the DATABridge Client appends the temporary log files to the end of the permanent log file (bcp.tablename.log). If a temporary discard file was produced, the DATABridge Client either copies it or appends it to the permanent discard file (bcp.tablename.bad), depending on whether this file exists or not.
  • The DATABridge Client deletes the temporary log and discard files as soon as they are appended to DATABridge Client permanent log and discard files.

Files related to bcp and DATABridge Client operations are listed in the following table. In some of the filenames below, nnn is the value for the table_number column in the DATATABLES client control table. The table number is unique within each data source.

File

Description

bcp.tablename.fmt

The bcp format file that is created by the generate command. It describes the format of the data in the data file (bcppipe.tablename).

bcppipe.tablename

A temporary file created by the DATABridge Client. It contains the data to be loaded into a Microsoft SQL Server table.

This file is automatically deleted after a successful load for a table. If the table is not loaded successfully, the file is not deleted. This gives you the opportunity to manually run bcp to determine why it is failing.

Important: The bcppipe.tablename files can be quite large. When these files are no longer needed, make sure you delete them to prevent errors from occurring.

bcp.tablename.log

A concatenation of bcp screen output created during the cloning process. The files are created in the working directory for the data source.

Caution: Do not delete the bcp.tablename.log file until you have looked at it. It can contain valuable information such as error messages about rows that were not loaded.

bcp.tablename.bad

A concatenation of all of the load_nnn.bad files created during the cloning process. These files are created in the discards subdirectory.

Caution: Do not delete the bcp.tablename.bad file until you have looked at it. It can contain valuable information such as which rows were not loaded. Correct the bad data and use bcp to load these records into the appropriate table.

The following temporary files are created while the bulk loader is being launched, but they are deleted before the run is completed:

  • load_nnn.log
  • load_nnn.bad

You see these files only if the bulk loader operation abends.