Tuesday, May 5, 2009

EXIT from sqlplus prompt without commit results pending changes are automatically committed

It is often happen to be with anyone who has been working on oracle databases i.e. forgetting committing transaction or roll back changes that we made in current session and quitting with exit command from SQLPLUS prompt without having idea what it make an affect on db. It happens to me a couple of time but never faced any problems as commit take place automatically but things will go wrong when we supposed to rollback changes. Be careful
It always good to check whether there are any pending changes to commit or to rollback before we actually quitting from SQLPLUS prompt because when we exit from SQLPLUS without thinking of those commit and rollback issues, we end up getting those changes permanent in database as EXIT command makes pending changes are automatically committed. Be caution
Exiting by closing the SQLPLUS window by clicking cross mark at right corner of window without issuing an EXIT command will cause rollback get performed and moreover Network failures can also cause ROLLBACK to occur. Quit is similar to exit i.e. makes pending changes are automatically committed.

1 comment: