【DB2学习】由于TSM损坏导致归档失败

2010-01-29-10.19.25.544030+480 I54728390A401      LEVEL: Error
PID     : 434422               TID  : 1           PROC : db2logmgr (MYDB) 0
INSTANCE: db2inst1             NODE : 000
FUNCTION: DB2 UDB, data protection services, sqlpgArchiveLogFile, probe:3160
MESSAGE : Failed to archive log file S0002000.LOG to USEREXIT from
          /home/db2inst1/db2inst1/NODE0000/SQL00004/SQLOGDIR/ with rc = 8.

2010-01-29-10.19.25.544197+480 I54728792A380      LEVEL: Warning
PID     : 434422               TID  : 1           PROC : db2logmgr (MYDB) 0
INSTANCE: db2inst1             NODE : 000
FUNCTION: DB2 UDB, data protection services, sqlpgRetryFailedArchive, probe:4780
MESSAGE : Still unable to archive log file 2000 due to rc 8 for LOGARCHMETH1
          using method 4 and target .

2010-01-29-10.19.34.944387+480 I54729173A401      LEVEL: Error
PID     : 434422               TID  : 1           PROC : db2logmgr (MYDB) 0
INSTANCE: db2inst1             NODE : 000
FUNCTION: DB2 UDB, data protection services, sqlpgArchiveLogFile, probe:3160
MESSAGE : Failed to archive log file S0002132.LOG to USEREXIT from
          /home/db2inst1/db2inst1/NODE0000/SQL00004/SQLOGDIR/ with rc = 8.

2010-01-29-10.19.34.944553+480 I54729575A319      LEVEL: Error
PID     : 434422               TID  : 1           PROC : db2logmgr (MYDB) 0
INSTANCE: db2inst1             NODE : 000
FUNCTION: DB2 UDB, data protection services, sqlpgArchivePendingLogs, probe:1500
MESSAGE : Log archive failed with rc 8 for LOGARCHMETH1.

解决思路 :

1  从 Failed to archive log file S0002132.LOG to USEREXIT from 。。。看出归档到userexit 指定的路径失败!所以应该查看userexit 指定的归档路径是什么地方。

编译用户出口程序

先改成C文件,并设置权限

mv /home/db2inst/sqllib/samples/c/db2uext.cdisk /home/db2inst/db2uext.c

chmod 777 /home/db2inst/db2uext.c

然后修改该文件,主要修改以下几个关键项

vi /home/db2inst/db2uext.c

#define ARCHIVE_PATH      "/u/"           /* path must end with a slash       */

#define RETRIEVE_PATH     "/u/"           /* path must end with a slash       */

#define AUDIT_ACTIVE          1           /* enable audit trail logging        */

#define ERROR_ACTIVE          1           /* enable error trail logging        */

#define AUDIT_ERROR_PATH  "/u/"           /* path must end with a slash      */

#define AUDIT_ERROR_ATTR    "a"           /* append to text file             */

#define BUFFER_SIZE          32           /* # of 4K pages for output buffer    */

3 看出这里的归档路径,(实际上该数据库是由TSM来管理备份的),TSM 失效,导致归档失败!

解决办法:

将userexit  设置为off ,将logarchmeth1设置为本地磁盘路径,DISK:具体的路径

附上:

userexit 参数的含义:当使用该参数时,日志的归档和检索使用用户出口程序自动执行的,这个出口程序是由db2uext2 调用的。这个程序用于将在线归档日志移动到与活动日志目录不同的目录中,或者移动到另一个媒介(此案例是在TSM 指定 的目录)。当在ROLLFORARD 操作期间需要某些离线归档日志时,这个程序还可以用于将归档日志取出到活动日志目录中。在windows下,db2uext2 必须在sqllib/bin 目录下,在unix下,db2uext2 必须在sqllib/adm目录下。

v9 版本以后 就不再推荐使用该参数了!而是使用 logarchmeth1 和logarchmeth2这两个参数来管理数据库日志的归档。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/22664653/viewspace-674177/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/22664653/viewspace-674177/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值