高水位(HWM)处理方法

有些时候,数据库表数据量很低的时候,表空间会特别大。这个时候,就需要对表空间进行释放。
备注一:查看表空间大小的方法如下
select Segment_Name,Sum(bytes)/1024/1024/1024
From User_Extents
Group By Segment_Name
备注二:
于是,释放多余表空间有以下两种方法:
第一种,直接shrink(慢)
alter table t1 enable row movement
alter table t1 shrink space cascade;
alter table t1 disable row movement;

第二种,基本思想:建立一个临时表,将原来的高HWM表数据全部导入临时表。删除原来的表。然后将临时表改名成原来的表的名字就行了。
–1 使得原表T_LAG_BUSINESS_INFO无日志化
alter table T_LAG_BUSINESS_INFO nologging;
–2 建立临时表T_LAG_BUSINESS_INFO_tmp数据来源于T_LAG_BUSINESS_INFO
create table T_LAG_BUSINESS_INFO_tmp as select * from T_LAG_BUSINESS_INFO;
–3 删除源表T_LAG_BUSINESS_INFO
drop table T_LAG_BUSINESS_INFO;
–4 修改临时表名称为源表,并且直接清空(不是放在回收站)源表
alter table T_LAG_BUSINESS_INFO_tmp rename to T_LAG_BUSINESS_INFO;
drop table T_LAG_BUSINESS_INFO_TMP purge;
–5 将新表添加comment和健
– Add comments to the table
comment on table T_LAG_BUSINESS_INFO
is ‘业务信息大宽表’;
– Add comments to the columns
comment on column T_LAG_BUSINESS_INFO.clientno
is ‘客户编号’;
comment on column T_LAG_BUSINESS_INFO.holdtotalpoly
is ‘投保人保单总数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdtotalkind
is ‘投保人险种总数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdtotalprem
is ‘投保人总保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdsuminsured
is ‘投保人总保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdcartags
is ‘投保人车险标的数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdcarpoly
is ‘投保人车险保单数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdlifepoly
is ‘投保人人身险险保单数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdproppoly
is ‘投保人财产险保单数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdfinscond
is ‘投保人交商投保情况(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdcarprem
is ‘投保人车险保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdlifeprem
is ‘投保人人身险保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdpropprem
is ‘投保人财产险保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holddecidamt
is ‘投保人已决赔付金额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdundecamt
is ‘投保人未决赔付金额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdcarrisktim
is ‘投保人车险出险次数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdliferisktim
is ‘投保人人身险出险次数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdproprisktim
is ‘投保人财产险出险次数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdcarinsd
is ‘投保人车险保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdlifeinsd
is ‘投保人人身险保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdpropinsd
is ‘投保人财产险保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.holdtotalamt
is ‘投保人总赔付金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdtotaltim
is ‘投保人总出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdhistoprem
is ‘投保人历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdhiscarprem
is ‘投保人车险历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdhislifeprem
is ‘投保人人身险历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdhispropprem
is ‘投保人财产险历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdcardecidamt
is ‘投保人车险已决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdcarundecamt
is ‘投保人车险未决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdlifedecidamt
is ‘投保人人身险已决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdlifeundecamt
is ‘投保人人身险未决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdpropdecidamt
is ‘投保人财产险已决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdpropundecamt
is ‘投保人财产险未决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdhiscarrisktim
is ‘投保人历史车险出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdhisliferisktim
is ‘投保人历史人身险出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdhisproprisktim
is ‘投保人历史财产险出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.holdcarchannel
is ‘投保人最近一次购买车险的渠道代码’;
comment on column T_LAG_BUSINESS_INFO.holdlifechannel
is ‘投保人最近一次购买人身险的渠道代码’;
comment on column T_LAG_BUSINESS_INFO.holdpropchannel
is ‘投保人最近一次购买财产险的渠道代码’;
comment on column T_LAG_BUSINESS_INFO.holdcarmechan
is ‘投保人最近一次购买车险的机构代码’;
comment on column T_LAG_BUSINESS_INFO.holdlifemechan
is ‘投保人最近一次购买人身险的机构代码’;
comment on column T_LAG_BUSINESS_INFO.holdpropmechan
is ‘投保人最近一次购买财产险的机构代码’;
comment on column T_LAG_BUSINESS_INFO.holdcaroffaid
is ‘投保人最近车险脱保时间’;
comment on column T_LAG_BUSINESS_INFO.holdlifeoffaid
is ‘投保人最近人身险脱保时间’;
comment on column T_LAG_BUSINESS_INFO.holdpropoffaid
is ‘投保人最近财产险脱保时间’;
comment on column T_LAG_BUSINESS_INFO.insutotalpoly
is ‘被保人保单总数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insutotalkind
is ‘被保人险种总数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insutotalprem
is ‘被保人总保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insusuminsured
is ‘被保人总保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insucartags
is ‘被保人车险标的数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insucarpoly
is ‘被保人车险保单数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insulifepoly
is ‘被保人人身险险保单数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insuproppoly
is ‘被保人财产险保单数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insufinscond
is ‘被保人交商投保情况(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insucarprem
is ‘被保人车险保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insulifeprem
is ‘被保人人身险保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insupropprem
is ‘被保人财产险保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insudecidamt
is ‘被保人已决赔付金额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insuundecamt
is ‘被保人未决赔付金额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insucarrisktim
is ‘被保人车险出险次数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insuliferisktim
is ‘被保人人身险出险次数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insuproprisktim
is ‘被保人财产险出险次数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insucarinsd
is ‘被保人车险保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insulifeinsd
is ‘被保人人身险保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insupropinsd
is ‘被保人财产险保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.insutotalamt
is ‘被保人总赔付金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insutotaltim
is ‘被保人总出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insuhistoprem
is ‘被保人历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insuhiscarprem
is ‘被保人车险历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insuhislifeprem
is ‘被保人人身险历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insuhispropprem
is ‘被保人财产险历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insucardecidamt
is ‘被保人车险已决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insucarundecamt
is ‘被保人车险未决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insulifedecidamt
is ‘被保人人身险已决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insulifeundecamt
is ‘被保人人身险未决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insupropdecidamt
is ‘被保人财产险已决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insupropundecamt
is ‘被保人财产险未决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insuhiscarrisktim
is ‘被保人历史车险出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insuhisliferisktim
is ‘被保人历史人身险出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insuhisproprisktim
is ‘被保人历史财产险出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.insucarchannel
is ‘被保人最近一次购买车险的渠道代码’;
comment on column T_LAG_BUSINESS_INFO.insulifechannel
is ‘被保人最近一次购买人身险的渠道代码’;
comment on column T_LAG_BUSINESS_INFO.insupropchannel
is ‘被保人最近一次购买财产险的渠道代码’;
comment on column T_LAG_BUSINESS_INFO.insucarmechan
is ‘被保人最近一次购买车险的机构代码’;
comment on column T_LAG_BUSINESS_INFO.insulifemechan
is ‘被保人最近一次购买人身险的机构代码’;
comment on column T_LAG_BUSINESS_INFO.insupropmechan
is ‘被保人最近一次购买财产险的机构代码’;
comment on column T_LAG_BUSINESS_INFO.insucaroffaid
is ‘被保人最近车险脱保时间’;
comment on column T_LAG_BUSINESS_INFO.insulifeoffaid
is ‘被保人最近人身险脱保时间’;
comment on column T_LAG_BUSINESS_INFO.insupropoffaid
is ‘被保人最近财产险脱保时间’;
comment on column T_LAG_BUSINESS_INFO.benitotalpoly
is ‘受益人保单总数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.benitotalkind
is ‘受益人险种总数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.benitotalprem
is ‘受益人总保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.benisumbenired
is ‘受益人总保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.benilifepoly
is ‘受益人人身险险保单数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.benifinscond
is ‘受益人交商投保情况(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.benilifeprem
is ‘受益人人身险保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.benidecidamt
is ‘受益人已决赔付金额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.beniundecamt
is ‘受益人未决赔付金额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.beniliferisktim
is ‘受益人人身险出险次数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.benilifeinsd
is ‘受益人人身险保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.benitotalamt
is ‘受益人总赔付金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.benitotaltim
is ‘受益人总出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.benihistoprem
is ‘受益人历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.benihislifeprem
is ‘受益人人身险历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.benilifedecidamt
is ‘受益人人身险已决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.benilifeundecamt
is ‘受益人人身险未决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.benihisliferisktim
is ‘受益人历史人身险出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.benilifechannel
is ‘受益人最近一次购买人身险的渠道代码’;
comment on column T_LAG_BUSINESS_INFO.benilifemechan
is ‘受益人最近一次购买人身险的机构代码’;
comment on column T_LAG_BUSINESS_INFO.benilifeoffaid
is ‘受益人最近人身险脱保时间’;
comment on column T_LAG_BUSINESS_INFO.clietotalpoly
is ‘客户保单总数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.clietotalkind
is ‘客户险种总数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.clietotalprem
is ‘客户总保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.cliesumcliered
is ‘客户总保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.cliecartags
is ‘客户车险标的数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.cliecarpoly
is ‘客户车险保单数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.clielifepoly
is ‘客户人身险险保单数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.clieproppoly
is ‘客户财产险保单数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.cliefinscond
is ‘客户交商投保情况(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.cliecarprem
is ‘客户车险保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.clielifeprem
is ‘客户人身险保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.cliepropprem
is ‘客户财产险保费(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.cliedecidamt
is ‘客户已决赔付金额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.clieundecamt
is ‘客户未决赔付金额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.cliecarrisktim
is ‘客户车险出险次数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.clieliferisktim
is ‘客户人身险出险次数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.clieproprisktim
is ‘客户财产险出险次数(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.cliecarinsd
is ‘客户车险保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.clielifeinsd
is ‘客户人身险保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.cliepropinsd
is ‘客户财产险保额(针对有效保单)’;
comment on column T_LAG_BUSINESS_INFO.clietotalamt
is ‘客户总赔付金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.clietotaltim
is ‘客户总出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.cliehistoprem
is ‘客户历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.cliehiscarprem
is ‘客户车险历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.cliehislifeprem
is ‘客户人身险历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.cliehispropprem
is ‘客户财产险历史总保费(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.cliecardecidamt
is ‘客户车险已决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.cliecarundecamt
is ‘客户车险未决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.clielifedecidamt
is ‘客户人身险已决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.clielifeundecamt
is ‘客户人身险未决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.cliepropdecidamt
is ‘客户财产险已决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.cliepropundecamt
is ‘客户财产险未决金额(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.cliehiscarrisktim
is ‘客户历史车险出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.cliehisliferisktim
is ‘客户历史人身险出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.cliehisproprisktim
is ‘客户历史财产险出险次数(所有保单)’;
comment on column T_LAG_BUSINESS_INFO.cliecarchannel
is ‘客户最近一次购买车险的渠道代码’;
comment on column T_LAG_BUSINESS_INFO.clielifechannel
is ‘客户最近一次购买人身险的渠道代码’;
comment on column T_LAG_BUSINESS_INFO.cliepropchannel
is ‘客户最近一次购买财产险的渠道代码’;
comment on column T_LAG_BUSINESS_INFO.cliecarmechan
is ‘客户最近一次购买车险的机构代码’;
comment on column T_LAG_BUSINESS_INFO.clielifemechan
is ‘客户最近一次购买人身险的机构代码’;
comment on column T_LAG_BUSINESS_INFO.cliepropmechan
is ‘客户最近一次购买财产险的机构代码’;
comment on column T_LAG_BUSINESS_INFO.cliecaroffaid
is ‘客户最近车险脱保时间’;
comment on column T_LAG_BUSINESS_INFO.clielifeoffaid
is ‘客户最近人身险脱保时间’;
comment on column T_LAG_BUSINESS_INFO.cliepropoffaid
is ‘客户最近财产险脱保时间’;
comment on column T_LAG_BUSINESS_INFO.carcontinueyear
is ‘车险连续承保年限’;
comment on column T_LAG_BUSINESS_INFO.carlastrisktims
is ‘车险上年出险次数’;
comment on column T_LAG_BUSINESS_INFO.cartworisktims
is ‘车险上两年出险次数’;
comment on column T_LAG_BUSINESS_INFO.loadname
is ‘加载程序名称’;
comment on column T_LAG_BUSINESS_INFO.loadtime
is ‘数据加载时间’;
comment on column T_LAG_BUSINESS_INFO.operator
is ‘操作人员ID’;
comment on column T_LAG_BUSINESS_INFO.effectiveflag
is ‘疑似客户号合并标志:疑似客户A,B合并为C,则A\B 是0,C是1’;
comment on column T_LAG_BUSINESS_INFO.updateddate
is ‘记录更新时间’;
comment on column T_LAG_BUSINESS_INFO.updateddate1
is ‘标签更新时间’;
– Create/Recreate primary, unique and foreign key constraints
alter table T_LAG_BUSINESS_INFO
add constraint PK_T_LAG_BUSINESS_INFO primary key (CLIENTNO)
;

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值