程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> SyBase數據庫 >> SyBase綜合文章 >> 舊版Sybase資料整理

舊版Sybase資料整理

編輯:SyBase綜合文章
1) 關於定時備份
http://www.chinaunix.Net/cgi-bin/bbs/topic.CGI?forum=10&topic=1233&show=390
crontab 中可以這樣寫:
00 23 * * * /sybase/ASE-12_0/bin/DUMPDB.sh >>/Sybase/ASE-12_0/install/DUMPDB.out

放那裡都無所謂,一個dumpdb.sh的例子:
#SUN Solaris 8
#!/bin/ksh
export SYBASE=/Sybase
export Sybase_FTS=FTS-12_0
export PATH=/sybase/ASE-12_0/bin:/sybase/OCS-12_0/bin:$PATH:/Sybase/ASE-12_0/install:/usr/sbin
export Sybase_OCS=OCS-12_0
export Sybase_ASE=ASE-12_0
export LM_LICENSE_FILE=/Sybase/SYSAM-1_0/licenses/license.dat:$LM_LICENSE_FILE
export LD_LIBRARY_PATH=/sybase/ASE-12_0/lib:/usr/local/openwin/lib:/sybase/FTS-12_0/lib:/sybase/OCS-12_0/lib:/usr/local/openwin/lib:/usr/lib:/Sybase/SQLRemote/lib:$LD_LIBRARY_PATH
export Sybase_SYSAM=SYSAM-1_0
export HOME=$Sybase
$SYBASE_OCS/bin/isql -Usa -SSybase -P <dump database YOURDBNAME to "/sybdump/dump.01"
stripe on "/sybdump/dump.02"
stripe on "/sybdump/dump.03"
stripe on "/sybdump/dump.04"
stripe on "/sybdump/dump.05"
go
!
這裡是一個典型的腳本,用於實現full備份!
#!/usr/bin/sh
# *************************************************************************
#for full backup after excuted dbcc Operation
# *************************************************************************
SHLIB_PATH=/opt/sybase/ASE-12_0/lib:/opt/sybase/FTS-12_0/lib:/opt/sybase/OCS-12_0/lib:/usr/lib:/lib:/usr/lib/Motif1.2:/opt/Sybase/SQLRemote/
lib
export SHLIB_PATH
Sybase_OCS=OCS-12_0
export Sybase_OCS
SYBASE=/opt/Sybase
export Sybase

ISQL="/opt/Sybase/OCS-12_0/bin"
ymd=`date +%y%m%d`
bk_user="unb"
bk_pwd="******"
bk_db="SYB_HP"
cd /Sybase/backup
mkdir $ymd
LOG="/Sybase/backup/$ymd"
echo $ymd >$LOG/backup.log
echo "\n11*************************" >>$LOG/backup.log
echo "Check database $bk_db..." >>$LOG/backup.log
d1=`date`
su - Sybase -c "isql -SSYB_HP -Usa -P****** <$LOG/dbcc-$ymd.log 2>&1
dbcc traceon(3604)
go
dbcc checkdb($bk_db)
go
dbcc traceoff(3604)
  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved