千家信息网

nbu备份db2数据库6号错误如何处理

发表于:2026-11-03 作者:千家信息网编辑
千家信息网最后更新 2026年11月03日,这篇文章给大家分享的是有关nbu备份db2数据库6号错误如何处理的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。NBU在备份一台AIX服务器上的DB2数据库时,报6号错误。报
千家信息网最后更新 2026年11月03日nbu备份db2数据库6号错误如何处理

这篇文章给大家分享的是有关nbu备份db2数据库6号错误如何处理的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。

NBU在备份一台AIX服务器上的DB2数据库时,报6号错误。

报错截图:

在AIX服务器上运行备份脚本,具体报错信息如下:

Executing: db2 BACKUP DATABASE BJMOA4 ONLINE LOAD /usr/openv/netbackup/bin/nbdb2.sl64 OPEN 4 SESSIONS BUFFER 1024

SQL2071N An error occurred while accessing the shared library

"/usr/openv/netbackup/bin/nbdb2.sl64". Reason code: "2".

一、分析检查

1、检查SQL2071N

$ db2 ? SQL2071N

SQL2071N An error occurred while accessing the shared library

"". Reason code: ""

Explanation:

An unexpected error occurred while accessing a vendor shared

library during the processing of a database utility. The

following is a list of reason codes:

1 An invalid shared library path was encountered.

2 An attempt to load the backup shared library failed.

3 An error was encountered while unloading the shared library.

The utility stops processing.

User Response:

Ensure the shared library provided is valid and resubmit the

utility command or use another supported media.

2、分析共享库的载入

# ldd /usr/openv/netbackup/bin/nbdb2.sl64

/usr/openv/netbackup/bin/nbdb2.sl64 needs:

/usr/openv/lib/libxbsa64.so

/usr/openv/lib/libVcvcomb64_noul.so

/usr/lib/libc.a(shr_64.o)

/usr/lib/libdl.a(shr_64.o)

/unix

/usr/lib/libcrypt.a(shr_64.o)

使用LDD命令可显示所依赖的动态连接库的尽可能的详细信息

根据提示去检查列出的文件是否都存在,如果不存在可以从其他正常可备份的机器上拷贝。

3、分析CODE 2

#cat /usr/include/sys/errno.h

#define EPERM 1 /* Operation not permitted */

#define ENOENT 2 /* No such file or directory */

#define ESRCH 3 /* No such process */

#define EINTR 4 /* interrupted system call */

#define EIO 5 /* I/O error */

#define ENXIO 6 /* No such device or address */

#define E2BIG 7 /* Arg list too long */

#define ENOEXEC 8 /* Exec format error */

#define EBADF 9 /* Bad file descriptor */

#define ECHILD 10 /* No child processes */

#define EAGAIN 11 /* Resource temporarily unavailable */

#define ENOMEM 12 /* Not enough space */

#define EACCES 13 /* Permission denied */

#define EFAULT 14 /* Bad address */

#define ENOTBLK 15 /* Block device required */

根据提示,可推断没有找到相关文件或路径不正确

4、分析DB2diag.log文件

DATA #3 : String, 265 bytes

0509-022 Cannot load module /usr/openv/netbackup/bin/nbdb2.sl64(shr.o).

0509-153 File /usr/openv/netbackup/bin/nbdb2.sl64 is not an archive or

the file could not be read properly.

FUNCTION: DB2 UDB, database utilities, sqlubcka, probe:140

MESSAGE : Backup Terminated.

根据以上的分析,可确知归档目录读取不正确

5、检查当前数据库是否开启归档

$ db2 get db cfg for bjtt4|grep -i log

Log retain for recovery enabled (LOGRETAIN) = RECOVERY

User exit for logging enabled (USEREXIT) = OFF

HADR log write synchronization mode (HADR_SYNCMODE) = NEARSYNC

First log archive method (LOGARCHMETH1) = LOGRETAIN

发现设置了归档,但归档目录没指定

二、解决问题

$db2 update db cfg for bjtt4 using LOGARCHMETH1 "disk:/archive/db2log"

运行后结果如下:

Log retain for recovery enabled ( LOGRETAIN) = RECOVERY
User exit for logging enabled (USEREXIT) = OFF
HADR log write synchronization mode (HADR_SYNCMODE) = NEARSYNC

First log archive method (LOGARCHMETH1) =DISK:/archivelog/db2log/

这个参数修改后,需要重启数据库才能生效。

重启后,发现问题已解决,可以重新正常备份了。

另外如果你是在做数据库恢复时,遇到这样的问题

例如:RESTORE DATABASE EPD FROM /db2 TAKEN AT 20130525112121 TO /db2/EPP INTO EPP NEWLOGPATH /db2/EPP/log_dir/ WITH 2

BUFFERS BUFFER 1024 REDIRECT

SQL2529W Warning! Restoring to an existing database that is different from the backup p_w_picpath database, and the alias name "EPP" of the existing database does not match the alias name "EPD" of the backup p_w_picpath, and the database name "EPP" of the existing database does not match the database name "EPD" of the backup p_w_picpath. The target database will be overwritten by the backup version. The Roll-forward recovery logs associated with the target database will be deleted.

Do you want to continue ? (y/n) y

SQL2071N An error occurred while accessing the shared library

"/db2/EPP/db2EPP/NODE0000/SQL00001/libdb2compr.a". Reason code: "2".

可以在恢复脚本上增加以下参数即可:

COMPRLIB /db2/db2EPP/sqllib/lib/libdb2compr.a

补充:

SQL2071N An error occurred while accessing the shared library

"/usr/openv/netbackup/bin/nbdb2.sl64". Reason code: "2".

这个问题的另外一种原因就是你的服务器如果装的是32位的NBU客户端,则不能使用nbdb2.sl64这个文件,而应该在脚本中指明使用nbdb2.sl这个32位的文件。这个问题跟你的服务器是64位的无关。

(# Change MY_LIB to the correct NetBackup library name for your host:

# Solaris or Linux 32-bit = nbdb2.so

# Solaris 64-bit = nbdb2.so64

# AIX or HPUX 32-bit = nbdb2.sl

# AIX or HPUX 64-bit = nbdb2.sl64)

感谢各位的阅读!关于"nbu备份db2数据库6号错误如何处理"这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!

备份 数据 数据库 文件 问题 分析 服务器 服务 检查 错误 脚本 信息 内容 参数 更多 目录 篇文章 提示 运行 不错 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 蓝思科技飞鸽互联网 科技金融是不是互联网金融 科技赋能下的互联网金融 互联网与科技金融数据 万达互联网科技 互联网巨头投资的硬核科技 中国科技互联网公司收入 互联网科技热点资讯 创业天下互联网科技有限公司 昭通互联网科技选哪家 语蝶互联网科技有限公司 互联网科技革命什么开始 玉溪互联网科技怎么选 速维有品互联网信息科技(苏州)有限公司 深圳市优智互联网科技有限公司 杭州披云加互联网科技有限公司 南京一网一红互联网科技有限公司 吉林省码上互联网科技电话 互联网科技和医药行业 上海旺乐尼互联网科技有限公司 保险科技 互联网保险 汇久创客互联网科技 碳银互联网科技有限公司 兼蜜互联网科技 佩信高科技互联网 互联网公司科技股 赶超互联网科技 微信多开 电子科技大学互联网创业大赛 群盈汇互联网科技有限公司 互联网企业科技类企业如何做账
0