Jennifer Lin’s Weblog

September 19, 2008

sql*plus autocommit and exit

Filed under: SQL*PLUS — jennyca @ 3:14 am

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.

March 4, 2008

links

Filed under: SQL*PLUS — jennyca @ 4:47 am

Starting SQL*Plus

http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14357/ch3.htm#sthref718

Use sqlplus/rman可以直接修改命令和查看命令历史

http://www.linux010.cn/UniX/Shi-sqlplusrman-KeYiZhiJieXiuGaiMingLingHeChaKanMingLingLiShi-zhsw89.htm

Sqlplus doesn’t have a command history

http://linux.omnipotent.net/article.php?article_id=11901#Oracle

Blog at WordPress.com.