- 浏览: 27135 次
- 性别:
- 来自: 北京
最新评论
When we COMMIT, all that is left to happen is the following:
• An SCN is generated for our transaction. In case you are not familiar with it, the SCN is
a simple timing mechanism Oracle uses to guarantee the ordering of transactions and
to enable recovery from failure. It is also used to guarantee read-consistency and check-
pointing in the database. Think of the SCN as a ticker; every time someone COMMITs, the
SCN is incremented by one.
• LGWR writes all of our remaining buffered redo log entries to disk and records the SCN in
the online redo log files as well. This step is actually the COMMIT. If this step occurs, we
have committed. Our transaction entry is “removed” from V$TRANSACTION—this shows
that we have committed.
• All locks recorded in V$LOCK held by our session are released, and everyone who was
enqueued waiting on locks we held will be woken up and allowed to proceed with their
work.
When we ROLLBACK,
• We undo all of the changes made. This is accomplished by reading the data back from
the undo segment, and in effect, reversing our operation and then marking the undo
entry as applied. If we inserted a row, a ROLLBACK will delete it. If we updated a row, a
rollback will reverse the update. If we deleted a row, a rollback will re-insert it again.
• All locks held by our session are released, and everyone who was enqueued waiting on
locks we held will be released.
A COMMIT, on the other hand, just flushes any remaining data in the redo log buffers. It
does very little work compared to a ROLLBACK. The point here is that you don’t want to roll back
unless you have to. It is expensive since you spend a lot of time doing the work, and you’ll also
spend a lot of time undoing the work. Don’t do work unless you’re sure you are going to want
to COMMIT it. This sounds like common sense—of course I wouldn’t do all of the work unless I
wanted to COMMIT it. Many times, however, I’ve seen a situation where a developer will use a
“real” table as a temporary table, fill it up with data, report on it, and then roll back to get rid
of the temporary data. In the next section, we’ll talk about true temporary tables and how to
avoid this issue.
发表评论
-
from string get number data using pl/sql or sql
2012-02-16 17:32 888declare @aa varchar(80),--- ... -
SQL
2012-02-15 18:01 7241.select sal salary from emp; ... -
modify ip
2012-02-10 17:45 7891.netconfig 2./etc/sysconfig/n ... -
MULTI dbwr or io slaves
2012-02-10 15:21 878thanks dukope of itpub. ... -
FAQS
2012-02-09 15:59 7531.How can I get the largest amo ... -
HOW TO STUDY ORACLE FROM Yong Huang
2012-01-18 14:48 798Assuming you want to study orac ... -
RMAN
2012-01-14 17:07 7031.components of the rman ... -
INSTANCE and CRASH RECOVERY
2012-01-12 10:12 7481.type of checkpoint full c ... -
STARTUP PFILE=
2011-12-31 14:11 11951.vi initdbs.ora spfile=&quo ... -
MANAGE TABLE
2011-12-26 16:50 5671.heap table IOT PARTI ... -
MONITOR redo size
2011-12-21 17:48 6421.set autot on stat 2.unsin ... -
What is the schema ?
2011-12-20 15:18 588A schema is a collection of dat ... -
MANAGE UNDOTABS
2011-12-19 17:15 6761.manual undo_management=ma ... -
DBA SQL
2011-12-19 15:21 4351.select a.name,b.status from v ... -
SEGMENT EXTENTS ORACLEBLOCK
2011-12-15 16:11 7881.SEGMENT: allocated fo ... -
MANAGE TABLESPACE AND DATAFILES
2011-12-13 15:28 5751. tablespace,segment,extent,bl ... -
ORACLE NET
2011-12-12 09:49 6841.net_service_name: servive ... -
SQLPLUS TIPS
2011-12-09 17:51 9031.SQLPLUS : a tool that execute ... -
ORACLE ENVIRONMENT VARIABLES
2011-12-09 17:15 652ORACLE_HOME ORACLE_SID : or ... -
Exam Test1
2011-12-09 16:18 6341.utl_file_dir: indicate the di ...
相关推荐
`BEGIN TRAN`、`COMMIT TRAN` 和 `ROLLBACK TRAN` 是SQL Server中用于管理事务的主要命令。下面将详细解释这些命令的用法和作用。 1. `BEGIN TRAN`: `BEGIN TRAN` 语句用于启动一个新的事务。当开始一个事务时,...
简单数据库 这是一个用 Java(版本 7)实现的简单数据库。 它能够执行数据命令(SET、GET、UNSET、NUMEQUALTO、END)和事务命令(BEGIN、ROLLBACK、COMMIT)。 可以在此处找到更多详细信息: :
RollBack Rx Pro是一款高效且强大的Windows系统多点还原软件,主要功能是为用户提供方便快捷的系统状态恢复解决方案。它能够创建系统快照,以便在系统出现故障或受到病毒攻击时,用户可以迅速将系统恢复到之前的正常...
RollBack Rx 10.3 破解版 最好的还原软件,支持Win8.1系统,安装即已注册。
RollBack Rx v11.1 正式永久使用无限制,内包括正式版本SN(注册码) 非破解版本。
Ansible-rollback.zip,在capistrano styleansistrano中负责回滚脚本应用程序(如php、python、ruby等),ansible是一个简单而强大的自动化引擎。它用于帮助配置管理、应用程序部署和任务自动化。
"雨过天晴RollBack 中英文版"是一个专注于数据保护和系统恢复的软件套装,包含了RollBack RX 10.2以及雨过天晴专业版两个主要组件。这两个工具都是为了帮助用户在遇到系统问题或者意外数据损失时,能够快速有效地...
SQL(Structured Query Language,结构化查询语言)是一种用于管理和操作关系型数据库的标准编程语言。它被广泛用于访问和修改数据库中的数据...8. **事务控制(Transaction Control)**:使用`BEGIN`、`COMMIT`和`ROLL
1. 错误处理:事务处理中应包含错误捕获机制,如果在事务过程中发生错误,应使用ROLLBACK命令回滚事务,以保持数据库一致性。 2. 数据库连接管理:确保在完成所有操作后关闭数据库连接,以释放系统资源。 3. 优化SQL...
2. 手动提交模式:通过执行`BEGIN`或`START TRANSACTION`语句,或显式设置`SET autocommit=0`,可以进入手动提交模式,在这个模式下,需要程序员手动执行`COMMIT`或`ROLLBACK`来控制事务的提交或回滚。 在事务的...
RollBack Rx是一款功能强大的优秀系统恢复还原软件,是全面的Windows系统还原解决方案,程序可以帮助用户和IT管理员轻松地在几秒钟内恢复他们的个人电脑到任何以前的状态。 系统出错或遭受病毒攻击之后,即使你清理...
注册机 雨过天晴海外版
这可能涉及到事务处理、错误处理和回滚(Rollback)机制,这些都是在数据库编程中常见的概念。 在压缩包内的文件名中,"gmx.pbl"是PowerBuilder的库文件,通常包含了一系列的窗口、对象和函数定义。开发者可能会在...
Win系统多点还原软件(RRx)RollBack Rx Pro V10.7带序列号版,可以对系统进行快照,多点记录,随时还原到记录点,快速还原
强大电脑系统恢复还原软件(RollBack Rx)是一款功能强大的优秀系统恢复还原软件,是全面的Windows系统还原解决方案,程序可以帮助用户和IT管理员轻松地在几秒钟内恢复他们的个人电脑到任何以前的状态。 系统出错或...
RollBack.Rx.Pro.11.1 (crack)RollBack.Rx.Pro.11.1 (crack)RollBack.Rx.Pro.11.1 (crack)
雨过天晴注册机(Rollback Rx 9.0 注册工具) 1.安装雨过天晴电脑保护系统专业版 V1.0.11.2.20100128,重启完成DOS下安装. 2.断开网络,注册机算出注册码. (机器码无法复制见这里X:\Program Files\Yuguo\netmsg.txt...
1、用begin,rollback,commit来实现begin 开始一个事务rollback 事务回滚commit 事务确认 2、直接用set来改变mysql的自动提交模式MYSQL默认是自动提交的,也就是你提交一个QUERY,它就直接执行!我们可以通过set ...
理解不同类型的提交方式以及何时使用`COMMIT`和`ROLLBACK`是管理数据库事务和确保数据完整性的基础。在实际操作中,应根据具体需求和数据库配置来决定何时使用`commit`,以达到最佳的数据管理效果。