Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I know how to check the DB is in a lock state or not, but my question is how to find out which query caused the lock on table /db.

IS there any log file getting created if something unexpected happens to the database?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

List the current database activities:

db2top -d [dbname]

This command will show you database locks:

db2pd -d [dbname] -lock wait 
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.