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

"<shr-lib-name>". Reason code: "<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"

运行后结果如下:

关于爱情的句子:情不知所起,一往而情深。

nbu备份db2数据库6号错误解决案例

相关文章:

你感兴趣的文章:

标签云: