All Products
Search
Document Center

Data Management:SearchDatabase

Last Updated:Mar 21, 2026

Index Details.

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

list

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Tid

integer

No

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

3***

SearchKey

string

No

The keyword to search for databases.

testdb

PageNumber

integer

No

The page number.

1

PageSize

integer

No

The number of entries per page.

10

EnvType

string

No

The environment type of the database. For more information, see Instance environment description.

test

SearchRange

string

No

The permission scope. Valid values:

  • HAS_PERMSSION: databases that you have permissions on.

  • OWNER: databases that you own.

  • MY_FOCUS: databases that you follow.

  • UNKNOWN: all databases.

HAS_PERMSSION

SearchTarget

string

No

The search target. Valid values:

  • DB: all databases, including physical and logical databases.

  • SINGLE_DB: physical databases.

  • LOGIC_DB: logical databases.

SINGLE_DB

DbType

string

No

The database engine type. For more information about the valid values, see DbType parameter.

MYSQL

RealLoginUserUid

string

No

The method for sorting the query results. Valid values:

  • LAST_ACTIVE_TIME: sorts the results by the last active time.

  • DB_NAME: sorts the results by the database name.

Response elements

Element

Type

Description

Example

object

TotalCount

integer

The total number of entries that meet the filter criteria.

1

RequestId

string

The ID of the request.

E0D21075-CD3E-4D98-8264-FD8AD04A63B6

SearchDatabaseList

object

SearchDatabase

array<object>

A list of databases.

array<object>

The details of databases.

DatabaseId

string

The ID of the database.

2528****

Host

string

The endpoint that is used to connect to the database.

rm-xxxx.mysql.rds.aliyuncs.com

DbaId

string

The ID of the database administrator (DBA) of the instance.

10****

SchemaName

string

The name of the database.

test

Logic

boolean

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

  • true: The database is a logical database.

  • false: The database is not a logical database.

false

DatalinkName

string

The name of the database link for cross-database queries.

datalink_name

Port

integer

The port that is used to connect to the database.

3306

EnvType

string

The environment type of the instance. For more information, see Instance environments.

test

Sid

string

The system ID (SID) of the instance.

testSid

OwnerIdList

object

OwnerIds

array

The IDs of the database owners.

string

The ID of a database owner.

1

Encoding

string

The character set that is used in the database.

utf8

DbType

string

The type of the database.

mysql

OwnerNameList

object

OwnerNames

array

The nicknames of the database owners.

string

The nickname of a database owner.

user1

SearchName

string

The name that is used to search for the database.

test@xxx.xxx.xxx.xxx:3306

Alias

string

The alias of the database.

test_rds

CatalogName

string

The name of the database catalog.

Note

For PostgreSQL databases, the database name is returned.

dmstest

ErrorCode

string

The error code that is returned if the request fails.

UnknownError

ErrorMessage

string

The error message that is returned if the request fails.

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": "E0D21075-CD3E-4D98-8264-FD8AD04A63B6",
  "SearchDatabaseList": {
    "SearchDatabase": [
      {
        "DatabaseId": "2528****",
        "Host": "rm-xxxx.mysql.rds.aliyuncs.com",
        "DbaId": "10****",
        "SchemaName": "test",
        "Logic": false,
        "DatalinkName": "datalink_name",
        "Port": 3306,
        "EnvType": "test",
        "Sid": "testSid",
        "OwnerIdList": {
          "OwnerIds": [
            "1"
          ]
        },
        "Encoding": "utf8",
        "DbType": "mysql",
        "OwnerNameList": {
          "OwnerNames": [
            "user1"
          ]
        },
        "SearchName": "test@xxx.xxx.xxx.xxx:3306",
        "Alias": "test_rds",
        "CatalogName": "dmstest"
      }
    ]
  },
  "ErrorCode": "UnknownError",
  "ErrorMessage": "UnknownError",
  "Success": true
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.