ITPub博客

首页 > 数据库 > Oracle > 1Z0-052 V12.49 Q128

1Z0-052 V12.49 Q128

原创 Oracle 作者:cow977 时间:2016-05-23 20:56:30 0 删除 编辑
QUESTION 128
Which three descriptions are correct about the effects of the TRUNCATE command on a table? (Choose three.)
A. The corresponding indexes for the table are also truncated.
B. Delete triggers on the table are fired during the execution of the TRUNCATE command.
C. The child table is truncated when the TRUNCATE command is applied on the parent table.
D. The highwater mark (HWM) is set to point to the first usable data block in the table segment.
E. No undo or very little undo data is generated during the execution of the TRUNCATE command.
Correct Answer: ADE

本题是关于TRUNCATE的。
TRUNCATE命令是DDL命令,不是DML命令。
DDL命令不是用户事务,用户无法控制事务的提交或回滚。
从用户的角度来看,TRUNCATE相当于对所有行执行了DELETE,但TRUNCATE会立即完成,而与表所包含的数据行数量无关。
对表所分配的空间,ORACLE除了跟踪区间分配之外,数据字典还通过高水位线来跟踪分配给表的空间已经使用了多少。
高水位线以下的所有空间都在某段时间被使用过,高水位线以上的空间还没有被使用。
TRUNCATE会重置高水位线。
TRUNCATE因为是DDL命令,所以基本或很少产生UNDO数据。

SQL> create table cow_test(id number,dt date);

表已创建。

SQL> insert into cow_test values (1,sysdate);

已创建 1 行。

SQL> /

已创建 1 行。

SQL> /

已创建 1 行。

SQL> /

已创建 1 行。

SQL> insert into cow_test select * from cow_test;

已创建 4 行。

SQL> /

已创建 8 行。

SQL> /

已创建 16 行。

SQL> /

已创建 32 行。

SQL> /

已创建 64 行。

SQL> /

已创建 128 行。

SQL> /

已创建 256 行。

SQL> /

已创建 512 行。

SQL>  select object_id,data_object_id from dba_objects where object_name='COW_TEST';

 OBJECT_ID DATA_OBJECT_ID
---------- --------------
     80023          80023

SQL> truncate table cow_test;

表被截断。

SQL> select object_id,data_object_id from dba_objects where object_name='COW_TEST';

 OBJECT_ID DATA_OBJECT_ID
---------- --------------
     80023          80024

SQL>

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

上一篇: 1Z0-052 V12.49 Q112
下一篇: 1Z0-053 V13.02 Q667
请登录后发表评论 登录
全部评论

注册时间:2011-03-02

  • 博文量
    698
  • 访问量
    893889