How to release a row lock?


I am using Oracle 7.3.4.  I make use of the SQL worksheet to  submit a "select .... for update nowait" statement to lock certain rows for future update.  Suppose now, the SQL worksheet crashes after I submitted the abovve select  statement. How can I release the lock?  I found that I have got no lock manager on my db server or client.


Ans1:

As to no lock manager, that's simply not true. The lock manager is included in Oracle! If your program crashes, the background process PMON will detect the crash. It will rollback the transaction automatically, and this will remove the lock. Of course, in normal circumstances, the lock will only disappear when the client session issues a commit or rollback. As this is a select for update only individual rows are locked by it, not the complete table!



Ans2:

Locks should be dropped when the crashed session is cleaned up by PMON.

If that isn't happening try killing the session manually.

You might also want to check out the dbms_lock.release( ) procedure.



Ans3:

If you havn't done so already, you should run the DBMSLOCK.SQL script in the RDBMS directory under the SYS account to see who is holding which locks.
 
 

Hosted by www.Geocities.ws

1