技术分享
DB2定时备份脚本
2021-07-04
@REM BAKE DATABASE----
@echo ----------------
@echo BAKE DATABASE JHKCGL START
@echo ----------------
@echo 指定一个目录.每天都可以备份.
SET STRPA=D:\soft\IBM\BKDB2\%DATE:~0,10%
MKDIR %STRPA%
@echo 连接数据库,开始备份
db2cmd
db2 CONNECT TO DBFY USER db2admin using db2fy
db2 QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS
db2 CONNECT RESET
db2 BACKUP DATABASE DBFY TO %STRPA% WITH 2 BUFFERS BUFFER 1024 PARALLELISM 1 WITHOUT PROMPTING
db2 CONNECT TO JHKCGL
db2 UNQUIESCE DATABASE
db2 CONNECT RESET
EXIT
@REM BAKE DATABASE----
@echo ----------------
@echo BAKE DATABASE END
@echo ----------------
- 标签:
-
行业资讯