开发者社区> 问答> 正文

怎样查看数据库列表


描述


查找指定实例、指定DB的DB列表信息。如果查找参数类型错误,返回错误提示,返回数据为空。


[backcolor=transparent]注意:此接口不支持PostgreSQL和PPAS。


请求参数

名称类型是否必须描述
ActionString系统规定参数,取值:DescribeDatabases。
DBInstanceIdString实例名。
DBNameString数据库名称。
DBStatusString数据库状态,取值范围:
  • Creating:创建中;
  • Running:使用中;
  • Deleting:删除中。


返回参数

名称类型描述
<公共返回参数>详见公共参数
DatabasesList<Database>由Database组成的数据。


DATABASE参数

名称类型描述
DBNameString数据库名称。
DBInstanceIdString数据库所属实例名称。
EngineString数据库实例类型。
DBStatusString数据库状态,取值范围:
  • Creating:创建中;
  • Running:使用中;
  • Deleting:删除中。
CharacterSetNameString字符集。
DBDescriptionString数据库描述。
AccountsList<AccountPrivilegeInfo>有Acounts组成的list。
AccountString账号名称。
AccountPrivilegeString账号对该DB具有的权限。


AccountPrivilegeInfo参数

名称类型描述
AccountString账号名称。
AccountPrivilegeString账号对该DB具有的权限。


示例


  • 请求示例
    1. [backcolor=transparent] https[backcolor=transparent] :[backcolor=transparent] //rds.aliyuncs.com/?Action=DescribeDatabases
    2. [backcolor=transparent]&[backcolor=transparent]DBInstanceId[backcolor=transparent]=[backcolor=transparent]rds3meynazqbzju
    3. [backcolor=transparent]&<公共请求参数>

  • 返回示例
    XML格式:
    1. [backcolor=transparent] < DescribeDatabasesResponse>
    2. [backcolor=transparent]       [backcolor=transparent]<RequestId>[backcolor=transparent]2603CA96-B17D-4903-BC04-61A2C829CD94[backcolor=transparent]</RequestId>
    3. [backcolor=transparent]         [backcolor=transparent]<Databases>
    4. [backcolor=transparent]             [backcolor=transparent]<Database>
    5. [backcolor=transparent]                [backcolor=transparent]<Engine>[backcolor=transparent]MySQL[backcolor=transparent]</Engine>
    6. [backcolor=transparent]                [backcolor=transparent]<DBName>[backcolor=transparent]testdb[backcolor=transparent]</DBName>
    7. [backcolor=transparent]                [backcolor=transparent]<CharacterSetName>[backcolor=transparent]utf8[backcolor=transparent]</CharacterSetName>
    8. [backcolor=transparent]                [backcolor=transparent]<DBStatus>[backcolor=transparent]Creating[backcolor=transparent]</DBStatus>
    9. [backcolor=transparent]                [backcolor=transparent]<DBInstanceId>[backcolor=transparent]rds3meynazqbzju[backcolor=transparent]</DBInstanceId>
    10. [backcolor=transparent]                [backcolor=transparent]<Accounts>
    11. [backcolor=transparent]                       [backcolor=transparent]<AccountPrivilegeInfo></AccountPrivilegeInfo>
    12. [backcolor=transparent]                [backcolor=transparent]<Accounts>[backcolor=transparent]  
    13. [backcolor=transparent]             [backcolor=transparent]</Database>
    14. [backcolor=transparent]             [backcolor=transparent]<Database>
    15. [backcolor=transparent]                [backcolor=transparent]<Engine>[backcolor=transparent]MySQL[backcolor=transparent]</Engine>
    16. [backcolor=transparent]                [backcolor=transparent]<DBName>[backcolor=transparent]testdb2[backcolor=transparent]</DBName>
    17. [backcolor=transparent]                [backcolor=transparent]<CharacterSetName>[backcolor=transparent]gbk[backcolor=transparent]</CharacterSetName>
    18. [backcolor=transparent]                [backcolor=transparent]<DBStatus>[backcolor=transparent]Creating[backcolor=transparent]</DBStatus>
    19. [backcolor=transparent]                [backcolor=transparent]<DBInstanceId>[backcolor=transparent]rds3meynazqbzju[backcolor=transparent]</DBInstanceId>
    20. [backcolor=transparent]                [backcolor=transparent]<Accounts>
    21. [backcolor=transparent]                       [backcolor=transparent]<AccountPrivilegeInfo></AccountPrivilegeInfo>
    22. [backcolor=transparent]                [backcolor=transparent]<Accounts>[backcolor=transparent]  
    23. [backcolor=transparent]             [backcolor=transparent]</Database>
    24. [backcolor=transparent]        [backcolor=transparent]</Databases>
    25. [backcolor=transparent]</ DescribeDatabasesResponse>

    JSON格式:
    1. [backcolor=transparent]{
    2. [backcolor=transparent]  [backcolor=transparent]"RequestId"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"2603CA96-B17D-4903-BC04-61A2C829CD94"[backcolor=transparent],[backcolor=transparent]
    3. [backcolor=transparent]  [backcolor=transparent]"Databases"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
    4. [backcolor=transparent]    [backcolor=transparent]"Database"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent][
    5. [backcolor=transparent]      [backcolor=transparent]{
    6. [backcolor=transparent]        [backcolor=transparent]"Engine"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"MySQL"[backcolor=transparent],[backcolor=transparent]
    7. [backcolor=transparent]        [backcolor=transparent]"CharacterSetName"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"utf8"[backcolor=transparent],[backcolor=transparent]
    8. [backcolor=transparent]        [backcolor=transparent]"DBStatus"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"Creating"[backcolor=transparent],[backcolor=transparent]
    9. [backcolor=transparent]        [backcolor=transparent]"DBDescription"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]""[backcolor=transparent],[backcolor=transparent]
    10. [backcolor=transparent]        [backcolor=transparent]"DBInstanceId"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"rds3meynazqbzju"[backcolor=transparent],[backcolor=transparent]
    11. [backcolor=transparent]        [backcolor=transparent]"Accounts"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
    12. [backcolor=transparent]          [backcolor=transparent]" AccountPrivilegeInfo"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent][]
    13. [backcolor=transparent]        [backcolor=transparent]},[backcolor=transparent]
    14. [backcolor=transparent]        [backcolor=transparent]"DBName"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"testdb"
    15. [backcolor=transparent]      [backcolor=transparent]},[backcolor=transparent]
    16. [backcolor=transparent]      [backcolor=transparent]{
    17. [backcolor=transparent]        [backcolor=transparent]"Engine"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"MySQL"[backcolor=transparent],[backcolor=transparent]
    18. [backcolor=transparent]        [backcolor=transparent]"CharacterSetName"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"gbk"[backcolor=transparent],[backcolor=transparent]
    19. [backcolor=transparent]        [backcolor=transparent]"DBStatus"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"Creating"[backcolor=transparent],[backcolor=transparent]
    20. [backcolor=transparent]        [backcolor=transparent]"DBDescription"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]""[backcolor=transparent],[backcolor=transparent]
    21. [backcolor=transparent]        [backcolor=transparent]"DBInstanceId"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"rds3meynazqbzju"[backcolor=transparent],[backcolor=transparent]
    22. [backcolor=transparent]        [backcolor=transparent]"Accounts"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]{
    23. [backcolor=transparent]          [backcolor=transparent]" AccountPrivilegeInfo"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent][]
    24. [backcolor=transparent]        [backcolor=transparent]},[backcolor=transparent]
    25. [backcolor=transparent]        [backcolor=transparent]"DBName"[backcolor=transparent]:[backcolor=transparent] [backcolor=transparent]"testdb2"
    26. [backcolor=transparent]      [backcolor=transparent]}
    27. [backcolor=transparent]    [backcolor=transparent]]
    28. [backcolor=transparent]  [backcolor=transparent]}
    29. [backcolor=transparent]}

展开
收起
云栖大讲堂 2017-10-19 10:04:37 1595 0
0 条回答
写回答
取消 提交回答
问答排行榜
最热
最新

相关电子书

更多
DTCC 2022大会集锦《云原生一站式数据库技术与实践》 立即下载
阿里云瑶池数据库精要2022版 立即下载
2022 DTCC-阿里云一站式数据库上云最佳实践 立即下载