turbot/alicloud
steampipe plugin install alicloud

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,
engine
from
alicloud_rds_database;
select
db_name,
db_instance_id,
db_status,
engine
from
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_count
from
alicloud_rds_database
group by
db_instance_id;
select
db_instance_id,
count("db_name") as database_count
from
alicloud_rds_database
group 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,
engine
from
alicloud_rds_database
where
engine = 'MySQL';
select
db_name,
db_instance_id,
db_status,
engine
from
alicloud_rds_database
where
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_type
from
alicloud_rds_database as d,
alicloud_rds_instance as i
where
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_type
from
alicloud_rds_database as d,
alicloud_rds_instance as i
where
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_status
from
alicloud_rds_instance
where
db_status <> 'Running';
select
db_name,
db_instance_id,
db_status
from
alicloud_rds_instance
where
db_status <> 'Running';

Schema for alicloud_rds_database

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The Alicloud Account ID in which the resource is located.
accountsjsonbAn array that consists of the details of the accounts. Each account has specific permissions on the database.
character_set_nametextThe name of the character set.
db_descriptiontextThe description of the database.
db_instance_idtext=The unique ID of the instance.
db_nametext=The name of the database.
db_statustext=The status of the database. Valid values: Creating, Running and Deleting.
enginetextThe database engine of the instance to which the database belongs.
regiontextThe Alicloud region in which the resource is located.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
tde_statustextThe TDE status of the database.
titletextTitle 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