All Products
Search
Document Center

Data Management:CreateDataArchiveOrder

Last Updated:Aug 28, 2026

Creates a data archiving ticket to archive data to dedicated storage, ApsaraDB RDS for MySQL, or other supported destinations.

Operation description

This operation is available only for database instances managed in Security Collaboration mode.

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:CreateDataArchiveOrder

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Comment

string

Yes

The description of the task.

Business test

Tid

integer

No

The tenant ID. Call GetUserActiveTenant or ListUserTenants to obtain this value.

3***

PluginType

string

No

The plugin type. Default value: DATA_ARCHIVE.

DATA_ARCHIVE

RelatedUserList

array

No

The related users.

string

No

The ID of a related operator.

123***

ParentId

integer

No

The ID of the parent ticket. A parent ticket is generated only when a child ticket is created.

896****

Param

object

Yes

The data archiving parameters.

ArchiveMethod

string

Yes

The archiving destination. Valid values:

Note

For values other than inner_oss, register the destination database with DMS first. Registered databases appear in the Instances Connected section of the DMS console.

  • inner_oss: dedicated storage, which is a built-in Object Storage Service (OSS) bucket.

  • oss_userself: OSS bucket of the user.

  • mysql: ApsaraDB RDS for MySQL instance.

  • polardb: PolarDB for MySQL cluster.

  • adb_mysql: AnalyticDB for MySQL V3.0 cluster.

  • lindorm: Lindorm instance.

adb_mysql

RunMethod

string

Yes

The execution method. Valid values:

  • schedule: runs the task on a periodic schedule.

  • now: runs the task immediately.

now

Variables

array<object>

No

The archiving variables used as filter conditions. Each variable has a name and a pattern.

object

No

An archiving variable configuration.

{name: "time", pattern: "yyyy-MM-dd|+2d"}

Name

string

No

The variable name. Must match the variable name specified in TableWhere when used as a filter condition.

t

Pattern

string

No

The time variable format that defines the variable value. See Configure variables for details. Examples:

  • yyyy-MM-dd|-3d: 3 days before task execution.

  • yyyy-MM-dd|-1w: 7 days before task execution.

  • yyyy-MM-dd|-4M: 4 months before task execution.

  • yyyy-MM-dd|-2y: 2 years before task execution.

  • yyyy-MM-dd|-3h: 3 hours before task execution.

  • yyyy-MM-dd|+5m: 5 minutes after task execution.

Note

In these formats, yyyy-MM-dd| is a fixed prefix. A hyphen (-) indicates a time before task execution, and a plus sign (+) indicates a time after.

yyyy-MM-dd|-3d

Logic

boolean

No

Whether the database is a logical database.

false

TableIncludes

array<object>

Yes

The tables to archive.

object

Yes

TableName

string

Yes

The table name.

table1

TableWhere

string

No

The WHERE clause filter condition. When using a time variable, specify the format: field name <='${variable name}'. The variable name must match the one in the Variables parameter.

gmt_modified<'${t}'

TableMapping

array

No

The table name mappings to the destination database. Optional; uses default mappings if not specified.

string

No

The table name mapped to the destination database.

table1

OrderAfter

array

No

The post-archiving actions.

string

No

The post-archiving action. Valid values:

  • delete: deletes archived data from the source database.

  • check: verifies archived data. This operation is time-consuming.

  • clear: deletes the temporary table. Takes effect only when both delete and check are also specified.

delete

SourceCatalogName

string

Yes

The source database catalog. Valid values:

  • def: for databases with a two-layer logical schema (MySQL, PolarDB for MySQL, or AnalyticDB for MySQL).

  • Empty string: for Lindorm or ApsaraDB for MongoDB instances.

  • Catalog name: for databases with a three-layer logical schema (such as PostgreSQL).

def

SourceSchemaName

string

Yes

The source database schema name. For MySQL, this is the database name. For PostgreSQL, this is the schema name. The source and destination schema names must be the same.

schema_test

SourceInstanceName

string

Yes

The source instance name. For self-managed or third-party cloud databases, call GetInstance to query the instance ID.

rm-bp187l****380w

TargetInstanceHost

string

Yes

The destination instance host. Use the internal endpoint if available.

  • For OSS bucket archiving, set to the bucket name.

  • For dedicated storage archiving, set to inner_oss.

amv-bp1****00444.ads.aliyuncs.com

CronStr

string

No

A crontab expression for scheduling the archiving task. See Crontab expressions. Required when RunMethod is set to schedule.

00 05 11 * * ?

DatabaseId

string

No

The database ID. For self-managed or third-party cloud databases, call GetDatabase to query the ID. Not required for Alibaba Cloud databases.

1***

Response elements

Element

Type

Description

Example

object

The schema of the response.

RequestId

string

The request ID for log queries and troubleshooting.

283C461F-11D8-48AA-B695-DF092DA32AF3

Success

boolean

Whether the request was successful. Valid values:

  • true

  • false

true

ErrorMessage

string

The error message returned if the request failed.

UnknownError

ErrorCode

string

The error code returned if the request failed.

UnknownError

CreateOrderResult

array

The ID of the data archiving ticket.

integer

The data archiving ticket ID.

12*****

Examples

Success response

JSON format

{
  "RequestId": "283C461F-11D8-48AA-B695-DF092DA32AF3",
  "Success": true,
  "ErrorMessage": "UnknownError",
  "ErrorCode": "UnknownError",
  "CreateOrderResult": [
    0
  ]
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.