Queries details of a specific database.
Debugging
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 | 192.168.XX.XX |
The endpoint that is used to connect to the database. |
| Port | Integer | Yes | 3306 |
The port that is used to connect to the database. |
| SchemaName | String | Yes | mysql |
The name of the database. |
| Tid | Long | Yes | -1 |
The ID of the tenant. You can call the GetUserActiveTenant operation to query the ID of the tenant. |
| Sid | String | No | test_sid |
The system identifier (SID) of the database. Note The SID uniquely identifies an Oracle database. After a database is created, a SID
is generated for the database.
|
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| Database | Struct |
The details of the database. |
|
| CatalogName | String | def |
The name of the catalog to which the database belongs. |
| DatabaseId | String | 984**** |
The ID of the database. |
| DbType | String | mysql |
The type of the database. For more information about the valid values of this parameter, see DbType parameter. |
| DbaId | String | 27**** |
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 | product |
The type of the environment to which the database belongs. Valid values:
|
| Host | String | 192.168.XX.XX |
The endpoint that is used to connect to the database. |
| InstanceId | String | 149**** |
The ID of the instance. |
| OwnerIdList | List | 27**** |
The IDs of the owners of the database. |
| OwnerNameList | List | test |
The names of the owners of the database. |
| Port | Integer | 3306 |
The port that is used to connect to the database. |
| SchemaName | String | mysql |
The name of the database. |
| SearchName | String | mysql@192.168.XX.XX:3306 |
The keyword that is used to search for the database. |
| Sid | String | test_sid |
The SID of the database. Note The value of the parameter is returned only for Oracle databases.
|
| State | String | NORMAL |
The status of the database. Valid values:
|
| ErrorCode | String | UnknownError |
The error code. |
| ErrorMessage | String | An unknown error occurred. |
The error message. |
| RequestId | String | 3CDB8601-AD74-4A47-8114-08E08CD6**** |
The ID of the request. |
| Success | Boolean | true |
Indicates whether the request is successful. Valid values:
|
Examples
Sample requests
http(s)://dms-enterprise.aliyuncs.com/?Action=GetDatabase
&Host=192.168.XX.XX
&Port=3306
&SchemaName=mysql
&Tid=-1
&<Common request parameters>
Sample success responses
XML format
<GetDatabaseResponse>
<RequestId>2EF65A2C-FCDC-5E14-A8B5-8D28F33A****</RequestId>
<Database>
<SearchName>mysql@192.168.XX.XX:3306[bw-mysql-el8]</SearchName>
<InstanceId>149****</InstanceId>
<Port>3306</Port>
<Encoding>utf8mb4</Encoding>
<Host>192.168.XX.XX</Host>
<DatabaseId>984****</DatabaseId>
<DbType>mysql</DbType>
<EnvType>product</EnvType>
<DbaName>dba_name</DbaName>
<DbaId>27****</DbaId>
<State>NORMAL</State>
<CatalogName>def</CatalogName>
<OwnerNameList>
<OwnerNames>test</OwnerNames>
</OwnerNameList>
<SchemaName>mysql</SchemaName>
<OwnerIdList>
<OwnerIds>27****</OwnerIds>
</OwnerIdList>
</Database>
<Success>true</Success>
</GetDatabaseResponse>
JSON format
{
"RequestId": "2EF65A2C-FCDC-5E14-A8B5-8D28F33A****",
"Database": {
"SearchName": "mysql@192.168.XX.XX:3306[bw-mysql-el8]",
"InstanceId": "149****",
"Port": "3306",
"Encoding": "utf8mb4",
"Host": "192.168.XX.XX",
"DatabaseId": "984****",
"DbType": "mysql",
"EnvType": "product",
"DbaName": "dba_name",
"DbaId": "27****",
"State": "NORMAL",
"CatalogName": "def",
"OwnerNameList": {
"OwnerNames": [
"test"
]
},
"SchemaName": "mysql",
"OwnerIdList": {
"OwnerIds": [
"27****"
]
}
},
"Success": true
}
Error codes
For a list of error codes, visit the API Error Center.