SqlTuningClient

class oci.database_management.SqlTuningClient(config, **kwargs)

Use the Database Management API to monitor and manage resources such as Oracle Databases, MySQL Databases, and External Database Systems. For more information, see [Database Management](/iaas/database-management/home.htm).

Methods

__init__(config, **kwargs) Creates a new service client
clone_sql_tuning_task(managed_database_id, …) Clones and runs a SQL tuning task in the database.
create_sql_tuning_set(managed_database_id, …) Creates an empty Sql tuning set within the Managed Database specified by managedDatabaseId.
drop_sql_tuning_set(managed_database_id, …) Drops the Sql tuning set specified by sqlTuningSet within the Managed Database specified by managedDatabaseId.
drop_sql_tuning_task(managed_database_id, …) Drops a SQL tuning task and its related results from the database.
drop_sqls_in_sql_tuning_set(…) Deletes the Sqls in the specified Sql tuning set that matches the filter criteria provided in the basicFilter.
fetch_sql_tuning_set(managed_database_id, …) Fetch the details of Sql statements in the Sql tuning set specified by name, owner and optional filter parameters.
get_execution_plan_stats_comparision(…) Retrieves a comparison of the existing SQL execution plan and a new plan.
get_sql_execution_plan(managed_database_id, …) Retrieves a SQL execution plan for the SQL being tuned.
get_sql_tuning_advisor_task_summary_report(…) Gets the summary report for the specified SQL Tuning Advisor task.
list_sql_tuning_advisor_task_findings(…) Gets an array of the details of the findings that match specific filters.
list_sql_tuning_advisor_task_recommendations(…) Gets the findings and possible actions for a given object in a SQL tuning task.
list_sql_tuning_advisor_tasks(…) Lists the SQL Tuning Advisor tasks for the specified Managed Database.
list_sql_tuning_sets(managed_database_id, …) Lists the SQL tuning sets for the specified Managed Database.
load_sql_tuning_set(managed_database_id, …) Load Sql statements into the Sql tuning set specified by name and optional filter parameters within the Managed Database specified by managedDatabaseId.
save_sql_tuning_set_as(managed_database_id, …) Saves the specified list of Sqls statements into another new Sql tuning set or loads into an existing Sql tuning set’.
start_sql_tuning_task(managed_database_id, …) Starts a SQL tuning task for a given set of SQL statements from the active session history top SQL statements.
validate_basic_filter(managed_database_id, …) Executes a SQL query to check whether user entered basic filter criteria is valid or not.
__init__(config, **kwargs)

Creates a new service client

Parameters:
  • config (dict) – Configuration keys and values as per SDK and Tool Configuration. The from_file() method can be used to load configuration from a file. Alternatively, a dict can be passed. You can validate_config the dict using validate_config()
  • service_endpoint (str) – (optional) The endpoint of the service to call using this client. For example https://iaas.us-ashburn-1.oraclecloud.com. If this keyword argument is not provided then it will be derived using the region in the config parameter. You should only provide this keyword argument if you have an explicit need to specify a service endpoint.
  • timeout (float or tuple(float, float)) – (optional) The connection and read timeouts for the client. The default values are connection timeout 10 seconds and read timeout 60 seconds. This keyword argument can be provided as a single float, in which case the value provided is used for both the read and connection timeouts, or as a tuple of two floats. If a tuple is provided then the first value is used as the connection timeout and the second value as the read timeout.
  • signer (AbstractBaseSigner) –

    (optional) The signer to use when signing requests made by the service client. The default is to use a Signer based on the values provided in the config parameter.

    One use case for this parameter is for Instance Principals authentication by passing an instance of InstancePrincipalsSecurityTokenSigner as the value for this keyword argument

  • retry_strategy (obj) –

    (optional) A retry strategy to apply to all calls made by this service client (i.e. at the client level). There is no retry strategy applied by default. Retry strategies can also be applied at the operation level by passing a retry_strategy keyword argument as part of calling the operation. Any value provided at the operation level will override whatever is specified at the client level.

    This should be one of the strategies available in the retry module. A convenience DEFAULT_RETRY_STRATEGY is also available. The specifics of the default retry strategy are described here.

  • circuit_breaker_strategy (obj) – (optional) A circuit breaker strategy to apply to all calls made by this service client (i.e. at the client level). This client uses DEFAULT_CIRCUIT_BREAKER_STRATEGY as default if no circuit breaker strategy is provided. The specifics of circuit breaker strategy are described here.
  • circuit_breaker_callback (function) – (optional) Callback function to receive any exceptions triggerred by the circuit breaker.
  • client_level_realm_specific_endpoint_template_enabled (bool) – (optional) A boolean flag to indicate whether or not this client should be created with realm specific endpoint template enabled or disable. By default, this will be set as None.
  • allow_control_chars – (optional) allow_control_chars is a boolean to indicate whether or not this client should allow control characters in the response object. By default, the client will not allow control characters to be in the response object.
clone_sql_tuning_task(managed_database_id, clone_sql_tuning_task_details, **kwargs)

Clones and runs a SQL tuning task in the database.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • clone_sql_tuning_task_details (oci.database_management.models.CloneSqlTuningTaskDetails) – (required) The detailed inputs required to clone a SQL tuning task.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningTaskReturn

Return type:

Response

Example:

Click here to see an example of how to use clone_sql_tuning_task API.

create_sql_tuning_set(managed_database_id, create_sql_tuning_set_details, **kwargs)

Creates an empty Sql tuning set within the Managed Database specified by managedDatabaseId.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • create_sql_tuning_set_details (oci.database_management.models.CreateSqlTuningSetDetails) – (required) The details required to create a Sql tuning set.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningSet

Return type:

Response

Example:

Click here to see an example of how to use create_sql_tuning_set API.

drop_sql_tuning_set(managed_database_id, sql_tuning_set_id, drop_sql_tuning_set_details, **kwargs)

Drops the Sql tuning set specified by sqlTuningSet within the Managed Database specified by managedDatabaseId.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • sql_tuning_set_id (int) – (required) The unique identifier of the Sql tuning set. This is not OCID.
  • drop_sql_tuning_set_details (oci.database_management.models.DropSqlTuningSetDetails) – (required) The details required to drop a Sql tuning set.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningSetAdminActionStatus

Return type:

Response

Example:

Click here to see an example of how to use drop_sql_tuning_set API.

drop_sql_tuning_task(managed_database_id, drop_sql_tuning_task_details, **kwargs)

Drops a SQL tuning task and its related results from the database.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • drop_sql_tuning_task_details (oci.database_management.models.DropSqlTuningTaskDetails) – (required) The detailed inputs required to drop a SQL tuning task.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type None

Return type:

Response

Example:

Click here to see an example of how to use drop_sql_tuning_task API.

drop_sqls_in_sql_tuning_set(managed_database_id, sql_tuning_set_id, drop_sqls_in_sql_tuning_set_details, **kwargs)

Deletes the Sqls in the specified Sql tuning set that matches the filter criteria provided in the basicFilter. If basicFilter criteria is not provided, then entire Sqls in the Sql tuning set is deleted.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • sql_tuning_set_id (int) – (required) The unique identifier of the Sql tuning set. This is not OCID.
  • drop_sqls_in_sql_tuning_set_details (oci.database_management.models.DropSqlsInSqlTuningSetDetails) – (required) Drops the selected list of Sql statements from the current Sql tuning set.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningSetAdminActionStatus

Return type:

Response

Example:

Click here to see an example of how to use drop_sqls_in_sql_tuning_set API.

fetch_sql_tuning_set(managed_database_id, sql_tuning_set_id, fetch_sql_tuning_set_details, **kwargs)

Fetch the details of Sql statements in the Sql tuning set specified by name, owner and optional filter parameters.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • sql_tuning_set_id (int) – (required) The unique identifier of the Sql tuning set. This is not OCID.
  • fetch_sql_tuning_set_details (oci.database_management.models.FetchSqlTuningSetDetails) – (required) The details required to fetch the Sql tuning set details.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningSet

Return type:

Response

Example:

Click here to see an example of how to use fetch_sql_tuning_set API.

get_execution_plan_stats_comparision(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, execution_id, **kwargs)

Retrieves a comparison of the existing SQL execution plan and a new plan. A SQL tuning task may suggest a new execution plan for a SQL, and this API retrieves the comparison report of the statistics of the two plans.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • sql_tuning_advisor_task_id (int) –

    (required) The SQL tuning task identifier. This is not the OCID.

  • sql_object_id (int) –

    (required) The SQL object ID for the SQL tuning task. This is not the OCID.

  • execution_id (int) –

    (required) The execution ID for an execution of a SQL tuning task. This is not the OCID.

  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_named_credential_id (str) – (optional) The OCID of the Named Credential.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type ExecutionPlanStatsComparision

Return type:

Response

Example:

Click here to see an example of how to use get_execution_plan_stats_comparision API.

get_sql_execution_plan(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, attribute, **kwargs)

Retrieves a SQL execution plan for the SQL being tuned.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • sql_tuning_advisor_task_id (int) –

    (required) The SQL tuning task identifier. This is not the OCID.

  • sql_object_id (int) –

    (required) The SQL object ID for the SQL tuning task. This is not the OCID.

  • attribute (str) –

    (required) The attribute of the SQL execution plan.

    Allowed values are: “ORIGINAL”, “ORIGINAL_WITH_ADJUSTED_COST”, “USING_SQL_PROFILE”, “USING_NEW_INDICES”, “USING_PARALLEL_EXECUTION”

  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_named_credential_id (str) – (optional) The OCID of the Named Credential.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningAdvisorTaskSqlExecutionPlan

Return type:

Response

Example:

Click here to see an example of how to use get_sql_execution_plan API.

get_sql_tuning_advisor_task_summary_report(managed_database_id, sql_tuning_advisor_task_id, **kwargs)

Gets the summary report for the specified SQL Tuning Advisor task.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • sql_tuning_advisor_task_id (int) –

    (required) The SQL tuning task identifier. This is not the OCID.

  • search_period (str) –

    (optional) How far back the API will search for begin and end exec id. Unused if neither exec ids nor time filter query params are supplied. This is applicable only for Auto SQL Tuning tasks.

    Allowed values are: “LAST_24HR”, “LAST_7DAY”, “LAST_31DAY”, “SINCE_LAST”, “ALL”

  • time_greater_than_or_equal_to (datetime) – (optional) The optional greater than or equal to query parameter to filter the timestamp. This is applicable only for Auto SQL Tuning tasks.
  • time_less_than_or_equal_to (datetime) – (optional) The optional less than or equal to query parameter to filter the timestamp. This is applicable only for Auto SQL Tuning tasks.
  • begin_exec_id_greater_than_or_equal_to (int) – (optional) The optional greater than or equal to filter on the execution ID related to a specific SQL Tuning Advisor task. This is applicable only for Auto SQL Tuning tasks.
  • end_exec_id_less_than_or_equal_to (int) – (optional) The optional less than or equal to query parameter to filter on the execution ID related to a specific SQL Tuning Advisor task. This is applicable only for Auto SQL Tuning tasks.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_named_credential_id (str) – (optional) The OCID of the Named Credential.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningAdvisorTaskSummaryReport

Return type:

Response

Example:

Click here to see an example of how to use get_sql_tuning_advisor_task_summary_report API.

list_sql_tuning_advisor_task_findings(managed_database_id, sql_tuning_advisor_task_id, **kwargs)

Gets an array of the details of the findings that match specific filters.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • sql_tuning_advisor_task_id (int) –

    (required) The SQL tuning task identifier. This is not the OCID.

  • begin_exec_id (int) – (optional) The optional greater than or equal to filter on the execution ID related to a specific SQL Tuning Advisor task.
  • end_exec_id (int) – (optional) The optional less than or equal to query parameter to filter on the execution ID related to a specific SQL Tuning Advisor task.
  • search_period (str) –

    (optional) The search period during which the API will search for begin and end exec id, if not supplied. Unused if beginExecId and endExecId optional query params are both supplied.

    Allowed values are: “LAST_24HR”, “LAST_7DAY”, “LAST_31DAY”, “SINCE_LAST”, “ALL”

  • finding_filter (str) –

    (optional) The filter used to display specific findings in the report.

    Allowed values are: “none”, “FINDINGS”, “NOFINDINGS”, “ERRORS”, “PROFILES”, “INDICES”, “STATS”, “RESTRUCTURE”, “ALTERNATIVE”, “AUTO_PROFILES”, “OTHER_PROFILES”

  • stats_hash_filter (str) – (optional) The hash value of the object for the statistic finding search.
  • index_hash_filter (str) – (optional) The hash value of the index table name.
  • sort_by (str) –

    (optional) The possible sortBy values of an object’s recommendations.

    Allowed values are: “DBTIME_BENEFIT”, “PARSING_SCHEMA”, “SQL_ID”, “STATS”, “PROFILES”, “SQL_BENEFIT”, “DATE”, “INDICES”, “RESTRUCTURE”, “ALTERNATIVE”, “MISC”, “ERROR”, “TIMEOUTS”

  • sort_order (str) –

    (optional) The option to sort information in ascending (‘ASC’) or descending (‘DESC’) order. Descending order is the default order.

    Allowed values are: “ASC”, “DESC”

  • page (str) – (optional) The page token representing the page from where the next set of paginated results are retrieved. This is usually retrieved from a previous list call.
  • limit (int) – (optional) The maximum number of records returned in the paginated response.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_named_credential_id (str) – (optional) The OCID of the Named Credential.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningAdvisorTaskFindingCollection

Return type:

Response

Example:

Click here to see an example of how to use list_sql_tuning_advisor_task_findings API.

list_sql_tuning_advisor_task_recommendations(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, execution_id, **kwargs)

Gets the findings and possible actions for a given object in a SQL tuning task. The task ID and object ID are used to retrieve the findings and recommendations.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • sql_tuning_advisor_task_id (int) –

    (required) The SQL tuning task identifier. This is not the OCID.

  • sql_object_id (int) –

    (required) The SQL object ID for the SQL tuning task. This is not the OCID.

  • execution_id (int) –

    (required) The execution ID for an execution of a SQL tuning task. This is not the OCID.

  • sort_by (str) –

    (optional) The possible sortBy values of an object’s recommendations.

    Allowed values are: “RECOMMENDATION_TYPE”, “BENEFIT”

  • sort_order (str) –

    (optional) The option to sort information in ascending (‘ASC’) or descending (‘DESC’) order. Descending order is the default order.

    Allowed values are: “ASC”, “DESC”

  • page (str) – (optional) The page token representing the page from where the next set of paginated results are retrieved. This is usually retrieved from a previous list call.
  • limit (int) – (optional) The maximum number of records returned in the paginated response.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_named_credential_id (str) – (optional) The OCID of the Named Credential.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningAdvisorTaskRecommendationCollection

Return type:

Response

Example:

Click here to see an example of how to use list_sql_tuning_advisor_task_recommendations API.

list_sql_tuning_advisor_tasks(managed_database_id, **kwargs)

Lists the SQL Tuning Advisor tasks for the specified Managed Database.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • name (str) – (optional) The optional query parameter to filter the SQL Tuning Advisor task list by name.
  • status (str) –

    (optional) The optional query parameter to filter the SQL Tuning Advisor task list by status.

    Allowed values are: “INITIAL”, “EXECUTING”, “INTERRUPTED”, “COMPLETED”, “ERROR”

  • time_greater_than_or_equal_to (datetime) – (optional) The optional greater than or equal to query parameter to filter the timestamp.
  • time_less_than_or_equal_to (datetime) – (optional) The optional less than or equal to query parameter to filter the timestamp.
  • page (str) – (optional) The page token representing the page from where the next set of paginated results are retrieved. This is usually retrieved from a previous list call.
  • limit (int) – (optional) The maximum number of records returned in the paginated response.
  • sort_by (str) –

    (optional) The option to sort the SQL Tuning Advisor task summary data.

    Allowed values are: “NAME”, “START_TIME”

  • sort_order (str) –

    (optional) The option to sort information in ascending (‘ASC’) or descending (‘DESC’) order. Descending order is the default order.

    Allowed values are: “ASC”, “DESC”

  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_named_credential_id (str) – (optional) The OCID of the Named Credential.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningAdvisorTaskCollection

Return type:

Response

Example:

Click here to see an example of how to use list_sql_tuning_advisor_tasks API.

list_sql_tuning_sets(managed_database_id, **kwargs)

Lists the SQL tuning sets for the specified Managed Database.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • owner (str) – (optional) The owner of the SQL tuning set.
  • name_contains (str) – (optional) Allow searching the name of the SQL tuning set by partial matching. The search is case insensitive.
  • sort_by (str) –

    (optional) The option to sort the SQL tuning set summary data.

    Allowed values are: “NAME”

  • sort_order (str) –

    (optional) The option to sort information in ascending (‘ASC’) or descending (‘DESC’) order. Ascending order is the default order.

    Allowed values are: “ASC”, “DESC”

  • page (str) – (optional) The page token representing the page from where the next set of paginated results are retrieved. This is usually retrieved from a previous list call.
  • limit (int) – (optional) The maximum number of records returned in the paginated response.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_named_credential_id (str) – (optional) The OCID of the Named Credential.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningSetCollection

Return type:

Response

Example:

Click here to see an example of how to use list_sql_tuning_sets API.

load_sql_tuning_set(managed_database_id, sql_tuning_set_id, load_sql_tuning_set_details, **kwargs)

Load Sql statements into the Sql tuning set specified by name and optional filter parameters within the Managed Database specified by managedDatabaseId.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • sql_tuning_set_id (int) – (required) The unique identifier of the Sql tuning set. This is not OCID.
  • load_sql_tuning_set_details (oci.database_management.models.LoadSqlTuningSetDetails) – (required) The details required to load Sql statements into the Sql tuning set.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningSetAdminActionStatus

Return type:

Response

Example:

Click here to see an example of how to use load_sql_tuning_set API.

save_sql_tuning_set_as(managed_database_id, sql_tuning_set_id, save_sql_tuning_set_as_details, **kwargs)

Saves the specified list of Sqls statements into another new Sql tuning set or loads into an existing Sql tuning set’.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • sql_tuning_set_id (int) – (required) The unique identifier of the Sql tuning set. This is not OCID.
  • save_sql_tuning_set_as_details (oci.database_management.models.SaveSqlTuningSetAsDetails) – (required) The details required to save a Sql tuning set into another Sql tuning set.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningSetAdminActionStatus

Return type:

Response

Example:

Click here to see an example of how to use save_sql_tuning_set_as API.

start_sql_tuning_task(managed_database_id, start_sql_tuning_task_details, **kwargs)

Starts a SQL tuning task for a given set of SQL statements from the active session history top SQL statements.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • start_sql_tuning_task_details (oci.database_management.models.StartSqlTuningTaskDetails) – (required) The detailed inputs required to start a SQL tuning task.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation will not retry by default, users can also use the convenient DEFAULT_RETRY_STRATEGY provided by the SDK to enable retries for it. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningTaskReturn

Return type:

Response

Example:

Click here to see an example of how to use start_sql_tuning_task API.

validate_basic_filter(managed_database_id, sql_tuning_set_id, validate_basic_filter_details, **kwargs)

Executes a SQL query to check whether user entered basic filter criteria is valid or not.

Parameters:
  • managed_database_id (str) –

    (required) The OCID of the Managed Database.

  • sql_tuning_set_id (int) – (required) The unique identifier of the Sql tuning set. This is not OCID.
  • validate_basic_filter_details (oci.database_management.models.ValidateBasicFilterDetails) – (required) Validate the basic filter criteria provided by the user.
  • opc_request_id (str) – (optional) The client request ID for tracing.
  • opc_retry_token (str) – (optional) A token that uniquely identifies a request so it can be retried in case of a timeout or server error without risk of executing that same action again. Retry tokens expire after 24 hours, but can be invalidated before then due to conflicting operations. For example, if a resource has been deleted and purged from the system, then a retry of the original creation request might be rejected.
  • retry_strategy (obj) –

    (optional) A retry strategy to apply to this specific operation/call. This will override any retry strategy set at the client-level.

    This should be one of the strategies available in the retry module. This operation uses DEFAULT_RETRY_STRATEGY as default if no retry strategy is provided. The specifics of the default retry strategy are described here.

    To have this operation explicitly not perform any retries, pass an instance of NoneRetryStrategy.

  • allow_control_chars (bool) – (optional) allow_control_chars is a boolean to indicate whether or not this request should allow control characters in the response object. By default, the response will not allow control characters in strings
Returns:

A Response object with data of type SqlTuningSetAdminActionStatus

Return type:

Response

Example:

Click here to see an example of how to use validate_basic_filter API.