Troubleshoot BCP errors

    Error 1

    bcp.exe or bcp.rll file not found in OpManager_Home/bin folder

    Solution

    1. Copy the bcp.exe and the bcp.rll files from the binn/ folder in MSSQL installed location and paste it in the OpManager_Home/bin/ folder.
    2. If there is more than one bcp.exe file, keep the version suitable for MSSQL and delete older versions.
      (Hint: Open command prompt and execute "bcp.exe -v" command in OpManager_Home/bin/ folder to get the version of bcp.exe.)

    Error 2

    BCP Login Failure

    Solution

    1. Make sure the MSSQL server password does not contain special characters like ‘;’.
    2. Update the correct MSSQL Username and Password in OpManager/NetFlow Analyzer by executing DBConfiguration.bat in OpManager_Home/bin/ folder.

    3. Steps for DBConfiguration.bat:

      1. Stop OpManager service.
      2. Open command prompt and execute DBConfiguration.bat in OpManager_Home/bin/ folder.
      3. Enter the correct authentication User Name and Password.



      4. If you wish to use the same database for data storage. Enter the same database name you want to use in Database Name field and click OK. A prompt opens whether you wish to use the same database, press OK.



        (or)

        If you wish to create a new database for data storage. Enter the new database name you want to create and press OK.
      5. When DBConfiguration is completed, start the OpManager service.

    Error 3

    BCP and MSSQL server version mismatch

    Solution

    1. Copy the bcp.exe and the bcp.rll files of same version as MSSQL from the binn/ folder in MSSQL installed location and paste it in the OpManager_Home/bin/ folder.
      (Hint: Open command prompt and execute "bcp.exe -v" command in OpManager_Home/bin/ folder to get the version of bcp.exe. You can check the MSSQL version executing the query "SELECT SERVERPROPERTY('productversion') as 'Version'" or go to SQL Server Management Studio and right click on the instance name and select the Properties)
    2. If Microsoft Native client is installed, check whether the version of Microsoft Native client matches the MSSQL version.

    Error 4

    BCP login timeout

    Solution

    1. In Object Explorer, right-click a server and select Properties.
    2. Click the Connections node.
    3. In the Remote query timeout box under Remote server connections, type or select a value from 0 through 2,147,483,647 in seconds, to set the maximum time for SQL Server to wait before timing out.

    Error 5

    Compatibility and other common troubleshooting options for bcp:

    Solution

    1. 1. Check the file permission for bcp.exe in the antivirus and allow permissions for bcp.exe.
    2. When the MSSQL server is hosted in the local system, change the MSSQL server name to the system name.
    3. When the user(Windows/MSSQL) does not have permission to execute bcp file, make sure your ODBC connection uses SQL Server Authentication. BCP will not start if you use only Windows authentication without also using SQL Server authentication[1].
    4. Examine the ODBCBCP.dll file and SQLSRV32.dll file. These files must be of the same version. If they are of different versions, rename the SQLSRV32.dll file, and then reinstall MDAC(ODBC). The ODBCBCP.dll and SQLSRV32.dll files are located in the WINNT\System32 folder. The version numbers of these files must be the same[1].
    5. If the MSSQL server is installed in a remote server and native client is not installed in the local System, install the native client suitable for the MSSQL server in the local system.

    6. Installing Native Client:

      Download the SQL Native Client from the link below. You will need to scroll down the page for the Native Client downloads:

      http://www.microsoft.com/download/en/details.aspx?id=16978

      Microsoft SQL Server 2008 R2 Native Client (SQL Server Native Client) is a single dynamic-link library (DLL) containing both the SQL OLE DB provider and SQL ODBC driver. It contains run-time support for applications using native-code APIs (ODBC, OLE DB and ADO) to connect to Microsoft SQL Server 2000, 2005, or 2008. SQL Server Native Client should be used to create new applications or enhance existing applications that need to take advantage of new SQL Server 2008 R2 features. This redistributable installer for SQL Server Native Client installs the client components needed during run time to take advantage of new SQL Server 2008 R2 features, and optionally installs the header files needed to develop an application that uses the SQL Server Native Client API.

      X86 Package (sqlncli.msi) X64 Package (sqlncli.msi) IA64 Package (sqlncli.msi)

      For more details on installing the native client, refer this site: http://msdn.microsoft.com/en-us/library/ms131321.aspx

    7. If error message says "msvcr120.dll ,msodbcsql13.dll files are missing" when executing bcp.exe in OpManager_Home/bin/ folder, it may be due to two reasons.
      1. Missing Visual C++ Redistributable Packages for Visual Studio: In this case install Visual C++ Redistributable Packages for Visual Studio from here.
      2. Missing Microsoft® ODBC Driver for SQL Server®: In this case install Microsoft® ODBC Driver for SQL Server® from here.
    8. If the bcp issue still persists,
      1. Open command prompt and execute bcp.exe in OpManager_Home/bin/ folder and take a screenshot of the output.
      2. Contact netflowanalyzer-support@mangeengine.com with the taken screenshot to resolve the issue.

    Error 6

    MSSQL server transaction Log is Full

    Solution

    1. Connect to the MSSQL database and right click on the database name.
    2. Click on properties, and under options select the Recovery Mode as Simple.
    3. Right Click the database name and select Tasks > Shrink > Files Then Click OK to compress.

    Reference:
    [1] https://support.microsoft.com/en-in/help/869315/error-message-when-you-perform-a-bulk-copy-process-bcp-in-microsoft-dy