扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:crystal 来源:yesky 2007年10月23日
关键字: ORACLE
在本页阅读全文(共3页)
语句 | 用途 |
Commit | 完成事务,数据修改成功并对其他用户开放 |
Rollback | 撤销事务,撤销所有操作 |
rollback to savepoint | 撤销在设置的回滚点以后的操作 |
set transaction | 响应事务或语句的一致性;特别对于事务使用回滚段 |
BEGIN UPDATE checking SET balance=balance-5000 WHERE account='Kieesha'; INSERT INTO checking_log(action_date,action,amount) VALUES (SYSDATE,'Transfer to brokerage',-5000); UPDATE brokerage SET cash_balance=cash_balance+5000 WHERE account='Kiesha'; INSERT INTO brokerage_log(action_date,action,amount) VALUES (SYSDATE,'Tracfer from checking',5000) COMMIT EXCEPTION WHEN OTHERS ROLLBACK END |
BEGIN INSERT INTO ATM_LOG(who,when,what,where) VALUES ('Kiesha',SYSDATE,'Withdrawal of $100','ATM54') SAVEPOINT ATM_LOGGED; UPDATE checking SET balance=balance-100 RETURN balance INTO new_balance; IF new_balance<0 THEN ROLLBACK TO ATM_LOGGED; COMMIT RAISE insufficient_funda; END IF END |
ROLLBACK TO ATM_LOGGED; ROLLBACK TO SAVEPOINT ATM_LOGGED; |
SET TRANSACTION ISOLATION LEVEL READ COMMIT; SET TRANSACTION ISOLATION LEVEL READ COMMIT |
SET TRANSCATION READ ONLY |
SELECT(没有FOR UPDATE子句) LOCK TABLE SET ROLE ALTER SYSTEM ALTER ALARM |
SET TRANSACTION USE ROLLBACK SEGMENT rb_large; |
rb_large(initial 100M minextenta 2) rb1 (initial 1M next minextents 5) rb2 (initial 1M next minextents 5) rb3 (initial 1M next minextents 5) rb4 (initial 1M next minextents 5) rb5 (initial 1M next minextents 5) rb6 (initial 1M next minextents 5) rb7 (initial 1M next minextents 5) rb8 (initial 1M next minextents 5) rb9 (initial 1M next minextents 5) rb10 (initial 1M next minextents 5) |
SET TRANSACTION USE ROLLBACK SEGMENT rb_large |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者