If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > DB2 connect SQL1042C error

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: May 2012
Posts: 2
DB2 connect SQL1042C error

When I give DB2 CONNECT command I get the error saying "SQL1042C An unexpected system error occurred". The most weird thing is this issue is intermittant.

sqlcode: -1042; sqlstate: 58004; DB2 connect command: connect to dbname user db2admin using password; My DB2 version is: DB2/NT64 9.5.0
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: Apr 2012
Posts: 569
When you get this error again, note the timestamp, then look in db2diag.log for lines around the same timestamp , and also look in eventvwr for events around the same timestamp.

It is unwise to stay on v9.5.0 - for many reasons, consider testing a more recent fixpack...
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: May 2012
Posts: 2
The most annoying thing is I can't find db2diag.log in my directory or on the server. There is one on the server but it doesn't have any entry for the past 2 months ...

Is there any other way I could debug this issue?

Also the time I started writing this reply I got connected to the server and may be tomorrow I can't. There is no definite time pattern of when this problem happens again.
Reply With Quote
  #4 (permalink)  
Old
Registered User
 
Join Date: Apr 2012
Posts: 569
(for DB2 v9.5)

In a "db2cmd.exe" window on your Windows based DB2-server, use

db2 get dbm cfg | find /i "DIAGPATH"

If the value is blank, the the default location for DB2 V9.5 on Windows depends on the windows version.

Windows XP , Windows 2003 Server:
C:\Documents and Settings\All Users\Application Data\IBM\DB2\DB2COPY1\DB2

Windows Vista , Windows 2008 Server and higher
C:\ProgramData\IBM\DB2\DB2COPY1\DB2

If the value is not blank, then the directory path needs to exist, and the account that runs the db2instance has to have full rights to this path. Verify this manually (use "runas" and test out writing the file).

If this is a production server, be sure to have a working db2diag setup, otherwise it is an unsupportable environment. The two symptoms might be connected...

Solve the db2diag.log issue first.
Reply With Quote
  #5 (permalink)  
Old
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 2,361
The easiest way to find db2diag.log on Windows is to use "db2diag -A".
Reply With Quote
  #6 (permalink)  
Old
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 2,158
we have a similar problem with db2 9.5 fp8 on p/linux and performance manager
opm is trying to get a snapshot and gets this error
[17:10:46.285][19]Terminating :Error while taking history snapshot. PMGETLIST failed, rc=-1042: snapproc.c 5021 -1042 QL1042C An unexpected system error occurred. SQLSTATE=58004
this for only 1 database in this instance (we have more - and monitored)
no entry in diag log either..
__________________
Best Regards, Guy Przytula
Database Software Consultant
Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
  #7 (permalink)  
Old
Registered User
 
Join Date: Apr 2012
Posts: 569
przytula_guy you might need a separate thread to progress your -1042 symptom because these can happen for many different and unrelated reasons.

Most often, the operating system returned an error to DB2 - so it's necessary to find what that error was.

In your case if the problem re-creates easily then does increasing DIAGLEVEL to 4 even temporarily show anything?

Additionally for the timestamp fot the -1042 is there any incriminating evidence in the system error log?
Reply With Quote
  #8 (permalink)  
Old
∞∞∞∞∞∞
 
Join Date: Aug 2008
Location: Toronto, Canada
Posts: 2,361
Quote:
Originally Posted by przytula_guy View Post
we have a similar problem with db2 9.5 fp8 on p/linux and performance manager
opm is trying to get a snapshot and gets this error
[17:10:46.285][19]Terminating :Error while taking history snapshot. PMGETLIST failed, rc=-1042: snapproc.c 5021 -1042 QL1042C An unexpected system error occurred. SQLSTATE=58004
this for only 1 database in this instance (we have more - and monitored)
no entry in diag log either..

Could be IBM IC77861: WHEN THERE ARE APPLICATIONS IN ROLLBACK OR COMMIT STATE, DB2 SNAPSHOT MONITOR MAY RETURN SQL1042C ERROR - United States
Reply With Quote
  #9 (permalink)  
Old
Registered User
 
Join Date: Apr 2006
Location: Belgium
Posts: 2,158
thanks for the update
yes this apar was on my todo list (forgotten about it - when you get older....)
__________________
Best Regards, Guy Przytula
Database Software Consultant
Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
Information Server Datastage Certified
http://www.infocura.be
Reply With Quote
Reply

Tags
db2, db2 command, db2 connect

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On