All Products
Search
Document Center

Data Management:ListTables

Last Updated:Mar 21, 2026

Call ListTables to retrieve details about tables in a database.

Operation description

This API can only be called for Database Instances with a Control Mode of Secure Collaboration.

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

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Tid

integer

No

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

3***

DatabaseId

string

Yes

The database ID. You can call the ListDatabases or SearchDatabase operation to obtain the database ID.

1860****

PageNumber

integer

No

The page number of the results.

1

PageSize

integer

No

The number of entries per page.

10

SearchName

string

No

The search keyword for table names. Fuzzy Search is supported.

test

ReturnGuid

boolean

No

Specifies whether to return the globally unique identifier (GUID) of the table. Valid values:

  • true: Returns the table's GUID.

  • false: Does not return the table's GUID.

true

RealLoginUserUid

string

No

Response elements

Element

Type

Description

Example

object

TotalCount

integer

The total number of tables that meet the specified criteria.

1

RequestId

string

The request ID.

B16FB618-5E96-4FFD-BB0D-490C890A4030

ErrorCode

string

The error code.

UnknownError

TableList

object

The details about the tables.

Table

array<object>

The list of tables.

array<object>

DatabaseId

string

The ID of the physical database.

1860****

TableName

string

The name of the table.

consumption_records

StoreCapacity

integer

The storage space occupied by the table. Unit: MB. This is a statistical value and not an accurate value.

1024

OwnerIdList

object

The IDs of the table owners.

OwnerIds

array

The user IDs of the table owners.

string

The user ID of a table owner.

51****

Description

string

The description of the table.

test

Encoding

string

The character set of the table.

utf8

OwnerNameList

object

The nicknames of the table owners.

OwnerNames

array

A list of the table owner nicknames.

string

The nickname of a table owner.

owner_name

TableSchemaName

string

The name of the database to which the table belongs.

qntest

TableType

string

The type of the table. Default value: NORMAL.

NORMAL

TableGuid

string

The globally unique identifier (GUID) of the table in Data Management (DMS).

IDB_44743****.qntest.consumption_records

Engine

string

The storage engine of the table.

InnoDB

NumRows

integer

The number of rows in the table. This is a statistical value and not an accurate value.

10085

TableId

string

The ID of the table.

44743****

ErrorMessage

string

The error message.

UnknownError

Success

boolean

Indicates whether the request was successful. Valid values:

  • true: The request was successful.

  • false: The request failed.

true

Examples

Success response

JSON format

{
  "TotalCount": 1,
  "RequestId": "B16FB618-5E96-4FFD-BB0D-490C890A4030",
  "ErrorCode": "UnknownError",
  "TableList": {
    "Table": [
      {
        "DatabaseId": "1860****",
        "TableName": "consumption_records",
        "StoreCapacity": 1024,
        "OwnerIdList": {
          "OwnerIds": [
            "51****"
          ]
        },
        "Description": "test",
        "Encoding": "utf8",
        "OwnerNameList": {
          "OwnerNames": [
            "owner_name"
          ]
        },
        "TableSchemaName": "qntest",
        "TableType": "NORMAL",
        "TableGuid": "IDB_44743****.qntest.consumption_records",
        "Engine": "InnoDB",
        "NumRows": 10085,
        "TableId": "44743****"
      }
    ]
  },
  "ErrorMessage": "UnknownError",
  "Success": true
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.