• sybase 备份和恢复


    use master
    go
    
    dump transaction MBFEWKDB with no_log
    go
    
    dump transaction MBFEHISDB with no_log
    go
    
    use master
    go
    dump database MBFEWKDB to 'MBFEWKDB.bak'
    go
    
    use master
    go
    dump database MBFEHISDB to 'MBFEHISDB.bak'
    go
    
    use master
    go
    
    dump transaction MBFEWKDB with no_log
    go
    
    dump transaction MBFEHISDB with no_log
    go
    
    quit
    
    ------------------------------------------------------------
    
    use master
    go
    
    dump transaction DIRWAYSDB with no_log
    go
    
    dump transaction DISWAYSDB with no_log
    go
    
    use master
    go
    dump database DIRWAYSDB to 'DIRWAYSDB.bak'
    go
    
    use master
    go
    dump database DISWAYSDB to 'DISWAYSDB.bak'
    go
    
    use master
    go
    
    dump transaction DIRWAYSDB with no_log
    go
    
    dump transaction DISWAYSDB with no_log
    go
    
    quit
    
    备份脚本;
    DATE=`date "+%Y%m%d"`
    . ~/.bash_profile
    isql -Usa -P <<!
    dump database cddb to '/home/sybase/dbbak/$DATE.cddb.bak'
    go
    dump database hddb to '/home/sybase/dbbak/$DATE.hddb.bak'
    go
    dump transaction cddb with no_log
    go
    dump transaction hddb with no_log
    go
    !
    
    
    清理日志脚本;
    $ cat /sybase/sbin/logclear
    #!/bin/ksh
    
    SYBASE=/sybase
    DSQUERY=SYBASE
    PATH=$SYBASE:$SYBASE/bin:$SYBASE/install:$PATH:.
    LD_LIBRARY_PATH=/sybase/lib:$LD_LIBRARY_PATH
    export SYBASE DSQUERY PATH LD_LIBRARY_PATH
    
    EDITOR=vi;export EDITOR
    cat $HOME/sbin/logclear.sql |isql -Usa -P
    $ cat $HOME/sbin/logclear.sql
    use master
    go
    
    dump transaction MBFEWKDB with no_log
    go
    
    dump transaction MBFEHISDB with no_log
    go
    
    dump transaction DIRWAYSDB with no_log
    go
    
    dump transaction DISWAYSDB with no_log
    go
    
    
    恢复SYBASE:
    isql -Usa -P <<!
    load database cddb from '/home/sybase/dbbak/$DATE.cddb.bak'
    go
    online database cddb
    go
    load database hddb from '/home/sybase/dbbak/$DATE.hddb.bak'
    go
    online database hddb
    go
    shutdown SYB_BACKUP
    go
    shutdown
    go
    !
    

  • 相关阅读:
    JQ购物车+1-1
    [转载]DATEDIFF() 函数返回两个日期之间的时间
    [转载]js获取当前页面url网址信息
    [转载]Request获取文件路径
    JQ页面跳转
    [转载]Sql Server 日期格式化函数
    [转载]jQuery的attr()与prop()的区别
    [转载]获取验证码60秒倒计时
    [转载]JQ键盘事件
    [转载]SQL常用语句
  • 原文地址:https://www.cnblogs.com/hzcya1995/p/13352329.html
Copyright © 2020-2023  润新知