Pick a big table. Select all rows, ordered by a column that isn't in the index. Er, that's it. Note: this won't simulate a sort, it will really do one...
Deadlock.
DB2 has quite sophisticated deadlock detection, so it's quite hard to engineer a deadlock. Are you trying to create a deadlock that DB2 will detect and break, or one that it won't see?
gbag,
I work on a mainframe and to force a deadlock I tend to go into one of the packages available (File Aid for DB2, QMF, Insight etc.) and take an update lock on a table.
Running an app against that table causes the deadlock condition.
It depends what your envirnoment is, but I'm sure you get the idea.
Thanks Stevexff & MarcLodge for your suggestions.
I really appreciate your time and suggestions.
I want to simulate the sort and want it to be driven to disk to create heavy io. I am having the following steps:
1. create a huge table without index.
2. Reduce the bufferpool size.
3. select all the rows on a character column.
I believed that this will drive the sort to disk. But this did not. Do I miss any steps.
Regarding deadlock, I am seeing lot of deadlocks from the application we have. But I want to simulate that kind of deadlock. Means, when I run my process/sql, db2 should say "a deadlock has been detected".
Any help.
Thanks in advance.
gBag.
gbag,
db2 will return an sqlcode of -911 to the application which indicates a deadlock has been detected, whilst also writing certain information to the log. I'ts up to the application to check the sqlcode and return the type of message that you are referring to. DB2 cannot do it, as DB2 does not know whether the app considers this an abend situation, or just a try again situation.
Marc
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.