重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2001|回复: 0
打印 上一主题 下一主题

[Oracle] 移动含有大对象的分区表的表空间

[复制链接]
跳转到指定楼层
楼主
发表于 2021-10-14 19:29:47 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

如果我们按普通分区表移动,移动后,会发现大对象还在以前表空间,对于大对象分区表,需要这样移动:
alter table gaodc.T_GNLK_ZSXX move  PARTITION PART_RZSJ_001 tablespace BKJ_GAODC_KK_DATA1 lob (XP) store as (tablespace  BKJ_GAODC_KK_DATA1);

有多个分区,使用脚本生成移动表空间语句:


SELECT    'alter table gaodc.'
       || table_name
       || ' move  PARTITION '
       || partition_name
       || ' tablespace BKJ_GAODC_KK_DATA1 lob (' || COLUMN_NAME || ') store as (tablespace  BKJ_GAODC_KK_DATA1);'
  FROM dba_lob_partitions
WHERE tablespace_name = 'BKJ_GAODC_KK_DATA';


------------------------------------------------
alter table gaodc.T_GNLK_ZSXX move  PARTITION PART_RZSJ_001 tablespace BKJ_GAODC_KK_DATA1 lob (XP) store as (tablespace  BKJ_GAODC_KK_DATA1);
alter table gaodc.T_GNLK_ZSXX move  PARTITION PART_RZSJ_002 tablespace BKJ_GAODC_KK_DATA1 lob (XP) store as (tablespace  BKJ_GAODC_KK_DATA1);
alter table gaodc.T_GNLK_ZSXX move  PARTITION PART_RZSJ_003 tablespace BKJ_GAODC_KK_DATA1 lob (XP) store as (tablespace  BKJ_GAODC_KK_DATA1);
alter table gaodc.T_GNLK_ZSXX move  PARTITION PART_RZSJ_004 tablespace BKJ_GAODC_KK_DATA1 lob (XP) store as (tablespace  BKJ_GAODC_KK_DATA1);
alter table gaodc.T_GNLK_ZSXX move  PARTITION PART_RZSJ_005 tablespace BKJ_GAODC_KK_DATA1 lob (XP) store as (tablespace  BKJ_GAODC_KK_DATA1);
alter table gaodc.T_GNLK_ZSXX move  PARTITION PART_RZSJ_006 tablespace BKJ_GAODC_KK_DATA1 lob (XP) store as (tablespace  BKJ_GAODC_KK_DATA1);
alter table gaodc.T_GNLK_ZSXX move  PARTITION PART_RZSJ_007 tablespace BKJ_GAODC_KK_DATA1 lob (XP) store as (tablespace  BKJ_GAODC_KK_DATA1);
alter table gaodc.T_GNLK_ZSXX move  PARTITION PART_RZSJ_008 tablespace BKJ_GAODC_KK_DATA1 lob (XP) store as (tablespace  BKJ_GAODC_KK_DATA1);
alter table gaodc.T_GNLK_ZSXX move  PARTITION PART_RZSJ_009 tablespace BKJ_GAODC_KK_DATA1 lob (XP) store as (tablespace  BKJ_GAODC_KK_DATA1);
alter table gaodc.T_GNLK_ZSXX move  PARTITION PART_RZSJ_011 tablespace BKJ_GAODC_KK_DATA1 lob (XP) store as (tablespace  BKJ_GAODC_KK_DATA1);
alter table gaodc.T_GNLK_ZSXX move  PARTITION PART_RZSJ_012 tablespace BKJ_GAODC_KK_DATA1 lob (XP) store as (tablespace  BKJ_GAODC_KK_DATA1);



分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-26 06:51 , Processed in 0.083939 second(s), 20 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表