sybase ASE在unix&linux上的自动备份脚本

以下操作均由sybase用户来做:

新建一个脚本文件,譬如/sybase/script/dump.sh
类容如下

$ cat dump.sh
/sybase/OCS-12_5/bin/isql -Usa -P******* -S******* -i /sybase/script/dump.sql -o /sybse/script/dump.log
mv /caiwubackup/backup/cwbase1.bak /caiwubackup/backup/cwbase1_`date +%Y%m%d`.bak
mv /caiwubackup/backup/cwbase2.bak /caiwubackup/backup/cwbase2_`date +%Y%m%d`.bak
mv /caiwubackup/backup/cwbase3.bak /caiwubackup/backup/cwbase3_`date +%Y%m%d`.bak
mv /caiwubackup/backup/cwmaster.bak /caiwubackup/backup/cwmaster_`date +%Y%m%d`.bak
mv /caiwubackup/backup/master.bak /caiwubackup/backup/master_`date +%Y%m%d`.bak

(注意:`号是在键盘左上角和波浪线在一起的那个键上,不是单引号)

在同一个目录下新建脚本dump.sql
类容如下

$ cat dump.sql

dump database cwbase1 to "/caiwubackup/backup/cwbase1.bak"
go
dump database cwbase2 to "/caiwubackup/backup/cwbase2.bak"
go
dump database cwbase3 to "/caiwubackup/backup/cwbase3.bak"
go
dump database cwmaster to "/caiwubackup/backup/cwmaster.bak"
go
dump database master to "/caiwubackup/backup/master.bak"
go

制定一个定时计划,每天晚上23点30开始备份数据库

$crontab -e
30  23 *  *  *  /sybase/script/dump.sh

根据你本机的实际情况,修改相关数据库名称和路径。

  • 本文链接地址:http://www.dbainfo.net/sybase-ase-auto-backup-shell-scripts-at-unix-linux.htm
  • 本文为dbainfo个人原创,请在尊重作者劳动成果的前提下进行转载;
  • 转载务必注明原始出处 : Sybase数据库技术,数据库恢复专家
  • 对《sybase ASE在unix&linux上的自动备份脚本》有何疑问或见解,请在本文下方发表;
  • 对网站还有其他问题或建议,请提交在留言板,谢谢!
    1. dbainfo
      2011-04-11 17:31:11

      ASE will *not* run on any system running 32bit with glibc >= 2.5 due
      to incompatibilities between the ASE code and those versions of
      glibc.

      ASE *will* run on 64bit systems with any recent version of glibc.

      Michael

    :wink: :twisted: :roll: :oops: :mrgreen: :lol: :idea: :evil: :cry: :arrow: :?: :-| :-x :-o :-P :-D :-? :) :( :!: 8-O 8)