You can call this operation to query detail information of a specified database.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes GetDatabase

The operation that you want to perform. Set the value to GetDatabase.

Host String Yes xxx.xxx.xxx.xxx

The endpoint of the database instance.

Port Integer Yes 3306

The connection port of the database instance.

SchemaName String Yes test_db

The name of the database.

Tid Long Yes -1

The ID of the tenant in Data Management (DMS) Enterprise.

Sid String No test_sid

The system ID (SID) of the database instance.

Response parameters

Parameter Type Example Description
Database

The detailed information of the database.

CatalogName String def

The catalog name of the database.

DatabaseId String 1

The ID of the database.

DbType String mysql

The type of the database.

DbaId String 1

The ID of the database administrator (DBA).

DbaName String dba_name

The nickname of the DBA.

Encoding String utf8mb4

The encoding format of the database.

EnvType String test

The type of the environment to which the database belongs.

Host String xxx.xxx.xxx.xxx

The endpoint of the database instance.

InstanceId String 1

The ID of the database instance.

OwnerIdList 1

The IDs of database owners.

OwnerIds

The ID of a database owner.

OwnerNameList test

The nicknames of database owners.

OwnerNames

The nickname of a database owner.

Port Integer 3306

The connection port of the database instance.

SchemaName String test_db

The name of the database.

SearchName String test_db@xxx.xxx.xxx.xxx:3306

The query name of the database.

Sid String test_sid

The SID of the database instance.

State String NORMAL

The status of the database. For more information about the valid values, see the description of the ListDatabases operation.

ErrorCode String UnknownError

The error code.

ErrorMessage String UnknownError

The error message.

RequestId String 3CDB8601-AD74-4A47-8114-08E08CD6319D

The ID of the request.

Success Boolean true

Indicates whether the request was successful.

Examples

Sample requests


http(s)://[Endpoint]/? Action=GetDatabase
&Host=xxx.xxx.xxx.xxx
&Port=3306
&SchemaName=test_db
&Tid=-1
&<Common request parameters>

Sample success responses

XML format

<Database>
    <Encoding>utf8mb4</Encoding>
    <Host>pc-xxx.rwlb.rds.aliyuncs.com</Host>
    <InstanceId>24710</InstanceId>
    <DbType>polardb</DbType>
    <OwnerIdList>
        <OwnerIds>88653</OwnerIds>
        <OwnerIds>104442</OwnerIds>
    </OwnerIdList>
    <EnvType>product</EnvType>
    <DbaId>104442</DbaId>
    <OwnerNameList>
        <OwnerNames>xxx</OwnerNames>
        <OwnerNames>xxx[RAM user]</OwnerNames>
    </OwnerNameList>
    <Port>3306</Port>
    <DatabaseId>116367</DatabaseId>
    <State>NORMAL</State>
    <SearchName>xxx_test@pc-xxx.rwlb.rds.aliyuncs.com:3306[xxx_test]</SearchName>
    <DbaName>xxx[RAM user]</DbaName>
    <SchemaName>xxx_test</SchemaName>
</Database>
<RequestId>3CDB8601-AD74-4A47-8114-08E08CD6319D</RequestId>
<Success>true</Success>

JSON format

{
	"Database":{
		"Encoding":"utf8mb4",
		"Host":"pc-xxx.rwlb.rds.aliyuncs.com",
		"InstanceId":24710,
		"DbType":"polardb",
		"OwnerIdList":{
			"OwnerIds":[
				88653,
				104442
			]
		},
		"EnvType":"product",
		"DbaId":104442,
		"OwnerNameList":{
			"OwnerNames":[
				"xxx",
				"xxx[RAM user]"
			]
		},
		"Port":3306,
		"DatabaseId":116367,
		"State":"NORMAL",
		"SearchName":"xxx_test@pc-xxx.rwlb.rds.aliyuncs.com:3306[xxx_test]",
		"DbaName":"xxx[RAM user]",
		"SchemaName":"xxx_test"
	},
	"RequestId":"3CDB8601-AD74-4A47-8114-08E08CD6319D",
	"Success":true
}

Error codes

For a list of error codes, visit the API Error Center.