日期:2014-05-16 浏览次数:20468 次
--DDL伪代码
begin commit; DDL_statement; commit; end;
㈠ 并发性
下面用反证法证明之
假设Oracle可以回滚DDL语句,也就是,DDL并不会自动提交,而是事务中的一部分
那么DDL就要满足READ COMMIT隔离机制,也就是说,用户执行的DDL语句在提交前,其他用户是无法看到的
比如A用户执行CREATE TABLE T的语句,然后对T执行了一些DML。而这时其他会话是无法看到T表的
Session A>create table t (id number);--A没有commit! Table created. Session B>insert into t values (1);--此时T表对B是透明的 --这里应该会返回"ORA-00942: table or view does not exist"
Q: 4 Evaluate the set of SQL statements: CREATE TABLE dept (deptno NUMBER(2), dname VARCHAR2(14), loc VARCHAR2(13)); ROLLBACK; DESCRIBE DEPT What is true about the set? A. The DESCRIBE DEPT statement displays the structure of the DEPT table. B. The ROLLBACK statement frees the storage space occupied by the DEPT table. C. The DESCRIBE DEPT statement returns an error ORA-04043: object DEPT does not exist. D. The DESCRIBE DEPT statement displays the structure of the DEPT table only if there is a COMMIT statement introduced before the ROLLBACK statement. Answer: A