如何使用命令行备份和还原sybase数据库表 [英] How to backup and restore sybase database tables using command line
问题描述
如何备份sybase表并使用命令行还原? 请使用bcp命令帮助我
How can I backup my sybase tables and restore using command line? please help me with the command using bcp
我尝试使用sybase中央GUI 谢谢.
I have tried using sybase central GUI Thanks.
推荐答案
由于您未指定要在Windows还是Unix上运行,因此我将尝试同时覆盖这两个方面.
Since you didn't specify whether you are running on Windows or Unix I'll try to cover both.
Unix
bcp
位于$ SYBASE/$ SYBASE_OCS/bin/
Windows
bcp
位于%SYBASE%\%SYBASE_OCS%\ bin
Unix
bcp
is located in $SYBASE/$SYBASE_OCS/bin/
Windows
bcp
is located in %SYBASE%\%SYBASE_OCS%\bin
导出
bcp DB_NAME..TABLE_NAME out TABLE_NAME.bcp -Sservername -Uusername -Ppassword -[c or n]
选择-c
或-n
,具体取决于您是否希望文件可读.我建议使用-n
,除非您迫切需要使用-c
,TABLE_NAME.bcp
可以是任何文件名,且具有任何扩展名.
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.
导入
$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.
bcp
实用程序的更多信息可以在这里找到:
More information abou the bcp
utility can be found here: