oracle锁机制例题,ORACLE锁机制(二)

User SCOTT executes the following command on the EMP table but has not issued COMMIT,

ROLLBACK, or any data definition language (DDL) command:

SQL> SELECT job FROM emp

2 WHERE job='CLERK' FOR UPDATE OF empno;

SCOTT has opened another session to work with the database. Which three operations would wait when

issued in SCOTT's second session? (Choose three.)

A. LOCK TABLE emp IN SHARE MODE;

B. LOCK TABLE emp IN EXCLUSIVE MODE;

C. DELETE FROM emp WHERE job='MANAGER';

D. INSERT INTO emp(empno,ename) VALUES (1289,'Dick');

E. SELECT job FROM emp WHERE job='CLERK' FOR UPDATE OF empno;

Answer: ABE

User Scott has updated the salary of one of the employees in the EMPLOYEES table and has not

committed the transaction. What are the two types of locks that this scenario would lead to? (Choose

two.)

A. null lock on the row being updated

B. null lock on the table containing the row

C. ROW SHARE lock for the row being updated

D. ROW EXCLUSIVE lock for the row being updated

E. shared row­exclusive lock for the row being updated

F. a shareable table lock for the table containing the row

G. exclusive table­level lock for the table containing the row

Answer: DF

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. It is terminated after receiving the error and JIM can continue with his transaction. B. The transaction in it is terminated after receiving the error and JIM can continue with his transaction. C. SCOTT should perform a COMMIT or ROLLBACK to allow JIM to continue with his transaction. D. SCOTT has to reexecute the last command in the transaction after he commits the transaction. Answer: CD User A executes the following command to update the TRANS table: SQL> UPDATE B. trans SET tr_amt=tr_amt+500 WHERE c_code='C005'; Before user A issues a COMMIT or ROLLBACK command, user B executes the following command on the TRANS table: SQl> ALTER TABLE trans MODIFY (tr_type VARCHAR2(3)); What would happen in this scenario? A. The transaction for user A is rolled back. B. The ALTER TABLE command modifies the column successfully. C. The ALTER TABLE command fails due to the resource being busy. D. The ALTER TABLE command waits until user A ends the transaction. Answer: C

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值