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"
运行后结果如下:
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 image database, and the alias name "EPP" of the existing database does not match the alias name "EPD" of the backup image, and the database name "EPP" of the existing database does not match the database name "EPD" of the backup image. 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号错误解决案例相关推荐

  1. 总结 db visualizer连接GBase8s数据库报-908错误解决方法

    总结 db visualizer连接GBase8s数据库报-908错误解决方法 检查数据库实例是否正常运行:在服务器端使用informix用户执行命令onstat – 检查dbaccess命令能否正常 ...

  2. linux自动备份db2数据库备份,db2 自动备份(linux 、windows)总结

    1.linux db2 自动备份,备份后压缩,拷贝到另一服务器 全备份: #!/bin/sh #------------------------------------- #db2自动备份脚本 #by ...

  3. oracle数据库适配器错误,Oracle数据库协议适配器错误解决方法

    Oracle协议适配器错误解决办法 作者:IT实验室出处:博客2012-01-29 15:44 在Oracle中新建了一个数据库,今天把它删了之后再登录SQL*PLUS就登不上去了,出现ORA-125 ...

  4. DB2数据库指定时间点恢复案例

    公司一生产环境AIX主机上的DB2数据库,由于开发人员的误操作,造成一个重要表的被删除,需要进行恢复.为了安全,不能在生产环境的数据库上进行操作,需要放到测试环境进行恢复. 问了一下开发人员,表被删除 ...

  5. MySQL数据库 1067号错误的解决办法

    在Windows Professional 7 64-bit系统下安装了MySQL 5.6,但是某一天发生了错误,错误号:1067:怎么解决这个问题呢? 以下为解决步骤: 1.以系统管理员登陆: 2. ...

  6. mysql 1326_mssqlserver无法远程数据库Error: 1326错误解决方法

    今天我在使用mssqlserver时空出不能远程服务器了,Error: 1326错误出现,下面我们来看看关于解决办法吧. 我们在在使用SQL Server时都会遇到使用SQL Server Manag ...

  7. golang 数据库null值错误 解决方法

    遇到问题: converting NULL to string is unsupported 定义的结构体中 结构体成员类型为string,从mysql数据库中查询数据中有NULL值,go语言执行sc ...

  8. SQL2012 附加数据库提示5120错误解决方法

    在win8.1 x64系统上使用sql2012进行附加数据库(包括在x86系统正在使用的数据库文件,直接拷贝附加在X64系统中)时,提示无法打开文件,5120错误. 这个错误是因为没有操作权限,所以附 ...

  9. CAFFE(FAQ.2):Ubuntu 配置caffe 框架之数据库读取,错误解决:ImportError: No module named leveldb解决办法...

    Z: 在安装了caffe框架后需要读取大量的数据进行学习训练.比如在MNIST识别训练中,一般直接读图片会比较耗时,我们一般将图片转存为数据库中.目前主流的数据库有以下两种选择: LevelDB Lm ...

最新文章

  1. 常用的数据结构-链表
  2. synchronous_commit 参数的再次说明
  3. VS2017调用MySQL 8.0(附上C++程序)
  4. iOS tableviewcell重用机制避免重复显示
  5. Python基础教程:3个方面理解Python的类方法与静态方法
  6. CodeForces - 1321E World of Darkraft: Battle for Azathoth(二维偏序+线段树)
  7. Error:Artifact com.*******:war exploded: java.nio.file.InvalidPathException: Illeg
  8. 【评价模型】数据包络分析法(DEA)
  9. 大版本号跨越,AIDA64更新6.0版本:更新测试,支持Zen 2架构
  10. 怎样用计算机做周计划表,电脑如何制作学生学习计划表
  11. 高效能人士的七个习惯读后感与总结概括-(第四章)
  12. 解构2019世界人工智能大会:三大变化,十年趋势,一场地球与火星的碰撞
  13. 有效沟通bic法则_有效沟通bic法则_合格职场人都会的3个有效的沟通法则
  14. 计算机网络路由器的配置连接不上,路由器安装设置好后电脑还是不能上网解决办法...
  15. 如何给外行解释云计算
  16. 学计算机是不是必须要买电脑,上大学了,你必须买一部电脑吗?
  17. 使用docker部署Nexus
  18. vue-cli4引入Element Plus 插件
  19. HQL:求出每个商品的打折天数
  20. 小程序与h5的相互跳转

热门文章

  1. AIR32F103(十一) 在AIR32F103上移植微雪墨水屏驱动
  2. Mendeley的安装
  3. Arduino UNO驱动土壤湿度传感器检测
  4. shuriken粒子系统(2)
  5. 华为mate40pro什么时候推送鸿蒙,mate40Pro什么时候可以用鸿蒙
  6. JisonLexerError: Lexical error on line 1: Unrecognized text Erroneous area:\n1: 100VH - 44px
  7. 微信接口测试号 php代码,模拟测试微信接口暨微信开发试验代码
  8. 数据库战争:MySQL VS MongoDB
  9. 枕包机 欧姆龙NJ501-1500,六轴定位控制,凸轮控制
  10. 全氢聚硅氮烷液体涂料材料 中文名称: ()(PHPS)