oracle.oci.oci_opsi_database_insights_actions – Perform actions on a DatabaseInsights resource in Oracle Cloud Infrastructure

Note

This plugin is part of the oracle.oci collection (version 4.14.0).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install oracle.oci.

To use it in a playbook, specify: oracle.oci.oci_opsi_database_insights_actions.

New in version 2.9.0: of oracle.oci

Synopsis

  • Perform actions on a DatabaseInsights resource in Oracle Cloud Infrastructure

  • For action=change, moves a DatabaseInsight resource from one compartment identifier to another. When provided, If-Match is checked against ETag values of the resource.

  • For action=change_pe_comanaged, change the connection details of a co-managed database insight. When provided, If-Match is checked against ETag values of the resource.

  • For action=disable, disables a database in Operations Insights. Database metric collection and analysis will be stopped.

  • For action=enable, enables a database in Operations Insights. Database metric collection and analysis will be started.

  • For action=ingest_database_configuration, this is a generic ingest endpoint for all database configuration metrics.

  • For action=ingest_sql_bucket, the sqlbucket endpoint takes in a JSON payload, persists it in Operations Insights ingest pipeline. Either databaseId or id must be specified.

  • For action=ingest_sql_plan_lines, the SqlPlanLines endpoint takes in a JSON payload, persists it in Operation Insights ingest pipeline. Either databaseId or id must be specified.

  • For action=ingest_sql_stats, the SQL Stats endpoint takes in a JSON payload, persists it in Operations Insights ingest pipeline. Either databaseId or id must be specified.

  • For action=ingest_sql_text, the SqlText endpoint takes in a JSON payload, persists it in Operation Insights ingest pipeline. Either databaseId or id must be specified. Disclaimer: SQL text being uploaded explicitly via APIs is not masked. Any sensitive literals contained in the sqlFullText column should be masked prior to ingestion.

Requirements

The below requirements are needed on the host that executes this module.

Parameters

Parameter Choices/Defaults Comments
action
string / required
    Choices:
  • change
  • change_pe_comanaged
  • disable
  • enable
  • ingest_database_configuration
  • ingest_sql_bucket
  • ingest_sql_plan_lines
  • ingest_sql_stats
  • ingest_sql_text
The action to perform on the DatabaseInsights.
api_user
string
The OCID of the user, on whose behalf, OCI APIs are invoked. If not set, then the value of the OCI_USER_ID environment variable, if any, is used. This option is required if the user is not specified through a configuration file (See config_file_location). To get the user's OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_fingerprint
string
Fingerprint for the key pair being used. If not set, then the value of the OCI_USER_FINGERPRINT environment variable, if any, is used. This option is required if the key fingerprint is not specified through a configuration file (See config_file_location). To get the key pair's fingerprint value please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm.
api_user_key_file
string
Full path and filename of the private key (in PEM format). If not set, then the value of the OCI_USER_KEY_FILE variable, if any, is used. This option is required if the private key is not specified through a configuration file (See config_file_location). If the key is encrypted with a pass-phrase, the api_user_key_pass_phrase option must also be provided.
api_user_key_pass_phrase
string
Passphrase used by the key referenced in api_user_key_file, if it is encrypted. If not set, then the value of the OCI_USER_KEY_PASS_PHRASE variable, if any, is used. This option is required if the key passphrase is not specified through a configuration file (See config_file_location).
auth_purpose
string
    Choices:
  • service_principal
The auth purpose which can be used in conjunction with 'auth_type=instance_principal'. The default auth_purpose for instance_principal is None.
auth_type
string
    Choices:
  • api_key ←
  • instance_principal
  • instance_obo_user
  • resource_principal
The type of authentication to use for making API requests. By default auth_type="api_key" based authentication is performed and the API key (see api_user_key_file) in your config file will be used. If this 'auth_type' module option is not specified, the value of the OCI_ANSIBLE_AUTH_TYPE, if any, is used. Use auth_type="instance_principal" to use instance principal based authentication when running ansible playbooks within an OCI compute instance.
cert_bundle
string
The full path to a CA certificate bundle to be used for SSL verification. This will override the default CA certificate bundle. If not set, then the value of the OCI_ANSIBLE_CERT_BUNDLE variable, if any, is used.
compartment_id
string
The OCID of the compartment into which the resource should be moved.
Required for action=change.
Required when $p.relatedDiscriminatorFieldName is 'PE_COMANAGED_DATABASE'
config_file_location
string
Path to configuration file. If not set then the value of the OCI_CONFIG_FILE environment variable, if any, is used. Otherwise, defaults to ~/.oci/config.
config_profile_name
string
The profile to load from the config file referenced by config_file_location. If not set, then the value of the OCI_CONFIG_PROFILE environment variable, if any, is used. Otherwise, defaults to the "DEFAULT" profile in config_file_location.
credential_details
dictionary
Required for action=change_pe_comanaged.
Required when $p.relatedDiscriminatorFieldName is 'PE_COMANAGED_DATABASE'
credential_source_name
string / required
Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service.
credential_type
string / required
    Choices:
  • CREDENTIALS_BY_SOURCE
  • CREDENTIALS_BY_VAULT
Credential type.
password_secret_id
string
The secret OCID mapping to the database credentials.
Applicable when credential_type is 'CREDENTIALS_BY_VAULT'
role
string
    Choices:
  • NORMAL
database user role.
Applicable when credential_type is 'CREDENTIALS_BY_VAULT'
user_name
string
database user name.
Applicable when credential_type is 'CREDENTIALS_BY_VAULT'
database_id
string
Optional OCID of the associated DBaaS entity.
Applicable only for action=ingest_database_configurationaction=ingest_sql_bucketaction=ingest_sql_plan_linesaction=ingest_sql_statsa ction=ingest_sql_text.
database_insight_id
string
Unique database insight identifier
Required for action=change, action=change_pe_comanaged, action=disable, action=enable.
defined_tags
dictionary
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace": {"bar-key": "value"}}`
Applicable only for action=enable.
Applicable when entity_source is 'PE_COMANAGED_DATABASE'
entity_source
string
    Choices:
  • EM_MANAGED_EXTERNAL_DATABASE
  • PE_COMANAGED_DATABASE
Source of the database entity.
Required for action=enable.
freeform_tags
dictionary
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
Applicable only for action=enable.
Applicable when entity_source is 'PE_COMANAGED_DATABASE'
id
string
OCID of the database insight resource.
Applicable only for action=ingest_database_configurationaction=ingest_sql_bucketaction=ingest_sql_plan_linesaction=ingest_sql_statsa ction=ingest_sql_text.
items
list / elements=dictionary
Array of one or more database configuration metrics objects.
Required for action=ingest_database_configuration.
access_predicates
string
Access predicates Example: `"\"RESOURCE_ID\"=:1 AND \"QUERY_ID\"=:2"`
action
string
Contains the name of the action that was executing when the SQL statement was first parsed, which is set by calling DBMS_APPLICATION_INFO.SET_ACTION
application_wait_time_in_us
integer
Application wait time (in microseconds)
avg_hard_parse_time_in_us
integer
Average hard parse time (in microseconds) used by this cursor
avoided_executions
integer
Number of executions attempted on this object, but prevented due to the SQL statement being in quarantine
bucket_id
string
SQL Bucket ID, examples <= 3 secs, 3-10 secs, 10-60 secs, 1-5 min, > 5 min Example: `"<= 3 secs"`
buffer_gets
integer
Number of Buffer Gets
bytes
integer
Bytes Example: `150`
cardinality
integer
Cardinality Example: `1`
cdb
string
Indicates if it is a CDB or not. This would be 'yes' or 'no'.
Applicable when metric_name is 'DB_EXTERNAL_PROPERTIES'
child_number
integer
Number of this child cursor
cluster_wait_time_in_us
integer
Cluster wait time (in microseconds). This value is specific to Oracle RAC
command_type
integer
Oracle command type definition
concurrency_wait_time_in_us
integer
Concurrency wait time (in microseconds)
control_file_type
string
Type of control file.
Applicable when metric_name is 'DB_EXTERNAL_PROPERTIES'
cost
integer
Cost Example: `1`
cpu_cost
integer
CPU cost Example: `7321`
cpu_count
integer
Total number of CPUs allocated for the host.
Applicable when metric_name is 'DB_EXTERNAL_INSTANCE'
cpu_time_in_sec
float
Total CPU time Example: `1046`
cpu_time_in_us
integer
CPU time (in microseconds) used by this cursor for parsing, executing, and fetching
created
string
Creation time.
Applicable when metric_name is 'DB_EXTERNAL_PROPERTIES'
database_role
string
Current role of the database.
Applicable when metric_name is 'DB_EXTERNAL_PROPERTIES'
database_status
string
Status of the database.
Applicable when metric_name is 'DB_EXTERNAL_INSTANCE'
database_type
string
Operations Insights internal representation of the database type.
db_external_instance_version
string
Database version.
Applicable when metric_name is 'DB_EXTERNAL_INSTANCE'
delta_cpu_rank
integer
Rank based on CPU Consumption
delta_cpu_time
integer
CPU time (in microseconds) for the cursor since the last AWR snapshot
delta_execs_rank
integer
Rank based on number of execution
delta_execution_count
integer
Number of executions for the cursor since the last AWR snapshot
delta_io_bytes
integer
Number of I/O bytes exchanged between the Oracle database and the storage system for the cursor since the last AWR snapshot
delta_io_rank
integer
Rank based on I/O Consumption
depth
integer
Depth Example: `3`
direct_reads
integer
Number of direct reads
direct_writes
integer
Number of Direct writes
disk_reads
integer
Number of disk reads
distribution
string
Distribution Example: `"QC (RANDOM)"`
edition
string
The edition of the database.
Applicable when metric_name is 'DB_EXTERNAL_INSTANCE'
elapsed_time_in_sec
float
Total elapsed time Example: `1.2`
elapsed_time_in_us
integer
Elapsed time (in microseconds) used by this cursor for parsing, executing, and fetching.
end_of_fetch_count
integer
Number of times this cursor was fully executed since the cursor was brought into the library cache
exact_matching_signature
string
exact_matching_signature Example: `"18067345456756876713"`
executions
integer
Number of executions
executions_count
integer
Total number of executions Example: `60`
fetches
integer
Number of fetches
filter_predicates
string
Filter predicates Example: `"(INTERNAL_FUNCTION(\"J\".\"DATABASE_ROLE\") OR (\"J\".\"DATABASE_ROLE\" IS NULL AND SYS_CONTEXT('userenv','database_role')='PRIMARY'))"`
force_matching_signature
string
force_matching_signature Example: `"18067345456756876713"`
full_plan_hash_value
string
Total Number of rows in SQLStats table
guard_status
string
Data protection policy.
Applicable when metric_name is 'DB_EXTERNAL_PROPERTIES'
harmonic_sum
integer
Harmonic sum based on ranking parameters
host_memory_capacity
float
Total amount of usable Physical RAM Memory available in gigabytes.
Applicable when metric_name is 'DB_EXTERNAL_INSTANCE'
host_name
string
Host name of the database instance.
Required when metric_name is one of ['DB_EXTERNAL_INSTANCE', 'DB_OS_CONFIG_INSTANCE']
identifier
integer
Identifier Example: `3`
instance_name
string
Name of the database instance.
Required when metric_name is one of ['DB_EXTERNAL_INSTANCE', 'DB_OS_CONFIG_INSTANCE']
instance_role
string
Role (permissions) of the database instance.
Applicable when metric_name is 'DB_EXTERNAL_INSTANCE'
invalidations
integer
Number of times this child cursor has been invalidated
io_cell_offload_eligible_bytes
integer
Number of I/O bytes which can be filtered by the Exadata storage system
io_cell_offload_returned_bytes
integer
Number of bytes that are returned by Exadata cell through the regular I/O path
io_cell_uncompressed_bytes
integer
Number of uncompressed bytes (that is, size after decompression) that are offloaded to the Exadata cells
io_cost
integer
IO cost Example: `1`
io_interconnect_bytes
integer
Number of I/O bytes exchanged between Oracle Database and the storage system. Typically used for Cache Fusion or parallel queries
io_time_in_sec
float
Total IO time Example: `5810`
java_exec_time_in_us
integer
Java execution time (in microseconds)
last_active_time
string
last_active_time Example: `"0000000099CCE300"`
loads
integer
Number of times the object was either loaded or reloaded
log_mode
string
Archive log mode.
Applicable when metric_name is 'DB_EXTERNAL_PROPERTIES'
logins
string
Indicates if logins are allowed or restricted.
Applicable when metric_name is 'DB_EXTERNAL_INSTANCE'
metric_name
string
    Choices:
  • DB_OS_CONFIG_INSTANCE
  • DB_EXTERNAL_INSTANCE
  • DB_EXTERNAL_PROPERTIES
Name of the metric group.
module
string
Module name
name
string
Name of the database.
Applicable when metric_name is 'DB_EXTERNAL_PROPERTIES'
num_cp_us
integer
Total number of CPUs available.
Applicable when metric_name is 'DB_OS_CONFIG_INSTANCE'
num_cpu_cores
integer
Number of CPU cores available (includes subcores of multicore CPUs as well as single-core CPUs).
Applicable when metric_name is 'DB_OS_CONFIG_INSTANCE'
num_cpu_sockets
integer
Number of CPU Sockets available.
Applicable when metric_name is 'DB_OS_CONFIG_INSTANCE'
object_alias
string
Object Alias Example: `"PLAN_LINES@SEL$1"`
object_instance
integer
Object Instance Example: `37472`
object_name
string
Object Name Example: `"PLAN_LINES_PK"`
object_node
string
Object Node Example: `"Q4000"`
object_owner
string
Object Owner Example: `"TENANT_A#SCHEMA"`
object_type
string
Object Type Example: `"INDEX (UNIQUE)"`
obsolete_count
integer
Number of times that a parent cursor became obsolete
open_mode
string
Open mode information.
Applicable when metric_name is 'DB_EXTERNAL_PROPERTIES'
operation
string
Operation Example: `"SELECT STATEMENT"`
optimizer
string
Optimizer Example: `"CLUSTER"`
optimizer_cost
integer
Cost of this query given by the optimizer
options
string
Options Example: `"RANGE SCAN"`
other
string
Other Example: ``
other_tag
string
Other Tag Example: `"PARALLEL_COMBINED_WITH_PARENT"`
other_wait_time_in_sec
float
Total other wait time Example: `24061`
other_xml
string
Other SQL Example: `"<other_xml><info type=\"db_version\">18.0.0.0</info><info type=\"parse_schema\"><![CDATA[\"SYS\"]]></info><info type=\"plan_hash_full\">483892784</info><info type=\"plan_hash\">2709293936</info><info type=\"plan_hash_2\">483892784</info><outline_data><hint><![CDATA[IGNORE_OPT IM_EMBEDDED_HINTS]]></hint><hint><![CDATA[OPTIMIZER_FEATURES_ENABLE('18.1.0')]]></hint><hint><![CDATA[DB_VERSION('18.1.0')]]></hint><hint> <![CDATA[OPT_PARAM('_b_tree_bitmap_plans' 'false')]]></hint><hint><![CDATA[OPT_PARAM('_optim_peek_user_binds' 'false')]]></hint><hint><![CDATA[OPT_PARAM('result_cache_mode' 'FORCE')]]></hint><hint><![CDATA[OPT_PARAM('_fix_control' '20648883:0 27745220:1 30001331:1 30142527:1 30539126:1')]]></hint><hint><![CDATA[OUTLINE_LEAF(@\"SEL$1\")]]></hint><hint><![CDATA[INDEX(@\"SEL$1\" \"USER$\"@\"SEL$1\" \"I_USER#\")]]></hint></outline_data></other_xml>"`
parallel
string
Indicates whether the instance is mounted in cluster database mode (YES) or not (NO).
Applicable when metric_name is 'DB_EXTERNAL_INSTANCE'
parent_identifier
integer
Parent Identifier Example: `2`
parse_calls
integer
Total integer of parse calls Example: `60`
partition_identifier
integer
Partition identifier Example: `8`
partition_start
string
Partition start Example: `1`
partition_stop
string
Partition stop Example: `2`
physical_memory_bytes
float
Total number of bytes of physical memory.
Applicable when metric_name is 'DB_OS_CONFIG_INSTANCE'
physical_read_bytes
integer
Number of bytes read from disks by the monitored SQL
physical_read_requests
integer
Number of physical read I/O requests issued by the monitored SQL. The requests may not be disk reads
physical_write_bytes
integer
Number of bytes written to disks by the monitored SQL
physical_write_requests
integer
Number of physical write I/O requests issued by the monitored SQL
plan_hash
integer
Plan hash value for the SQL Execution Plan
plan_hash_value
integer
Plan hash value for the SQL Execution Plan
platform_name
string
Platform name of the database, OS with architecture.
Applicable when metric_name is 'DB_EXTERNAL_PROPERTIES'
plsql_exec_time_in_us
integer
PL/SQL execution time (in microseconds)
position
integer
Position Example: `1`
projection
string
Projection Example: `"COUNT(*)[22]"`
px_servers_executions
integer
Total number of executions performed by parallel execution servers (0 when the statement has never been executed in parallel)
qblock_name
string
Qblock Name Example: `"SEL$1"`
remark
string
Remark Example: `""`
rows_processed
integer
Number of row processed
search_columns
integer
Search Columns Example: `3`
serializable_aborts
integer
Number of serializable aborts
service
string
Service name
sharable_mem
integer
Total shared memory (in bytes) currently occupied by all cursors with this SQL text and plan
sharable_mem_rank
integer
Rank based on sharable memory
sorts
integer
Number of sorts that were done for the child cursor
sql_command
string
SQL command Example: `"SELECT"`
sql_full_text
string
Full SQL Text Example: `"SELECT username,profile,default_tablespace,temporary_tablespace FROM dba_users"` Disclaimer: SQL text being uploaded explicitly via APIs is not masked. Any sensitive literals contained in the sqlFullText column should be masked prior to ingestion.
sql_identifier
string
Unique SQL_ID for a SQL Statement.
sql_patch
string
SQL patch used for this statement, if any
sql_plan_baseline
string
SQL plan baseline used for this statement, if any
sql_profile
string
SQL profile used for this statement, if any
startup_time
string
Start up time of the database instance.
Applicable when metric_name is 'DB_EXTERNAL_INSTANCE'
status
string
Status of the instance.
Applicable when metric_name is 'DB_EXTERNAL_INSTANCE'
switchover_status
string
Indicates whether switchover is allowed.
Applicable when metric_name is 'DB_EXTERNAL_PROPERTIES'
temp_space
integer
Time space Example: `15614000`
time_collected
string
Collection timestamp Example: `"2020-05-06T00:00:00.000Z"`
total_sharable_mem
integer
Total shared memory (in bytes) occupied by all cursors with this SQL text and plan if they were to be fully loaded in the shared pool (that is, cursor size)
total_sql_count
integer
Total number of rows in SQLStats table
total_time_in_sec
float
Total time Example: `30917`
type_check_mem
integer
Typecheck memory
user_io_wait_time_in_us
integer
User I/O wait time (in microseconds)
users_executing
integer
Number of users executing the statement
users_opening
integer
Number of users that have any of the child cursors open
version
float
Version Example: `1`
version_count
integer
Number of cursors present in the cache with this SQL text and plan
wt_harmonic_sum
integer
Weight based harmonic sum of ranking parameters
opsi_private_endpoint_id
string
The OCID of the OPSI private endpoint
Required for action=change_pe_comanaged.
Required when $p.relatedDiscriminatorFieldName is 'PE_COMANAGED_DATABASE'
region
string
The Oracle Cloud Infrastructure region to use for all OCI API requests. If not set, then the value of the OCI_REGION variable, if any, is used. This option is required if the region is not specified through a configuration file (See config_file_location). Please refer to https://docs.us-phoenix-1.oraclecloud.com/Content/General/Concepts/regions.htm for more information on OCI regions.
service_name
string
Database service name used for connection requests.
Required for action=change_pe_comanaged.
Required when $p.relatedDiscriminatorFieldName is 'PE_COMANAGED_DATABASE'
system_tags
dictionary
System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud": {"free-tier-retained": "true"}}`
Applicable only for action=enable.
Applicable when entity_source is 'PE_COMANAGED_DATABASE'
tenancy
string
OCID of your tenancy. If not set, then the value of the OCI_TENANCY variable, if any, is used. This option is required if the tenancy OCID is not specified through a configuration file (See config_file_location). To get the tenancy OCID, please refer https://docs.us-phoenix-1.oraclecloud.com/Content/API/Concepts/apisigningkey.htm
wait
boolean
    Choices:
  • no
  • yes ←
Whether to wait for create or delete operation to complete.
wait_timeout
integer
Time, in seconds, to wait when wait=yes. Defaults to 1200 for most of the services but some services might have a longer wait timeout.

Examples

- name: Perform action change on database_insights
  oci_opsi_database_insights_actions:
    # required
    database_insight_id: "ocid1.databaseinsight.oc1..xxxxxxEXAMPLExxxxxx"
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
    action: change

- name: Perform action change_pe_comanaged on database_insights
  oci_opsi_database_insights_actions:
    # required
    opsi_private_endpoint_id: "ocid1.opsiprivateendpoint.oc1..xxxxxxEXAMPLExxxxxx"
    service_name: service_name_example
    credential_details:
      # required
      credential_source_name: credential_source_name_example
      credential_type: CREDENTIALS_BY_SOURCE
    database_insight_id: "ocid1.databaseinsight.oc1..xxxxxxEXAMPLExxxxxx"
    action: change_pe_comanaged

- name: Perform action disable on database_insights
  oci_opsi_database_insights_actions:
    # required
    database_insight_id: "ocid1.databaseinsight.oc1..xxxxxxEXAMPLExxxxxx"
    action: disable

- name: Perform action enable on database_insights with entity_source = EM_MANAGED_EXTERNAL_DATABASE
  oci_opsi_database_insights_actions:
    # required
    entity_source: EM_MANAGED_EXTERNAL_DATABASE

- name: Perform action enable on database_insights with entity_source = PE_COMANAGED_DATABASE
  oci_opsi_database_insights_actions:
    # required
    entity_source: PE_COMANAGED_DATABASE
    opsi_private_endpoint_id: "ocid1.opsiprivateendpoint.oc1..xxxxxxEXAMPLExxxxxx"
    service_name: service_name_example
    credential_details:
      # required
      credential_source_name: credential_source_name_example
      credential_type: CREDENTIALS_BY_SOURCE
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"

    # optional
    freeform_tags: {'Department': 'Finance'}
    defined_tags: {'Operations': {'CostCenter': 'US'}}
    system_tags: null

- name: Perform action ingest_database_configuration on database_insights
  oci_opsi_database_insights_actions:
    # required
    items:
    - # required
      host_name: host_name_example
      metric_name: DB_OS_CONFIG_INSTANCE
      instance_name: instance_name_example

      # optional
      num_cp_us: 56
      num_cpu_cores: 56
      num_cpu_sockets: 56
      physical_memory_bytes: 3.4
      time_collected: time_collected_example
    action: ingest_database_configuration

    # optional
    database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx"
    id: "ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx"

- name: Perform action ingest_sql_bucket on database_insights
  oci_opsi_database_insights_actions:
    # required
    action: ingest_sql_bucket

    # optional
    items:
    - # required
      host_name: host_name_example
      metric_name: DB_OS_CONFIG_INSTANCE
      instance_name: instance_name_example

      # optional
      num_cp_us: 56
      num_cpu_cores: 56
      num_cpu_sockets: 56
      physical_memory_bytes: 3.4
      time_collected: time_collected_example
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
    database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx"
    id: "ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx"

- name: Perform action ingest_sql_plan_lines on database_insights
  oci_opsi_database_insights_actions:
    # required
    action: ingest_sql_plan_lines

    # optional
    items:
    - # required
      host_name: host_name_example
      metric_name: DB_OS_CONFIG_INSTANCE
      instance_name: instance_name_example

      # optional
      num_cp_us: 56
      num_cpu_cores: 56
      num_cpu_sockets: 56
      physical_memory_bytes: 3.4
      time_collected: time_collected_example
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
    database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx"
    id: "ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx"

- name: Perform action ingest_sql_stats on database_insights
  oci_opsi_database_insights_actions:
    # required
    action: ingest_sql_stats

    # optional
    items:
    - # required
      host_name: host_name_example
      metric_name: DB_OS_CONFIG_INSTANCE
      instance_name: instance_name_example

      # optional
      num_cp_us: 56
      num_cpu_cores: 56
      num_cpu_sockets: 56
      physical_memory_bytes: 3.4
      time_collected: time_collected_example
    database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx"
    id: "ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx"

- name: Perform action ingest_sql_text on database_insights
  oci_opsi_database_insights_actions:
    # required
    action: ingest_sql_text

    # optional
    items:
    - # required
      host_name: host_name_example
      metric_name: DB_OS_CONFIG_INSTANCE
      instance_name: instance_name_example

      # optional
      num_cp_us: 56
      num_cpu_cores: 56
      num_cpu_sockets: 56
      physical_memory_bytes: 3.4
      time_collected: time_collected_example
    compartment_id: "ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx"
    database_id: "ocid1.database.oc1..xxxxxxEXAMPLExxxxxx"
    id: "ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx"

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
database_insights
complex
on success
Details of the DatabaseInsights resource acted upon by the current operation

Sample:
{'compartment_id': 'ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx', 'connection_credential_details': {'credential_source_name': 'credential_source_name_example', 'credential_type': 'CREDENTIALS_BY_SOURCE', 'password_secret_id': 'ocid1.passwordsecret.oc1..xxxxxxEXAMPLExxxxxx', 'role': 'NORMAL', 'user_name': 'user_name_example'}, 'connection_details': {'host_name': 'host_name_example', 'hosts': [{'host_ip': 'host_ip_example', 'port': 56}], 'port': 56, 'protocol': 'TCP', 'service_name': 'service_name_example'}, 'connector_id': 'ocid1.connector.oc1..xxxxxxEXAMPLExxxxxx', 'credential_details': {'credential_source_name': 'credential_source_name_example', 'credential_type': 'CREDENTIALS_BY_SOURCE', 'password_secret_id': 'ocid1.passwordsecret.oc1..xxxxxxEXAMPLExxxxxx', 'role': 'NORMAL', 'user_name': 'user_name_example'}, 'database_connection_status_details': 'database_connection_status_details_example', 'database_display_name': 'database_display_name_example', 'database_id': 'ocid1.database.oc1..xxxxxxEXAMPLExxxxxx', 'database_name': 'database_name_example', 'database_resource_type': 'database_resource_type_example', 'database_type': 'database_type_example', 'database_version': 'database_version_example', 'db_additional_details': {}, 'defined_tags': {'Operations': {'CostCenter': 'US'}}, 'enterprise_manager_bridge_id': 'ocid1.enterprisemanagerbridge.oc1..xxxxxxEXAMPLExxxxxx', 'enterprise_manager_entity_display_name': 'enterprise_manager_entity_display_name_example', 'enterprise_manager_entity_identifier': 'enterprise_manager_entity_identifier_example', 'enterprise_manager_entity_name': 'enterprise_manager_entity_name_example', 'enterprise_manager_entity_type': 'enterprise_manager_entity_type_example', 'enterprise_manager_identifier': 'enterprise_manager_identifier_example', 'entity_source': 'AUTONOMOUS_DATABASE', 'exadata_insight_id': 'ocid1.exadatainsight.oc1..xxxxxxEXAMPLExxxxxx', 'freeform_tags': {'Department': 'Finance'}, 'id': 'ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx', 'lifecycle_details': 'lifecycle_details_example', 'lifecycle_state': 'CREATING', 'management_agent_id': 'ocid1.managementagent.oc1..xxxxxxEXAMPLExxxxxx', 'opsi_private_endpoint_id': 'ocid1.opsiprivateendpoint.oc1..xxxxxxEXAMPLExxxxxx', 'parent_id': 'ocid1.parent.oc1..xxxxxxEXAMPLExxxxxx', 'processor_count': 56, 'root_id': 'ocid1.root.oc1..xxxxxxEXAMPLExxxxxx', 'status': 'DISABLED', 'system_tags': {}, 'time_created': '2013-10-20T19:20:30+01:00', 'time_updated': '2013-10-20T19:20:30+01:00'}
 
compartment_id
string
on success
Compartment identifier of the database

Sample:
ocid1.compartment.oc1..xxxxxxEXAMPLExxxxxx
 
connection_credential_details
complex
on success

   
credential_source_name
string
on success
Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service.

Sample:
credential_source_name_example
   
credential_type
string
on success
Credential type.

Sample:
CREDENTIALS_BY_SOURCE
   
password_secret_id
string
on success
The secret OCID mapping to the database credentials.

Sample:
ocid1.passwordsecret.oc1..xxxxxxEXAMPLExxxxxx
   
role
string
on success
database user role.

Sample:
NORMAL
   
user_name
string
on success
database user name.

Sample:
user_name_example
 
connection_details
complex
on success

   
host_name
string
on success
Name of the listener host that will be used to create the connect string to the database.

Sample:
host_name_example
   
hosts
complex
on success
List of hosts and port for private endpoint accessed database resource.

     
host_ip
string
on success
Host IP used for connection requests for Cloud DB resource.

Sample:
host_ip_example
     
port
integer
on success
Listener port number used for connection requests for rivate endpoint accessed db resource.

Sample:
56
   
port
integer
on success
Listener port number used for connection requests.

Sample:
56
   
protocol
string
on success
Protocol used for connection requests.

Sample:
TCP
   
service_name
string
on success
Database service name used for connection requests.

Sample:
service_name_example
 
connector_id
string
on success
The OCID of External Database Connector

Sample:
ocid1.connector.oc1..xxxxxxEXAMPLExxxxxx
 
credential_details
complex
on success

   
credential_source_name
string
on success
Credential source name that had been added in Management Agent wallet. This is supplied in the External Database Service.

Sample:
credential_source_name_example
   
credential_type
string
on success
Credential type.

Sample:
CREDENTIALS_BY_SOURCE
   
password_secret_id
string
on success
The secret OCID mapping to the database credentials.

Sample:
ocid1.passwordsecret.oc1..xxxxxxEXAMPLExxxxxx
   
role
string
on success
database user role.

Sample:
NORMAL
   
user_name
string
on success
database user name.

Sample:
user_name_example
 
database_connection_status_details
string
on success
A message describing the status of the database connection of this resource. For example, it can be used to provide actionable information about the permission and content validity of the database connection.

Sample:
database_connection_status_details_example
 
database_display_name
string
on success
Display name of database

Sample:
database_display_name_example
 
database_id
string
on success
The OCID of the database.

Sample:
ocid1.database.oc1..xxxxxxEXAMPLExxxxxx
 
database_name
string
on success
Name of database

Sample:
database_name_example
 
database_resource_type
string
on success
OCI database resource type

Sample:
database_resource_type_example
 
database_type
string
on success
Operations Insights internal representation of the database type.

Sample:
database_type_example
 
database_version
string
on success
The version of the database.

Sample:
database_version_example
 
db_additional_details
dictionary
on success
Additional details of a database in JSON format. For autonomous databases, this is the AutonomousDatabase object serialized as a JSON string as defined in https://docs.cloud.oracle.com/en-us/iaas/api/#/en/database/20160918/AutonomousDatabase/. For EM, pass in null or an empty string. Note that this string needs to be escaped when specified in the curl command.

 
defined_tags
dictionary
on success
Defined tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"foo-namespace": {"bar-key": "value"}}`

Sample:
{'Operations': {'CostCenter': 'US'}}
 
enterprise_manager_bridge_id
string
on success
OPSI Enterprise Manager Bridge OCID

Sample:
ocid1.enterprisemanagerbridge.oc1..xxxxxxEXAMPLExxxxxx
 
enterprise_manager_entity_display_name
string
on success
Enterprise Manager Entity Display Name

Sample:
enterprise_manager_entity_display_name_example
 
enterprise_manager_entity_identifier
string
on success
Enterprise Manager Entity Unique Identifier

Sample:
enterprise_manager_entity_identifier_example
 
enterprise_manager_entity_name
string
on success
Enterprise Manager Entity Name

Sample:
enterprise_manager_entity_name_example
 
enterprise_manager_entity_type
string
on success
Enterprise Manager Entity Type

Sample:
enterprise_manager_entity_type_example
 
enterprise_manager_identifier
string
on success
Enterprise Manager Unique Identifier

Sample:
enterprise_manager_identifier_example
 
entity_source
string
on success
Source of the database entity.

Sample:
AUTONOMOUS_DATABASE
 
exadata_insight_id
string
on success
The OCID of the Exadata insight.

Sample:
ocid1.exadatainsight.oc1..xxxxxxEXAMPLExxxxxx
 
freeform_tags
dictionary
on success
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`

Sample:
{'Department': 'Finance'}
 
id
string
on success
Database insight identifier

Sample:
ocid1.resource.oc1..xxxxxxEXAMPLExxxxxx
 
lifecycle_details
string
on success
A message describing the current state in more detail. For example, can be used to provide actionable information for a resource in Failed state.

Sample:
lifecycle_details_example
 
lifecycle_state
string
on success
The current state of the database.

Sample:
CREATING
 
management_agent_id
string
on success
The OCID of the Management Agent

Sample:
ocid1.managementagent.oc1..xxxxxxEXAMPLExxxxxx
 
opsi_private_endpoint_id
string
on success
The OCID of the OPSI private endpoint

Sample:
ocid1.opsiprivateendpoint.oc1..xxxxxxEXAMPLExxxxxx
 
parent_id
string
on success
The OCID of the VM Cluster or DB System ID, depending on which configuration the resource belongs to.

Sample:
ocid1.parent.oc1..xxxxxxEXAMPLExxxxxx
 
processor_count
integer
on success
Processor count. This is the OCPU count for Autonomous Database and CPU core count for other database types.

Sample:
56
 
root_id
string
on success
The OCID of the Exadata Infrastructure.

Sample:
ocid1.root.oc1..xxxxxxEXAMPLExxxxxx
 
status
string
on success
Indicates the status of a database insight in Operations Insights

Sample:
DISABLED
 
system_tags
dictionary
on success
System tags for this resource. Each key is predefined and scoped to a namespace. Example: `{"orcl-cloud": {"free-tier-retained": "true"}}`

 
time_created
string
on success
The time the the database insight was first enabled. An RFC3339 formatted datetime string

Sample:
2013-10-20T19:20:30+01:00
 
time_updated
string
on success
The time the database insight was updated. An RFC3339 formatted datetime string

Sample:
2013-10-20T19:20:30+01:00


Authors

  • Oracle (@oracle)