DB2 ERRORCODE以及SQLSTATE错误解决方案小结

DB2 ERRORCODE以及SQLSTATE错误解决方案小结

java程序的连接DB2时,遇到了 ERRORCODE=-4499, SQLSTATE=08004错误,IBM官方站点找到了对应的解决方案:

The DB2 Content Manager installation is blocked: failure to connect to the DB2 database

 

Problem(Abstract)
The DB2 Content Manager installation is blocked by a failure to connect to the DB2 database. The problem is related to a DB2 connection failure with the DB2 Content Manager V8.4 installer. The error messages can be summarized as follows:

Error 1: DB2 return code is -4499, DB2 Content Manager return code is 3
CheckDBConnUtil00002 exception (com.ibm.db2.jcc.b.gm: [jcc][t4][2043][11550][3.50.152] Exception java.net.ConnectException: Error opening socket to server install01/9.123.114.105 on port 50,000 with message: A remote host refused an attempted connect operation.. ERRORCODE=-4499, SQLSTATE=08001)

Another message with the same error code can appear as follows:
CheckDBConnUtil00002 exception (com.ibm.db2.jcc.b.gm: [jcc][t4][2057][11264][3.50.152] The application server rejected establishment of the connection.An attempt was made to access a database, icmnlsdb, which was either not found or does not support transactions. ERRORCODE=-4499, SQLSTATE=08004)

Error 2: DB2 return code is -4222, DB2 Content Manager return code is 9
CheckDBConnUtil00002 exception (com.ibm.db2.jcc.b.qm: [jcc][t4][10380][11951][3.50.152] Required property "install02" is unknown host. ERRORCODE=-4222, SQLSTATE=08001)

Error 3: DB2 return code is -4214, DB2 Content Manager return code is 5
CheckDBConnUtil00002 exception (com.ibm.db2.jcc.b.mm: [jcc][t4][2013][11249][3.50.152] Connection authorization failure occurred. Reason: User ID or Password invalid. ERRORCODE=-4214, SQLSTATE=28000)
 
Symptom
DB2 connection failure with DB2 Content Manager V8.4 installer
 
ERRORCODE以及SQLSTATE错误解决方案小结" alt="" src="http://www-01.ibm.com/support/docview.wss?uid=swg21322400&aid=1" border="0" real_src="http://www-01.ibm.com/support/docview.wss?uid=swg21322400&aid=1">
 
Cause
Error 1: DB2 return code is -4499
Three problems might be the cause of this error.
  • DB2 is stopped.
  • The wrong DB2 database listening port number is specified.
  • The wrong database name is specified.


Error 2: DB2 return code is -4222
For this problem, the host name is probably specified incorrectly.

Error 3: DB2 return code is -4214
Three problems might be the cause of this error.
  • The user name is invalid
  • The password is invalid.
  • Both the user name and the password are invalid.
 
 
Resolving the problem
The following procedures might help you resolve the connection failure problem:
Resolving Error 1: DB2 return code is -4499
  1. Check whether DB2 is started.
  2. Check whether the database exists. Use the command

 

db2 list db directory to list the databases.
  • Check the DB2 listening port. The DB2 instance is listening on Port 50000 by default, but the port number might have been modified.
  • Restart DB2 or restart the computer on which DB2 is running, because there might be too many connections already active for DB2 to respond to the new request.
    Resolving Error 2: DB2 return code is -4222
    1. If the wrong host name is specified, or the DNS server cannot parse the host name, then you can use the command ping hostname, where hostname is the host name, to test the connection. You can also use the IP address directly in this command.
    2. Check the privileges of folder /tmp/CM/db2cmv8. The DB2 Content Manager installer performs the su command to DB2 Content Manager accounts to test the connection. For example, if you have an icmadmin account as the library server administrator, the installer uses this account, creates a shell script under the /tmp/CM/db2cmv8 folder, and runs it to see the result. If the folder does not have the write and execute privileges for icmadmin, the connection test fails.

    Resolving Error 3: DB2 return code is -4214
    1. Check that the user name and password are specified correctly.
    2. Check that the password does not contain special characters, such as the dollar sign ($).

ANR2971E Database backup fails with DB2 sqlcode -5005 error

Technote (troubleshooting)


Problem(Abstract)

Tivoli Storage Manager DB backup fails with DB2 sqlcode -5005 error.

Symptom

While attempting to run BACKUP DB the command fails, and the activity log reports the following error message:

ANR2971E Database backup/restore/rollforwardterminated - DB2 sqlcode -5005 error. 

The db2diag.log shows following error:

2013-06-29-10.38.23.072007-420 I1493A414 LEVEL: Error 
PID : 5308450 TID : 772 PROC : db2acd 0 
INSTANCE: tsminst1 NODE : 000 
EDUID : 772 EDUNAME: db2acd 0 
FUNCTION: DB2 UDB, config/install, sqlfGetDbmCfg, probe:10 
MESSAGE : SQL5005sqlf_openfile rc = 
DATA #1 : Hexdump, 4 bytes 
0x000000011050A250 : 860F 000A


Cause

The sqlcode -5005 translates to: 
"The operation failed because the database manager failed to access either the database manager configuration file or the database configuration file."


Diagnosing the problem

When querying DB2 for more details on this error the following explanation is shown:


$ db2 "? sql5005"

SQL5005C System Error.

Explanation:

A system error, probably an I/O error, was encountered while accessing a configuration file.

The command cannot be processed.

User Response:

Resubmit the command.

If the error persists, check the db2diag.log file for details and ensure that the configuration file is accessible. If unable to resolve the problem, contact an IBM Service Representative for assistance.


Resolving the problem

The db2systm configuration file is created in the sqllib subdirectory of the instance directory (/home/<instance_name>/sqllib) when the instance is initially created.

To resolve this error, check following:

1. The permissions for this file should be similiar to the following: 
-rw-rw-r-- 1 <instance_name> <sysadm group> 16384 Jun 29 2013 db2systm 

2. If the db2systm file is not present then contact DB2 support for further assistance.

Product Alias/Synonym

TSM

业务热线电话:(+86)021-52765253 021-61172807      上海哲涛网络科技有限公司版权所有 © 2005-2018       沪ICP备06058430-1号

沪公网安备 31011302000898号

校睿宝,培训机构学员管理软件,教师工资计算软件,消课管理软件!

手机智慧课堂答题,短信答题,微信答题!

数据备份软件,文件数据备份软件,文件备份软件,B/S架构备份软件,分布式计算机备份软件!