---
title: "创建 ODP 数据源 | OceanBase 文档中心"
description: 创建 ODP 数据源 本文为您介绍 OceanBase 迁移服务（OceanBase Migration Service，OMS）提供的 OpenAPI：创建 ODP 数据源 CreateOceanBaseODPDataSource。 功能说明 本接口用于创建 OceanBase ODP 数据源。 调用说明 接口约束…
---
切换语言

- 中文站 - 简体中文
- International - English
- 日本站 - 日本語

文档反馈![](https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*L03BS6f-o40AAAAAAAAAAAAADiGDAQ/original) 迁移服务 OMSV 4.3.1 企业版

# 创建 ODP 数据源

更新时间：2026-04-14 15:36:02

本文为您介绍 OceanBase 迁移服务（OceanBase Migration Service，OMS）提供的 OpenAPI：创建 ODP 数据源 CreateOceanBaseODPDataSource。

## 功能说明

本接口用于创建 OceanBase ODP 数据源。

## 调用说明

### 接口约束

本接口适用于 OMS V4.2.2 及之后版本。

### 请求路径

`POST /api/v2?Action=CreateOceanBaseODPDataSource`

### 请求参数

| 参数 | 类型 | 描述 |
| --- | --- | --- |
| name | string | 数据源标识。 |
| url | string | OP 网关地址，或者是独立部署模式下可以请求到的 OP 网关 JSON 文件地址。 |
| obProxy | string | OB Proxy 地址（可选），格式为 IP:Port。 |
| route | string | 路由到的 API，例如 MiddleWareCluster-ODP。 |
| accessKey | string | 访问者的 Access Key。 |
| instanceId | string | ODP 物理节点的实例 ID, 对应 OMS 控制台 **新建数据源** 页面上的 **ODP Instance ID**。例如，odp-xxx。 |
| middlewareInstanceId | string | ODP 中间件 ID，对应页面上的 Instance ID。例如，000001。 |
| secretKey | string | 访问者的 Security Key。 |
| userName | string | 用于数据迁移或数据同步的数据库用户的名称。 |
| password | string | 数据库用户的密码，需要使用 Base64 编码。 |
| region | string | 数据源所属的地域。 |
| description | string | 数据源的备注信息，不能超过 128 个字符。 |
| drcUserName | string | 该用户主要用于读取 OceanBase 数据库增量日志和数据库对象结构信息，请在业务集群 sys 租户下创建该用户。 |
| drcPassword | string | DRC 用户的密码，需要使用 Base64 编码。 |

### 返回结果

| 参数 | 类型 | 描述 |
| --- | --- | --- |
| success | boolean | 是否调用成功。 |
| errorDetail | object | 错误详情。 |
| code | string | 错误码。 |
| message | string | 描述信息。 |
| advice | string | 建议。 |
| requestId | string | 请求 ID。 |
| pageNumber | integer | 页序号，分页查询时生效。 |
| pageSize | integer | 页大小，分页查询时生效。 |
| totalCount | integer | 总数，分页查询时生效。 |
| cost | string | 请求耗时，单位为秒。 |
| data | string | OceanBase ODP 数据源的 ID。 |

## 示例

### 请求示例

```JSON
{
    "name":"ODP 数据源测试",
    "url": "http://xxx.xxx.xxx.1",
    "obProxy": "http://xxx.xxx.xxx.2:8080",
    "route": "MiddleWareCluster-ODP",
    "accessKey": "abc****",
    "instanceId": "odp-xxx",
    "middlewareInstanceId": "000001",
    "secretKey": "ncd****",
    "userName": "username",
    "password": "cGFzc3dvcmQ=",
    "region": "cn-hangzhou",
    "description": "open-api",
    "drcUserName": "",
    "drcPassword": ""
  }

```

### 返回示例

```JSON
{
    "success":true,
    "errorDetail":null,
    "code":null,
    "message":null,
    "advice":null,
    "requestId":"a7b57****",
    "pageNumber":null,
    "pageSize":null,
    "totalCount":null,
    "cost":"599 ms",
    "data":"e_edz****"
}

```

 上一篇 下一篇 ![有帮助](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)[AI](https://www.oceanbase.com/obi) 咨询热线
