oracle学习9
Posted 托马斯骨头收集
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle学习9相关的知识,希望对你有一定的参考价值。
一、事务
从一种状态到另一种状态:
比如转账:一个人的钱多了或者少了
1.COMMIT
2.ROLLBACK
3.SAVEPOINT
SELECT * from ms_brda1
(1)select count(*) from ms_brda1
(2)delete from ms_brda1 where brid=158475
select count(*) from ms_brda1
(3)savepoint a;
select count(*) from ms_brda1
(4)delete from ms_brda1 where brid=158477
select count(*) from ms_brda1
(5)savepoint b;
(6)rollback to savepoint a;
(7)rollback to savepoint b;
(8)rollback ;
(1)
(2)
(3)savepoint a;
(4)
(5)savepoint b;
(6)rollback to savepoint a;
(7)rollback to savepoint b;
上面的情况是因为没分清楚先后顺序
先设置的“保存点A”,然后设置的“保存点B”
你已经回滚到A了,已经越过B了,再想回到B是不可以的
但是可以先回到B再回到A,
(8)rollback ;
而rollback是回到最初的状态
即
这样是因为deleted与select需要手动commit
所以可以rollback到最初的状态
以上是关于oracle学习9的主要内容,如果未能解决你的问题,请参考以下文章
Oracle学习-Power Designervisio 2003Oracle sql developerOEMexpdp