So my posts on speific error codes that are frequently seen in commerce databases, and what to do about them seem pretty popular. My #1 and #2 posts in # of views (after “Home Page” ) are ones that describe specific errors and what to do about them. So this was one of the areas I came up with when thinking about that type of post.
How this error looks
This error happens most frequently with BODL or with custom code that is meant to do something with a large number of rows, usually using cursors in a stored procedure or statement handles in a Java application. At least once every six months a developer comes to me with this error. It typically looks something like this:
2010-04-23 15:32:56,675 [Thread-263069] INFO - com.ibm.db2.jcc.b.SqlException: DB2 SQL Error: SQLCODE=-805, SQLSTATE=51002, SQLERRMC=NULLID.SYSLH21E 0X5359534C564C3031, DRIVER=3.50.152 2010-04-23 15:32:56,675 [Thread-263069] INFO - at com.ibm.db2.jcc.b.wc.a(wc.java(Compiled Code))
One of the important things to look for beyond the “SQLCODE=-805” is the package name – in this case “NULLID.SYSLH21E”. You may also be presented with the error in this format:
SQL0805N Package NULLID.SYSLH21E was not found.
The package name will always start out with either NULLID.SYSLH or NULLID.SYSLN. If it is something completely different, then the error being encountered is NOT the one being discussed here(and you may just need to do a simple bind on db2ubind and/or db2cli). To get a bit over technically detailed, the H means the cursors are declared with hold and the N means they are declared without hold. There will then be three numbers. The first represents the isolation level, and is one of the following:
- 0 – NC
- 1 – UR
- 2 – CS
- 4 – RS
- 8 – RR
The Band-Aid
cd ~/sqllib/bnd db2 connect to dbname db2 bind @db2cli.lst blocking all grant public clipkg 30
[…] I mentioned earlier, what I want, or what I am trying to accomplish.. This is what I found based on my research so far: By default DB2 creates 3 packages when you do the cli binds, these three packages together provides the capability of a total of 1344 open cursors. In my case due to some funky application code, the 1344 open cursor limit is exhausted and I was looking to find ways to increase them… ( this is what I was trying to accomplish) The quick fix is to increase the number of packages and thereby increase the total limit on the number of open cursors.. The packages have a limit, you cannot take that higher than 30 which represents 11712 concurrently open cursors… The real fix is to come from the application folks.. Do they really need so many open cursors? A code fix is in order: Check this out: This decoded the problem I faced.. SQL0805N Package “” was not found. […]
[…] my blog entry on this issue for more information and a link to a IBM tech note on the […]
[…] entry by DB2 DBA Ember Crooks is stellar with regards to binding and what it means. She also wrote a previous entry on packages not being found and when to up the CLIPKG number for the binds and what that means. These articles […]
Hello,
“db2 bind @db2cli.lst blocking all grant public clipkg X” <== where can I find the current value of X before increasing it?
Thank you.
There may be an easier way, but this will get it for you. In the example output below, I have the default of 3:
db2 "select substr(PKGNAME,1,6) as pkgname, count(*) from syscat.packages
where pkgschema='NULLID'
and pkgname like 'SYSL%'
group by substr(PKGNAME,1,6)"