Class: OCI::DatabaseManagement::Models::SqlPlanBaseline

Inherits:
Object
  • Object
show all
Defined in:
lib/oci/database_management/models/sql_plan_baseline.rb

Overview

The details of a SQL plan baseline.

Constant Summary collapse

ORIGIN_ENUM =
[
  ORIGIN_ADDM_SQLTUNE = 'ADDM_SQLTUNE'.freeze,
  ORIGIN_AUTO_CAPTURE = 'AUTO_CAPTURE'.freeze,
  ORIGIN_AUTO_SQLTUNE = 'AUTO_SQLTUNE'.freeze,
  ORIGIN_EVOLVE_AUTO_INDEX_LOAD = 'EVOLVE_AUTO_INDEX_LOAD'.freeze,
  ORIGIN_EVOLVE_CREATE_FROM_ADAPTIVE = 'EVOLVE_CREATE_FROM_ADAPTIVE'.freeze,
  ORIGIN_EVOLVE_LOAD_FROM_STS = 'EVOLVE_LOAD_FROM_STS'.freeze,
  ORIGIN_EVOLVE_LOAD_FROM_AWR = 'EVOLVE_LOAD_FROM_AWR'.freeze,
  ORIGIN_EVOLVE_LOAD_FROM_CURSOR_CACHE = 'EVOLVE_LOAD_FROM_CURSOR_CACHE'.freeze,
  ORIGIN_MANUAL_LOAD = 'MANUAL_LOAD'.freeze,
  ORIGIN_MANUAL_LOAD_FROM_AWR = 'MANUAL_LOAD_FROM_AWR'.freeze,
  ORIGIN_MANUAL_LOAD_FROM_CURSOR_CACHE = 'MANUAL_LOAD_FROM_CURSOR_CACHE'.freeze,
  ORIGIN_MANUAL_LOAD_FROM_STS = 'MANUAL_LOAD_FROM_STS'.freeze,
  ORIGIN_MANUAL_SQLTUNE = 'MANUAL_SQLTUNE'.freeze,
  ORIGIN_STORED_OUTLINE = 'STORED_OUTLINE'.freeze,
  ORIGIN_UNKNOWN = 'UNKNOWN'.freeze,
  ORIGIN_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ENABLED_ENUM =
[
  ENABLED_YES = 'YES'.freeze,
  ENABLED_NO = 'NO'.freeze,
  ENABLED_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ACCEPTED_ENUM =
[
  ACCEPTED_YES = 'YES'.freeze,
  ACCEPTED_NO = 'NO'.freeze,
  ACCEPTED_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
FIXED_ENUM =
[
  FIXED_YES = 'YES'.freeze,
  FIXED_NO = 'NO'.freeze,
  FIXED_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
REPRODUCED_ENUM =
[
  REPRODUCED_YES = 'YES'.freeze,
  REPRODUCED_NO = 'NO'.freeze,
  REPRODUCED_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
AUTO_PURGE_ENUM =
[
  AUTO_PURGE_YES = 'YES'.freeze,
  AUTO_PURGE_NO = 'NO'.freeze,
  AUTO_PURGE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ADAPTIVE_ENUM =
[
  ADAPTIVE_YES = 'YES'.freeze,
  ADAPTIVE_NO = 'NO'.freeze,
  ADAPTIVE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SqlPlanBaseline

Initializes the object

Parameters:

  • attributes (Hash) (defaults to: {})

    Model attributes in the form of hash

Options Hash (attributes):

  • :plan_name (String)

    The value to assign to the #plan_name property

  • :sql_handle (String)

    The value to assign to the #sql_handle property

  • :sql_text (String)

    The value to assign to the #sql_text property

  • :origin (String)

    The value to assign to the #origin property

  • :time_created (DateTime)

    The value to assign to the #time_created property

  • :time_last_modified (DateTime)

    The value to assign to the #time_last_modified property

  • :time_last_executed (DateTime)

    The value to assign to the #time_last_executed property

  • :enabled (String)

    The value to assign to the #enabled property

  • :accepted (String)

    The value to assign to the #accepted property

  • :fixed (String)

    The value to assign to the #fixed property

  • :reproduced (String)

    The value to assign to the #reproduced property

  • :auto_purge (String)

    The value to assign to the #auto_purge property

  • :adaptive (String)

    The value to assign to the #adaptive property

  • :_module (String)

    The value to assign to the #_module property

  • :action (String)

    The value to assign to the #action property

  • :execution_plan (String)

    The value to assign to the #execution_plan property



216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
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
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 216

def initialize(attributes = {})
  return unless attributes.is_a?(Hash)

  # convert string to symbol for hash key
  attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

  self.plan_name = attributes[:'planName'] if attributes[:'planName']

  raise 'You cannot provide both :planName and :plan_name' if attributes.key?(:'planName') && attributes.key?(:'plan_name')

  self.plan_name = attributes[:'plan_name'] if attributes[:'plan_name']

  self.sql_handle = attributes[:'sqlHandle'] if attributes[:'sqlHandle']

  raise 'You cannot provide both :sqlHandle and :sql_handle' if attributes.key?(:'sqlHandle') && attributes.key?(:'sql_handle')

  self.sql_handle = attributes[:'sql_handle'] if attributes[:'sql_handle']

  self.sql_text = attributes[:'sqlText'] if attributes[:'sqlText']

  raise 'You cannot provide both :sqlText and :sql_text' if attributes.key?(:'sqlText') && attributes.key?(:'sql_text')

  self.sql_text = attributes[:'sql_text'] if attributes[:'sql_text']

  self.origin = attributes[:'origin'] if attributes[:'origin']

  self.time_created = attributes[:'timeCreated'] if attributes[:'timeCreated']

  raise 'You cannot provide both :timeCreated and :time_created' if attributes.key?(:'timeCreated') && attributes.key?(:'time_created')

  self.time_created = attributes[:'time_created'] if attributes[:'time_created']

  self.time_last_modified = attributes[:'timeLastModified'] if attributes[:'timeLastModified']

  raise 'You cannot provide both :timeLastModified and :time_last_modified' if attributes.key?(:'timeLastModified') && attributes.key?(:'time_last_modified')

  self.time_last_modified = attributes[:'time_last_modified'] if attributes[:'time_last_modified']

  self.time_last_executed = attributes[:'timeLastExecuted'] if attributes[:'timeLastExecuted']

  raise 'You cannot provide both :timeLastExecuted and :time_last_executed' if attributes.key?(:'timeLastExecuted') && attributes.key?(:'time_last_executed')

  self.time_last_executed = attributes[:'time_last_executed'] if attributes[:'time_last_executed']

  self.enabled = attributes[:'enabled'] if attributes[:'enabled']

  self.accepted = attributes[:'accepted'] if attributes[:'accepted']

  self.fixed = attributes[:'fixed'] if attributes[:'fixed']

  self.reproduced = attributes[:'reproduced'] if attributes[:'reproduced']

  self.auto_purge = attributes[:'autoPurge'] if attributes[:'autoPurge']

  raise 'You cannot provide both :autoPurge and :auto_purge' if attributes.key?(:'autoPurge') && attributes.key?(:'auto_purge')

  self.auto_purge = attributes[:'auto_purge'] if attributes[:'auto_purge']

  self.adaptive = attributes[:'adaptive'] if attributes[:'adaptive']

  self._module = attributes[:'module'] if attributes[:'module']

  raise 'You cannot provide both :module and :_module' if attributes.key?(:'module') && attributes.key?(:'_module')

  self._module = attributes[:'_module'] if attributes[:'_module']

  self.action = attributes[:'action'] if attributes[:'action']

  self.execution_plan = attributes[:'executionPlan'] if attributes[:'executionPlan']

  raise 'You cannot provide both :executionPlan and :execution_plan' if attributes.key?(:'executionPlan') && attributes.key?(:'execution_plan')

  self.execution_plan = attributes[:'execution_plan'] if attributes[:'execution_plan']
end

Instance Attribute Details

#_moduleString

The application module name.

Returns:

  • (String)


136
137
138
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 136

def _module
  @_module
end

#acceptedString

Indicates whether the plan baseline is accepted (YES) or not (NO).

Returns:

  • (String)


106
107
108
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 106

def accepted
  @accepted
end

#actionString

The application action.

Returns:

  • (String)


140
141
142
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 140

def action
  @action
end

#adaptiveString

Indicates whether a plan that is automatically captured by SQL plan management is marked adaptive or not.

When a new adaptive plan is found for a SQL statement that has an existing SQL plan baseline, that new plan will be added to the SQL plan baseline as an unaccepted plan, and the ADAPTIVE property will be marked YES. When this new plan is verified (either manually or via the auto evolve task), the plan will be test executed and the final plan determined at execution will become an accepted plan if its performance is better than the existing plan baseline. At this point, the value of the ADAPTIVE property is set to NO since the plan is no longer adaptive, but resolved.

Returns:

  • (String)


132
133
134
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 132

def adaptive
  @adaptive
end

#auto_purgeString

Indicates whether the plan baseline is auto-purged (YES) or not (NO).

Returns:

  • (String)


120
121
122
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 120

def auto_purge
  @auto_purge
end

#enabledString

Indicates whether the plan baseline is enabled (YES) or disabled (NO).

Returns:

  • (String)


102
103
104
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 102

def enabled
  @enabled
end

#execution_planString

[Required] The execution plan for the SQL statement.

Returns:

  • (String)


144
145
146
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 144

def execution_plan
  @execution_plan
end

#fixedString

Indicates whether the plan baseline is fixed (YES) or not (NO).

Returns:

  • (String)


110
111
112
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 110

def fixed
  @fixed
end

#originString

The origin of the SQL plan baseline.

Returns:

  • (String)


81
82
83
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 81

def origin
  @origin
end

#plan_nameString

[Required] The unique plan identifier.

Returns:

  • (String)


69
70
71
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 69

def plan_name
  @plan_name
end

#reproducedString

Indicates whether the optimizer was able to reproduce the plan (YES) or not (NO). The value is set to YES when a plan is initially added to the plan baseline.

Returns:

  • (String)


116
117
118
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 116

def reproduced
  @reproduced
end

#sql_handleString

[Required] The unique SQL identifier.

Returns:

  • (String)


73
74
75
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 73

def sql_handle
  @sql_handle
end

#sql_textString

[Required] The SQL text.

Returns:

  • (String)


77
78
79
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 77

def sql_text
  @sql_text
end

#time_createdDateTime

[Required] The date and time when the plan baseline was created.

Returns:

  • (DateTime)


85
86
87
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 85

def time_created
  @time_created
end

#time_last_executedDateTime

The date and time when the plan baseline was last executed.

Note: For performance reasons, database does not update this value immediately after each execution of the plan baseline. Therefore, the plan baseline may have been executed more recently than this value indicates.

Returns:

  • (DateTime)


98
99
100
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 98

def time_last_executed
  @time_last_executed
end

#time_last_modifiedDateTime

The date and time when the plan baseline was last modified.

Returns:

  • (DateTime)


89
90
91
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 89

def time_last_modified
  @time_last_modified
end

Class Method Details

.attribute_mapObject

Attribute mapping from ruby-style variable name to JSON key.



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 147

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'plan_name': :'planName',
    'sql_handle': :'sqlHandle',
    'sql_text': :'sqlText',
    'origin': :'origin',
    'time_created': :'timeCreated',
    'time_last_modified': :'timeLastModified',
    'time_last_executed': :'timeLastExecuted',
    'enabled': :'enabled',
    'accepted': :'accepted',
    'fixed': :'fixed',
    'reproduced': :'reproduced',
    'auto_purge': :'autoPurge',
    'adaptive': :'adaptive',
    '_module': :'module',
    'action': :'action',
    'execution_plan': :'executionPlan'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 171

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'plan_name': :'String',
    'sql_handle': :'String',
    'sql_text': :'String',
    'origin': :'String',
    'time_created': :'DateTime',
    'time_last_modified': :'DateTime',
    'time_last_executed': :'DateTime',
    'enabled': :'String',
    'accepted': :'String',
    'fixed': :'String',
    'reproduced': :'String',
    'auto_purge': :'String',
    'adaptive': :'String',
    '_module': :'String',
    'action': :'String',
    'execution_plan': :'String'
    # rubocop:enable Style/SymbolLiteral
  }
end

Instance Method Details

#==(other) ⇒ Object

Checks equality by comparing each attribute.

Parameters:

  • other (Object)

    the other object to be compared



389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 389

def ==(other)
  return true if equal?(other)

  self.class == other.class &&
    plan_name == other.plan_name &&
    sql_handle == other.sql_handle &&
    sql_text == other.sql_text &&
    origin == other.origin &&
    time_created == other.time_created &&
    time_last_modified == other.time_last_modified &&
    time_last_executed == other.time_last_executed &&
    enabled == other.enabled &&
    accepted == other.accepted &&
    fixed == other.fixed &&
    reproduced == other.reproduced &&
    auto_purge == other.auto_purge &&
    adaptive == other.adaptive &&
    _module == other._module &&
    action == other.action &&
    execution_plan == other.execution_plan
end

#build_from_hash(attributes) ⇒ Object

Builds the object from hash

Parameters:

  • attributes (Hash)

    Model attributes in the form of hash

Returns:

  • (Object)

    Returns the model itself



434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 434

def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)

  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      # check to ensure the input is an array given that the the attribute
      # is documented as an array but the input is not
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        public_method("#{key}=").call(
          attributes[self.class.attribute_map[key]]
            .map { |v| OCI::Internal::Util.convert_to_type(Regexp.last_match(1), v) }
        )
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      public_method("#{key}=").call(
        OCI::Internal::Util.convert_to_type(type, attributes[self.class.attribute_map[key]])
      )
    end
    # or else data not found in attributes(hash), not an issue as the data can be optional
  end

  self
end

#eql?(other) ⇒ Boolean

Parameters:

  • other (Object)

    the other object to be compared

Returns:

  • (Boolean)

See Also:

  • `==` method


414
415
416
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 414

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



423
424
425
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 423

def hash
  [plan_name, sql_handle, sql_text, origin, time_created, time_last_modified, time_last_executed, enabled, accepted, fixed, reproduced, auto_purge, adaptive, _module, action, execution_plan].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



467
468
469
470
471
472
473
474
475
476
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 467

def to_hash
  hash = {}
  self.class.attribute_map.each_pair do |attr, param|
    value = public_method(attr).call
    next if value.nil? && !instance_variable_defined?("@#{attr}")

    hash[param] = _to_hash(value)
  end
  hash
end

#to_sString

Returns the string representation of the object

Returns:

  • (String)

    String presentation of the object



461
462
463
# File 'lib/oci/database_management/models/sql_plan_baseline.rb', line 461

def to_s
  to_hash.to_s
end