# This is an automatically generated code sample.
# To make this code sample work in your Oracle Cloud tenancy,
# please replace the values for any parameters whose current values do not fit
# your use case (such as resource IDs, strings containing ‘EXAMPLE’ or ‘unique_id’, and
# boolean, number, and enum parameters with values not fitting your use case).
require 'oci'
require 'date'
# Create a default config using DEFAULT profile in default location
# Refer to https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm#SDK_and_CLI_Configuration_File for more info
config = OCI::ConfigFileLoader.load_config
# Initialize service client with default config file
opsi_client = OCI::Opsi::OperationsInsightsClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
ingest_sql_plan_lines_response =
opsi_client.ingest_sql_plan_lines(
OCI::Opsi::Models::IngestSqlPlanLinesDetails.new(
items: [
OCI::Opsi::Models::SqlPlanLine.new(
sql_identifier: 'EXAMPLE-sqlIdentifier-Value',
plan_hash: 713,
time_collected: DateTime.parse('2016-12-26T16:43:08.054Z'),
operation: 'EXAMPLE-operation-Value',
identifier: 22,
version: 7651.434,
remark: 'EXAMPLE-remark-Value',
options: 'EXAMPLE-options-Value',
object_node: 'EXAMPLE-objectNode-Value',
object_owner: 'EXAMPLE-objectOwner-Value',
object_name: 'EXAMPLE-objectName-Value',
object_alias: 'EXAMPLE-objectAlias-Value',
object_instance: 928,
object_type: 'EXAMPLE-objectType-Value',
optimizer: 'EXAMPLE-optimizer-Value',
search_columns: 894,
parent_identifier: 766,
depth: 229,
position: 532,
cost: 333,
cardinality: 76,
bytes: 738,
other: 'EXAMPLE-other-Value',
other_tag: 'EXAMPLE-otherTag-Value',
partition_start: 'EXAMPLE-partitionStart-Value',
partition_stop: 'EXAMPLE-partitionStop-Value',
partition_identifier: 283,
distribution: 'EXAMPLE-distribution-Value',
cpu_cost: 156,
io_cost: 151,
temp_space: 813,
access_predicates: 'EXAMPLE-accessPredicates-Value',
filter_predicates: 'EXAMPLE-filterPredicates-Value',
projection: 'EXAMPLE-projection-Value',
qblock_name: 'EXAMPLE-qblockName-Value',
elapsed_time_in_sec: 253.6881,
other_xml: 'EXAMPLE-otherXML-Value'
)
]
)
)
# Get the data from response
puts "#{ingest_sql_plan_lines_response.data}"