Deadlock Detection (338)

Oracle automatically detects deadlock situations and resolves them by rolling back one
of the statements involved in the deadlock, thereby releasing one set of the conflicting
row locks. A corresponding message also is returned to the transaction that undergoes
statement-level rollback. The statement rolled back is the one belonging to the
transaction that detects the deadlock. Usually, the signalled transaction should be
rolled back explicitly, but it can retry the rolled-back statement after waiting.

Note: In distributed transactions, local deadlocks are detected
by analyzing wait data, and global deadlocks are detected by a time
out. Once detected, nondistributed and distributed deadlocks are
handled by the database and application in the same way.

Deadlocks most often occur when transactions explicitly override the default locking
of Oracle. Because Oracle itself does no lock escalation and does not use read locks for
queries, but does use row-level locking (rather than page-level locking), deadlocks
occur infrequently in Oracle.

死锁检测
1. 当遇到死锁时,Oracle将自动回滚检查到死锁的语句
2. 当事务显示的覆盖了默认的锁方式时,更容易发生死锁 . 因为Oracle不会进行锁升级,
不会在查询时使用读锁 , 而使用行级别锁,这样发生死锁的现象就少见
注意 :
对于分布式事务,Oracle 通过分析被等待的数据来检测本地死锁,而全局死锁则是根据超时来检测的
无论分布式或非分布式死锁,在数据库及应用程序中的处理方法都是相同的

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10599713/viewspace-990926/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10599713/viewspace-990926/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值