End of a Transaction
A transaction ends when any of the following actions occurs:
-
A user issues a
COMMIT
orROLLBACK
statement without aSAVEPOINT
clause.In a commit, a user explicitly or implicitly requested that the changes in the transaction be made permanent. Changes made by the transaction are permanent and visible to other users only after a transaction commits. The transaction shown in Figure 10-1 ends with a commit.
-
A user runs a DDL command such as
CREATE
,DROP
,RENAME
, orALTER
.The database issues an implicit
COMMIT
statement before and after every DDL statement. If the current transaction contains DML statements, then Oracle Database first commits the transaction and then runs and commits the DDL statement as a new, single-statement transaction. -
A user exits normally from most Oracle Database utilities and tools, causing the current transaction to be implicitly committed. The commit behavior when a user disconnects is application-dependent and configurable.
上面说明当用drop等ddl语句,会在drop之前和之后隐式的发出commit语句。
A rollback of an uncommitted transaction undoes any changes to data that have been performed by SQL statements within the transaction. After a transaction has been rolled back, the effects of the work done in the transaction no longer exist.
而只有没有commit的语句可以rollback。
所以当drop table之后 ,rollback并不起作用
如果想恢复drop的表可以用flashback技术,参考http://blog.csdn.net/wyxz126/article/details/8697255