OCP-1Z0-052-V8.02-172题

来源:互联网 发布:千兆端口无线路由器 编辑:程序博客网 时间:2024/05/17 04:35

172. The session of user SCOTT receives the following error after executing an UPDATE command on

the EMP table:

ERROR at line 1:

ORA-00060: deadlock detected while waiting for resource

On investigation, you find that a session opened by user JIM has a transaction that caused the deadlock.

Which two statements are true regarding the session of SCOTT in this scenario? (Choose two.)

A.The session is terminated after receiving the error and JIM can continue with his transaction.

B.SCOTT should perform a COMMIT or ROLLBACK to allow JIM to continue with his transaction.

C.The session is rolled back after receiving the error and JIM can continue with his transaction.

D.SCOTT has to reexecute the last command in the transaction after he commits the transaction.

Answer: BD

答案解析:

参考:http://blog.csdn.net/rlhua/article/details/12652569

死锁是锁定冲突的特殊示例。两个或多个会话等待由对方锁定的数据时,就会发生死锁。

因为每个会话都在等待另一个会话释放锁定,所以任何一个会话都不能完成事务处理,也不能解

决冲突。Oracle 数据库会自动检测死锁并终止语句,同时显示错误消息。

更正这种错误的适当做法是执行提交或回退,这样做会在一个会话中释放任何其它锁定,以便其它会话可继续完成其事务处理。

scott必须提交或回退,才能更正检测到的死锁错误。如果执行提交,则必须重新提交第二次更新才能完成事务处理。如果执行回退,则必须同时重新提交这两个语句才能完成事务处理。

原创粉丝点击