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_timefrom alicloud_rds_backup;
select backup_id, db_instance_id, backup_status, backup_mode, backup_size, backup_start_timefrom 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_countfrom alicloud_rds_backupgroup by db_instance_id;
select db_instance_id, count(backup_id) as backup_countfrom alicloud_rds_backupgroup 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_timefrom alicloud_rds_backupwhere backup_mode = 'Manual';
select backup_id, db_instance_id, backup_status, backup_mode, backup_size, backup_start_timefrom alicloud_rds_backupwhere 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_timefrom alicloud_rds_backupwhere backup_type = 'IncrementalBackup';
select backup_id, db_instance_id, backup_status, backup_type, backup_size, backup_start_time, backup_end_timefrom alicloud_rds_backupwhere 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_locationfrom alicloud_rds_backupwhere backup_location = 'OSS';
select backup_id, db_instance_id, backup_status, backup_type, backup_size, backup_start_time, backup_end_time, backup_locationfrom alicloud_rds_backupwhere 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_locationfrom alicloud_rds_backupwhere 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_locationfrom alicloud_rds_backupwhere backup_end_time >= datetime('now', '-30 day');
Query examples
Schema for alicloud_rds_backup
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
account_id | text | =, !=, ~~, ~~*, !~~, !~~* | The Alicloud Account ID in which the resource is located. |
backup_db_names | text | The name of the database that has been backed up. | |
backup_download_url | text | The internet download URL of the backup set. If the download URL is unavailable, this parameter is an empty string. | |
backup_end_time | timestamp 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_status | text | The backup extraction status. | |
backup_id | text | = | The ID of the backup set. |
backup_initiator | text | The initiator of the backup task. | |
backup_intranet_download_url | text | The internal download URL of the backup set. | |
backup_location | text | = | The location where backup is available. |
backup_method | text | The backup method. Valid values: Snapshot, Physical and Logical. | |
backup_mode | text | = | The backup mode. |
backup_size | bigint | The size of the backup set. Unit: bytes. | |
backup_start_time | timestamp 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_status | text | = | The status of the backup. Valid values: Success, Failed. |
backup_type | text | The backup type. | |
consistent_time | timestamp with time zone | The point in time at which the data in the data backup is consistent. | |
copy_only_backup | text | The backup mode of the data backup. Valid values: 0, 1. | |
db_instance_id | text | = | The ID of the single instance to query. |
encryption | text | The encryption information of the data backup. | |
host_instance_id | text | The 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_avail | text | Indicates whether the data backup is available. Valid values: 0, 1. | |
meta_status | text | The status of the data backup file that is used to restore individual databases or tables. | |
slave_status | text | The slave status of the backup. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
storage_class | text | The storage class of the data backup. Valid values: 0(regular storage), 1 (archive storage). | |
store_status | text | Indicates whether the data backup can be deleted. Valid values: Enabled, Disabled. | |
title | text | Title of the resource. | |
total_backup_size | text | The 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