| This is a known limitation in version 7 and, unfortunately, due to design considerations it cannot be resolved in the current version. This sometimes occurs when the operating system does not allow DB2 to remove the directory /sqllib/function/routine/sqlproc/<db> for a given database. This operation is attempted during the first connect after a database restore to ensure that the version of the procedures stored in the catalogs is the same as the version of the procedures in the file system. After the directory is removed, DB2 will recreate the libraries from the image stored in the catalogs. The user does not need to either recreate the procedures after the restore or manually save the sqlproc directory. DB2 will automatically take care of that.
The most common reason for this to fail is that a db2dari process (the ones used to execute SQL procedures) is holding a lock on a library stored under /sqllib/function/routine/sqlproc/<db>/<schema>. The two possible workarounds for this problem are:
- Run with KEEPDARI set to NO. This has an impact on stored procedure performance because a new process has to be created every time a procedure is called.
- Restart the instance (db2stop force; db2start). When db2 is stopped, the db2dari processes are killed and, therefore, there should be no process holding a lock on stored procedure libraries.
Occasionally, some db2dari process may not killed during the db2stop. If that is the case, the db2dari can be killed by a sysadm. In addition to killing the runaway db2dari, the sysadm should also execute "slibclean" to make sure the OS frees the locks on the libraries. SLIBCLEAN is used to remove any currently unused modules in kernel and library memory. It unloads all the object files with load and use counts of 0 and frees up memory used by shared libraries with no references. If there is no db2dari after the db2stop, the first connection after db2start should succeed.
I hope this will solve the problem. |
|
Farah Shire
Database Administration - IBM Global Services
[EMAIL PROTECTED]
(704) 594-8241 or T/L 794-8241
Pager 1-800-759-8352 PIN 1875048#
(NONE OF US IS GOOD AS ALL OF US!!!)