配置备份方法三
配置备份:使用用户出口程序和 ARCFUNC COPY(日志采用文件备份)
1.将启用的日志记录的用户出口参数USEREXIT设为 ON, 已更改的至日志文件的路径
NEWLOGPATH参数设为你的日志文件存放路径例如 :\DB2LOG\NBU\
2.创建DB2数据库备分策略DB2_DB 类型: DB2
Attributes:
Policy type: DB2
Schedules:
DBFULL
Schedule:
Default-Application-Backup-DB
3.创建日志归档策略DB2_LOG 类型:MS-Windows-NT
Attributes:
Policy type:MS-Windows-NT
Schedules:
Name:USER_ARCHIVE
Type of backup:User Archive
Backup Selections:此处为空
4.创建DB2日志备份策略DB2_LOG_ARCHIVE类型: MS-Windows-NT
Schedules:Full
Backup Selections:此处为db2.conf中定义的目录ARCDIR目录
5.配置db2.conf参数文件
将示例 db2.conf 文件从其所在的示例文件夹位置复制到活动位置。
从install_path\NetBackup\dbext\db2\samples\db2.conf复制到
Install_path\NetBackup\dbext\db2\db2.conf
修改如下项:
DATABASE SAMPLE
OBJECTTYPE DATABASE
POLICY DB2_DB_Policy
SCHEDULE Default-Application-Backup
ENDOPER
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
POLICY DB2_Log_Policy
SCHEDULE User
ARCFUNC SAVE
#ARCFUNC COPY
#ARCDIR /home/db2inst1/arcdir
#RETDIR /home/db2inst1/arcdir
ENDOPER
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
POLICY DB2_ARCH_Policy
SCHEDULE Default-Application-Backup
ENDOPER
为下面的配置:
DATABASE NBU
OBJECTTYPE DATABASE
POLICY DB2_DB
SCHEDULE Default-Application-Backup-DB
ENDOPER
DATABASE NBU
OBJECTTYPE ARCHIVE
POLICY DB2_LOG
SCHEDULE USER_ARCHIVE
#SCHEDULE User
#ARCFUNC SAVE
ARCFUNC COPY
ARCDIR D:\DB2LOGARC
RETDIR D:\DB2LOG\NBU\ \NODE0000
ENDOPER
#DATABASE NBU
#OBJECTTYPE ARCHIVE
#POLICY DB2_LOG
#SCHEDULE Default-Application-Backup-LOG
#ENDOPER
注意:配置中红色部份与策略中对应
# Use ARCDIR 指日志备份目标路径
# Use RETDIR 指DB2归档日志源路径,即db2 cfg指定的目径
6.创建备份脚本文件
将备份示例脚本从install_path\NetBackup\ DbExt\sample\ db2_backup_db_online.cmd复制到D盘
D:\db2_backup_nbu_online.cmd
并修改以下项:
@REM Example: @set db2_nblib=C:\progra~1\veritas\netbackup\bin\nbdb2.dll
@set db2_nblib=C:\progra~1\veritas\netbackup\bin\nbdb2.dll
@echo db2_nblib = %db2_nblib%
@REM Example: @set db2_home=D:\sqllib
@set db2_home=D:\sqllib
@echo db2_home = %db2_home%
@REM Example: @set db2_name=SAMPLE
@set db2_name=NBU
@echo db2_name = %db2_name%
7.确认db2uext2.exe
确认DB2安装目径的bin下有db2uext2.exe,如果没有
将C:\Program Files\Veritas\NetBackup\DbExt\DB2\db2uext2.exe复制到D:\SQLLIB\BIN
此情况一般出现在先安装了NBU后安装DB2