Results 1 to 9 of 9
  1. #1
    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

  2. #2
    Join Date
    Apr 2012
    Posts
    680
    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...

  3. #3
    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.

  4. #4
    Join Date
    Apr 2012
    Posts
    680
    (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.

  5. #5
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,361
    The easiest way to find db2diag.log on Windows is to use "db2diag -A".

  6. #6
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,274
    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

  7. #7
    Join Date
    Apr 2012
    Posts
    680
    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?

  8. #8
    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

  9. #9
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,274
    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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •