View previous topic :: View next topic |
Author |
Message |
abhayasahoo Beginner
Joined: 04 Dec 2002 Posts: 8 Topics: 6
|
Posted: Sat Dec 07, 2002 3:36 pm Post subject: DB2 timestamp question |
|
|
Many times, we get an SQLCODE of -805 or-818 on BIND. Is there a way we can find the date and time from the CONTOKEN stored in DB2 catalog ?
For example, can we decode the CONTOKEN 170A36060594C259 in YYYY-MM-DD-HH.MM.SS.NNNNNN format ? This will help us in finding out when the load module was created and when the package was created. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Sat Dec 07, 2002 5:26 pm Post subject: |
|
|
abhayasahoo,
The SQL precompiler(the first step in preparing an application program) places timestamp 'y' in the DBRM, and time stamp 'x' in the parameter list in the application program for each SQL statement.At BIND time, DB2 stores the DBRM timestamp for run-time use.At run-time, timestamp 'x',for the SQL statement being processed, is compared with timestamp 'y' derived from the DBRM 'z' at BIND time.If the two timestamps do not match, the DBRM and the application program were not the result of the same precompile which will result in -818,when the program execuetes.Timestamps 'x' and 'y' are DB2 internal timestamps.They do not have an external interpretation.
check here for a rexx routine which will convert the contoken into a displayable timestamp. The time is based on the STCK so does not include leap second or GMT offset considerations. It can be usefull in determining when the failing program was pre-compiled.
Hope this helps...
cheers
kolusu |
|
Back to top |
|
|
Rajeev_jha Beginner
Joined: 20 Dec 2002 Posts: 5 Topics: 0
|
Posted: Fri Dec 20, 2002 4:46 am Post subject: |
|
|
In case you do not have Platinum you can find it using SPUFI. Execute the following query
SELECT * FROM SYSIBM.SYSPLAN WHERE NAME = 'plan name';
SELECT * FROM SYSIBM.SYSDBRM WHERE PLNAME = 'plan name';
These two queries will give you the BIND and PRECOMP date/time which you can use to compare with the load modules
thanks
Rajeev |
|
Back to top |
|
|
ST Beginner
Joined: 04 Jan 2003 Posts: 24 Topics: 12
|
Posted: Sat Jan 04, 2003 5:38 pm Post subject: |
|
|
Kolusu,
Thx for ur info reg Timestamps...But When we get Timestamp mismatch how do we fix that?
Suppose after the BIND,if the pgm is abended then do we really need to start from PRECOMPILE again? if not if we just REBIND the program then obviously we get TIMESTAMP mismatches I think..Correct me if am wrong and pls let me know the solution..
Thanks,
ST |
|
Back to top |
|
|
Rajeev_jha Beginner
Joined: 20 Dec 2002 Posts: 5 Topics: 0
|
Posted: Sun Jan 05, 2003 11:42 pm Post subject: |
|
|
Once you get the precompile time from the catalog table(SYSIBM.SYSDBRM) try to find out the compile time from your load module. There can be any one of the following reasons
1) your load library name in your JCL can be wrong may be some old library
2) the DBRM library that you have used to BIND the plan can be wrong, not the one where your DBRM was generated at the compile time
3) Or may be you have not actually done the BIND
After you know what your problem is you can just change the load module name or the DBRM library name and BIND the program |
|
Back to top |
|
|
pravinba Beginner
Joined: 05 Apr 2007 Posts: 4 Topics: 1
|
Posted: Thu Sep 27, 2007 5:21 am Post subject: Specific Doubts on Plan consistency check |
|
|
Hi,
I have read through the entire conversation on db2 timestamp and consistency token stuff.
1) It all falls in place when we consider the case where we bind our programs to a package (since its 1:1 relationship between package and program). In this case, there is only one timestamp involved (ie) only one program is involved.
Eg.,
DSN SYSTEM(XXXX)
BIND PACKAGE (PACKAGE1) -
MEMBER (PROGRAM1) -
ACTION (REPLACE) -
VALIDATE (BIND) -
ISOLATION(CS) -
RELEASE(DEALLOCATE) -
LIBRARY ('U99999.DEV.DBRMLIB')
2. When you bind program(s) to a single PLAN, its a N to 1 relationship. Each program might have a unique timestamp engraved on it when compiled.(assume that each program was compiled separately).
For eg.,
After precompile each program would have different timestamps
ProgA |
|
Back to top |
|
|
|
|