Solved

DROP PROCEDURE fails with SQL0911N  Reason code "68".  SQLSTATE=40001

Posted on 2014-01-16
2
1,483 Views
Last Modified: 2014-01-23
I'm trying to drop a very large, complex stored procedure, which calls other stored procedures. I keep getting a lock error and if fails

DB21034E  The command was processed as an SQL statement because it was not a
valid Command Line Processor command.  During SQL processing it returned:
SQL0911N  The current transaction has been rolled back because of a deadlock
or timeout.  Reason code "68".  SQLSTATE=40001

We're running DB2 v9.7 on AIX.

Why can't I drop the procedure? We plan on recreating the procedure. Should I use "CREATE OR REPLACE PROCEDURE" instead of two discrete steps of DROP then CREATE?

Sorry, I don't deal much with stored procedures and I'm just trying to help out.

Thanks!
0
Comment
Question by:data_bits
2 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 39786329
yes, if you want to "recreate" anyhow, don't drop it. with the drop, you are loosing all permissions assigned to the procedure, by using the create or replace you will retain any permissions granted to roles/users.
0
 
LVL 25

Accepted Solution

by:
Tomas Helgi Johannsson earned 500 total points
ID: 39790508
Hi!

The reason why you cant drop a stored procedure and are getting -911 error is due to that another application/session is using the procedure.
Use db2top to find the session executing the SP and terminate it. Then you will be able to
drop the procedure.

Regards,
    Tomas Helgi
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question