Table: oci_mysql_backup - Query OCI MySQL Backups using SQL
MySQL Backups in Oracle Cloud Infrastructure (OCI) are automated or manual backups of your MySQL DB System. These backups are stored in OCI Object Storage and are used to restore a DB System to a specific point in time. The backup data includes the data volume and the system volume.
Table Usage Guide
The oci_mysql_backup
table provides insights into MySQL backups within Oracle Cloud Infrastructure (OCI). As a DBA or DevOps engineer, explore backup-specific details through this table, including backup type, lifecycle state, and associated metadata. Utilize it to uncover information about backups, such as those with specific creation and expiry times, the DB system associated with the backup, and the verification of backup configurations.
Examples
Basic info
Analyze your MySQL backups in Oracle Cloud Infrastructure to understand their current lifecycle state, backup type, and MySQL version. This can help manage backups more efficiently and ensure they're configured correctly for your needs.
select display_name, id, description, lifecycle_state as state, backup_type, mysql_versionfrom oci_mysql_backup;
select display_name, id, description, lifecycle_state as state, backup_type, mysql_versionfrom oci_mysql_backup;
List manual backups
Explore which MySQL backups have been manually created. This is useful for understanding how many backups have been created by user intervention, which can help in managing resources and planning future automated backups.
select display_name, id, creation_typefrom oci_mysql_backupwhere creation_type = 'MANUAL';
select display_name, id, creation_typefrom oci_mysql_backupwhere creation_type = 'MANUAL';
List backups with retention days less than 90 days
Determine areas in which backups have a retention period of less than 90 days. This can be useful for identifying potential vulnerabilities or non-compliance with data retention policies.
select display_name, id, retention_in_daysfrom oci_mysql_backupwhere retention_in_days < 90;
select display_name, id, retention_in_daysfrom oci_mysql_backupwhere retention_in_days < 90;
Count of backups per DB system
Explore the frequency of backups for each database system to understand how often data protection measures are being implemented. This can help in assessing the robustness of your data recovery strategy.
select db_system_id, count(*) as backup_countfrom oci_mysql_backupgroup by db_system_id;
select db_system_id, count(*) as backup_countfrom oci_mysql_backupgroup by db_system_id;
Query examples
- mysql_automatic_backup_count
- mysql_backup_1_year
- mysql_backup_24_hrs
- mysql_backup_30_days
- mysql_backup_365_days
- mysql_backup_90_days
- mysql_backup_age_report
- mysql_backup_by_backup_type
- mysql_backup_by_compartment
- mysql_backup_by_creation_month
- mysql_backup_by_creation_type
- mysql_backup_by_region
- mysql_backup_by_tenancy
- mysql_backup_count
- mysql_backup_storage_by_backup_type
- mysql_backup_storage_by_compartment
- mysql_backup_storage_by_creation_month
- mysql_backup_storage_by_creation_type
- mysql_backup_storage_by_region
- mysql_backup_storage_by_tenancy
- mysql_backup_storage_total
- mysql_backups_for_mysql_db_system
- mysql_db_system_backup
- mysql_db_system_backup_disabled_count
- mysql_full_backup_count
Schema for oci_mysql_backup
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
backup_size_in_gbs | bigint | The size of the backup in GiBs. | |
backup_type | text | The type of backup. | |
compartment_id | text | = | The OCID of the compartment in Tenant in which the resource is located. |
creation_type | text | = | If the backup was created automatically, or by a manual request. |
data_storage_size_in_gbs | bigint | Initial size of the data volume in GiBs. | |
db_system_id | text | = | The OCID of the DB System the Backup is associated with. |
db_system_snapshot | jsonb | Snapshot of the DbSystem details at the time of the backup. | |
defined_tags | jsonb | Defined tags for resource. Defined tags are set up in your tenancy by an administrator. Only users granted permission to work with the defined tags can apply them to resources. | |
description | text | A user-supplied description of the backup. | |
display_name | text | = | A user-supplied display name for the backup. |
freeform_tags | jsonb | Free-form tags for resource. This tags can be applied by any user with permissions on the resource. | |
id | text | = | The OCID of the backup. |
lifecycle_details | text | Additional information about the current lifecycleState. | |
lifecycle_state | text | = | The current state of the Backup. |
mysql_version | text | The version of the DB System used for backup. | |
region | text | The OCI region in which the resource is located. | |
retention_in_days | bigint | Number of days to retain this backup. | |
shape_name | text | The shape of the DB System instance used for backup. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tags | jsonb | A map of tags for the resource. | |
tenant_id | text | =, !=, ~~, ~~*, !~~, !~~* | The OCID of the Tenant in which the resource is located. |
tenant_name | text | The name of the Tenant in which the resource is located. | |
time_created | timestamp with time zone | The time the backup record was created. | |
time_updated | timestamp with time zone | The time at which the backup was updated. | |
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)" -- oci
You can pass the configuration to the command with the --config
argument:
steampipe_export_oci --config '<your_config>' oci_mysql_backup