Help Center/ Data Replication Service/ API Reference/ APIs V5.0/ Workload Replay/ Querying SQL Execution of the Destination Database in a Workload Replay Task
Updated on 2026-09-07 GMT+08:00

Querying SQL Execution of the Destination Database in a Workload Replay Task

Function

This API is used to query replayed SQL statistics based on the execution time of the destination database.

Authorization Information

Each account has all the permissions required to call all APIs, but IAM users must be assigned the required permissions.

  • If you are using role/policy-based authorization, see Permissions and Supported Actions for details on the required permissions.
  • If you are using identity policy-based authorization, no identity policy-based permissions are required for calling this API.

URI

GET /v5/{project_id}/jobs/{job_id}/replay-execute-record

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

Project ID of a tenant in a region.

For details about how to obtain the project ID, see Obtaining a Project ID.

Constraints

N/A

Range

N/A

Default Value

N/A

job_id

Yes

String

Definition

Task ID, which uniquely identifies a data replication task and serves as the identifier for operations such as query, modification, and deletion.

Constraints

N/A

Range

N/A

Default Value

N/A

Table 2 Query parameters

Parameter

Mandatory

Type

Description

start_time

Yes

Long

Definition

Start time of SQL execution records.

Constraints

The value is a timestamp in seconds.

Range

N/A

Default Value

N/A

end_time

Yes

Long

Definition

End time of SQL execution records.

Constraints

The value is a timestamp in seconds.

Range

N/A

Default Value

N/A

offset

No

Integer

Definition

Offset, which is used for pagination query. The records after this offset will be queried.

Constraints

N/A

Range

N/A

Default Value

0

limit

No

Integer

Definition

Maximum number of records that can be returned. This parameter is used to specify the number of records returned on each page during pagination query.

Constraints

N/A

Range

N/A

Default Value

10

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Definition

MIME type of the request body. Use the default value application/json. For APIs used to upload objects or images, the value varies depending on the flow type.

Constraints

N/A

Range

application/json

Default Value

application/json

X-Auth-Token

Yes

String

Definition

User token obtained from IAM. It is a response to the API for obtaining a user token. This API is the only one that does not require authentication. The token is the value of X-Subject-Token in the response header.

Constraints

N/A

Range

N/A

Default Value

N/A

X-Language

No

String

Definition

Request language type.

Constraints

N/A

Range

  • en-us: English
  • zh-cn: Chinese

Default Value

en-us

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

total_count

Integer

Definition

Total number of records in the list, which is irrelevant to pagination.

Constraints

N/A

Range

N/A

sql_records

Array of objects

Definition

SQL execution records of a replay task.

For details, see Table 5.

Table 5 ReplayExecuteRecords

Parameter

Type

Description

execute_time

Long

Definition

Execution record time.

Constraints

The value is a timestamp in seconds.

Range

N/A

finished_sql

Long

Definition

Number of executed SQL statements.

Constraints

N/A

Range

N/A

abnormal_sql

Long

Definition

Number of abnormal SQL statements executed.

Constraints

N/A

Range

N/A

slow_sql

Long

Definition

Number of slow SQL statements executed.

Constraints

N/A

Range

N/A

total_sql

Long

Definition

Total number of SQL statements in execution records.

Constraints

N/A

Range

N/A

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition

Error code returned when an error occurs during task execution.

Constraints

  • Minimum length: 12 characters
  • Maximum length: 12 characters

Range

The format is DRS.XXXXXX.

error_msg

String

Definition

Detailed error description returned when a task fails to be executed.

Constraints

  • Minimum length: 1 character
  • Maximum length: 512 characters

Range

N/A

Example Request

Querying replayed SQL statistics based on the execution time of the destination database within a specified time range

https://{endpoint}/v5/5237e10fe9aa4ad5b16b6a5245248314/jobs/7b35723d-1525-410e-90c3-70f9ed3jb601/replay-execute-record&start_time=1700421943&end_time=1700439961

Example Response

Status code: 200

OK

{ 
  "total_count" : 1, 
  "sql_records" : [ { 
    "execute_time" : 1700439961, 
    "finished_sql" : 1, 
    "abnormal_sql" : 0, 
    "slow_sql" : 0, 
    "total_sql" : 1 
  } ] 
}

Status code: 400

Bad Request

{ 
  "error_code" : "DRS.10020000", 
  "error_msg" : "Incorrect parameter type." 
}

Status Code

Status Code

Description

200

OK

400

Bad Request

For other statuses, see Status Code.

Error Code

For details, see Error Code.