Results 1 to 7 of 7

Thread: BCP out error

  1. #1
    Join Date
    Nov 2006
    Posts
    12

    Unanswered: BCP out error

    Hi

    I have a table which has 20 millions records. I tried to bcp the table out and I have encountered the following error:

    7017000 rows successfully bulk-copied to host-file.
    Error: Writing BCP file (0)!
    bcp copy out partially failed

    7017922 rows copied.

    Command used for bcp:
    bcp dbname.username.tablename out name -U<username> -P<password> -S<server> -c

    Is there a limitation in size for bcp? Any help please?

    Thanks!

  2. #2
    Join Date
    Apr 2004
    Posts
    79

    -b option

    Try using -b option with bcp to specify batch size.

  3. #3
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Maybe the disk that you write to is full

  4. #4
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    Also check the ulimit value, and make sure that the filesystem is capable of handling large (> 2GB) files.

    Michael

  5. #5
    Join Date
    Nov 2006
    Posts
    12
    Hi

    The ulimit is unlimited and there are enough space in the disk. I do not know what is the probblem. I tried using the options -b and -n too, but it doesn't work.

    Pls help... thanks!

  6. #6
    Join Date
    Jan 2003
    Location
    Geneva, Switzerland
    Posts
    353
    Which version of Sybase are you using?

    Some older versions of bcp were limited to 2GB for the size of the file.

    If that is the case you can maybe work around this by creating a named pipe (via mknod), doing the bcp out to the pipe and then using cat to read from the pipe to the file.

    Michael

  7. #7
    Join Date
    Sep 2002
    Location
    Sydney, Australia
    Posts
    255
    1 Well you definitley have a "error writing to output file, so chase that up. Check the output file size, if it is v close to 2gb then that is your problem. You may have to fiddle with various (o/s) settings before you can create files > 2gb.
    2 bcp is mature and heavily used, so look for problems elsewhere first (not in bcp).
    3 -n/-c does not matter, except to identify the exact point of failure (#rows copied). Use the -F and -L operators in separate execs to drag out slices of the table (start out with slices that create less than 2gb; then grab a slice which crosses the 7017922 row). If it is partitioned, you can also drag the table out in partitions.

    Cheers
    Derek Asirvadem
    Senior Sybase DBA/Information Architect derekATsoftwaregemsDOTcomDOTau
    Anything worth doing is worth doing Right The First Time
    Spend your money on standards-compliant development or spend 10 times more fixing it

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •