免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3023 | 回复: 9
打印 上一主题 下一主题

[Veritas NBU] db2 备份错误 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-03-23 19:49 |只看该作者 |倒序浏览
我遇到个问题 环境win-master   win-DB2client
nbu7.0备份DB2的问题,用的是copy 日志方式,修改bp.conf和脚本后,还是备份失败。
脚本:@REM bcpyrght
@REM ***************************************************************************
@REM * $VRTScprght: Copyright 1993 - 2009 Symantec Corporation, All Rights Reserved $ *
@REM ***************************************************************************
@REM ecpyrght

@REM ---------------------------------------------------------------------------
@REM
@REM This script is provided as an example.  See the instructions below
@REM for making customizations to work within your environment.
@REM
@REM Please copy this script to a safe location before customizing it.
@REM Modifications to the original files will be lost during product updates.
@REM
@REM This script performs an online backup of the database.  An online backup
@REM requires that the database is configured for forward recovery (see the
@REM DB2 USEREXIT and LOGRETAIN settings).  DB2 users can remain connected
@REM while performing an online backup.
@REM
@REM To back up a database or a database partition, the user must have SYSADM,
@REM SYSCTRL, or SYSMAINT authority.
@REM ---------------------------------------------------------------------------

@echo off
@setlocal

@REM !!!!! START CUSTOMIZATIONS !!!!!
@REM
@REM The following changes need to be made to make this script work with your
@REM environment:
@REM
@REM ---------------------------------------------------------------------------
@REM (1) NetBackup for DB2 shared library:
@REM ---------------------------------------------------------------------------
@REM        This is the NetBackup library that backs up and restores DB2 databases
@REM        Set db2_nblib below to the correct NetBackup library path for your host
@REM       
@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 ---------------------------------------------------------------------------
@REM (2) DB2 home directory (the system catalog node):
@REM ---------------------------------------------------------------------------
@REM         This is the DB2 home directory where DB2 is installed
@REM        Set db2_home to DB2 home directory
@REM
@REM Example: @set db2_home=D:\SQLLIB
@set db2_home=C:\Program Files\IBM\SQLLIB
@echo db2_home = %db2_home%

@REM ---------------------------------------------------------------------------
@REM (3) Database to backup:
@REM ---------------------------------------------------------------------------
@REM        Set db2_name to the name of the database to backup:
@REM
@REM Example: @set db2_name=SAMPLE       
@set db2_name=TOOLSDB
@echo db2_name = %db2_name%

@REM ---------------------------------------------------------------------------
@REM (4) Multiple Sessions:
@REM ---------------------------------------------------------------------------
@REM        Concurrency can improve backup performance of large databases.
@REM        Multiple sessions are used to perform the backup, with each session
@REM        backing up a subset of the database.  The sessions operate
@REM        concurrently, reducing the overall time to backup the database.
@REM        This approach assumes there are adequate resources available, like
@REM        multiple tape devices and/or multiplexing enabled.
@REM
@REM        For more information on configuring NetBackup multiplexing,
@REM        refer to the "Veritas NetBackup System Administrator's Guide".
@REM       
@REM        If using multiple sessions change db2_sessions to use multiple sessions
@REM
@REM Example: @set db2_sessions="OPEN 2 SESSIONS WITH 4 BUFFERS BUFFER 1024"
@set db2_sessions=


@REM !!!!! END CUSTOMIZATIONS !!!!!

@REM ---------------------------------------------------------------------------
@REM Exit now if the sample script has not been customized
@REM ---------------------------------------------------------------------------
if "%db2_name%" == "" goto custom_err_msg

@REM ---------------------------------------------------------------------------
@REM These environmental variables are created by Netbackup (bphdb)
@REM ---------------------------------------------------------------------------

@echo DB2_POLICY = %DB2_POLICY%
@echo DB2_SCHED = %DB2_SCHED%
@echo DB2_CLIENT = %DB2_CLIENT%
@echo DB2_SERVER = %DB2_SERVER%
@echo DB2_USER_INITIATED = %DB2_USER_INITIATED%
@echo DB2_FULL = %DB2_FULL%
@echo DB2_CINC = %DB2_CINC%
@echo DB2_INCR = %DB2_INCR%
@echo DB2_SCHEDULED = %DB2_SCHEDULED%
@echo STATUS_FILE = %STATUS_FILE%

@REM ---------------------------------------------------------------------------
@REM Type of Backup:
@REM ---------------------------------------------------------------------------
@REM        NetBackup policies for DB2  recognize different
@REM        backup types, i.e. full, cumulative, and differential.
@REM        For more information on NetBackup backup types, please refer to the
@REM    NetBackup for DB2 System Administrator's Guide.
@REM
@REM        Use NetBackup variables to set DB2 full or incremental options
@REM

@set db2_action=
if "%DB2_FULL%" == "1" @set db2_action=ONLINE
if "%DB2_CINC%" == "1" @set db2_action=ONLINE INCREMENTAL
if "%DB2_INCR%" == "1" @set db2_action=ONLINE INCREMENTAL DELTA
@echo db2_action = %db2_action%

@REM ---------------------------------------------------------------------------
@REM Actual command that will be used to execute a backup
@REM Note: the parameters /c /w /i and db2 should be used with db2cmd.exe
@REM Without them, NetBackup job monitor may not function properly.
@REM ---------------------------------------------------------------------------

@set CMD_FILE=%temp%\cmd_file
@echo CMD_FILE = %CMD_FILE%

@set CMD_LINE=%db2_home%\bin\db2cmd.exe /c /w /i db2 -f %CMD_FILE%
@echo CMD_LINE = %CMD_LINE%

@echo BACKUP DATABASE %db2_name% %db2_action% LOAD %db2_nblib% %db2_sessions%
@echo BACKUP DATABASE %db2_name% %db2_action% LOAD %db2_nblib% %db2_sessions% > %CMD_FILE%

@REM ---------------------------------------------------------------------------
@REM Execute the command
@REM ---------------------------------------------------------------------------

@echo Executing CMD=%CMD_LINE%

%CMD_LINE%


@REM Successful Backup
if errorlevel 1 goto errormsg
echo BACKUP SUCCESSFUL
if "%STATUS_FILE%" == "" goto end
if exist "%STATUS_FILE%" echo 0 > "%STATUS_FILE%"
goto end

:custom_err_msg
echo This script must be customized for proper operation in your environment.


@REM Backup command unsuccessful
:errormsg
echo Execution of BACKUP command FAILED - exiting
if "%STATUS_FILE%" == "" goto end
if exist "%STATUS_FILE%" echo 1 > "%STATUS_FILE%"

:end

@endlocal
--------------------------------------------------
bp.conf文件
# $Header: db2.conf,v 1.6 2009/08/26 15:58:31 $
#
# ***************************************************************************
# * $Copyright: Copyright 1993 - 2009 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 TOOLSDB
OBJECTTYPE DATABASE
POLICY DB2-DB
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" (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 TOOLSDB
OBJECTTYPE ARCHIVE
POLICY DB2-LOG
SCHEDULE  DB2-LOG
#SCHEDULE User
#ARCFUNC SAVE
ARCFUNC COPY

ARCDIR  C:\db2log\NODE0000
RETDIR  C:\db2log\NODE0000
#ARCDIR /home/db2inst1/arcdir
#RETDIR /home/db2inst1/arcdir
ENDOPER


# --------------------------------------------------------------
# LOGARCHMETH1 = "VENDOR.." parameter for versions 8.2 and above
# Policy is of type DB2.
# --------------------------------------------------------------
#
# Comment the above DB2 User Exit section when using LOGARCHMETH1 = "VENDOR.."
#
DATABASE TOOLSDB
OBJECTTYPE ARCHIVE
POLICY DB2_ARCH_Policy
SCHEDULE Default-Application-Backup
ENDOPER
------------------------------------------------------------

我在客户端备份也是错误代码也是6,出错中
SQL30082N  安全处理失败,因为 "24"("USERNAME AND/OR PASSWORD INVALID")。  SQLSTATE=0800

我又修改了Nbu客户端登陆帐户为db2管理员可还是如此错误。
是不是我bp.conf和脚本文件写得不对啊,你有修改的格式吗?

论坛徽章:
221
15-16赛季CBA联赛之吉林
日期:2017-12-11 12:51:59黑曼巴
日期:2019-04-12 13:40:0515-16赛季CBA联赛之广东
日期:2019-04-23 10:41:1215-16赛季CBA联赛之辽宁
日期:2019-05-06 13:03:2815-16赛季CBA联赛之山西
日期:2019-05-09 10:56:5815-16赛季CBA联赛之青岛
日期:2019-05-17 13:57:0515-16赛季CBA联赛之新疆
日期:2019-06-10 13:39:0515-16赛季CBA联赛之天津
日期:2019-07-08 15:04:4519周年集字徽章-19
日期:2019-08-27 13:31:2619周年集字徽章-19
日期:2019-08-27 13:31:2619周年集字徽章-周
日期:2019-09-06 18:46:4715-16赛季CBA联赛之天津
日期:2019-02-27 11:24:07
2 [报告]
发表于 2011-03-23 23:05 |只看该作者
脚本可以通过模板拷贝过来修改,具体可以参考官方手册

论坛徽章:
0
3 [报告]
发表于 2011-03-24 10:07 |只看该作者
是拷贝出来修改的。
已经按照 官方文档修改了db2.conf文件,但是shell脚本官方没有文档,我是根据DB2环境修改的。

win03下db2 v9.5,实例DB2数据库名 TOOLSDB  
home=c:\pro..\ibm\sqllib
日志文件路径c:\db2log\NODE0000\     (这个路径是通过NEWLOGPATH修改后的。。userexit\logretain\trackmod 都已修改)

安装client后复制db2uext.exe到DB2下,但已经存在。再将db2.conf复制到上层目录,脚本复制到C根目录下开始修改...

论坛徽章:
0
4 [报告]
发表于 2011-03-24 10:42 |只看该作者
服务器上所作策略
1。 DB2-DB  类型DB2  日志 除了默认还添加了自动完全备份名称FULL,选择客户端添加备份选择,客户端C盘下(复制出的)脚本。
2。DB2-LOG 类型 M-windows,日志DB2-LOG 全备份,备份选择c:\db2log\NODE0000\
3.DB2-ARC  类型 M-windows  日志DB2-ARC   用户归档 备份选择  无

论坛徽章:
0
5 [报告]
发表于 2011-03-24 10:55 |只看该作者
在线等兄弟们

论坛徽章:
0
6 [报告]
发表于 2011-03-24 11:15 |只看该作者
不能沉啊   

论坛徽章:
0
7 [报告]
发表于 2011-03-24 13:07 |只看该作者
{:3_190:}   还没人来瞧瞧啊

论坛徽章:
0
8 [报告]
发表于 2011-03-30 12:47 |只看该作者
  怎么回事  这么久了也没人理

论坛徽章:
0
9 [报告]
发表于 2011-04-01 11:12 |只看该作者
这个帖子就这样沉默了

论坛徽章:
1
CU十二周年纪念徽章
日期:2013-10-24 15:41:34
10 [报告]
发表于 2011-04-01 11:19 |只看该作者
建议楼主先打一下NBU7.0.1的补丁再试一试。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP