Class: OCI::DatabaseManagement::Models::SqlPlanBaselineConfiguration

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

Overview

The configuration details of SQL plan baselines. The details include:

  • whether automatic initial plan capture is enabled or disabled

  • whether use of SQL plan baselines is enabled or disabled

  • whether Automatic SPM Evolve Advisor task is enabled or disabled

  • whether high-frequency Automatic SPM Evolve Advisor task is enabled or disabled

  • filters for the automatic initial plan capture

  • parameters for the Automatic SPM Evolve Advisor task

  • plan retention and allocated space for the plan baselines

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ SqlPlanBaselineConfiguration

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



111
112
113
114
115
116
117
118
119
120
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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 111

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.is_automatic_initial_plan_capture_enabled = attributes[:'isAutomaticInitialPlanCaptureEnabled'] unless attributes[:'isAutomaticInitialPlanCaptureEnabled'].nil?

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

  self.is_automatic_initial_plan_capture_enabled = attributes[:'is_automatic_initial_plan_capture_enabled'] unless attributes[:'is_automatic_initial_plan_capture_enabled'].nil?

  self.is_sql_plan_baselines_usage_enabled = attributes[:'isSqlPlanBaselinesUsageEnabled'] unless attributes[:'isSqlPlanBaselinesUsageEnabled'].nil?

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

  self.is_sql_plan_baselines_usage_enabled = attributes[:'is_sql_plan_baselines_usage_enabled'] unless attributes[:'is_sql_plan_baselines_usage_enabled'].nil?

  self.is_auto_spm_evolve_task_enabled = attributes[:'isAutoSpmEvolveTaskEnabled'] unless attributes[:'isAutoSpmEvolveTaskEnabled'].nil?

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

  self.is_auto_spm_evolve_task_enabled = attributes[:'is_auto_spm_evolve_task_enabled'] unless attributes[:'is_auto_spm_evolve_task_enabled'].nil?

  self.is_high_frequency_auto_spm_evolve_task_enabled = attributes[:'isHighFrequencyAutoSpmEvolveTaskEnabled'] unless attributes[:'isHighFrequencyAutoSpmEvolveTaskEnabled'].nil?

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

  self.is_high_frequency_auto_spm_evolve_task_enabled = attributes[:'is_high_frequency_auto_spm_evolve_task_enabled'] unless attributes[:'is_high_frequency_auto_spm_evolve_task_enabled'].nil?

  self.plan_retention_weeks = attributes[:'planRetentionWeeks'] if attributes[:'planRetentionWeeks']

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

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

  self.space_budget_percent = attributes[:'spaceBudgetPercent'] if attributes[:'spaceBudgetPercent']

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

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

  self.space_budget_mb = attributes[:'spaceBudgetMB'] if attributes[:'spaceBudgetMB']

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

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

  self.space_used_mb = attributes[:'spaceUsedMB'] if attributes[:'spaceUsedMB']

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

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

  self.auto_capture_filters = attributes[:'autoCaptureFilters'] if attributes[:'autoCaptureFilters']

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

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

  self.auto_spm_evolve_task_parameters = attributes[:'autoSpmEvolveTaskParameters'] if attributes[:'autoSpmEvolveTaskParameters']

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

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

Instance Attribute Details

#auto_capture_filtersArray<OCI::DatabaseManagement::Models::AutomaticCaptureFilter>

The capture filters used in automatic initial plan capture.



54
55
56
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 54

def auto_capture_filters
  @auto_capture_filters
end

#auto_spm_evolve_task_parametersOCI::DatabaseManagement::Models::SpmEvolveTaskParameters



57
58
59
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 57

def auto_spm_evolve_task_parameters
  @auto_spm_evolve_task_parameters
end

#is_auto_spm_evolve_task_enabledBOOLEAN

[Required] Indicates whether the Automatic SPM Evolve Advisor task is enabled (true) or not (false).

Returns:

  • (BOOLEAN)


30
31
32
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 30

def is_auto_spm_evolve_task_enabled
  @is_auto_spm_evolve_task_enabled
end

#is_automatic_initial_plan_capture_enabledBOOLEAN

[Required] Indicates whether the automatic capture of SQL plan baselines is enabled (true) or not (false).

Returns:

  • (BOOLEAN)


22
23
24
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 22

def is_automatic_initial_plan_capture_enabled
  @is_automatic_initial_plan_capture_enabled
end

#is_high_frequency_auto_spm_evolve_task_enabledBOOLEAN

[Required] Indicates whether the high frequency Automatic SPM Evolve Advisor task is enabled (true) or not (false).

Returns:

  • (BOOLEAN)


34
35
36
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 34

def is_high_frequency_auto_spm_evolve_task_enabled
  @is_high_frequency_auto_spm_evolve_task_enabled
end

#is_sql_plan_baselines_usage_enabledBOOLEAN

[Required] Indicates whether the database uses SQL plan baselines (true) or not (false).

Returns:

  • (BOOLEAN)


26
27
28
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 26

def is_sql_plan_baselines_usage_enabled
  @is_sql_plan_baselines_usage_enabled
end

#plan_retention_weeksInteger

[Required] The number of weeks to retain unused plans before they are purged.

Returns:

  • (Integer)


38
39
40
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 38

def plan_retention_weeks
  @plan_retention_weeks
end

#space_budget_mbFloat

The maximum SYSAUX space that can be used for SQL Management Base in MB.

Returns:

  • (Float)


46
47
48
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 46

def space_budget_mb
  @space_budget_mb
end

#space_budget_percentFloat

[Required] The maximum percent of SYSAUX space that can be used for SQL Management Base.

Returns:

  • (Float)


42
43
44
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 42

def space_budget_percent
  @space_budget_percent
end

#space_used_mbFloat

The space used by SQL Management Base in MB.

Returns:

  • (Float)


50
51
52
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 50

def space_used_mb
  @space_used_mb
end

Class Method Details

.attribute_mapObject

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



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 60

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'is_automatic_initial_plan_capture_enabled': :'isAutomaticInitialPlanCaptureEnabled',
    'is_sql_plan_baselines_usage_enabled': :'isSqlPlanBaselinesUsageEnabled',
    'is_auto_spm_evolve_task_enabled': :'isAutoSpmEvolveTaskEnabled',
    'is_high_frequency_auto_spm_evolve_task_enabled': :'isHighFrequencyAutoSpmEvolveTaskEnabled',
    'plan_retention_weeks': :'planRetentionWeeks',
    'space_budget_percent': :'spaceBudgetPercent',
    'space_budget_mb': :'spaceBudgetMB',
    'space_used_mb': :'spaceUsedMB',
    'auto_capture_filters': :'autoCaptureFilters',
    'auto_spm_evolve_task_parameters': :'autoSpmEvolveTaskParameters'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 78

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'is_automatic_initial_plan_capture_enabled': :'BOOLEAN',
    'is_sql_plan_baselines_usage_enabled': :'BOOLEAN',
    'is_auto_spm_evolve_task_enabled': :'BOOLEAN',
    'is_high_frequency_auto_spm_evolve_task_enabled': :'BOOLEAN',
    'plan_retention_weeks': :'Integer',
    'space_budget_percent': :'Float',
    'space_budget_mb': :'Float',
    'space_used_mb': :'Float',
    'auto_capture_filters': :'Array<OCI::DatabaseManagement::Models::AutomaticCaptureFilter>',
    'auto_spm_evolve_task_parameters': :'OCI::DatabaseManagement::Models::SpmEvolveTaskParameters'
    # 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



185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 185

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

  self.class == other.class &&
    is_automatic_initial_plan_capture_enabled == other.is_automatic_initial_plan_capture_enabled &&
    is_sql_plan_baselines_usage_enabled == other.is_sql_plan_baselines_usage_enabled &&
    is_auto_spm_evolve_task_enabled == other.is_auto_spm_evolve_task_enabled &&
    is_high_frequency_auto_spm_evolve_task_enabled == other.is_high_frequency_auto_spm_evolve_task_enabled &&
    plan_retention_weeks == other.plan_retention_weeks &&
    space_budget_percent == other.space_budget_percent &&
    space_budget_mb == other.space_budget_mb &&
    space_used_mb == other.space_used_mb &&
    auto_capture_filters == other.auto_capture_filters &&
    auto_spm_evolve_task_parameters == other.auto_spm_evolve_task_parameters
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



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 224

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


204
205
206
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 204

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



213
214
215
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 213

def hash
  [is_automatic_initial_plan_capture_enabled, is_sql_plan_baselines_usage_enabled, is_auto_spm_evolve_task_enabled, is_high_frequency_auto_spm_evolve_task_enabled, plan_retention_weeks, space_budget_percent, space_budget_mb, space_used_mb, auto_capture_filters, auto_spm_evolve_task_parameters].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



257
258
259
260
261
262
263
264
265
266
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 257

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



251
252
253
# File 'lib/oci/database_management/models/sql_plan_baseline_configuration.rb', line 251

def to_s
  to_hash.to_s
end