Oracle 11g新特性延迟段创建和truncate的增强
SQL> select * from tab; TNAME TABTYPE CLUSTERID ------------------------------ ------- ---------- TEST1 TABLE SQL> select segment_name,bytes from user_segments; ----还没有给分配空间 no rows selected SQL> insert into test1 select * from dba_objects where rownum<2; -----插入一行记录 1 row created. SQL> select segment_name,bytes from user_segments; ----分配空间 SEGMENT_NAME BYTES ------------------------------ ---------- TEST1 65536 SQL> commit; Commit complete. SQL> alter table test1 allocate extent; ------手动给表分配一个区 Table altered. SQL> select segment_name,bytes from user_segments; SEGMENT_NAME BYTES ------------------------------ ---------- TEST1 131072 SQL> truncate table test1; ------使用不加子句的truncate Table truncated. SQL> select segment_name,bytes from user_segments; -----只是删除到最小的区 SEGMENT_NAME BYTES ------------------------------ ---------- TEST1 65536 SQL> truncate table test1 drop all storage; -----使用11g中新加的子句drop all stroage Table truncated. SQL> select segment_name,bytes from user_segments; -----段全部被回收 no rows selected
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。