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

142. The user SCOTT owns the CUST table that is placed in the SALES tablespace. The user SCOTT

opens a session and executes commands as follows:

SQL> INSERT INTO cust VALUES(101, 'JACK');

1 row created.

SQL> INSERT INTO cust VALUES(102, 'SMITH');

1 row created.

As a DBA, you execute the following command from another session:

ALTER TABLESPACE sales READ ONLY;

Which statement is true regarding the effect of this command on the transaction in Scott's session?

A.The command fails as a transaction is still pending.

B.The transaction in Scott's session is rolled back and the tablespace becomes read-only. 

C.The command waits and the user SCOTT can execute data manipulation language (DML) statements

only as part of the current transaction.

D.The command hangs until all transactions on the objects in the tablespace commit or rollback, and then
the tablespace is placed in read-only mode.

Answer: D  

答案解析:

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

在SCOTT执行插入操作时,会将整个表锁定起来,而这时DBA去更改这个表空间为只读状态,只能等待scott提交或者回滚后才能对表空间进行操作。

原文地址:https://www.cnblogs.com/hzcya1995/p/13316759.html