All Products
Search
Document Center

Data Management:CreateDataImportOrder

Last Updated:Aug 28, 2026

Creates a data import ticket to import data into a specified database.

Operation description

This operation applies only to database instances in Security Collaboration control mode.

For more information about this feature, see Data Import.

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

create

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Comment

string

Yes

The purpose or objective of the data import. Helps reduce unnecessary communication.

test

RelatedUserList

array

No

The stakeholders of the data import. Stakeholders can view ticket details and assist in the approval process. Users who are not stakeholders, DMS administrators, or DBAs cannot view ticket details.

integer

No

The user ID of a stakeholder. Specified stakeholders can view and collaborate on the ticket. Other users cannot view the ticket, except administrators and DBAs.

51****

Param

object

Yes

The parameters of the ticket.

Classify

string

No

The reason for the data import.

test

AttachmentName

string

Yes

The key of the attachment that contains the SQL statements used to import data. You can call the GetUserUploadFileJob operation to obtain the attachment key from the value of the AttachmentKey parameter.

upload_big_file_test_orders

DbItemList

array<object>

Yes

The database to which you want to import data. You can specify only one database.

object

No

Database information.

DbId

integer

Yes

The database ID. The database can be physical or logical.

1860****

Logic

boolean

Yes

Whether the database is a logical database. Valid values:

  • true: The database is a logical database.

  • false: The database is a physical database.

Note

If you set this parameter to true, the database that you specify must be a logical database.

false

FileType

string

Yes

The file format for the data import. Valid values:

  • SQL: an SQL file

  • CSV: a CSV file

Valid values:

  • EXCEL :

    EXCEL

  • CSV :

    CSV

  • JSON :

    JSON

  • SQL :

    SQL

CSV

FileEncoding

string

No

The encoding of the destination database. Valid values:

  • AUTO: automatic identification

  • UTF-8: UTF-8 encoding

  • GBK: GBK encoding

  • ISO-8859-1: ISO-8859-1 encoding

AUTO

TableName

string

No

The destination table for CSV data import.

Note

This parameter is required if you set the FileType parameter to CSV.

Table_text

InsertType

string

No

The write mode for CSV data in the destination table. Valid values:

  • INSERT: The database checks the primary key when data is written. If a duplicate primary key value exists, an error message is returned.

  • INSERT_IGNORE: If the imported data contains data records that are the same as those in the destination table, the new data records are ignored.

  • REPLACE_INTO: If the imported data contains a row that has the same value for the primary key or unique index as one row in the destination table, the database deletes the existing row and inserts the new row into the destination table.

Note

This parameter is required if you set the FileType parameter to CSV.

INSERT

CsvFirstRowIsColumnDef

boolean

No

The type of the CSV file. Valid values:

  • true: The first row in the CSV file contains field names.

  • false: The first row in the CSV file contains data.

Note

This parameter is required if you set the FileType parameter to CSV.

true

IgnoreError

boolean

No

Whether to skip errors during execution. Valid values:

  • true: skips the error and continues to execute SQL statements.

  • false: stops executing SQL statements.

false

ImportMode

string

No

The import mode. Valid values:

  • FAST_MODE: In the Execute step, the uploaded file is read and SQL statements are executed to import data. This mode is more efficient but less secure than the safe mode.

  • SAFE_MODE: In the Precheck step, the uploaded file is parsed, and SQL statements or CSV data is cached. In the Execute step, the cached data is read and imported. This mode is more secure but less efficient than the fast mode.

FAST_MODE

RollbackSQL

string

No

The SQL statements used to roll back the data import.

Note

This parameter is required if you set the RollbackSqlType parameter to TEXT.

empty

RollbackAttachmentName

string

No

The key of the attachment that contains the SQL statements used to roll back the data import. You can call the GetUserUploadFileJob operation to obtain the attachment key from the value of the AttachmentKey parameter.

Note

This parameter is required if you set the RollbackSqlType parameter to ATTACHMENT.

rollback.sql

RollbackSqlType

string

No

The format of the rollback SQL statements. Valid values:

  • TEXT: text

  • ATTACHMENT: attachment

TEXT

ExecMode

string

No

The ticket execution mode. Valid values:

  • COMMITOR: After approval, the submitter executes the ticket.

  • AUTO: After approval, the system automatically executes the ticket.

  • LAST_AUDITOR: After approval, the last approver executes the ticket.

COMMITOR

AttachmentKey

string

No

The key of the attachment that provides additional instructions for the ticket. You can call the GetUserUploadFileJob operation to obtain the attachment key.

order_attachment.txt

Tid

integer

No

The ID of the tenant. You can call the GetUserActiveTenant or ListUserTenants operation to obtain the tenant ID.

3***

RealLoginUserUid

string

No

The UID of the Alibaba Cloud account that calls this operation.

21400447956867****

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The ID of the request.

0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931

Success

boolean

Whether the request was successful. Valid values:

  • true: The request is successful.

  • false: The request fails.

true

ErrorMessage

string

The error message returned if the request fails.

UnknownError

ErrorCode

string

The error code returned if the request fails.

UnknownError

CreateOrderResult

array

The ID of the ticket.

integer

Ticket ID.

1****

Examples

Success response

JSON format

{
  "RequestId": "0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931",
  "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.