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. It takes either credentials or databaseCredential. It's recommended to provide databaseCredential

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



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
207
208
209
210
211
212
213
214
215
216
217
218
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 145

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

  self.database_credential = attributes[:'databaseCredential'] if attributes[:'databaseCredential']

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

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

Instance Attribute Details

#credentialsOCI::DatabaseManagement::Models::ManagedDatabaseCredential



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

def credentials
  @credentials
end

#database_credentialOCI::DatabaseManagement::Models::DatabaseCredentialDetails



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

def database_credential
  @database_credential
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)


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

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)


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

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)


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

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)


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

def is_fixed
  @is_fixed
end

#job_descriptionString

The description of the job.

Returns:

  • (String)


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

def job_description
  @job_description
end

#job_nameString

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

Returns:

  • (String)


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

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)


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

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)


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

def sql_handle
  @sql_handle
end

#sql_idString

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

Returns:

  • (String)


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

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)


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

def sql_text
  @sql_text
end

Class Method Details

.attribute_mapObject

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



88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 88

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

.swagger_typesObject

Attribute type mapping.



108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 108

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',
    'database_credential': :'OCI::DatabaseManagement::Models::DatabaseCredentialDetails'
    # 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



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 235

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 &&
    database_credential == other.database_credential
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



276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 276

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


256
257
258
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 256

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



265
266
267
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 265

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

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



309
310
311
312
313
314
315
316
317
318
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 309

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



303
304
305
# File 'lib/oci/database_management/models/load_sql_plan_baselines_from_cursor_cache_details.rb', line 303

def to_s
  to_hash.to_s
end