Chinaunix

标题: 如何用NBU备份db2的归档日志 [打印本页]

作者: aping2005    时间: 2008-10-18 22:51
标题: 如何用NBU备份db2的归档日志
想用NBU的出口程序备份DB2的归档?不知道怎么来实现,Veritas的文档写的不是很详细。

设置了如下:
db2 update db cfg for sample using userexit on 启用用户出口

db2 update db cfg for sample using logretain on 启用归档日志

在NBU里面做了个policy叫db2_standard,是不是就可以了,
怎么知道它是不是能正常工作,好像这个policy 没有办法手工执行测试?
bp.conf文件如下:

# $Header: db2.conf,v 1.5 2007/04/12 14:05:29 $
#
# ***************************************************************************
# * $Copyright: Copyright 1993 - 2007 Symantec Corporation, All Rights Reserved $ *
# ***************************************************************************
#
# The following settings are used by NetBackup to backup/restore a DB2 database.
#
# Reminders:
# 1) The specified policy must have a type of "DB2".
# 2) The specified schedule must be defined for this policy.
# 3) The DB2 database host must be entered as a client for this policy.
#

DATABASE SAMPLE
OBJECTTYPE DATABASE
POLICY DB2
SCHEDULE Default-Application-Backup
ENDOPER

#
# The following settings are used by NetBackup to backup/restore DB2 log files.
#
Reminders:
# 1) DB2 transcation logs can be backed up/restored using  either
#  (a) DB2 User Exit Program
#       The specified policy must have a type of "Standard" (for UNIX DB2
#       host) or "MS-Windows-NT" (for Windows DB2 host).
#
#  (b) LOGARCHMETH1 can be configured to use NetBackup.
#      (When LOGARCHMETH1 = "VENDOR:NetBackup for DB2 agent")
#       This option is possible only for versions 8.2 and above.
#       The specified policy must have a type of DB2.
#
# 2) The specified schedule must be defined for this policy.
# 3) The DB2 database host must be entered as a client for this policy.
#

# ---------------------
# DB2 User Exit Program
# ---------------------
# If DB2 log file archiving is enabled (DB2 USEREXIT ON), DB2 will invoke
# the NetBackup user-exit program to backup & restore DB2 archive log files.
# Using ARCFUNC SAVE causes log files to be archived to NetBackup storage,
# as specified by the policy storage-unit setting.
# Using ARCFUNC COPY causes log files to be archived to a disk directory.
# Use ARCDIR to specify the destination directory for log file backup.
# Use RETDIR to specify the source directory for log file restore.
#
DATABASE SAMPLE
OBJECTTYPE ARCHIVE
POLICY db2_standard
SCHEDULE userexit
ARCFUNC SAVE
#ARCFUNC COPY
#ARCDIR /home/db2inst1/arcdir
#RETDIR /home/db2inst1/arcdir
ENDOPER
作者: wolfheader    时间: 2008-10-19 21:55
还需要文档多全啊,呵呵,看这个注释就够了
作者: aping2005    时间: 2008-10-19 22:04
看它配置这么简单,db2diag.log却总是报错:

2008-10-19-22.03.02.562000+480 E2573188H546       LEVEL: Error
PID     : 2804                 TID  : 3836        PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000
EDUID   : 3836                 EDUNAME: db2logmgr (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, sqlpgArchiveLogFile, probe:3160
MESSAGE : ZRC=0x00000008=8
          DIA8008C Out of range occurred during data type conversion, data "".
DATA #1 : <preformatted>
Failed to archive log file S0000000.LOG to USEREXIT from F:\DB2\NODE0000\SQL00002\SQLOGDIR\.

2008-10-19-22.03.02.562000+480 I2573736H439       LEVEL: Warning
PID     : 2804                 TID  : 3836        PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000
EDUID   : 3836                 EDUNAME: db2logmgr (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, sqlpgRetryFailedArchive, probe:4780
MESSAGE : Still unable to archive log file 0 due to rc 8 for LOGARCHMETH1 using
          method 4 and target .

2008-10-19-22.03.23.562000+480 E2574177H385       LEVEL: Warning
PID     : 2804                 TID  : 3836        PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000
EDUID   : 3836                 EDUNAME: db2logmgr (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, sqlpgArchiveLogFile, probe:3108
MESSAGE : ADM1844I  Started archive for log file "S0000000.LOG"

2008-10-19-22.03.23.953000+480 E2574564H532       LEVEL: Error
PID     : 2804                 TID  : 3836        PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000
EDUID   : 3836                 EDUNAME: db2logmgr (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, sqlpgInvokeUserexit, probe:1550
MESSAGE : ADM1833E  The user exit program returned an error when archiving log
          file "S0000000.LOG" from "F:\DB2\NODE0000\SQL00002\SQLOGDIR\" for
          database "SAMPLE".  The error code was "8".

2008-10-19-22.03.23.953000+480 E2575098H452       LEVEL: Warning
PID     : 2804                 TID  : 3836        PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000
EDUID   : 3836                 EDUNAME: db2logmgr (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, sqlpgArchiveLogFile, probe:3150
MESSAGE : ADM1848W  Failed to archive log file "S0000000.LOG" to "USEREXIT"
          from "F:\DB2\NODE0000\SQL00002\SQLOGDIR\".

2008-10-19-22.03.23.953000+480 E2575552H546       LEVEL: Error
PID     : 2804                 TID  : 3836        PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000
EDUID   : 3836                 EDUNAME: db2logmgr (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, sqlpgArchiveLogFile, probe:3160
MESSAGE : ZRC=0x00000008=8
          DIA8008C Out of range occurred during data type conversion, data "".
DATA #1 : <preformatted>
Failed to archive log file S0000000.LOG to USEREXIT from F:\DB2\NODE0000\SQL00002\SQLOGDIR\.

2008-10-19-22.03.23.953000+480 I2576100H439       LEVEL: Warning
PID     : 2804                 TID  : 3836        PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000
EDUID   : 3836                 EDUNAME: db2logmgr (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, sqlpgRetryFailedArchive, probe:4780
MESSAGE : Still unable to archive log file 0 due to rc 8 for LOGARCHMETH1 using
          method 4 and target .

2008-10-19-22.03.44.953000+480 E2576541H385       LEVEL: Warning
PID     : 2804                 TID  : 3836        PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000
EDUID   : 3836                 EDUNAME: db2logmgr (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, sqlpgArchiveLogFile, probe:3108
MESSAGE : ADM1844I  Started archive for log file "S0000000.LOG"

2008-10-19-22.03.45.375000+480 E2576928H532       LEVEL: Error
PID     : 2804                 TID  : 3836        PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000
EDUID   : 3836                 EDUNAME: db2logmgr (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, sqlpgInvokeUserexit, probe:1550
MESSAGE : ADM1833E  The user exit program returned an error when archiving log
          file "S0000000.LOG" from "F:\DB2\NODE0000\SQL00002\SQLOGDIR\" for
          database "SAMPLE".  The error code was "8".

2008-10-19-22.03.45.375000+480 E2577462H452       LEVEL: Warning
PID     : 2804                 TID  : 3836        PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000
EDUID   : 3836                 EDUNAME: db2logmgr (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, sqlpgArchiveLogFile, probe:3150
MESSAGE : ADM1848W  Failed to archive log file "S0000000.LOG" to "USEREXIT"
          from "F:\DB2\NODE0000\SQL00002\SQLOGDIR\".

2008-10-19-22.03.45.390000+480 E2577916H546       LEVEL: Error
PID     : 2804                 TID  : 3836        PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000
EDUID   : 3836                 EDUNAME: db2logmgr (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, sqlpgArchiveLogFile, probe:3160
MESSAGE : ZRC=0x00000008=8
          DIA8008C Out of range occurred during data type conversion, data "".
DATA #1 : <preformatted>
Failed to archive log file S0000000.LOG to USEREXIT from F:\DB2\NODE0000\SQL00002\SQLOGDIR\.

2008-10-19-22.03.45.390000+480 I2578464H439       LEVEL: Warning
PID     : 2804                 TID  : 3836        PROC : db2syscs.exe
INSTANCE: DB2                  NODE : 000
EDUID   : 3836                 EDUNAME: db2logmgr (SAMPLE) 0
FUNCTION: DB2 UDB, data protection services, sqlpgRetryFailedArchive, probe:4780
MESSAGE : Still unable to archive log file 0 due to rc 8 for LOGARCHMETH1 using
          method 4 and target .
作者: aping2005    时间: 2008-10-19 23:06
搞定。
作者: wolfheader    时间: 2008-10-20 10:46
出了什么问题?怎么解决的
作者: 冬瓜头    时间: 2008-10-20 13:19
我记得 备份的时候用一个“include log”,就可以顺便备份log,不用单独备份,restor的时候可以先提取出log。
作者: alexbow    时间: 2008-11-03 18:18
标题: 回复 #6 冬瓜头 的帖子
手工编译db2uexit可以自动归档到NBU的




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2