Table: oci_database_autonomous_database - Query OCI Database Autonomous Databases using SQL
The Autonomous Database is a feature of the Oracle Cloud Infrastructure Database service. It automates management tasks such as tuning, patching, backups and more, allowing developers to focus on higher-value tasks. The Autonomous Database supports a variety of workloads, including OLTP, data warehousing, and JSON document store.
Table Usage Guide
The oci_database_autonomous_database
table provides insights into Autonomous Databases within Oracle Cloud Infrastructure Database service. As a database administrator or developer, explore specific details about these databases, including their configurations, statuses, and associated metadata. Utilize this table to manage and monitor your databases, ensuring they are optimized, secure, and functioning as expected.
Examples
Basic info
Gain insights into the lifecycle state and creation time of your autonomous databases to better understand their status and duration of existence. This is particularly useful for database management and auditing purposes.
select db_name, display_name, lifecycle_state, time_createdfrom oci_database_autonomous_database;
select db_name, display_name, lifecycle_state, time_createdfrom oci_database_autonomous_database;
List databases that are not available
Discover the databases that are currently not available. This can be useful to identify potential issues or disruptions in your database services.
select db_name, display_name, lifecycle_state, time_createdfrom oci_database_autonomous_databasewhere lifecycle_state <> 'AVAILABLE';
select db_name, display_name, lifecycle_state, time_createdfrom oci_database_autonomous_databasewhere lifecycle_state <> 'AVAILABLE';
List databases with a data storage size greater than 1024 GB
Discover the databases that have a storage size exceeding 1024 GB. This query is useful to monitor and manage your database storage, aiding in efficient resource allocation and preventing potential storage shortages.
select db_name, display_name, lifecycle_state, time_createdfrom oci_database_autonomous_databasewhere data_storage_size_in_gbs > 1024;
select db_name, display_name, lifecycle_state, time_createdfrom oci_database_autonomous_databasewhere data_storage_size_in_gbs > 1024;
Get KMS key details for the databases
Discover the encryption key details for your databases to gain insights into their security measures. This can be particularly useful for assessing the strength of your data protection and identifying areas for potential improvement.
select d.db_name, d.display_name, d.kms_key_id, k.name as key_name, k.algorithm as key_algorithm, k.current_key_version, k.protection_modefrom oci_database_autonomous_database as d, oci_kms_key as kwhere k.id = d.kms_key_id;
select d.db_name, d.display_name, d.kms_key_id, k.name as key_name, k.algorithm as key_algorithm, k.current_key_version, k.protection_modefrom oci_database_autonomous_database as d, oci_kms_key as kwhere k.id = d.kms_key_id;
Get KMS vault details for the databases
Determine the areas in which your databases are connected to specific KMS vaults. This can help you understand the security measures in place for your data, as well as identify potential areas for improvement or optimization.
select d.db_name, d.display_name, d.vault_id, v.display_name as vault_display_name, v.crypto_endpoint, v.vault_type, v.management_endpointfrom oci_database_autonomous_database as d, oci_kms_vault as vwhere v.id = d.vault_id;
select d.db_name, d.display_name, d.vault_id, v.display_name as vault_display_name, v.crypto_endpoint, v.vault_type, v.management_endpointfrom oci_database_autonomous_database as d, oci_kms_vault as vwhere v.id = d.vault_id;
Query examples
- database_autonomous_database_access_detail
- database_autonomous_database_backup
- database_autonomous_database_core
- database_autonomous_database_data_guard
- database_autonomous_database_db
- database_autonomous_database_input
- database_autonomous_database_overview
- database_autonomous_database_private_endpoint
- database_autonomous_database_tag
- database_autonomous_databases_for_kms_key
- database_autonomous_db_1_year
- database_autonomous_db_24_hrs
- database_autonomous_db_30_days
- database_autonomous_db_365_days
- database_autonomous_db_90_days
- database_autonomous_db_age_report
- database_autonomous_db_by_compartment
- database_autonomous_db_by_creation_month
- database_autonomous_db_by_region
- database_autonomous_db_by_tenancy
- database_autonomous_db_by_workload_type
- database_autonomous_db_count
- database_autonomous_db_total_cores
- database_autonomous_db_total_size
- database_autonomous_db_with_data_guard_count
- kms_keys_for_database_autonomous_database
- kms_vaults_for_database_autonomous_database
- vcn_network_security_groups_for_database_autonomous_database
- vcn_subnets_for_database_autonomous_database
- vcn_vcns_for_database_autonomous_database
Control examples
- CIS v1.2.0 > 2 Networking > 2.8 Ensure Oracle Autonomous Shared Databases (ADB) access is restricted to allowed sources or deployed within a Virtual Cloud Network
- CIS v2.0.0 > 2 Networking > 2.8 Ensure Oracle Autonomous Shared Databases (ADB) access is restricted to allowed sources or deployed within a Virtual Cloud Network
Schema for oci_database_autonomous_database
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
apex_details | jsonb | Information about Oracle APEX Application Development. | |
are_primary_whitelisted_ips_used | boolean | This field will be null if the Autonomous Database is not Data Guard enabled or Access Control is disabled. | |
autonomous_container_database_id | text | = | The Autonomous Container Database OCID. |
available_upgrade_versions | jsonb | List of Oracle Database versions available for a database upgrade. If there are no version upgrades available, this list is empty. | |
backup_config | jsonb | Autonomous Database configuration details for storing manual backups in the Object Storage service. | |
compartment_id | text | = | The OCID of the compartment in Tenant in which the resource is located. |
connection_strings | jsonb | The connection string used to connect to the Autonomous Database. The username for the Service Console is ADMIN. Use the password you entered when creating the Autonomous Database for the password value. | |
connection_urls | jsonb | The URLs for accessing Oracle Application Express (APEX) and SQL Developer Web with a browser from a Compute instance within your VCN or that has a direct connection to your VCN. Note that these URLs are provided by the console only for databases on dedicated Exadata infrastructure. | |
cpu_core_count | bigint | The number of OCPU cores to be made available to the database. | |
data_safe_status | text | Status of the Data Safe registration for this Autonomous Database. | |
data_storage_size_in_gbs | bigint | The quantity of data in the database, in gigabytes. | |
data_storage_size_in_tbs | bigint | The quantity of data in the database, in terabytes. | |
db_name | text | The database name. | |
db_version | text | = | A valid Oracle Database version for Autonomous Database. |
db_workload | text | = | The Autonomous Database workload type. |
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. | |
display_name | text | = | The user-friendly name for the Autonomous Database. The name does not have to be unique. |
failed_data_recovery_in_seconds | bigint | Indicates the number of seconds of data loss for a Data Guard failover. | |
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 Autonomous Database. |
infrastructure_type | text | = | The infrastructure type this resource belongs to. |
is_access_control_enabled | boolean | Indicates if the database-level access control is enabled. | |
is_auto_scaling_enabled | boolean | Indicates if auto scaling is enabled for the Autonomous Database CPU core count. | |
is_data_guard_enabled | boolean | !=, = | Indicates whether the Autonomous Database has Data Guard enabled. |
is_dedicated | boolean | True if the database uses dedicated Exadata infrastructure. | |
is_free_tier | boolean | !=, = | Indicates if this is an Always Free resource. The default value is false. |
is_preview | boolean | Indicates if the Autonomous Database version is a preview version. | |
is_refreshable_clone | boolean | Indicates whether the Autonomous Database is a refreshable clone. | |
key_store_id | text | The OCID of the key store. | |
key_store_wallet_name | text | The wallet name for Oracle Key Vault. | |
kms_key_id | text | The OCID of the key container that is used as the master encryption key in database transparent data encryption (TDE) operations. | |
kms_key_version_id | text | The OCID of the key container version that is used in database transparent data encryption (TDE) operations KMS Key can have multiple key versions. | |
license_model | text | The Oracle license model that applies to the Oracle Autonomous Database. | |
lifecycle_details | text | Information about the current lifecycle state. | |
lifecycle_state | text | = | The current state of the Autonomous Database. |
nsg_ids | jsonb | A list of the OCIDs of the network security groups (NSGs) that this resource belongs to. | |
open_mode | text | The `DATABASE OPEN` mode. You can open the database in `READ_ONLY` or `READ_WRITE` mode. | |
operations_insights_status | text | Status of Operations Insights for this Autonomous Database. | |
permission_level | text | The Autonomous Database permission level. | |
private_endpoint | text | The private endpoint for the resource. | |
private_endpoint_ip | text | The private endpoint Ip address for the resource. | |
private_endpoint_label | text | The private endpoint label for the resource. | |
refreshable_mode | text | The refresh mode of the clone. AUTOMATIC indicates that the clone is automatically being refreshed with data from the source Autonomous Database. | |
refreshable_status | text | The refresh status of the clone. REFRESHING indicates that the clone is currently being refreshed with data from the source Autonomous Database. | |
region | text | The OCI region in which the resource is located. | |
role | text | The role of the Autonomous Data Guard-enabled Autonomous Container Database. | |
service_console_url | text | The URL of the Service Console for the Autonomous Database. | |
source_id | text | The OCID of the source Autonomous Database that was cloned to create the current Autonomous Database. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
standby_db | jsonb | Autonomous Data Guard standby database details. | |
standby_whitelisted_ips | jsonb | The client IP access control list (ACL). This feature is available for autonomous databases on shared Exadata infrastructure and on Exadata Cloud@Customer. Only clients connecting from an IP address included in the ACL may access the Autonomous Database instance. For shared Exadata infrastructure, this is an array of CIDR (Classless Inter-Domain Routing) notations for a subnet or VCN OCID. | |
subnet_id | text | The OCID of the subnet the resource is associated with. | |
system_tags | jsonb | System tags for resource. System tags can be viewed by users, but can only be created by the system. | |
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 Autonomous Database was created. | |
time_deletion_of_free_autonomous_database | timestamp with time zone | The date and time the Always Free database will be automatically deleted because of inactivity. If the database is in the STOPPED state and without activity until this time, it will be deleted. | |
time_maintenance_begin | timestamp with time zone | The date and time when maintenance will begin. | |
time_maintenance_end | timestamp with time zone | The date and time when maintenance will end. | |
time_of_last_failover | timestamp with time zone | The timestamp of the last failover operation. | |
time_of_last_refresh | timestamp with time zone | The date and time when last refresh happened. | |
time_of_last_refresh_point | timestamp with time zone | The refresh point timestamp (UTC). The refresh point is the time to which the database was most recently refreshed. Data created after the refresh point is not included in the refresh. | |
time_of_last_switchover | timestamp with time zone | The timestamp of the last switchover operation for the Autonomous Database. | |
time_of_next_refresh | timestamp with time zone | The date and time of next refresh. | |
time_reclamation_of_free_autonomous_database | timestamp with time zone | The date and time the Always Free database will be stopped because of inactivity. If this time is reached without any database activity, the database will automatically be put into the STOPPED state. | |
title | text | Title of the resource. | |
used_data_storage_size_in_tbs | bigint | The amount of storage that has been used, in terabytes. | |
vault_id | text | The OCID of the Oracle Cloud Infrastructure vault. | |
whitelisted_ips | jsonb | The client IP access control list (ACL). |
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_database_autonomous_database