# 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).

import 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.config.from_file()


# Initialize service client with default config file
database_management_client = oci.database_management.SqlTuningClient(config)


# Send the request to service, some parameters are not required, see API
# doc for more info
save_sql_tuning_set_as_response = database_management_client.save_sql_tuning_set_as(
    managed_database_id="ocid1.test.oc1..<unique_ID>EXAMPLE-managedDatabaseId-Value",
    sql_tuning_set_id=409,
    save_sql_tuning_set_as_details=oci.database_management.models.SaveSqlTuningSetAsDetails(
        name="EXAMPLE-name-Value",
        destination_sql_tuning_set_name="EXAMPLE-destinationSqlTuningSetName-Value",
        create_new=938,
        credential_details=oci.database_management.models.SqlTuningSetAdminPasswordCredentialDetails(
            sql_tuning_set_admin_credential_type="PASSWORD",
            username="EXAMPLE-username-Value",
            role="NORMAL",
            password="EXAMPLE-password-Value"),
        database_credential=oci.database_management.models.DatabaseSecretCredentialDetails(
            credential_type="SECRET",
            password_secret_id="ocid1.test.oc1..<unique_ID>EXAMPLE-passwordSecretId-Value",
            username="EXAMPLE-username-Value",
            role="SYSDBA"),
        show_sql_only=676,
        owner="EXAMPLE-owner-Value",
        destination_sql_tuning_set_description="EXAMPLE-destinationSqlTuningSetDescription-Value",
        destination_sql_tuning_set_owner="EXAMPLE-destinationSqlTuningSetOwner-Value",
        basic_filter="EXAMPLE-basicFilter-Value",
        plan_filter="MAX_ELAPSED_TIME",
        recursive_sql="NO_RECURSIVE_SQL",
        result_percentage=772.58527,
        result_limit=699,
        ranking_measure1="OPTIMIZER_COST",
        ranking_measure2="OPTIMIZER_COST",
        ranking_measure3="DISK_READS",
        attribute_list="EXAMPLE-attributeList-Value",
        load_option="MERGE",
        update_option="ACCUMULATE",
        update_condition="OLD",
        update_attributes="EXAMPLE-updateAttributes-Value",
        is_ignore_null=True,
        commit_rows=563),
    opc_request_id="5FELLCSWHV8PMDGIKUIK<unique_ID>",
    opc_retry_token="EXAMPLE-opcRetryToken-Value")

# Get the data from response
print(save_sql_tuning_set_as_response.data)