A brief introduction to the BCP usage of Sybase data backup

Source: Internet
Author: User
Tags character set execution sybase backup

BCP is generally stored in the installed ASE or open Client Bin directory. The 12 version of the previous ASE,BCP storage directory for the $SYBASE/bin,12 version (including 12 versions) after the storage directory for $SYBASE/ocs-12_x/bin. Where $sybase is the Sybase installation directory, 12_x represents version 12.0, 12.5, displayed as 12_0 or 12_5, executable file name is called bcp. Exe.

The list of parameters is as follows: (Available bcp–)

USAGE:BCP [[database_name.] Owner.] Table_name[:slice_number] {in | out} datafile

[M maxerrors] [F FormatFile] [-E Errfile]

[F FirstRow] [-L LastRow] [B batchsize]

[-N] [-c] [-T Field_terminator] [R Row_terminator]

[-u username] [-p password] [I. Interfaces_file] [-s server]

[-A Display_charset] [Q Datafile_charset] [Z Language] [-V]

[-A Packet size] [-j client Character Set]

[-T-text or image size] [-E] [G Id_start_value] [-N] [-X]

[M LabelName Labelvalue] [-labeled]

[k Keytab_file] [R Remote_server_principal]

[-V [security_options]] [Z security_mechanism] [Q]

The usual data backup format is:

BCP dbname ... TableName out C:\temp\filename-usa-ppassword–sservername–c

Where –u is the Sybase login name after –p, the Sybase login password after –s, and the Sybase service name after the –C representative uses the visible text method to export the data, and if you need to replace out with in for data recovery.

You can generate an execution script that exports data from all tables in one database at a time.

Edit one of the following text files, with the file name example Bcpscript:

Use dbname to select the database to which you want to export data

Go

Select ' bcp dbname. ' + name + ' out c:\temp\ ' + name + '-usa-p-ssybcdsrv-c ' from sysobjects where type = ' U ' (in Sysobj The table with type U in the ECTS system table is the user table and the system table is s)

Go

Executed in the following format:

Isql–usa–ppassword–sservername–i Bcpscript–o Bcpout.bat (after i parameter for input file, o parameter after file for input file after execution of output file)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.