Class: OCI::DatabaseManagement::Models::SqlPlanBaselineSummary

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

Overview

The summary 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 = {}) ⇒ SqlPlanBaselineSummary

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



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
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
# File 'lib/oci/database_management/models/sql_plan_baseline_summary.rb', line 195

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']
end

Instance Attribute Details

#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_summary.rb', line 106

def accepted
  @accepted
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_summary.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_summary.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_summary.rb', line 102

def enabled
  @enabled
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_summary.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_summary.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_summary.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_summary.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_summary.rb', line 73

def sql_handle
  @sql_handle
end

#sql_textString

[Required] The SQL text (truncated to the first 50 characters).

Returns:

  • (String)


77
78
79
# File 'lib/oci/database_management/models/sql_plan_baseline_summary.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_summary.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_summary.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_summary.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.



135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/oci/database_management/models/sql_plan_baseline_summary.rb', line 135

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'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# File 'lib/oci/database_management/models/sql_plan_baseline_summary.rb', line 156

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'
    # 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



354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
# File 'lib/oci/database_management/models/sql_plan_baseline_summary.rb', line 354

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
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



396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
# File 'lib/oci/database_management/models/sql_plan_baseline_summary.rb', line 396

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


376
377
378
# File 'lib/oci/database_management/models/sql_plan_baseline_summary.rb', line 376

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



385
386
387
# File 'lib/oci/database_management/models/sql_plan_baseline_summary.rb', line 385

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



429
430
431
432
433
434
435
436
437
438
# File 'lib/oci/database_management/models/sql_plan_baseline_summary.rb', line 429

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



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

def to_s
  to_hash.to_s
end