How can I backup my sybase tables and restore using command line? please help me with the command using bcp
I have tried using sybase central GUI Thanks.
Since you didn't specify whether you are running on Windows or Unix I'll try to cover both.
Unix
bcp
is located in $SYBASE/$SYBASE_OCS/bin/
Windows
bcp
is located in %SYBASE%\%SYBASE_OCS%\bin
Export
bcp DB_NAME..TABLE_NAME out TABLE_NAME.bcp -Sservername -Uusername -Ppassword -[c or n]
Choose either -c
or -n
depending if you want the file to be human readable or not. I recommend using -n
unless you have a compelling need to use -c
TABLE_NAME.bcp
can be any filename, with any extension.
Import
$SYBASE/$SYBASE_OCS/bin/bcp DB_NAME..TABLE_NAME in TABLE_NAME.bcp -Sservername -Uusername -Ppassword -[c or n]
There are many more options and flags available, but these are the basics to get it to work.
More information abou the bcp
utility can be found here:
and
来源:https://stackoverflow.com/questions/16931683/how-to-backup-and-restore-sybase-database-tables-using-command-line