网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

oracle怎么回滚数据 oracle回滚是什么意思

oracle 删除数据提交怎么回滚

execute执行后

成都创新互联公司是一家专业从事网站设计、做网站、网页设计的品牌网络公司。如今是成都地区具影响力的网站设计公司,作为专业的成都网站建设公司,成都创新互联公司依托强大的技术实力、以及多年的网站运营经验,为您提供专业的成都网站建设、营销型网站建设及网站设计开发服务!

可以回滚

commit提交后

不可以回滚

其实oracle提交数据是分两步操作的,第一步execute执行,第二步commit提交。对应的pl\sql也是要先点execute执行,执行后再点commit提交。

但是

commit提交后

可以用闪回查询恢复原来的数据

因为oracle会将近期的数据保存到快照中

如:

select

*

from

table_1

as

of

timestamp

to_timestamp('20080606

20:00:00','yyyymmdd

hh24:mi:ss');

这里'20080606

20:00:00'就是你想恢复数据到哪个时间状态

table_1是数据库的表名

这样查询到的数据就是执行更新操作之前的数据

oracle 提交之后怎么回滚

execute执行后

可以回滚

commit提交后

不可以回滚

其实Oracle提交数据是分两步操作的,第一步execute执行,第二步commit提交。对应的PL\SQL也是要先点execute执行,执行后再点commit提交。

但是

commit提交后

可以用闪回查询恢复原来的数据

因为oracle会将近期的数据保存到快照中

如:

SELECT

*

FROM

TABLE_1

AS

OF

TIMESTAMP

TO_TIMESTAMP('20080606

20:00:00','YYYYMMDD

HH24:MI:SS');

这里'20080606

20:00:00'就是你想恢复数据到哪个时间状态

TABLE_1是数据库的表名

这样查询到的数据就是执行更新操作之前的数据

oracle大事务回滚注意事项

1、首先在执行Update时,Oracle就地更新,如出现原block空间不足的情况,通过link的方式链接至新block上。

2、其次PG的Update,不是原地更新,而是保留原有数据,通过新增新的tuple保存新增数据,原有数据通过Vacuum机制清理。

3、最后Vacuum机制需要满足MVCC的要求,在某些情况下,不会清理垃圾数据,在事务繁忙的时候导致会导致数据表空间不断增长。

oracle 提交数据,怎么回滚

execute执行后 可以回滚

commit提交后 不可以回滚

其实Oracle提交数据是分两步操作的,第一步execute执行,第二步commit提交。对应的PL\SQL也是要先点execute执行,执行后再点commit提交。

但是 commit提交后 可以用闪回查询恢复原来的数据 因为oracle会将近期的数据保存到快照中 如:

SELECT * FROM TABLE_1 AS OF TIMESTAMP TO_TIMESTAMP('20080606 20:00:00','YYYYMMDD HH24:MI:SS');

这里'20080606 20:00:00'就是你想恢复数据到哪个时间状态 TABLE_1是数据库的表名 这样查询到的数据就是执行更新操作之前的数据

Oracle8i中回滚段使用和ORA-1555

回滚段中保存的回滚数据有 个作用 一致读和回滚 回滚段是由连续block组成的区间extent组成 回滚段有顺序的循环的使用这些区间 当当前区间写满的时候 oracle移向下一个区间 如一个回滚段有 个区间A B C D;当区间C被写满的时候 oracle将写区间D 而当D写满的时候 oracle将尝试重新写区间A 这样循环的有顺序的使用区间

事务必须将回滚信息写到回滚段中 事务的当前新产生的回滚信息写在该回滚段的位置叫做回滚段的head 而在该回滚段上最早发生的尚未提交的事务最早产生的回滚信息所在位置叫做回滚段的tail 当前区间写满的时候 oracle移动head到下一个区间

i时每个事务只能使用一个回滚段 Oracle会根据回滚段workload 平均将事务分配给各个回滚段 在回滚段使用上的一些规则

一个事务只能使用一个回滚段

多个事务可以共用一个区间 但Active的事务不能共用一个block

回滚段的current extent写满的时候 回滚段的Head不能够移动到回滚段tail所在的区间

区间总是被有顺序的循环的时候 当head移动的时候 不会跳跃区间 只能移动到下一个区间

如果head不能够使用下一个区间(如tail在下一个区间) 将会分配一个新的区间extent 并将新区间extent插入到这个循环使用的extent圈中 这叫做回滚段的扩展

ORA snapshot too old主要是在一致读和延迟块清除delay block cleanout的时候产生

[参考]一致读的步骤

Read the Data Block

Read the Row Header

Check the Lock Byte to determine whether theres an ITL entry

Read the ITL entry to determine the Transaction ID (Xid)

Read the Transaction Table using the Transaction ID If the transaction has been mitted and has a System Commit Number less than the querys System Change Number update the status of the block (block cleanout) and start over at step

第 步细分

IF 在Transaction Table 中根据Transaction ID 找到transaction

IF transaction 已经mit

IF query scnmit scn

则接受该块 进行clean out 返回

ELSEIF query scn

则进行一致性读 从第 步向后执行

ELSEIF transaction 没有mit

也进行一致性读 从第 步向后执行

ELSEIF 在Transaction Table 中没有找到transaction(undo header中的transaction slot被覆盖了 也说明事务已经提交 因为只有提交后所在的transaction slot才能被覆盖 这样query scn则去比较control scn 在该回滚段上control scn以前的transaction都已经被提交 也就是事务表中所能找到的最小的mit scn了)

IF query scn

则无法知道query scn和mit scn得大小关系 出现ORA 错误

IF query scncontrol scn

则query scn肯定mit scn

则接受该块 进行clean out 并将block 中ITL标记上 U 表示 upper bound mit 并返回

Read the last undo block (Uba)

Compare the block transaction ID with the transaction table transaction ID If the Transaction ID in the undo block doesnt equal the Transaction ID from the Transaction Table then issue ORA Snapshot Too Old 表示回滚段中回滚信息被覆盖 无法为一致读提供必需的before image

If the Transaction IDs are identical make a copy of the data block in memory Starting with the head undo entry apply the changes to the copied data block

If the tail undo entry (the actual first undo entry in the chain or the last in the chain going backwards!) indicates another data block address read the indicated undo block into memory and repeat steps and until the undo entries dont contain a value for the data block address

When theres no previous data block address the transaction has been pletely undone

If the undo entry contains:

a a pointer to a previous transaction undo block address read the Transaction ID in the previous transaction undo block header and read the appropriate Transaction Table entry Return to step

b an ITL record restore the ITL record to the data block Return to step

出现 的时候 首先判断是哪个原因导致 可以设置event 如果因为transaction slot被覆盖导致 则增加回滚段数目 如果因为回滚信息被覆盖 则增加回滚大大小 错误比较复杂 通常需要考虑很多问题

event = trace name processstate forever level

lishixinzhi/Article/program/Oracle/201311/17091


本文标题:oracle怎么回滚数据 oracle回滚是什么意思
网站链接:http://bjjierui.cn/article/hgjihc.html

其他资讯