Table: oci_core_volume_backup_policy - Query OCI Core Volume Backup Policies using SQL
A Core Volume Backup Policy in Oracle Cloud Infrastructure (OCI) is a resource that defines a set of rules for automatic backups of block volumes. These policies are designed to automate the process of backing up your data, ensuring that it's protected and can be restored if necessary. They offer flexibility in terms of scheduling, allowing you to specify when backups should occur and how long they should be retained.
Table Usage Guide
The oci_core_volume_backup_policy
table provides insights into the backup policies of block volumes within OCI. As a system administrator, you can use this table to explore policy-specific details, including backup schedules, retention periods, and associated metadata. This can be particularly useful for ensuring data protection and compliance with organizational backup policies.
Examples
Basic info
Explore which volume backup policies have been created in specific regions, along with their creation times and any applied tags. This can be useful for managing and tracking backup policies across different geographies.
select id, display_name, time_created, region, tagsfrom oci_core_volume_backup_policy;
select id, display_name, time_created, region, tagsfrom oci_core_volume_backup_policy;
Get the destination region for each volume backup policy
Determine the destination region for each volume backup policy to help manage and optimize data storage across different regions.
select id, display_name, destination_regionfrom oci_core_volume_backup_policy;
select id, display_name, destination_regionfrom oci_core_volume_backup_policy;
Get schedule info for each volume backup policy
Explore the scheduling details for each volume backup policy. This can help in identifying when and how frequently backups are taken, thus enabling efficient resource planning and data recovery strategies.
select id, display_name, s ->> 'backupType' as backup_type, s ->> 'dayOfMonth' as day_of_month, s ->> 'dayOfWeek' as day_of_week, s ->> 'hourOfDay' as hour_of_day, s ->> 'month' as month, s ->> 'offsetSeconds' as offset_econds, s ->> 'offsetType' as offset_type, s ->> 'period' as offset_econds, s ->> 'retentionSeconds' as retention_seconds, s ->> 'timeZone' as time_zonefrom oci_core_volume_backup_policy, jsonb_array_elements(schedules) as s;
select id, display_name, json_extract(s.value, '$.backupType') as backup_type, json_extract(s.value, '$.dayOfMonth') as day_of_month, json_extract(s.value, '$.dayOfWeek') as day_of_week, json_extract(s.value, '$.hourOfDay') as hour_of_day, json_extract(s.value, '$.month') as month, json_extract(s.value, '$.offsetSeconds') as offset_econds, json_extract(s.value, '$.offsetType') as offset_type, json_extract(s.value, '$.period') as offset_econds, json_extract(s.value, '$.retentionSeconds') as retention_seconds, json_extract(s.value, '$.timeZone') as time_zonefrom oci_core_volume_backup_policy, json_each(schedules) as s;
List volume back policies that create full backups
Explore which volume backup policies are set to create full backups. This can be beneficial to ensure important data is completely backed up and to identify any areas that may require a change in backup strategy.
select id, display_name, s ->> 'backupType' as backup_typefrom oci_core_volume_backup_policy, jsonb_array_elements(schedules) as swhere s ->> 'backupType' = 'FULL';
select id, display_name, json_extract(s.value, '$.backupType') as backup_typefrom oci_core_volume_backup_policy, json_each(schedules) as swhere json_extract(s.value, '$.backupType') = 'FULL';
Query examples
Schema for oci_core_volume_backup_policy
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
compartment_id | text | = | The OCID of the compartment in Tenant in which the resource is located. |
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. | |
destination_region | text | The paired destination region for copying scheduled backups to. | |
display_name | text | A user-friendly name for volume backup policy. | |
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 volume backup policy. |
region | text | The OCI region in which the resource is located. | |
schedules | jsonb | The collection of schedules that this policy will apply. | |
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 date and time the volume backup policy was created. | |
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_core_volume_backup_policy