steampipe plugin install oci

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,
tags
from
oci_core_volume_backup_policy;
select
id,
display_name,
time_created,
region,
tags
from
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_region
from
oci_core_volume_backup_policy;
select
id,
display_name,
destination_region
from
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_zone
from
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_zone
from
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_type
from
oci_core_volume_backup_policy,
jsonb_array_elements(schedules) as s
where
s ->> 'backupType' = 'FULL';
select
id,
display_name,
json_extract(s.value, '$.backupType') as backup_type
from
oci_core_volume_backup_policy,
json_each(schedules) as s
where
json_extract(s.value, '$.backupType') = 'FULL';

Schema for oci_core_volume_backup_policy

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
compartment_idtext=The OCID of the compartment in Tenant in which the resource is located.
defined_tagsjsonbDefined 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_regiontextThe paired destination region for copying scheduled backups to.
display_nametextA user-friendly name for volume backup policy.
freeform_tagsjsonbFree-form tags for resource. This tags can be applied by any user with permissions on the resource.
idtext=The OCID of the volume backup policy.
regiontextThe OCI region in which the resource is located.
schedulesjsonbThe collection of schedules that this policy will apply.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
tagsjsonbA map of tags for the resource.
tenant_idtext=, !=, ~~, ~~*, !~~, !~~*The OCID of the Tenant in which the resource is located.
tenant_nametextThe name of the Tenant in which the resource is located.
time_createdtimestamp with time zoneThe date and time the volume backup policy was created.
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)" -- oci

You can pass the configuration to the command with the --config argument:

steampipe_export_oci --config '<your_config>' oci_core_volume_backup_policy