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

标题: 移动含有大对象的分区表的表空间 [打印本页]

作者: 郑全    时间: 2021-10-14 19:29
标题: 移动含有大对象的分区表的表空间

如果我们按普通分区表移动,移动后,会发现大对象还在以前表空间,对于大对象分区表,需要这样移动:
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);








欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2