Table: oci_nosql_table - Query OCI NoSQL Database Tables using SQL
Oracle NoSQL Database is a fully managed NoSQL database cloud service that provides on-demand throughput and storage-based provisioning. It is designed for today's most demanding applications that require low latency responses, flexible data models, and elastic scaling for dynamic workloads. With Oracle NoSQL Database, you can focus on application development and deployment without worrying about infrastructure provisioning, patching, and scaling.
Table Usage Guide
The oci_nosql_table
table provides insights into NoSQL Database Tables within Oracle Cloud Infrastructure (OCI). As a Database Administrator or Developer, you can explore table-specific details through this table, including the schema, storage, and associated metadata. Utilize it to discover information about tables, such as their capacity, the indexes they use, and the time of their last modification.
Examples
Basic info
Explore which NoSQL tables are in use, along with their creation times and lifecycle states, to gain insights into resource allocation and usage patterns. This can help optimize database management and resource planning.
select name, id, lifecycle_state, time_createdfrom oci_nosql_table;
select name, id, lifecycle_state, time_createdfrom oci_nosql_table;
List tables that are not active
Explore which NoSQL tables in your Oracle Cloud Infrastructure are not currently active. This can help in managing resources and identifying any tables that may be underutilized or no longer needed.
select name, id, lifecycle_state, time_createdfrom oci_nosql_tablewhere lifecycle_state <> 'ACTIVE';
select name, id, lifecycle_state, time_createdfrom oci_nosql_tablewhere lifecycle_state <> 'ACTIVE';
List tables with disk storage greater than 1024 GB
Explore which tables are using significant disk storage space to manage resources more effectively. This helps in identifying tables that might be consuming more storage than expected, assisting in efficient resource allocation and cost management.
select name, id, lifecycle_state, time_createdfrom oci_nosql_tablewhere cast(table_limits -> 'maxStorageInGBs' as INTEGER) > 1024;
select name, id, lifecycle_state, time_createdfrom oci_nosql_tablewhere CAST( json_extract(table_limits, '$.maxStorageInGBs') as INTEGER ) > 1024;
Count child tables for parent tables with children
Analyze the settings to understand the distribution of child tables across parent tables. This helps in assessing the complexity of your NoSQL database structure and can guide optimization efforts.
select t2.name as parent, count(t1.*) as child_countfrom oci_nosql_table t1 join oci_nosql_table t2 on t1.title like t2.title || '.%' and t1.title <> t2.titlegroup by parent;
select t2.name as parent, count(t1.name) as child_countfrom oci_nosql_table t1 join oci_nosql_table t2 on t1.title like t2.title || '.%' and t1.title <> t2.titlegroup by parent;
Count child tables for parent tables with and without children
Determine the number of child tables linked to each parent table in your NoSQL database. This allows you to understand the complexity and structure of your data, helping in its efficient management and navigation.
select t2.name as parent, -- To exclude the parent table from being counted as a child, we subtract 1 from the count. count(t1.*) - 1 as child_countfrom oci_nosql_table t1 join oci_nosql_table t2 on t1.title like t2.title || '%'group by parent;
select t2.name as parent, -- To exclude the parent table from being counted as a child, we subtract 1 from the count. count(t1.name) - 1 as child_countfrom oci_nosql_table t1 join oci_nosql_table t2 on t1.title like t2.title || '%'group by parent;
Query examples
- nosql_table_1_year
- nosql_table_24_hrs
- nosql_table_30_days
- nosql_table_365_days
- nosql_table_90_days
- nosql_table_age_report
- nosql_table_auto_reclaimable
- nosql_table_by_compartment
- nosql_table_by_creation_month
- nosql_table_by_region
- nosql_table_by_tenancy
- nosql_table_children_for_nosql_table
- nosql_table_column
- nosql_table_count
- nosql_table_input
- nosql_table_limits
- nosql_table_overview
- nosql_table_parents_for_nosql_table
- nosql_table_read_throttle
- nosql_table_state
- nosql_table_tag
- nosql_table_write_throttle
Schema for oci_nosql_table
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. |
ddl_statement | text | A DDL statement representing the schema. | |
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. | |
freeform_tags | jsonb | Free-form tags for resource. This tags can be applied by any user with permissions on the resource. | |
id | text | = | Unique identifier that is immutable. |
is_auto_reclaimable | boolean | True if this table can be reclaimed after an idle period. | |
lifecycle_details | text | A message describing the current state in more detail. | |
lifecycle_state | text | = | The state of a table. |
name | text | = | Immutable human-friendly table name. |
region | text | The OCI region in which the resource is located. | |
schema | jsonb | The schema of the table. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
system_tags | jsonb | System tags for resource. System tags can be viewed by users, but can only be created by the system. | |
table_limits | jsonb | Various limit for the table. | |
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 the table was created. | |
time_of_expiration | timestamp with time zone | If lifecycleState is INACTIVE, indicates when this table will be automatically removed. | |
time_updated | timestamp with time zone | The time the the table 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_nosql_table