---
title: OMS 迁移异构主键表时全量组件报错：perhaps source index not match destination-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于OMS 迁移异构主键表时全量组件报错：perhaps source index not match destination相关的常见问题和使用技巧，帮助您快速解决OMS 迁移异构主键表时全量组件报错：perhaps source index not match destination的难题。
image: https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*OSPzQ6GUQF4AAAAAQHAAAAgAeiGDAQ/original
---
[OceanBase AI 数据大会](https://www.oceanbase.com/conference2026 "OceanBase AI 数据大会")

## 体验新一代 AI 数据平台

[立即咨询](https://www.oceanbase.com/contactus) [免费试用 免费试用](https://www.oceanbase.com/free-trial)划线反馈

# OMS 迁移异构主键表时全量组件报错：perhaps source index not match destination

更新时间：2026-06-22 02:01

适用版本： V3.1.x、V3.2.x、V3.3.x、V2.1.x、V2.2.x 内容类型：Troubleshoot  

本文为您介绍使用 OceanBase 迁移服务（OceanBase Migration Service，OMS）迁移异构主键表时全量组件报错的原因和解决方法。

## 适用版本

适用于 OMS V2.x 和 V3.x。

## 问题描述

使用 OMS 迁移 MySQL 数据库的数据至 OceanBase 数据库 MySQL 租户时，迁移异构主键表报错。

- 源端：

  ```sql
  CREATE TABLE t1(id INT NOT NULL,col1 INT NOT NULL,PRIMARY KEY(id));

  ```
 - 目标端：

  ```sql
  CREATE TABLE t1(id INT NOT NULL,col1 INT NOT NULL,PRIMARY KEY(col1));

  ```
 - 迁移时全量组件报错：

  ```shell
  non-index mode(perhaps source index not match destination) count of records larger than 0；please check index with match rule

  ```

## 问题原因

OMS 仅支持迁移 MySQL 数据库的有主键表至 OceanBase 数据库 MySQL 租户，并且迁移时，源端的主键字段需要在目标端对应字段上具备唯一索引或主键，才能进行 `INSERT ON CONFLICT` 操作。

## 解决方法

为目标端 OceanBase 数据库 MySQL 租户的表对应字段（源端主键列）添加唯一索引。

```sql
ALTER TABLE t1 ADD UNIQUE KEY udx_id(id);

```

上一篇

[OMS 全量迁移 OceanBase 表到其他数据库时报错误：-4012, Timeout](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000280770)

下一篇

[OMS 全量迁移报错 No alive hosts in current region](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000262840) ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ) 咨询
