devxlogo

Releasing Database Locks

Releasing Database Locks

Question:
How can I release all existing database locks for all the sessions a specific user has started?

Answer:
The easiest way probably is to log that user out. Otherwise, you can find out which locks are out there by typing onstat -k. Find the address of the owner of the lock under the “owner” column.

Then run an onstat -u and look for the address of your culprit owner. Look under the “sessid” column to get the session id for the user holding the lock. Then do an onmode -z with the session id, which will kill that user’s session (and zap the lock).

See also  5 Ways to Improve Customer Experience
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist