A transaction is demarkated by savepoints or commit or rollback not by statements.
A transaction ends when any of the following occurs:
- You issue a COMMIT or ROLLBACK (without a SAVEPOINT clause) statement.
- You execute a DDL statement (such as CREATE, DROP, RENAME, ALTER). If the current transaction contains any DML statements, Oracle first commits the transaction, and then executes and commits the DDL statement as a new, single statement transaction.
- A user disconnects from Oracle. (The current transaction is committed.)
- A user process terminates abnormally. (The current transaction is rolled back.)
exit commits all pending changes by default, logs out of Oracle, terminates SQL Plus and returns control to the operating system. If we wanted to exit SQL Plus without committing, we should have either issued a rollback then an exit or just simply exit rollback. Note that both SQL Plus commands exit and quit are identical and have the same behavior.
EXIT defaults to COMMIT the current transactions.
Autocommit causes a commit to be issued after every statement.