Toad World® Forums

Forgot to commit in oracle

Hi, i am actually new to oracle. My case is I ran delete statement but forgot to commit, when check the data its not deleted. Then I try to run the delete statement again but its hanging like its lock. What should I do now, please help me..

It sounds like you are using 2 different sessions, each trying to delete the same rows.

Go back to your first session and commit there. That will cause your 2nd session to become unlocked. The 2nd session will then not delete any rows since the first session already did it.

Ok i understand. But actually i deleted the 1st time was yesterday, and today I tried to delete again. Can you explain more about the session, how can I go back to the 1st session and commit. Sorry if my question sounds really silly.

Oh. You can't go back to a closed session. If you've closed the session then that's not what's causing the lock (unless someone else deleted and forgot to commit and left the session open).

Toad has a window called "Session Browser" (you'll need DBA privs to use it), but there you could see the session that is holding the lock.

And it doesn't have to be that both sessions are doing a delete. First session could be updating the rows in question. The main thing is that changes are being made to the same rows in both sessions, and first one did not commit (or rollback or disconnect) before 2nd session attempted changes.