21

And while we're at it, how do I switch between autocommit and non-autocommit?

2
  • 2
    As far as I know there is no autocommit on the server side. Only on the client side. Sep 2, 2009 at 10:15
  • 3
    It seems the OP's concern was "How to find out whether my session with the oracle database has autocommit on". Half of the answer is "it is not on the DB, it is on the client". The second half is to answer how to check/change it on the various clients.
    – Florian F
    Jun 21, 2017 at 7:51

3 Answers 3

19

There is no such thing as autocommit in Oracle (server). Some client applications however default to autocommit (meaning they deliberately issue a commit between each statement). You will have to read the documentation of your application in order to determine if this is the case.

5
  • 3
    Thanks. Found it: sql*plus: SQL> show autocommit; autocommit OFF SQL> set autocommit ON; sqlpython does not seem to have this feature.
    – 0x89
    Sep 2, 2009 at 12:39
  • 4
    @0x89: SQL*Plus is only a CLIENT application, it is NOT the Oracle DB :) Sep 2, 2009 at 13:45
  • 2
    Yes, I got that after reading your answer. So I added the information how to set sqlplus to autocommit, so that people who basically just want to know how to switch sqlplus to autocommit can read it here.
    – 0x89
    Sep 3, 2009 at 21:35
  • This answer is already outdated. Now Oracle supports autocommit !
    – tnkh
    Apr 15, 2020 at 2:21
  • @tnkh: I'm not aware of an autocommit server setting. You can set your client to autocommit if you so desire, but the database has no such settings as far as I know. See for example this article by askTom. Admittedly, it was in 2012, things may have changed since. Please let us know if you find any indication that the database now supports autocommit. Apr 21, 2020 at 12:13
8

Oracle SQL Developer 4

  • Window > Preferences > Database > Advanced > check/uncheck Autocommit

Oracle SQL*Plus

SQuirreL SQL Client Version 3.7

  • File > New Session Properties > SQL tab > SQL section > check/uncheck Auto Commit SQL

Toad for Oracle Xpert 9.6.1.1

  • View > Toad Options... > Oracle > Transactions > check/uncheck Commit after every statement

SQL Workbench/J

  • Check the "Autocommit" property in the connection profile to set the connection default
  • Use SQL > Autocommit from the menu to change it dynamically
  • Use SET AUTOCOMMIT
3
  • 3
    There are probably hundreds of different tools that have an autocommit settings. Listing them here won't be helpful.
    – Jon Heller
    Aug 21, 2014 at 16:29
  • 1
    True but only 3 are widely used and SQL Developer is one of them Jan 22, 2016 at 9:17
  • I'll convert this answer to a community wiki, so that everybody can contribute. It would be nice to have a list with many tools in this post. Jan 22, 2016 at 9:20
5

Try command show autocommit from command prompt. Steps:

  • Open SQL*PLUS from command prompt in admin mode
  • Type command show autocommit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.