暂无图片
【迁移】Oracle分区表及索引迁移表空间
最近更新:2022-03-11 14:21:05

近期计划使用XTTS方式迁移某库,在进行自包含检查时发现,该库有部分数据(分区表、索引)存放于SYSTEM表空间中,需要先将这部分数据移动到要迁移的表空间中。

一、环境说明

操作系统:CentOS 5.7 数据库版本:11.2.0.3

二、准备工作

1、表空间自包含检查

execute sys.dbms_tts.transport_set_check('USERS,XXXX', true);
select * from sys.transport_set_violations;

结果

ORA-39921: Default Partition (Table) Tablespace SYSTEM for LINSHI_XXXX_LISHI not contained in transportable set.
ORA-39906: Constraint FK_XXXXX_FOURLS between table LINSHI_XXXX_LISHI in tablespace SYSTEM and table LINSHI_XXXX_BIND in tablespace ORCLTBS.
ORA-39908: Index LINSHI_XXXX_BOX in tablespace SYSTEM enforces primary constraints  of table LINSHI_XXXX_BOX in tablespace ORCLTBS.
ORA-39911: Index XXXX_LISHI_KEY in tablespace ORCLTBS points to partition SYS_P5721 of table LINSHI_XXXX_LISHI in tablespace SYSTEM outside of transportable set.
ORA-39901: Partitioned table LINSHI_XXXX_LISHI is partially contained in the transportable set.
...

通过该步骤确定需要迁移的分区表、索引,及需要重建的索引

2、检查是否非系统默认用户数据存放在SYSTEM表空间

--确认用户情况
select username,user_id,account_status,created from dba_users order by user_id asc;
......