db2 online backup shell
来源:互联网 发布:传奇霸业数据汇总 编辑:程序博客网 时间:2024/05/21 20:27
#!/bin/sh
usage()
{
echo "usage: $0 <DatabaseName>"
exit 1;
}
log_message()
{
message=$1
timestamp=`date "+%m/%d/%Y %H:%M:%S"`
echo "$timestamp $message" >> $LOG
}
# Database name is the first argument.
if [ $# -eq 0 ]
then
usage
fi
# Set DB2 environment
. $HOME/sqllib/db2profile
DBNAME=$1
BACKUPDIR=/home/db2inst1/db2backup
LOG=/home/db2inst1/db2backup/db2backup.log
log_message "*********************************************************************************************************";
log_message "********************************Begin********************************************************************";
log_message "*********************************************************************************************************";
# Make sure there are no active applications
NUM=`db2 get db cfg for $DBNAME | grep '(LOGRETAIN) = RECOVERY' | wc -l`
if [ $NUM -ne "1" ]
then
log_message "The value of LOGRETAIN is 'OFF'. Terminate 30 seconds for changing it's value to 'RECOVERY'"
db2 update db cfg for $DBNAME using
sleep 30
fi
NUM=`db2 get db cfg for $DBNAME | grep 'TRACKMOD = ON' | wc -l`
if [ $NUM -ne "1" ]
then
log_message "The value of TRACKMOD is 'OFF'. Terminate 30 seconds for changing it's value to 'ON'"
db2 update db cfg for $DBNAME using
sleep 30
fi
# Connect to database
log_message "Connecting to database $DBNAME"
db2 connect to $DBNAME >> $LOG 2>&1
# Take Backup
log_message "Backing up database to $LOG (online incremental)....This will take a while";
db2 backup database $DBNAME online incremental to $BACKUPDIR compress include logs without prompting >> $LOG 2>&1
log_message "*********************************************************************************************************";
log_message "********************************End**********************************************************************";
log_message "*********************************************************************************************************";
- db2 online backup shell
- db2 online backup 设置
- db2 offline backup shell
- Db2: online backup和nonrecoverable load的兼容性
- db2 backup
- AIX 下 DB2 BACKUP
- DB2 Backup Basics
- DB2 Express backup & restore
- DB2 Backup and Restore
- DB2 Online备份方案
- DB2 ONLINE UTILITY 监控
- 解决db2 backup pending状态
- db2 表空间backup pending
- [shell]mysql backup脚本
- Using the SQLite Online Backup API
- DB2 Online Reorg
- DB2 Backup Basics - Part 1-3
- DB2 Backup and Recovery for LiveCycle ES
- TCP 协议文件传输示例
- VC下ADO访问远程ORACLE数据库
- db2 offline backup shell
- 判断素数问题(C语言实现)
- Server.MapPath
- db2 online backup shell
- C语言实现去除字符串中空格
- 由于sys用户密码于orapwd文件不一致导致的ora-03113错误
- ASP.NET中应用Excel:(3)访问工作表数据
- 关于ajax中文乱码问题
- Begine....
- Reporting Service 在打印或预览时可能会导致出现空白页的原因
- 忽然之间
- 适配器模式 The Adapter Pattern