SQL Packages on the AS400??

CNCOneWorld

Active Member
I recently had an issue with a UBE having sequencing issues. The problem was when I submitted the UBE to the server(ISeries) the data sequencing was not in the proper order, However when I ran it locally the DAta sequencing was fine. After looking at the logs and finding nothing I deleted the SQL package for the RUNBATCH and reran the UBE. It worked fine. We currently have a robot job to delete the SQL packages on the weekends. My questions are:
1.What are the SQL packages?
2.Can we stop the system from saving them at all?
3.Is this a typical occurance.
Thank you for any insight you can give me on this questions.

Colin
XE 6 SP22_Q1
 
Colin,

1. The AS/400 uses SQLPKGs as a time saving device for repeated SQL statements. The system determines the best method for accessing the data based on the SQL statement, and then saves that information in the SQLPKG. If a later, identical SQL statement comes along, the system simply re-uses the access path/method from the earlier SQL statement. This saves the query optimizer time executing the SQL statement, by not having to determine the best access path all over again. Works nicely for UBEs but not so nicely for SQL statements generated by ad hoc queries (like those generated when you use QBE).

2. In your ODBC connections setup, there is a check box on the Packages tab: Enable extended dynamic (package) support. Uncheck the box to disable SQL packages for a particular ODBC connection (like Business Data - PROD). There may or may not be a performance impact from disabling SQL packages. There are other threads that discuss the impact of disabling SQL packages. In short, your mileage may vary. Also, it appears UBEs that execute on the server will create SQL packages regardless of your ODBC settings, because they're not using ODBC settings. The jury is still out on how to disable this behavior, if it's possible at all.

3. Problems with SQL packages can occur if the SQLPKG becomes full or if there is a change to one or more of the tables. In our experience, we've had issues with reports over custom tables when our developers have made changes to the table structure. There are probably other reasons that SQL packages become unusable.

On our system, we delete SQL packages weekly as well, but you could easily delete just the R* SQLPKGs every night. This would likely slightly impact performance the first time a UBE is executed, but should not after that unless data selection is changed. But deleting them nightly would prevent the problem you discovered.

Hope this is helpful.
 
We don't delete the packages unless a problem is perceived but we delete the packages prior to putting down a new service pack (SP) or new operating system release (per IBM recommendation). Grant
 
Check the post "V5R2 and SQL Packages" - evidently there is an issue with V5R2 and V5R3 that corrupts the SQL Packages, and demands that a regular cleansing occurs. There is also a PTF mentioned in the thread that helps with this issue.

In effect, SQL Packages can become corrupted, and even dropping and recreating a table will not eliminate the SQL Package. Therefore, SQL Packages should be removed on a weekly basis (according to Peoplesoft) or the issue should be fixed by an IBM PTF.
 
We have turned off SQLPKGS for very large corporations who kept having them reach the maximum size and so far, they have either had the same performance (no difference) or an improvement.
One of the first clients we did this for was on V5R1 and they have a Zero Down Time policy. The SQLPKGs in PRODDTA could not be easily deleted because they were always in use, so this caused a major headache...they would either fill up and performance was degraded, or they became corrupted and caused even more of a headache.
They have now been "package free" for over 1.5 years (other than the UBE packages).
For the UBE SQLPKGS (R*) we just added a weekly, after-hours jobscde that deletes them.

Jennifer Sharma, Sr. Technical Specialist
AELLIUS Professional Research & Consulting
www.aellius.com
 
Back
Top