# 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'
# 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
database_management_client =
OCI::DatabaseManagement::SqlTuningClient.new(config: config)
# Send the request to service, some parameters are not required, see API doc for more info
load_sql_tuning_set_response =
database_management_client.load_sql_tuning_set(
'ocid1.test.oc1..<unique_ID>EXAMPLE-managedDatabaseId-Value',
469,
OCI::DatabaseManagement::Models::LoadSqlTuningSetDetails.new(
name: 'EXAMPLE-name-Value',
load_type: 'AWR',
credential_details:
OCI::DatabaseManagement::Models::SqlTuningSetAdminPasswordCredentialDetails
.new(
sql_tuning_set_admin_credential_type: 'PASSWORD',
username: 'EXAMPLE-username-Value',
role: 'NORMAL',
password: 'EXAMPLE-password-Value'
),
database_credential:
OCI::DatabaseManagement::Models::DatabaseSecretCredentialDetails.new(
credential_type: 'SECRET',
password_secret_id:
'ocid1.test.oc1..<unique_ID>EXAMPLE-passwordSecretId-Value',
username: 'EXAMPLE-username-Value',
role: 'NORMAL'
),
show_sql_only: 593,
owner: 'EXAMPLE-owner-Value',
basic_filter: 'EXAMPLE-basicFilter-Value',
recursive_sql: 'NO_RECURSIVE_SQL',
result_percentage: 1249.0171,
result_limit: 628,
ranking_measure1: 'CPU_TIME',
ranking_measure2: 'DIRECT_WRITES',
ranking_measure3: 'DIRECT_WRITES',
total_time_limit: 11,
repeat_interval: 91,
capture_option: 'INSERT',
capture_mode: 'MODE_ACCUMULATE_STATS',
attribute_list: 'EXAMPLE-attributeList-Value',
load_option: 'INSERT',
update_option: 'ACCUMULATE',
update_attributes: 'EXAMPLE-updateAttributes-Value',
update_condition: 'NULL',
is_ignore_null: true,
commit_rows: 502,
begin_snapshot: 384,
end_snapshot: 810,
baseline_name: 'EXAMPLE-baselineName-Value'
)
)
# Get the data from response
puts "#{load_sql_tuning_set_response.data}"