Quote:
Originally Posted by JAYANTA_DATTA
From a session, try to lock the particular table in exclusive mode and then from the same session run the drop statement. It should work.
|
This test is not valid... has to be done from two different sessions. I also had to turn autocommit off.
session #1:
$ db2 +c "lock table testme in exclusive mode"
DB20000I The SQL command completed successfully.
session #2:
$ db2pd -d testme -locks
Database Partition 0 -- Database TESTME -- Active -- Up 0 days 02:05:21 -- Date 10/27/2011 14:47:32
Locks:
Address TranHdl Lockname Type Mode Sts Owner Dur HoldCount Att ReleaseFlg rrIID
0x0700000040501B80 2 4141414141504161B4F02AB641 Internal P ..S G 2 1 0 0x00000000 0x40000000 0
0x0700000040501680 2 000000050000360443A821A043 CatCache ..S G 2 1 0 0x00000000 0x40000000 0
0x0700000040866B00 2 00000005000000000036000452 Row .NS G 2 1 0 0x00000000 0x40000000 0
0x0700000040501C80 2 00020004000000000000000054 Table ..X G 2 255 0 0x00003000 0x40000000 0
0x0700000040866C00 2 00000005000000000000000054 Table .IS G 2 1 0 0x00003000 0x40000000 0
$ db2 drop table testme
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
IBM DB2 9.7 for Linux, UNIX and Windows Information Center