All Products
Search
Document Center

Data Management:ListDBTaskSQLJob

Last Updated:Aug 28, 2026

Queries a list of SQL tasks.

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

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

DBTaskGroupId

integer

Yes

The ID of the SQL task group. You can call the GetStructSyncJobDetail operation to obtain this parameter.

132****

PageNumber

integer

No

The number of the page to return.

1

PageSize

integer

No

The number of entries to return on each page.

20

Tid

integer

No

The ID of the tenant.

Note

: To view the ID of the tenant, log on to the Data Management (DMS) console and move the pointer over the profile picture in the upper-right corner. For more information, see Manage DMS tenants.

1***

Response elements

Element

Type

Description

Example

object

Schema of Response

RequestId

string

The ID of the request.

F6C47680-8D2D-43A4-8902-F2740D71A398

Success

boolean

Indicates whether the request is successful.

true

ErrorMessage

string

The error message returned if the request failed.

UnknownError

ErrorCode

string

The error code returned if the request failed.

UnknownError

DBTaskSQLJobList

array<object>

The list of the SQL tasks.

object

The SQL task.

JobId

integer

The ID of the SQL task.

12****

JobType

string

The type of the SQL task.

STRUCT_SYNC

Comment

string

The description of the SQL task.

test

DbSearchName

string

The name that is used to search for the database.

test@xxx:3306[test]

DbId

integer

The ID of the database.

43214523

Logic

boolean

Indicates whether the database is a logical database. Valid values:

  • true: The database is a logical database.

  • false: The database is a logical database.

false

CreateTime

string

The time when the SQL task was created.

2021-02-18 17:49:20

LastExecTime

string

The time when the SQL task was last executed.

2021-02-18 17:49:31

DbTaskGroupId

integer

The ID of the SQL task group.

432****

Status

string

The state of the SQL task. Valid values:

  • INIT: The SQL task was initialized.

  • PENDING: The SQL task waited to be run.

  • BE_SCHEDULED: The SQL task waited to be scheduled.

  • FAIL: The SQL task failed.

  • SUCCESS: The SQL task was successful.

  • PAUSE: The SQL task was paused.

  • DELETE: The SQL task was deleted.

  • RUNNING: The SQL task was being run.

SUCCESS

Transactional

boolean

Indicates whether the SQL task is executed as a transaction. Valid values:

  • true: The SQL task is executed as a transaction.

  • false: The SQL task is not executed as a transaction.

false

TotalCount

integer

The total number of the SQL tasks.

1

Examples

Success response

JSON format

{
  "RequestId": "F6C47680-8D2D-43A4-8902-F2740D71A398",
  "Success": true,
  "ErrorMessage": "UnknownError",
  "ErrorCode": "UnknownError",
  "DBTaskSQLJobList": [
    {
      "JobId": 0,
      "JobType": "STRUCT_SYNC",
      "Comment": "test",
      "DbSearchName": "test@xxx:3306[test]",
      "DbId": 43214523,
      "Logic": false,
      "CreateTime": "2021-02-18 17:49:20",
      "LastExecTime": "2021-02-18 17:49:31",
      "DbTaskGroupId": 0,
      "Status": "SUCCESS",
      "Transactional": false
    }
  ],
  "TotalCount": 1
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.