All Products
Search
Document Center

Data Management:RegisterInstance

Last Updated:Mar 21, 2026

Register a database instance in DMS.

Operation description

Prerequisites: You must have the Administrator or Database Administrator (DBA) role. You can get the RoleIdList by calling the ListUsers or GetUser API.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

dms:RegisterInstance

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Tid

integer

No

The tenant ID. You can call the GetUserActiveTenant operation to get this ID.

3***

InstanceType

string

Yes

The database type. For more information, see DbType parameter description.

MySQL

InstanceSource

string

Yes

The source of the database instance. Valid values:

  • PUBLIC_OWN: a self-managed instance connected over the Internet.

  • RDS: an ApsaraDB RDS instance.

  • ECS_OWN: a self-managed instance that is deployed on an Elastic Compute Service (ECS) instance.

  • VPC_IDC: a self-managed instance in a data center that is connected to a Virtual Private Cloud (VPC).

RDS

NetworkType

string

Yes

The network type. Valid values:

  • CLASSIC: classic network

  • VPC: Virtual Private Cloud (VPC)

VPC

EnvType

string

Yes

The environment type. Valid values:

  • product: production environment

  • dev: development environment

  • pre: pre-release environment

  • test: test environment

  • sit: system integration testing (SIT) environment

  • uat: user acceptance testing (UAT) environment

  • pet: performance testing environment

  • stag: staging environment

product

EcsInstanceId

string

No

The ID of the ECS instance.

Note

This parameter is required if InstanceSource is set to ECS_OWN.

i-2zei9gs1t7h8l7ac****

VpcId

string

No

The ID of the VPC.

Note

This parameter is required if InstanceSource is set to VPC_IDC.

vpc-xxxxxxxxxxxxxxxxxxxxx

EcsRegion

string

No

The region where the instance is located.

Note

This parameter is required if InstanceSource is set to RDS, ECS_OWN, or VPC_IDC.

cn-hangzhou

Host

string

Yes

The endpoint of the database instance.

172.XX.XXX.254

Port

integer

Yes

The connection port of the database instance.

3306

Sid

string

No

The system ID (SID) of the database.

Note

This parameter is required if InstanceType is set to ORACLE.

XXX

DatabaseUser

string

Yes

The username for the database account.

dmstest

DatabasePassword

string

Yes

The password for the database account.

******

InstanceAlias

string

Yes

An alias for the instance to help you identify it quickly.

测试实例

DbaUid

integer

Yes

The UID of the user with the Database Administrator (DBA) role for the instance. You can call the ListUsers or GetInstance operation to get this ID.

22275482072787****

SafeRule

string

Yes

The name of the Security Rule Set (GroupName) for the instance. You can call the ListStandardGroups or GetInstance operation to get this value.

测试使用

QueryTimeout

integer

Yes

The query timeout period, in seconds.

60

ExportTimeout

integer

Yes

The export timeout period, in seconds.

600

DataLinkName

string

No

The datalink name for cross-instance queries.

Note
  • This parameter is required if UseDsql is set to 1.

  • The datalink name can contain only lowercase letters and underscores (_).

  • The datalink name must be unique within the tenant.

dblink_test

DdlOnline

integer

No

The strategy for lock-free schema changes. Valid values:

  • 0: Disabled.

  • 1: Prioritize native lock-free operations. If an operation fails, it falls back to Data Management (DMS) for execution.

  • 2: Use Data Management (DMS) for lock-free schema changes.

Note

Supported database types: ApsaraDB RDS for MySQL, PolarDB for MySQL, ApsaraDB for MyBase (MySQL), and other MySQL-compatible databases.

2

UseDsql

integer

No

Specifies whether to enable cross-instance queries. Valid values:

  • 0: Disabled

  • 1: Enabled

Note

Supported database types: MySQL, SQL Server, PostgreSQL, PolarDB for PostgreSQL (Oracle-compatible), and Redis.

1

SkipTest

boolean

No

Specifies whether to skip the connectivity test. Valid values:

  • true: Skip the test.

  • false: Perform the test.

true

EnableSellSitd

string

No

  • Y: Enable sensitive data protection.

  • NULL or other values: Disable sensitive data protection.

Y

TemplateId

integer

No

The ID of the sensitivity classification template. You can call the ListClassificationTemplates operation to get this ID.

31***

TemplateType

string

No

The type of the sensitivity classification template. You can call the ListClassificationTemplates operation to get this value.

INNER

DbaUidByString

string

No

This parameter replaces DbaUid and supports non-numeric UIDs, such as the UIDs of RAM roles.

22275482072787****

ResourceGroup

string

No

The ID of the resource group.

Response elements

Element

Type

Description

Example

object

The response data.

RequestId

string

The ID of the request.

F4E2A94B-604F-43FF-93E7-F4EE3DCF412E

ErrorCode

string

The error code returned if the request fails.

UnknownError

ErrorMessage

string

The error message returned if the request fails.

UnknownError

Success

boolean

Indicates whether the request succeeded. Valid values:

  • true: The request succeeded.

  • false: The request failed.

true

Examples

Success response

JSON format

{
  "RequestId": "F4E2A94B-604F-43FF-93E7-F4EE3DCF412E",
  "ErrorCode": "UnknownError",
  "ErrorMessage": "UnknownError",
  "Success": true
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.