现在的位置: 首页 > 综合 > 正文

db2实现备份

2018年04月26日 ⁄ 综合 ⁄ 共 777字 ⁄ 字号 评论关闭
db2实现备份
/var/db2/db2inst1/sqllib/db2profile;
dbbackpath=/db2/db2inst1/1;
dblogpath=/db2/NODE0000;
mv $dbbackpath/file/*.gz $dbbackpath/all;
mv $dbbackpath/logs/*.gz $dbbackpath/all;
mv $dbbackpath/logs/*.tar $dbbackpath/all;
db2 backup db urp_rs online to $dbbackpath/file;
db2 backup db sysrsdb online to $dbbackpath/file;
db2 backup db cmstar online to $dbbackpath/file;
gzip $dbbackpath/file/*.001;
cp $dblogpath/SQL00001/SQLOGDIR/* $dbbackpath/logs/urp_rs;
cp $dblogpath/SQL00002/SQLOGDIR/* $dbbackpath/logs/sysrsdb;
cp $dblogpath/SQL00004/SQLOGDIR/* $dbbackpath/logs/cmstar;
tar -cvf $dbbackpath/logs/urp_rs`date +%y%m%d`.tar $dbbackpath/logs/urp_rs;
tar -cvf $dbbackpath/logs/sysrsdb`date +%y%m%d`.tar $dbbackpath/logs/sysrsdb;
tar -cvf $dbbackpath/logs/cmstar`date +%y%m%d`.tar $dbbackpath/logs/cmstar;
gzip $dbbackpath/logs/*.tar;

抱歉!评论已关闭.