steampipe plugin install oci

Table: oci_mysql_db_system - Query OCI MySQL Database Systems using SQL

A MySQL Database System is a managed service provided by Oracle Cloud Infrastructure (OCI) that makes it easy to set up, operate, and scale MySQL deployments in the cloud. It offers cost-efficient and resizable capacity while automating time-consuming administration tasks such as hardware provisioning, database setup, patching and backups. It frees you to focus on your applications so you can give them the fast performance, high availability, security and compatibility they need.

Table Usage Guide

The oci_mysql_db_system table provides insights into MySQL Database Systems within Oracle Cloud Infrastructure (OCI). As a Database Administrator, you can explore system-specific details through this table, including configurations, network settings, and associated metadata. Utilize it to uncover information about systems, such as their current lifecycle state, the associated configurations, and the details of the subnet in which the system resides.

Examples

Basic info

Explore the lifecycle status and creation date of your MySQL database systems to understand their operational state and longevity. This can be useful in managing and assessing the overall health of your databases.

select
id,
display_name,
lifecycle_state as state,
time_created
from
oci_mysql_db_system;
select
id,
display_name,
lifecycle_state as state,
time_created
from
oci_mysql_db_system;

List DB systems that are not active

Discover the segments that consist of DB systems that are not currently active. This is useful in identifying and managing inactive resources within your MySQL database.

select
id,
display_name,
lifecycle_state as state,
time_created
from
oci_mysql_db_system
where
lifecycle_state <> 'ACTIVE';
select
id,
display_name,
lifecycle_state as state,
time_created
from
oci_mysql_db_system
where
lifecycle_state <> 'ACTIVE';

List DB systems with backups not enabled

Discover the segments that have active database systems without backup enabled, enabling you to identify potential vulnerabilities and risks in your data management. This is crucial for maintaining data integrity and implementing disaster recovery plans.

select
id,
display_name,
lifecycle_state as state,
time_created
from
oci_mysql_db_system
where
lifecycle_state = 'ACTIVE'
and backup_policy -> 'isEnabled' <> 'true';
select
id,
display_name,
lifecycle_state as state,
time_created
from
oci_mysql_db_system
where
lifecycle_state = 'ACTIVE'
and json_extract(backup_policy, '$.isEnabled') <> 'true';

List the CPU and RAM configuration of DB systems

Explore the active DB systems to analyze their processing and memory capabilities. This helps in understanding the hardware resource allocation, supporting efficient system management and performance optimization.

select
id,
display_name,
lifecycle_state as state,
cpu_core_count,
memory_size_in_gbs
from
oci_mysql_db_system
where
lifecycle_state = 'ACTIVE';
select
id,
display_name,
lifecycle_state as state,
cpu_core_count,
memory_size_in_gbs
from
oci_mysql_db_system
where
lifecycle_state = 'ACTIVE';

Schema for oci_mysql_db_system

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form.
analytics_clusterjsonbA summary of an Analytics Cluster.
availability_domaintextThe Availability Domain where the primary DB System should be located.
backup_policyjsonbBackupPolicy The Backup policy for the DB System.
channelsjsonbA list with a summary of all the Channels attached to the DB System.
compartment_idtext=The OCID of the compartment in Tenant in which the resource is located.
configuration_idtext=The OCID of the Configuration to be used for Instances in this DB System.
cpu_core_countbigintThe number of CPU Cores the Instance provides. These are OCPU's.
data_storage_size_in_gbsbigintInitial size of the data volume in GiBs that will be created and attached.
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.
descriptiontextUser-provided data about the DB System.
display_nametext=The user-friendly name for the DB System. It does not have to be unique.
endpointsjsonbThe network endpoints available for this DB System.
fault_domaintextThe name of the fault domain the DB System is located in.
freeform_tagsjsonbFree-form tags for resource. This tags can be applied by any user with permissions on the resource.
hostname_labeltextThe hostname for the primary endpoint of the DB System.
idtext=The OCID of the DB System.
ip_addressinetThe IP address the DB System is configured to listen on.
is_analytics_cluster_attachedboolean=If the DB System has an Analytics Cluster attached.
is_heat_wave_cluster_attachedboolean=Whether the DB System has a HeatWave cluster attached.
lifecycle_detailstextAdditional information about the current lifecycleState.
lifecycle_statetext=The current state of the DB System.
maintenancejsonbThe Maintenance Policy for the DB System.
memory_size_in_gbsbigintThe amount of RAM the Instance provides. This is an IEC base-2 number.
mysql_versiontextName of the MySQL Version in use for the DB System.
portbigintThe port for primary endpoint of the DB System to listen on.
port_xbigintThe network port on which X Plugin listens for TCP/IP connections. This is the X Plugin equivalent of port.
regiontextThe OCI region in which the resource is located.
shape_nametextThe shape of the primary instances of the DB System.
sourcejsonbDbSystemSource Parameters detailing how to provision the initial data of the DB System.
sp_connection_nametext=, !=, ~~, ~~*, !~~, !~~*Steampipe connection name.
sp_ctxjsonbSteampipe context in JSON form.
subnet_idtextThe OCID of the subnet the DB System is associated with.
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 DB System was created.
time_updatedtimestamp with time zoneThe time the DB System was last updated.
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_mysql_db_system