oracle中rollback的使用

2021-06-08 18:38:13 字數 1177 閱讀 8113

----》rollback使用

sql> create table tbl(name varchar2(10));

table created.

sql> insert into tbl values('zhiqiao');

1 row created.

sql> select * from tbl;

name

----------

zhiqiao

sql> delete tbl;

1 row deleted.

sql> select * from tbl;

no rows selected

sql> rollback;

rollback complete.

----》沒有提交(commit)的資料刪除後無法rollback

sql> select * from tbl;

no rows selected

sql> insert into tbl values('zhiqiao');

1 row created.

sql> select * from tbl;

name

----------

zhiqiao

sql> commit;

commit complete.

sql> delete tbl;

1 row deleted.

sql> select * from tbl;

no rows selected

sql> rollback;

rollback complete.

----》提交(commit)了的資料刪除後可以使用rollback恢復

sql> select * from tbl;

name

----------

zhiqiao

sql> delete tbl;

1 row deleted.

sql> commit;

commit complete.

sql> rollback;

rollback complete.

----》刪除資料後提交(commit)則無法使用rollback恢復

sql> select * from tbl;

no rows selected

oracle 回滾演示 rollback演示

sql lock table state in exclusive mode table s locked.sql insert into state state cd,state name values nm neimenggu 1 row created.sql select from stat...

oracle 回滾演示 rollback演示

sql lock table state in exclusive mode table s locked.sql insert into state state cd,state name values nm neimenggu 1 row created.sql select from stat...

佇列Rollback的設計

有乙個佇列包含了n個block,每個block是佇列中的乙個元素。block很大,乙個block中可以容納m個item m 1 這個佇列的基本使用模式就是 不斷的有item過來,往block裡面填充,一旦block滿,就建立乙個新的block,後繼item都填往新block。rollback的定義 ...