die Seilerwerks

Chronicling Life, Love, Linux and Oracle database administration.

sqlplus commit-on-exit?

with 4 comments

ACHTUNG: Did you know that SQL*Plus issues a COMMIT when you exit? This has nothing to do with the AUTOCOMMIT setting, which will automatically commit after every statement in sqlplus.

If you issue a graceful exit (via the “exit” or “quit” command), sqlplus will always issue a commit. However, if you were to be ungracefully disconnected, for example by closing your terminal window, then PMON will issue a rollback like it does with any other disconnected session.

Here’s a small oracle-l thread about it as well. Google also turns up an Eddie Awad post on it. Of course it turns out that this is a documented “feature”:

“Regardless of the AUTOCOMMIT setting, changes are committed when you exit SQL*Plus successfully.”

Written by Don Seiler

January 9, 2007 at 9:42 pm

Posted in Uncategorized

Tagged with ,

4 Responses

Subscribe to comments with RSS.

  1. Thanks. Exactly what I was looking for.

    Frank Kim

    August 25, 2009 at 10:05 am

  2. [...] sqlplus commit-on-exit? [...]

  3. unless you

    SET EXITCOMMIT OFF

    :-)

    Laurent Schneider

    July 22, 2010 at 3:44 am

    • set EXITCOMMIT is not a sqlplus option!

      Razvan

      October 27, 2011 at 10:16 am


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.