Class: OCI::DatabaseManagement::SqlTuningClient
- Inherits:
-
Object
- Object
- OCI::DatabaseManagement::SqlTuningClient
- Defined in:
- lib/oci/database_management/sql_tuning_client.rb
Overview
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.
Instance Attribute Summary collapse
-
#api_client ⇒ OCI::ApiClient
readonly
Client used to make HTTP requests.
-
#endpoint ⇒ String
readonly
Fully qualified endpoint URL.
-
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
-
#retry_config ⇒ OCI::Retry::RetryConfig
readonly
The default retry configuration to apply to all operations in this service client.
Instance Method Summary collapse
-
#clone_sql_tuning_task(managed_database_id, clone_sql_tuning_task_details, opts = {}) ⇒ Response
Clones and runs a SQL tuning task in the database.
-
#create_sql_tuning_set(managed_database_id, create_sql_tuning_set_details, opts = {}) ⇒ Response
Creates an empty Sql tuning set within the Managed Database specified by managedDatabaseId.
-
#drop_sql_tuning_set(managed_database_id, sql_tuning_set_id, drop_sql_tuning_set_details, opts = {}) ⇒ Response
Drops the Sql tuning set specified by sqlTuningSet within the Managed Database specified by managedDatabaseId.
-
#drop_sql_tuning_task(managed_database_id, drop_sql_tuning_task_details, opts = {}) ⇒ Response
Drops a SQL tuning task and its related results from the database.
-
#drop_sqls_in_sql_tuning_set(managed_database_id, sql_tuning_set_id, drop_sqls_in_sql_tuning_set_details, opts = {}) ⇒ Response
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, sql_tuning_set_id, fetch_sql_tuning_set_details, opts = {}) ⇒ Response
Fetch the details of Sql statements in the Sql tuning set specified by name, owner and optional filter parameters.
-
#get_execution_plan_stats_comparision(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, execution_id, opts = {}) ⇒ Response
Retrieves a comparison of the existing SQL execution plan and a new plan.
-
#get_sql_execution_plan(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, attribute, opts = {}) ⇒ Response
Retrieves a SQL execution plan for the SQL being tuned.
-
#get_sql_tuning_advisor_task_summary_report(managed_database_id, sql_tuning_advisor_task_id, opts = {}) ⇒ Response
Gets the summary report for the specified SQL Tuning Advisor task.
-
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ SqlTuningClient
constructor
Creates a new SqlTuningClient.
-
#list_sql_tuning_advisor_task_findings(managed_database_id, sql_tuning_advisor_task_id, opts = {}) ⇒ Response
Gets an array of the details of the findings that match specific filters.
-
#list_sql_tuning_advisor_task_recommendations(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, execution_id, opts = {}) ⇒ Response
Gets the findings and possible actions for a given object in a SQL tuning task.
-
#list_sql_tuning_advisor_tasks(managed_database_id, opts = {}) ⇒ Response
Lists the SQL Tuning Advisor tasks for the specified Managed Database.
-
#list_sql_tuning_sets(managed_database_id, opts = {}) ⇒ Response
Lists the SQL tuning sets for the specified Managed Database.
-
#load_sql_tuning_set(managed_database_id, sql_tuning_set_id, load_sql_tuning_set_details, opts = {}) ⇒ Response
Load Sql statements into the Sql tuning set specified by name and optional filter parameters within the Managed Database specified by managedDatabaseId.
-
#logger ⇒ Logger
The logger for this client.
-
#save_sql_tuning_set_as(managed_database_id, sql_tuning_set_id, save_sql_tuning_set_as_details, opts = {}) ⇒ Response
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, start_sql_tuning_task_details, opts = {}) ⇒ Response
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, sql_tuning_set_id, validate_basic_filter_details, opts = {}) ⇒ Response
Executes a SQL query to check whether user entered basic filter criteria is valid or not.
Constructor Details
#initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) ⇒ SqlTuningClient
Creates a new SqlTuningClient. Notes: If a config is not specified, then the global OCI.config will be used.
This client is not thread-safe
Either a region or an endpoint must be specified. If an endpoint is specified, it will be used instead of the region. A region may be specified in the config or via or the region parameter. If specified in both, then the region parameter will be used.
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 57 def initialize(config: nil, region: nil, endpoint: nil, signer: nil, proxy_settings: nil, retry_config: nil) # If the signer is an InstancePrincipalsSecurityTokenSigner or SecurityTokenSigner and no config was supplied (they are self-sufficient signers) # then create a dummy config to pass to the ApiClient constructor. If customers wish to create a client which uses instance principals # and has config (either populated programmatically or loaded from a file), they must construct that config themselves and then # pass it to this constructor. # # If there is no signer (or the signer is not an instance principals signer) and no config was supplied, this is not valid # so try and load the config from the default file. config = OCI::Config.validate_and_build_config_with_signer(config, signer) signer = OCI::Signer.config_file_auth_builder(config) if signer.nil? @api_client = OCI::ApiClient.new(config, signer, proxy_settings: proxy_settings) @retry_config = retry_config if endpoint @endpoint = endpoint + '/20201101' else region ||= config.region region ||= signer.region if signer.respond_to?(:region) self.region = region end logger.info "SqlTuningClient endpoint set to '#{@endpoint}'." if logger end |
Instance Attribute Details
#api_client ⇒ OCI::ApiClient (readonly)
Client used to make HTTP requests.
17 18 19 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 17 def api_client @api_client end |
#endpoint ⇒ String (readonly)
Fully qualified endpoint URL
21 22 23 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 21 def endpoint @endpoint end |
#region ⇒ String
The region, which will usually correspond to a value in Regions::REGION_ENUM.
31 32 33 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 31 def region @region end |
#retry_config ⇒ OCI::Retry::RetryConfig (readonly)
The default retry configuration to apply to all operations in this service client. This can be overridden on a per-operation basis. The default retry configuration value is nil
, which means that an operation will not perform any retries
27 28 29 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 27 def retry_config @retry_config end |
Instance Method Details
#clone_sql_tuning_task(managed_database_id, clone_sql_tuning_task_details, opts = {}) ⇒ Response
Click here to see an example of how to use clone_sql_tuning_task API.
Clones and runs a SQL tuning task in the database.
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 121 def clone_sql_tuning_task(managed_database_id, clone_sql_tuning_task_details, opts = {}) logger.debug 'Calling operation SqlTuningClient#clone_sql_tuning_task.' if logger raise "Missing the required parameter 'managed_database_id' when calling clone_sql_tuning_task." if managed_database_id.nil? raise "Missing the required parameter 'clone_sql_tuning_task_details' when calling clone_sql_tuning_task." if clone_sql_tuning_task_details.nil? raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) path = '/managedDatabases/{managedDatabaseId}/actions/cloneSqlTuningTask'.sub('{managedDatabaseId}', managed_database_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(clone_sql_tuning_task_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#clone_sql_tuning_task') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningTaskReturn' ) end # rubocop:enable Metrics/BlockLength end |
#create_sql_tuning_set(managed_database_id, create_sql_tuning_set_details, opts = {}) ⇒ Response
Click here to see an example of how to use create_sql_tuning_set API.
Creates an empty Sql tuning set within the Managed Database specified by managedDatabaseId.
186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 186 def create_sql_tuning_set(managed_database_id, create_sql_tuning_set_details, opts = {}) logger.debug 'Calling operation SqlTuningClient#create_sql_tuning_set.' if logger raise "Missing the required parameter 'managed_database_id' when calling create_sql_tuning_set." if managed_database_id.nil? raise "Missing the required parameter 'create_sql_tuning_set_details' when calling create_sql_tuning_set." if create_sql_tuning_set_details.nil? raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets'.sub('{managedDatabaseId}', managed_database_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(create_sql_tuning_set_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#create_sql_tuning_set') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningSet' ) end # rubocop:enable Metrics/BlockLength end |
#drop_sql_tuning_set(managed_database_id, sql_tuning_set_id, drop_sql_tuning_set_details, opts = {}) ⇒ Response
Click here to see an example of how to use drop_sql_tuning_set API.
Drops the Sql tuning set specified by sqlTuningSet within the Managed Database specified by managedDatabaseId.
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 252 def drop_sql_tuning_set(managed_database_id, sql_tuning_set_id, drop_sql_tuning_set_details, opts = {}) logger.debug 'Calling operation SqlTuningClient#drop_sql_tuning_set.' if logger raise "Missing the required parameter 'managed_database_id' when calling drop_sql_tuning_set." if managed_database_id.nil? raise "Missing the required parameter 'sql_tuning_set_id' when calling drop_sql_tuning_set." if sql_tuning_set_id.nil? raise "Missing the required parameter 'drop_sql_tuning_set_details' when calling drop_sql_tuning_set." if drop_sql_tuning_set_details.nil? raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) raise "Parameter value for 'sql_tuning_set_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_set_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets/{sqlTuningSetId}/actions/dropSqlTuningSet'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningSetId}', sql_tuning_set_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(drop_sql_tuning_set_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#drop_sql_tuning_set') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningSetAdminActionStatus' ) end # rubocop:enable Metrics/BlockLength end |
#drop_sql_tuning_task(managed_database_id, drop_sql_tuning_task_details, opts = {}) ⇒ Response
Click here to see an example of how to use drop_sql_tuning_task API.
Drops a SQL tuning task and its related results from the database.
319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 319 def drop_sql_tuning_task(managed_database_id, drop_sql_tuning_task_details, opts = {}) logger.debug 'Calling operation SqlTuningClient#drop_sql_tuning_task.' if logger raise "Missing the required parameter 'managed_database_id' when calling drop_sql_tuning_task." if managed_database_id.nil? raise "Missing the required parameter 'drop_sql_tuning_task_details' when calling drop_sql_tuning_task." if drop_sql_tuning_task_details.nil? raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) path = '/managedDatabases/{managedDatabaseId}/actions/dropSqlTuningTask'.sub('{managedDatabaseId}', managed_database_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(drop_sql_tuning_task_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#drop_sql_tuning_task') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body ) end # rubocop:enable Metrics/BlockLength end |
#drop_sqls_in_sql_tuning_set(managed_database_id, sql_tuning_set_id, drop_sqls_in_sql_tuning_set_details, opts = {}) ⇒ Response
Click here to see an example of how to use drop_sqls_in_sql_tuning_set API.
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.
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 385 def drop_sqls_in_sql_tuning_set(managed_database_id, sql_tuning_set_id, drop_sqls_in_sql_tuning_set_details, opts = {}) logger.debug 'Calling operation SqlTuningClient#drop_sqls_in_sql_tuning_set.' if logger raise "Missing the required parameter 'managed_database_id' when calling drop_sqls_in_sql_tuning_set." if managed_database_id.nil? raise "Missing the required parameter 'sql_tuning_set_id' when calling drop_sqls_in_sql_tuning_set." if sql_tuning_set_id.nil? raise "Missing the required parameter 'drop_sqls_in_sql_tuning_set_details' when calling drop_sqls_in_sql_tuning_set." if drop_sqls_in_sql_tuning_set_details.nil? raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) raise "Parameter value for 'sql_tuning_set_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_set_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets/{sqlTuningSetId}/actions/dropSqlsInSqlTuningSet'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningSetId}', sql_tuning_set_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(drop_sqls_in_sql_tuning_set_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#drop_sqls_in_sql_tuning_set') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningSetAdminActionStatus' ) end # rubocop:enable Metrics/BlockLength end |
#fetch_sql_tuning_set(managed_database_id, sql_tuning_set_id, fetch_sql_tuning_set_details, opts = {}) ⇒ Response
Click here to see an example of how to use fetch_sql_tuning_set API.
Fetch the details of Sql statements in the Sql tuning set specified by name, owner and optional filter parameters.
453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 453 def fetch_sql_tuning_set(managed_database_id, sql_tuning_set_id, fetch_sql_tuning_set_details, opts = {}) logger.debug 'Calling operation SqlTuningClient#fetch_sql_tuning_set.' if logger raise "Missing the required parameter 'managed_database_id' when calling fetch_sql_tuning_set." if managed_database_id.nil? raise "Missing the required parameter 'sql_tuning_set_id' when calling fetch_sql_tuning_set." if sql_tuning_set_id.nil? raise "Missing the required parameter 'fetch_sql_tuning_set_details' when calling fetch_sql_tuning_set." if fetch_sql_tuning_set_details.nil? raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) raise "Parameter value for 'sql_tuning_set_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_set_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets/{sqlTuningSetId}'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningSetId}', sql_tuning_set_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(fetch_sql_tuning_set_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#fetch_sql_tuning_set') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningSet' ) end # rubocop:enable Metrics/BlockLength end |
#get_execution_plan_stats_comparision(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, execution_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_execution_plan_stats_comparision API.
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.
520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 520 def get_execution_plan_stats_comparision(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, execution_id, opts = {}) logger.debug 'Calling operation SqlTuningClient#get_execution_plan_stats_comparision.' if logger raise "Missing the required parameter 'managed_database_id' when calling get_execution_plan_stats_comparision." if managed_database_id.nil? raise "Missing the required parameter 'sql_tuning_advisor_task_id' when calling get_execution_plan_stats_comparision." if sql_tuning_advisor_task_id.nil? raise "Missing the required parameter 'sql_object_id' when calling get_execution_plan_stats_comparision." if sql_object_id.nil? raise "Missing the required parameter 'execution_id' when calling get_execution_plan_stats_comparision." if execution_id.nil? raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) raise "Parameter value for 'sql_tuning_advisor_task_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_advisor_task_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningAdvisorTasks/{sqlTuningAdvisorTaskId}/executionPlanStatsComparision'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningAdvisorTaskId}', sql_tuning_advisor_task_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:sqlObjectId] = sql_object_id query_params[:executionId] = execution_id # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-named-credential-id'] = opts[:opc_named_credential_id] if opts[:opc_named_credential_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#get_execution_plan_stats_comparision') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::ExecutionPlanStatsComparision' ) end # rubocop:enable Metrics/BlockLength end |
#get_sql_execution_plan(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, attribute, opts = {}) ⇒ Response
Click here to see an example of how to use get_sql_execution_plan API.
Retrieves a SQL execution plan for the SQL being tuned.
587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 587 def get_sql_execution_plan(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, attribute, opts = {}) logger.debug 'Calling operation SqlTuningClient#get_sql_execution_plan.' if logger raise "Missing the required parameter 'managed_database_id' when calling get_sql_execution_plan." if managed_database_id.nil? raise "Missing the required parameter 'sql_tuning_advisor_task_id' when calling get_sql_execution_plan." if sql_tuning_advisor_task_id.nil? raise "Missing the required parameter 'sql_object_id' when calling get_sql_execution_plan." if sql_object_id.nil? raise "Missing the required parameter 'attribute' when calling get_sql_execution_plan." if attribute.nil? unless %w[ORIGINAL ORIGINAL_WITH_ADJUSTED_COST USING_SQL_PROFILE USING_NEW_INDICES USING_PARALLEL_EXECUTION].include?(attribute) raise "Invalid value for 'attribute', must be one of ORIGINAL, ORIGINAL_WITH_ADJUSTED_COST, USING_SQL_PROFILE, USING_NEW_INDICES, USING_PARALLEL_EXECUTION." end raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) raise "Parameter value for 'sql_tuning_advisor_task_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_advisor_task_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningAdvisorTasks/{sqlTuningAdvisorTaskId}/sqlExecutionPlan'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningAdvisorTaskId}', sql_tuning_advisor_task_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:sqlObjectId] = sql_object_id query_params[:attribute] = attribute # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-named-credential-id'] = opts[:opc_named_credential_id] if opts[:opc_named_credential_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#get_sql_execution_plan') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningAdvisorTaskSqlExecutionPlan' ) end # rubocop:enable Metrics/BlockLength end |
#get_sql_tuning_advisor_task_summary_report(managed_database_id, sql_tuning_advisor_task_id, opts = {}) ⇒ Response
Click here to see an example of how to use get_sql_tuning_advisor_task_summary_report API.
Gets the summary report for the specified SQL Tuning Advisor task.
660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 660 def get_sql_tuning_advisor_task_summary_report(managed_database_id, sql_tuning_advisor_task_id, opts = {}) logger.debug 'Calling operation SqlTuningClient#get_sql_tuning_advisor_task_summary_report.' if logger raise "Missing the required parameter 'managed_database_id' when calling get_sql_tuning_advisor_task_summary_report." if managed_database_id.nil? raise "Missing the required parameter 'sql_tuning_advisor_task_id' when calling get_sql_tuning_advisor_task_summary_report." if sql_tuning_advisor_task_id.nil? if opts[:search_period] && !%w[LAST_24HR LAST_7DAY LAST_31DAY SINCE_LAST ALL].include?(opts[:search_period]) raise 'Invalid value for "search_period", must be one of LAST_24HR, LAST_7DAY, LAST_31DAY, SINCE_LAST, ALL.' end raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) raise "Parameter value for 'sql_tuning_advisor_task_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_advisor_task_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningAdvisorTasks/{sqlTuningAdvisorTaskId}/summaryReport'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningAdvisorTaskId}', sql_tuning_advisor_task_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:searchPeriod] = opts[:search_period] if opts[:search_period] query_params[:timeGreaterThanOrEqualTo] = opts[:time_greater_than_or_equal_to] if opts[:time_greater_than_or_equal_to] query_params[:timeLessThanOrEqualTo] = opts[:time_less_than_or_equal_to] if opts[:time_less_than_or_equal_to] query_params[:beginExecIdGreaterThanOrEqualTo] = opts[:begin_exec_id_greater_than_or_equal_to] if opts[:begin_exec_id_greater_than_or_equal_to] query_params[:endExecIdLessThanOrEqualTo] = opts[:end_exec_id_less_than_or_equal_to] if opts[:end_exec_id_less_than_or_equal_to] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-named-credential-id'] = opts[:opc_named_credential_id] if opts[:opc_named_credential_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#get_sql_tuning_advisor_task_summary_report') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningAdvisorTaskSummaryReport' ) end # rubocop:enable Metrics/BlockLength end |
#list_sql_tuning_advisor_task_findings(managed_database_id, sql_tuning_advisor_task_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_sql_tuning_advisor_task_findings API.
Gets an array of the details of the findings that match specific filters.
746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 746 def list_sql_tuning_advisor_task_findings(managed_database_id, sql_tuning_advisor_task_id, opts = {}) logger.debug 'Calling operation SqlTuningClient#list_sql_tuning_advisor_task_findings.' if logger raise "Missing the required parameter 'managed_database_id' when calling list_sql_tuning_advisor_task_findings." if managed_database_id.nil? raise "Missing the required parameter 'sql_tuning_advisor_task_id' when calling list_sql_tuning_advisor_task_findings." if sql_tuning_advisor_task_id.nil? if opts[:search_period] && !%w[LAST_24HR LAST_7DAY LAST_31DAY SINCE_LAST ALL].include?(opts[:search_period]) raise 'Invalid value for "search_period", must be one of LAST_24HR, LAST_7DAY, LAST_31DAY, SINCE_LAST, ALL.' end if opts[:finding_filter] && !%w[none FINDINGS NOFINDINGS ERRORS PROFILES INDICES STATS RESTRUCTURE ALTERNATIVE AUTO_PROFILES OTHER_PROFILES].include?(opts[:finding_filter]) raise 'Invalid value for "finding_filter", must be one of none, FINDINGS, NOFINDINGS, ERRORS, PROFILES, INDICES, STATS, RESTRUCTURE, ALTERNATIVE, AUTO_PROFILES, OTHER_PROFILES.' end if opts[:sort_by] && !%w[DBTIME_BENEFIT PARSING_SCHEMA SQL_ID STATS PROFILES SQL_BENEFIT DATE INDICES RESTRUCTURE ALTERNATIVE MISC ERROR TIMEOUTS].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of DBTIME_BENEFIT, PARSING_SCHEMA, SQL_ID, STATS, PROFILES, SQL_BENEFIT, DATE, INDICES, RESTRUCTURE, ALTERNATIVE, MISC, ERROR, TIMEOUTS.' end if opts[:sort_order] && !OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.' end raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) raise "Parameter value for 'sql_tuning_advisor_task_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_advisor_task_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningAdvisorTasks/{sqlTuningAdvisorTaskId}/findings'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningAdvisorTaskId}', sql_tuning_advisor_task_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:beginExecId] = opts[:begin_exec_id] if opts[:begin_exec_id] query_params[:endExecId] = opts[:end_exec_id] if opts[:end_exec_id] query_params[:searchPeriod] = opts[:search_period] if opts[:search_period] query_params[:findingFilter] = opts[:finding_filter] if opts[:finding_filter] query_params[:statsHashFilter] = opts[:stats_hash_filter] if opts[:stats_hash_filter] query_params[:indexHashFilter] = opts[:index_hash_filter] if opts[:index_hash_filter] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-named-credential-id'] = opts[:opc_named_credential_id] if opts[:opc_named_credential_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#list_sql_tuning_advisor_task_findings') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningAdvisorTaskFindingCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_sql_tuning_advisor_task_recommendations(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, execution_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_sql_tuning_advisor_task_recommendations API.
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.
843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 843 def list_sql_tuning_advisor_task_recommendations(managed_database_id, sql_tuning_advisor_task_id, sql_object_id, execution_id, opts = {}) logger.debug 'Calling operation SqlTuningClient#list_sql_tuning_advisor_task_recommendations.' if logger raise "Missing the required parameter 'managed_database_id' when calling list_sql_tuning_advisor_task_recommendations." if managed_database_id.nil? raise "Missing the required parameter 'sql_tuning_advisor_task_id' when calling list_sql_tuning_advisor_task_recommendations." if sql_tuning_advisor_task_id.nil? raise "Missing the required parameter 'sql_object_id' when calling list_sql_tuning_advisor_task_recommendations." if sql_object_id.nil? raise "Missing the required parameter 'execution_id' when calling list_sql_tuning_advisor_task_recommendations." if execution_id.nil? if opts[:sort_by] && !%w[RECOMMENDATION_TYPE BENEFIT].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of RECOMMENDATION_TYPE, BENEFIT.' end if opts[:sort_order] && !OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.' end raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) raise "Parameter value for 'sql_tuning_advisor_task_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_advisor_task_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningAdvisorTasks/{sqlTuningAdvisorTaskId}/recommendations'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningAdvisorTaskId}', sql_tuning_advisor_task_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:sqlObjectId] = sql_object_id query_params[:executionId] = execution_id query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-named-credential-id'] = opts[:opc_named_credential_id] if opts[:opc_named_credential_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#list_sql_tuning_advisor_task_recommendations') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningAdvisorTaskRecommendationCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_sql_tuning_advisor_tasks(managed_database_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_sql_tuning_advisor_tasks API.
Lists the SQL Tuning Advisor tasks for the specified Managed Database.
930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 930 def list_sql_tuning_advisor_tasks(managed_database_id, opts = {}) logger.debug 'Calling operation SqlTuningClient#list_sql_tuning_advisor_tasks.' if logger raise "Missing the required parameter 'managed_database_id' when calling list_sql_tuning_advisor_tasks." if managed_database_id.nil? if opts[:status] && !%w[INITIAL EXECUTING INTERRUPTED COMPLETED ERROR].include?(opts[:status]) raise 'Invalid value for "status", must be one of INITIAL, EXECUTING, INTERRUPTED, COMPLETED, ERROR.' end if opts[:sort_by] && !%w[NAME START_TIME].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of NAME, START_TIME.' end if opts[:sort_order] && !OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.' end raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningAdvisorTasks'.sub('{managedDatabaseId}', managed_database_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:name] = opts[:name] if opts[:name] query_params[:status] = opts[:status] if opts[:status] query_params[:timeGreaterThanOrEqualTo] = opts[:time_greater_than_or_equal_to] if opts[:time_greater_than_or_equal_to] query_params[:timeLessThanOrEqualTo] = opts[:time_less_than_or_equal_to] if opts[:time_less_than_or_equal_to] query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-named-credential-id'] = opts[:opc_named_credential_id] if opts[:opc_named_credential_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#list_sql_tuning_advisor_tasks') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningAdvisorTaskCollection' ) end # rubocop:enable Metrics/BlockLength end |
#list_sql_tuning_sets(managed_database_id, opts = {}) ⇒ Response
Click here to see an example of how to use list_sql_tuning_sets API.
Lists the SQL tuning sets for the specified Managed Database.
1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 1016 def list_sql_tuning_sets(managed_database_id, opts = {}) logger.debug 'Calling operation SqlTuningClient#list_sql_tuning_sets.' if logger raise "Missing the required parameter 'managed_database_id' when calling list_sql_tuning_sets." if managed_database_id.nil? if opts[:sort_by] && !%w[NAME].include?(opts[:sort_by]) raise 'Invalid value for "sort_by", must be one of NAME.' end if opts[:sort_order] && !OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.include?(opts[:sort_order]) raise 'Invalid value for "sort_order", must be one of the values in OCI::DatabaseManagement::Models::SORT_ORDERS_ENUM.' end raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets'.sub('{managedDatabaseId}', managed_database_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} query_params[:owner] = opts[:owner] if opts[:owner] query_params[:nameContains] = opts[:name_contains] if opts[:name_contains] query_params[:sortBy] = opts[:sort_by] if opts[:sort_by] query_params[:sortOrder] = opts[:sort_order] if opts[:sort_order] query_params[:page] = opts[:page] if opts[:page] query_params[:limit] = opts[:limit] if opts[:limit] # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-named-credential-id'] = opts[:opc_named_credential_id] if opts[:opc_named_credential_id] # rubocop:enable Style/NegatedIf post_body = nil # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#list_sql_tuning_sets') do @api_client.call_api( :GET, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningSetCollection' ) end # rubocop:enable Metrics/BlockLength end |
#load_sql_tuning_set(managed_database_id, sql_tuning_set_id, load_sql_tuning_set_details, opts = {}) ⇒ Response
Click here to see an example of how to use load_sql_tuning_set API.
Load Sql statements into the Sql tuning set specified by name and optional filter parameters within the Managed Database specified by managedDatabaseId.
1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 1094 def load_sql_tuning_set(managed_database_id, sql_tuning_set_id, load_sql_tuning_set_details, opts = {}) logger.debug 'Calling operation SqlTuningClient#load_sql_tuning_set.' if logger raise "Missing the required parameter 'managed_database_id' when calling load_sql_tuning_set." if managed_database_id.nil? raise "Missing the required parameter 'sql_tuning_set_id' when calling load_sql_tuning_set." if sql_tuning_set_id.nil? raise "Missing the required parameter 'load_sql_tuning_set_details' when calling load_sql_tuning_set." if load_sql_tuning_set_details.nil? raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) raise "Parameter value for 'sql_tuning_set_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_set_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets/{sqlTuningSetId}/actions/loadSqlTuningSet'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningSetId}', sql_tuning_set_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(load_sql_tuning_set_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#load_sql_tuning_set') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningSetAdminActionStatus' ) end # rubocop:enable Metrics/BlockLength end |
#logger ⇒ Logger
Returns The logger for this client. May be nil.
96 97 98 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 96 def logger @api_client.config.logger end |
#save_sql_tuning_set_as(managed_database_id, sql_tuning_set_id, save_sql_tuning_set_as_details, opts = {}) ⇒ Response
Click here to see an example of how to use save_sql_tuning_set_as API.
Saves the specified list of Sqls statements into another new Sql tuning set or loads into an existing Sql tuning set'.
1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 1162 def save_sql_tuning_set_as(managed_database_id, sql_tuning_set_id, save_sql_tuning_set_as_details, opts = {}) logger.debug 'Calling operation SqlTuningClient#save_sql_tuning_set_as.' if logger raise "Missing the required parameter 'managed_database_id' when calling save_sql_tuning_set_as." if managed_database_id.nil? raise "Missing the required parameter 'sql_tuning_set_id' when calling save_sql_tuning_set_as." if sql_tuning_set_id.nil? raise "Missing the required parameter 'save_sql_tuning_set_as_details' when calling save_sql_tuning_set_as." if save_sql_tuning_set_as_details.nil? raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) raise "Parameter value for 'sql_tuning_set_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_set_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets/{sqlTuningSetId}/actions/saveAs'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningSetId}', sql_tuning_set_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(save_sql_tuning_set_as_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#save_sql_tuning_set_as') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningSetAdminActionStatus' ) end # rubocop:enable Metrics/BlockLength end |
#start_sql_tuning_task(managed_database_id, start_sql_tuning_task_details, opts = {}) ⇒ Response
Click here to see an example of how to use start_sql_tuning_task API.
Starts a SQL tuning task for a given set of SQL statements from the active session history top SQL statements.
1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 1229 def start_sql_tuning_task(managed_database_id, start_sql_tuning_task_details, opts = {}) logger.debug 'Calling operation SqlTuningClient#start_sql_tuning_task.' if logger raise "Missing the required parameter 'managed_database_id' when calling start_sql_tuning_task." if managed_database_id.nil? raise "Missing the required parameter 'start_sql_tuning_task_details' when calling start_sql_tuning_task." if start_sql_tuning_task_details.nil? raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) path = '/managedDatabases/{managedDatabaseId}/actions/startSqlTuningTask'.sub('{managedDatabaseId}', managed_database_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(start_sql_tuning_task_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#start_sql_tuning_task') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningTaskReturn' ) end # rubocop:enable Metrics/BlockLength end |
#validate_basic_filter(managed_database_id, sql_tuning_set_id, validate_basic_filter_details, opts = {}) ⇒ Response
Click here to see an example of how to use validate_basic_filter API.
Executes a SQL query to check whether user entered basic filter criteria is valid or not.
1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 |
# File 'lib/oci/database_management/sql_tuning_client.rb', line 1295 def validate_basic_filter(managed_database_id, sql_tuning_set_id, validate_basic_filter_details, opts = {}) logger.debug 'Calling operation SqlTuningClient#validate_basic_filter.' if logger raise "Missing the required parameter 'managed_database_id' when calling validate_basic_filter." if managed_database_id.nil? raise "Missing the required parameter 'sql_tuning_set_id' when calling validate_basic_filter." if sql_tuning_set_id.nil? raise "Missing the required parameter 'validate_basic_filter_details' when calling validate_basic_filter." if validate_basic_filter_details.nil? raise "Parameter value for 'managed_database_id' must not be blank" if OCI::Internal::Util.blank_string?(managed_database_id) raise "Parameter value for 'sql_tuning_set_id' must not be blank" if OCI::Internal::Util.blank_string?(sql_tuning_set_id) path = '/managedDatabases/{managedDatabaseId}/sqlTuningSets/{sqlTuningSetId}/actions/validateBasicFilter'.sub('{managedDatabaseId}', managed_database_id.to_s).sub('{sqlTuningSetId}', sql_tuning_set_id.to_s) operation_signing_strategy = :standard # rubocop:disable Style/NegatedIf # Query Params query_params = {} # Header Params header_params = {} header_params[:accept] = 'application/json' header_params[:'content-type'] = 'application/json' header_params[:'opc-request-id'] = opts[:opc_request_id] if opts[:opc_request_id] header_params[:'opc-retry-token'] = opts[:opc_retry_token] if opts[:opc_retry_token] # rubocop:enable Style/NegatedIf header_params[:'opc-retry-token'] ||= OCI::Retry.generate_opc_retry_token post_body = @api_client.object_to_http_body(validate_basic_filter_details) # rubocop:disable Metrics/BlockLength OCI::Retry.(applicable_retry_config(opts), call_name: 'SqlTuningClient#validate_basic_filter') do @api_client.call_api( :POST, path, endpoint, header_params: header_params, query_params: query_params, operation_signing_strategy: operation_signing_strategy, body: post_body, return_type: 'OCI::DatabaseManagement::Models::SqlTuningSetAdminActionStatus' ) end # rubocop:enable Metrics/BlockLength end |