turbot/alicloud
steampipe plugin install alicloud

Table: alicloud_rds_backup - Query Alicloud RDS Backups using SQL

Alicloud RDS Backup is a feature of the Alicloud RDS service which allows users to create backups of their RDS instances. These backups can be used to restore a database instance to a previous state, ensuring data security and continuity. The backups can be created manually or scheduled according to the user's needs.

Table Usage Guide

The alicloud_rds_backup table provides insights into the backups of RDS instances within Alicloud. As a Database Administrator, you can explore backup-specific details through this table, including backup status, type, method, and more. Utilize it to understand your current backup strategy, identify potential risks, and ensure the security and continuity of your data.

Examples

Basic info

Explore the status and details of your database backups to ensure they are functioning as expected and to understand their impact on storage capacity. This is crucial in maintaining data safety and optimizing resource usage.

select
backup_id,
db_instance_id,
backup_status,
backup_mode,
backup_size,
backup_start_time
from
alicloud_rds_backup;
select
backup_id,
db_instance_id,
backup_status,
backup_mode,
backup_size,
backup_start_time
from
alicloud_rds_backup;

Count backup by instance

Assess the number of backups associated with each database instance. This can be useful for managing and monitoring data redundancy and recovery processes.

select
db_instance_id,
count(backup_id) as backup_count
from
alicloud_rds_backup
group by
db_instance_id;
select
db_instance_id,
count(backup_id) as backup_count
from
alicloud_rds_backup
group by
db_instance_id;

List manual backups

Explore which backups have been manually created in your database. This can be useful in understanding your backup strategy and ensuring that manual backups are being created as expected.

select
backup_id,
db_instance_id,
backup_status,
backup_mode,
backup_size,
backup_start_time
from
alicloud_rds_backup
where
backup_mode = 'Manual';
select
backup_id,
db_instance_id,
backup_status,
backup_mode,
backup_size,
backup_start_time
from
alicloud_rds_backup
where
backup_mode = 'Manual';

List backups of type incremental

Explore which backups are incremental in nature, allowing you to focus on specific data recovery scenarios where only changes since the last backup are needed, thus saving time and resources.

select
backup_id,
db_instance_id,
backup_status,
backup_type,
backup_size,
backup_start_time,
backup_end_time
from
alicloud_rds_backup
where
backup_type = 'IncrementalBackup';
select
backup_id,
db_instance_id,
backup_status,
backup_type,
backup_size,
backup_start_time,
backup_end_time
from
alicloud_rds_backup
where
backup_type = 'IncrementalBackup';

List backups by location

Explore which backups are stored in a specific location to better manage storage and retrieval processes.

select
backup_id,
db_instance_id,
backup_status,
backup_type,
backup_size,
backup_start_time,
backup_end_time,
backup_location
from
alicloud_rds_backup
where
backup_location = 'OSS';
select
backup_id,
db_instance_id,
backup_status,
backup_type,
backup_size,
backup_start_time,
backup_end_time,
backup_location
from
alicloud_rds_backup
where
backup_location = 'OSS';

List backups that were created in the last 30 days

This query helps to monitor and manage data security by identifying recent database backups. It is particularly useful in ensuring regular backups are being created and stored correctly, which is crucial for data recovery in case of accidental loss or system failure.

select
backup_id,
db_instance_id,
backup_status,
backup_type,
backup_size,
backup_start_time,
backup_end_time,
backup_location
from
alicloud_rds_backup
where
backup_end_time >= now() - interval '30' day;
select
backup_id,
db_instance_id,
backup_status,
backup_type,
backup_size,
backup_start_time,
backup_end_time,
backup_location
from
alicloud_rds_backup
where
backup_end_time >= datetime('now', '-30 day');

Schema for alicloud_rds_backup

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
account_idtext=, !=, ~~, ~~*, !~~, !~~*The Alicloud Account ID in which the resource is located.
backup_db_namestextThe name of the database that has been backed up.
backup_download_urltextThe internet download URL of the backup set. If the download URL is unavailable, this parameter is an empty string.
backup_end_timetimestamp with time zone=The end of the backup time range. The time is in the yyyy-MM-ddTHH:mm:ssZ format and displayed in UTC.
backup_extraction_statustextThe backup extraction status.
backup_idtext=The ID of the backup set.
backup_initiatortextThe initiator of the backup task.
backup_intranet_download_urltextThe internal download URL of the backup set.
backup_locationtext=The location where backup is available.
backup_methodtextThe backup method. Valid values: Snapshot, Physical and Logical.
backup_modetext=The backup mode.
backup_sizebigintThe size of the backup set. Unit: bytes.
backup_start_timetimestamp with time zone=The beginning of the backup time range. The time is in the yyyy-MM-ddTHH:mm:ssZ format and displayed in UTC.
backup_statustext=The status of the backup. Valid values: Success, Failed.
backup_typetextThe backup type.
consistent_timetimestamp with time zoneThe point in time at which the data in the data backup is consistent.
copy_only_backuptextThe backup mode of the data backup. Valid values: 0, 1.
db_instance_idtext=The ID of the single instance to query.
encryptiontextThe encryption information of the data backup.
host_instance_idtextThe number of the instance that generates the data backup. This parameter is used to indicate whether the instance that generates the data backup file is a primary instance or a secondary instance.
is_availtextIndicates whether the data backup is available. Valid values: 0, 1.
meta_statustextThe status of the data backup file that is used to restore individual databases or tables.
slave_statustextThe slave status of the backup.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
storage_classtextThe storage class of the data backup. Valid values: 0(regular storage), 1 (archive storage).
store_statustextIndicates whether the data backup can be deleted. Valid values: Enabled, Disabled.
titletextTitle of the resource.
total_backup_sizetextThe total backup size.

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_backup