Question:58 (Shrink)

Question:

Using Database Control, you have scheduled a job to shrink the TRANS table residing on the TT tablespace. 
The job would run at 5:00 p.m. every Friday.
When you examine the space usage of the table after the completion of the job, you find that the table has not 
been shrunk.

What could have been the reason for this?
A. The tablespace that contains the TRANS table is online.
B. The tablespace that contains the TRANS table is permanent.
C. The tablespace that contains the TRANS table is locally managed.
D. The segment space management of the tablespace that contains the TRANS table is manual in nature.

Answer: D

Notes:

对一张表执行shrink需要有两个先要条件:
1、表必须启用row movement(rowid  要发生变化)
2、表段所在表空间的必须是自动段空间管理(segment space management)的表空间
Tips:
Shrink  优点: 
1: shrink  命令让表缩小,cascade  命令会让相关的索引也同时缩小。 
2:  执行  shrink  命令的时候就不需要  rebuild index。而执行  move  命令之后无法使用  index,所以无法利用  index  查找。
要解决这个问题让  index  恢复可以使用的状态,必须对  index  进行  rebuild。 
3:即使对象所在表空间几乎没有空闲空间,shrink  命令也能执行。 
SQL> alter table emp shrink space; 
Table altered. 
SQL> alter table emp move; 
AUTOSEG_TST  表空间没有足够的空闲空间。 
Shrink  缺点: 
1.无法解除行迁移 
2.必须是  local  管理的自动段管理 
3.不可以是下面的段: 
-集群(cluster)、集群化表 
-包含  long  列的物件 
-LOB  段 
-包含函数索引(function index)的表 
另外  move  命令的执行时间很短,根据情况选择

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值