Table: alicloud_rds_database - Query Alicloud RDS Databases using SQL
Alicloud RDS (Relational Database Service) is a web service that makes it easier to set up, operate, and scale a relational database in the cloud. It provides cost-efficient, resizable capacity for an industry-standard relational database and manages common database administration tasks. Alicloud RDS supports multiple types of databases, including MySQL, SQL Server, and PostgreSQL, among others.
Table Usage Guide
The alicloud_rds_database
table provides insights into databases within Alicloud RDS. As a database administrator or a DevOps engineer, explore database-specific details through this table, including database names, character sets, and associated metadata. Utilize it to uncover information about databases, such as their status, creation times, and engine versions.
Examples
Basic info
Explore which databases are active and their corresponding engines in your Alicloud RDS service. This can be beneficial for a quick overview of your database's status and understanding which database engines are in use.
select db_name, db_instance_id, db_status, enginefrom alicloud_rds_database;
select db_name, db_instance_id, db_status, enginefrom alicloud_rds_database;
Count databases per instance
Assess the number of databases within each instance to better understand your resource distribution and usage. This can be useful in managing your resources effectively and planning for capacity or scaling needs.
select db_instance_id, count("db_name") as database_countfrom alicloud_rds_databasegroup by db_instance_id;
select db_instance_id, count("db_name") as database_countfrom alicloud_rds_databasegroup by db_instance_id;
List databases of engine MySQL
Explore the status and instance IDs of your MySQL databases. This is useful for managing and tracking your MySQL databases across your Alicloud RDS service.
select db_name, db_instance_id, db_status, enginefrom alicloud_rds_databasewhere engine = 'MySQL';
select db_name, db_instance_id, db_status, enginefrom alicloud_rds_databasewhere engine = 'MySQL';
Get DB instance details of each database
This example helps you discover the segments that include specific details about each database in your Alicloud RDS instances. It assists in gaining insights into the network type, creation time, and engine used, which can be beneficial for database management and optimization.
select d.db_name, d.db_instance_id, i.vpc_id, i.creation_time, i.engine, i.db_instance_net_typefrom alicloud_rds_database as d, alicloud_rds_instance as iwhere d.db_instance_id = i.db_instance_id;
select d.db_name, d.db_instance_id, i.vpc_id, i.creation_time, i.engine, i.db_instance_net_typefrom alicloud_rds_database as d, alicloud_rds_instance as iwhere d.db_instance_id = i.db_instance_id;
List databases that are not running
Determine the areas in which certain databases are not operational. This is particularly useful for identifying potential issues and ensuring all databases are functioning as expected.
select db_name, db_instance_id, db_statusfrom alicloud_rds_instancewhere db_status <> 'Running';
select db_name, db_instance_id, db_statusfrom alicloud_rds_instancewhere db_status <> 'Running';
Query examples
Schema for alicloud_rds_database
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The Alicloud Account ID in which the resource is located. |
accounts | jsonb | An array that consists of the details of the accounts. Each account has specific permissions on the database. | |
character_set_name | text | The name of the character set. | |
db_description | text | The description of the database. | |
db_instance_id | text | = | The unique ID of the instance. |
db_name | text | = | The name of the database. |
db_status | text | = | The status of the database. Valid values: Creating, Running and Deleting. |
engine | text | The database engine of the instance to which the database belongs. | |
region | text | The Alicloud region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tde_status | text | The TDE status of the database. | |
title | text | Title of the resource. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- alicloud
You can pass the configuration to the command with the --config
argument:
steampipe_export_alicloud --config '<your_config>' alicloud_rds_database