Class: OCI::DatabaseManagement::Models::LoadSqlPlanBaselinesFromCursorCacheDetails

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

Overview

The details of SQL statements and plans to be loaded from cursor cache. You can specify the plans to load using SQL ID, plan identifier, or filterName and filterValue pair. You can also control the SQL plan baseline into which the plans are loaded using either SQL text or SQL handle.

Constant Summary collapse

FILTER_NAME_ENUM =
[
  FILTER_NAME_SQL_TEXT = 'SQL_TEXT'.freeze,
  FILTER_NAME_PARSING_SCHEMA_NAME = 'PARSING_SCHEMA_NAME'.freeze,
  FILTER_NAME_MODULE = 'MODULE'.freeze,
  FILTER_NAME_ACTION = 'ACTION'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ LoadSqlPlanBaselinesFromCursorCacheDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 139

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.job_name = attributes[:'jobName'] if attributes[:'jobName']

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

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

  self.job_description = attributes[:'jobDescription'] if attributes[:'jobDescription']

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

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

  self.sql_id = attributes[:'sqlId'] if attributes[:'sqlId']

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

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

  self.plan_hash = attributes[:'planHash'] if attributes[:'planHash']

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

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

  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.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.filter_name = attributes[:'filterName'] if attributes[:'filterName']

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

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

  self.filter_value = attributes[:'filterValue'] if attributes[:'filterValue']

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

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

  self.is_fixed = attributes[:'isFixed'] unless attributes[:'isFixed'].nil?

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

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

  self.is_enabled = attributes[:'isEnabled'] unless attributes[:'isEnabled'].nil?

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

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

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

Instance Attribute Details

#credentialsOCI::DatabaseManagement::Models::ManagedDatabaseCredential

This attribute is required.



82
83
84
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 82

def credentials
  @credentials
end

#filter_nameString

The name of the filter.

  • SQL_TEXT: Search pattern to apply to SQL text.

  • PARSING_SCHEMA_NAME: Name of the parsing schema.

  • MODULE: Name of the module.

  • ACTION: Name of the action.

Returns:

  • (String)


60
61
62
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 60

def filter_name
  @filter_name
end

#filter_valueString

The filter value. It is upper-cased except when it is enclosed in double quotes or filter name is SQL_TEXT.

Returns:

  • (String)


66
67
68
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 66

def filter_value
  @filter_value
end

#is_enabledBOOLEAN

Indicates whether the loaded plans are enabled (true) or not (false). By default, they are enabled.

Returns:

  • (BOOLEAN)


78
79
80
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 78

def is_enabled
  @is_enabled
end

#is_fixedBOOLEAN

Indicates whether the plans are loaded as fixed plans (true) or non-fixed plans (false). By default, they are loaded as non-fixed plans.

Returns:

  • (BOOLEAN)


72
73
74
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 72

def is_fixed
  @is_fixed
end

#job_descriptionString

The description of the job.

Returns:

  • (String)


28
29
30
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 28

def job_description
  @job_description
end

#job_nameString

[Required] The name of the database job used for loading SQL plan baselines.

Returns:

  • (String)


24
25
26
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 24

def job_name
  @job_name
end

#plan_hashFloat

The plan identifier. By default, all plans present in the cursor cache for the SQL statement identified by sqlId are captured.

Returns:

  • (Float)


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

def plan_hash
  @plan_hash
end

#sql_handleString

The SQL handle to use in identifying the SQL plan baseline into which the plans are loaded.

Returns:

  • (String)


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

def sql_handle
  @sql_handle
end

#sql_idString

The SQL statement identifier. Identifies a SQL statement in the cursor cache.

Returns:

  • (String)


32
33
34
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 32

def sql_id
  @sql_id
end

#sql_textString

The SQL text to use in identifying the SQL plan baseline into which the plans are loaded. If the SQL plan baseline does not exist, it is created.

Returns:

  • (String)


44
45
46
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 44

def sql_text
  @sql_text
end

Class Method Details

.attribute_mapObject

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



85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 85

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'job_name': :'jobName',
    'job_description': :'jobDescription',
    'sql_id': :'sqlId',
    'plan_hash': :'planHash',
    'sql_text': :'sqlText',
    'sql_handle': :'sqlHandle',
    'filter_name': :'filterName',
    'filter_value': :'filterValue',
    'is_fixed': :'isFixed',
    'is_enabled': :'isEnabled',
    'credentials': :'credentials'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 104

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'job_name': :'String',
    'job_description': :'String',
    'sql_id': :'String',
    'plan_hash': :'Float',
    'sql_text': :'String',
    'sql_handle': :'String',
    'filter_name': :'String',
    'filter_value': :'String',
    'is_fixed': :'BOOLEAN',
    'is_enabled': :'BOOLEAN',
    'credentials': :'OCI::DatabaseManagement::Models::ManagedDatabaseCredential'
    # 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



223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 223

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

  self.class == other.class &&
    job_name == other.job_name &&
    job_description == other.job_description &&
    sql_id == other.sql_id &&
    plan_hash == other.plan_hash &&
    sql_text == other.sql_text &&
    sql_handle == other.sql_handle &&
    filter_name == other.filter_name &&
    filter_value == other.filter_value &&
    is_fixed == other.is_fixed &&
    is_enabled == other.is_enabled &&
    credentials == other.credentials
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



263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 263

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


243
244
245
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 243

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



252
253
254
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 252

def hash
  [job_name, job_description, sql_id, plan_hash, sql_text, sql_handle, filter_name, filter_value, is_fixed, is_enabled, credentials].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



296
297
298
299
300
301
302
303
304
305
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 296

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



290
291
292
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 290

def to_s
  to_hash.to_s
end