How to backup and restore sybase database tables using command line [closed]

一曲冷凌霜 提交于 2019-11-30 09:58:49

问题


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.


回答1:


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:

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc30191.1570/html/utilityguide/BABGCCIC.htm

and

http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.infocenter.dc30191.1570/html/utilityguide/X14951.htm



来源:https://stackoverflow.com/questions/16931683/how-to-backup-and-restore-sybase-database-tables-using-command-line

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!