如何用NBU备份db2的归档日志

发布于 2022-08-12 06:25:30 字数 2939 浏览 23 评论 6

想用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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

剩一世无双 2022-08-18 02:45:20

手工编译db2uexit可以自动归档到NBU的

居里长安 2022-08-18 02:14:21

我记得 备份的时候用一个“include log”,就可以顺便备份log,不用单独备份,restor的时候可以先提取出log。

z祗昰~ 2022-08-17 21:49:41

出了什么问题?怎么解决的

月依秋水 2022-08-17 10:49:46

搞定。

北座城市 2022-08-16 01:42:55

看它配置这么简单,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:DB2NODE0000SQL00002SQLOGDIR.

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:DB2NODE0000SQL00002SQLOGDIR" 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:DB2NODE0000SQL00002SQLOGDIR".

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:DB2NODE0000SQL00002SQLOGDIR.

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:DB2NODE0000SQL00002SQLOGDIR" 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:DB2NODE0000SQL00002SQLOGDIR".

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:DB2NODE0000SQL00002SQLOGDIR.

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 .

余生共白头 2022-08-15 07:13:44

还需要文档多全啊,呵呵,看这个注释就够了

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文