Class: OCI::DatabaseManagement::Models::FetchSqlTuningSetDetails

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

Overview

The details required to fetch the Sql tuning set details.

Constant Summary collapse

RECURSIVE_SQL_ENUM =
[
  RECURSIVE_SQL_HAS_RECURSIVE_SQL = 'HAS_RECURSIVE_SQL'.freeze,
  RECURSIVE_SQL_NO_RECURSIVE_SQL = 'NO_RECURSIVE_SQL'.freeze
].freeze
RANKING_MEASURE1_ENUM =
[
  RANKING_MEASURE1_ELAPSED_TIME = 'ELAPSED_TIME'.freeze,
  RANKING_MEASURE1_CPU_TIME = 'CPU_TIME'.freeze,
  RANKING_MEASURE1_OPTIMIZER_COST = 'OPTIMIZER_COST'.freeze,
  RANKING_MEASURE1_BUFFER_GETS = 'BUFFER_GETS'.freeze,
  RANKING_MEASURE1_DISK_READS = 'DISK_READS'.freeze,
  RANKING_MEASURE1_DIRECT_WRITES = 'DIRECT_WRITES'.freeze
].freeze
RANKING_MEASURE2_ENUM =
[
  RANKING_MEASURE2_ELAPSED_TIME = 'ELAPSED_TIME'.freeze,
  RANKING_MEASURE2_CPU_TIME = 'CPU_TIME'.freeze,
  RANKING_MEASURE2_OPTIMIZER_COST = 'OPTIMIZER_COST'.freeze,
  RANKING_MEASURE2_BUFFER_GETS = 'BUFFER_GETS'.freeze,
  RANKING_MEASURE2_DISK_READS = 'DISK_READS'.freeze,
  RANKING_MEASURE2_DIRECT_WRITES = 'DIRECT_WRITES'.freeze
].freeze
RANKING_MEASURE3_ENUM =
[
  RANKING_MEASURE3_ELAPSED_TIME = 'ELAPSED_TIME'.freeze,
  RANKING_MEASURE3_CPU_TIME = 'CPU_TIME'.freeze,
  RANKING_MEASURE3_OPTIMIZER_COST = 'OPTIMIZER_COST'.freeze,
  RANKING_MEASURE3_BUFFER_GETS = 'BUFFER_GETS'.freeze,
  RANKING_MEASURE3_DISK_READS = 'DISK_READS'.freeze,
  RANKING_MEASURE3_DIRECT_WRITES = 'DIRECT_WRITES'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ FetchSqlTuningSetDetails

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):



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
207
208
209
210
211
212
213
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 144

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

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

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

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

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

  self.basic_filter = attributes[:'basicFilter'] if attributes[:'basicFilter']
  self.basic_filter = "null" if basic_filter.nil? && !attributes.key?(:'basicFilter') # rubocop:disable Style/StringLiterals

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

  self.basic_filter = attributes[:'basic_filter'] if attributes[:'basic_filter']
  self.basic_filter = "null" if basic_filter.nil? && !attributes.key?(:'basicFilter') && !attributes.key?(:'basic_filter') # rubocop:disable Style/StringLiterals

  self.recursive_sql = attributes[:'recursiveSql'] if attributes[:'recursiveSql']
  self.recursive_sql = "HAS_RECURSIVE_SQL" if recursive_sql.nil? && !attributes.key?(:'recursiveSql') # rubocop:disable Style/StringLiterals

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

  self.recursive_sql = attributes[:'recursive_sql'] if attributes[:'recursive_sql']
  self.recursive_sql = "HAS_RECURSIVE_SQL" if recursive_sql.nil? && !attributes.key?(:'recursiveSql') && !attributes.key?(:'recursive_sql') # rubocop:disable Style/StringLiterals

  self.result_percentage = attributes[:'resultPercentage'] if attributes[:'resultPercentage']
  self.result_percentage = 1.0 if result_percentage.nil? && !attributes.key?(:'resultPercentage') # rubocop:disable Style/StringLiterals

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

  self.result_percentage = attributes[:'result_percentage'] if attributes[:'result_percentage']
  self.result_percentage = 1.0 if result_percentage.nil? && !attributes.key?(:'resultPercentage') && !attributes.key?(:'result_percentage') # rubocop:disable Style/StringLiterals

  self.result_limit = attributes[:'resultLimit'] if attributes[:'resultLimit']

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

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

  self.ranking_measure1 = attributes[:'rankingMeasure1'] if attributes[:'rankingMeasure1']
  self.ranking_measure1 = "null" if ranking_measure1.nil? && !attributes.key?(:'rankingMeasure1') # rubocop:disable Style/StringLiterals

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

  self.ranking_measure1 = attributes[:'ranking_measure1'] if attributes[:'ranking_measure1']
  self.ranking_measure1 = "null" if ranking_measure1.nil? && !attributes.key?(:'rankingMeasure1') && !attributes.key?(:'ranking_measure1') # rubocop:disable Style/StringLiterals

  self.ranking_measure2 = attributes[:'rankingMeasure2'] if attributes[:'rankingMeasure2']
  self.ranking_measure2 = "null" if ranking_measure2.nil? && !attributes.key?(:'rankingMeasure2') # rubocop:disable Style/StringLiterals

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

  self.ranking_measure2 = attributes[:'ranking_measure2'] if attributes[:'ranking_measure2']
  self.ranking_measure2 = "null" if ranking_measure2.nil? && !attributes.key?(:'rankingMeasure2') && !attributes.key?(:'ranking_measure2') # rubocop:disable Style/StringLiterals

  self.ranking_measure3 = attributes[:'rankingMeasure3'] if attributes[:'rankingMeasure3']
  self.ranking_measure3 = "null" if ranking_measure3.nil? && !attributes.key?(:'rankingMeasure3') # rubocop:disable Style/StringLiterals

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

  self.ranking_measure3 = attributes[:'ranking_measure3'] if attributes[:'ranking_measure3']
  self.ranking_measure3 = "null" if ranking_measure3.nil? && !attributes.key?(:'rankingMeasure3') && !attributes.key?(:'ranking_measure3') # rubocop:disable Style/StringLiterals
end

Instance Attribute Details

#basic_filterString

Specifies the Sql predicate to filter the Sql from the Sql tuning set defined on attributes of the SQLSET_ROW. User could use any combination of the following columns with appropriate values as Sql predicate Refer to the documentation docs.oracle.com/en/database/oracle/oracle-database/18/arpls/DBMS_SQLTUNE.html#GUID-1F4AFB03-7B29-46FC-B3F2-CB01EC36326C

Returns:

  • (String)


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

def basic_filter
  @basic_filter
end

#credential_detailsOCI::DatabaseManagement::Models::SqlTuningSetAdminCredentialDetails

This attribute is required.



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

def credential_details
  @credential_details
end

#nameString

[Required] The name of the Sql tuning set.

Returns:

  • (String)


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

def name
  @name
end

#ownerString

[Required] The owner of the Sql tuning set.

Returns:

  • (String)


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

def owner
  @owner
end

#ranking_measure1String

Specifies an ORDER BY clause on the selected Sql. User can specify upto three ranking measures.

Returns:

  • (String)


80
81
82
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 80

def ranking_measure1
  @ranking_measure1
end

#ranking_measure2String

Specifies an ORDER BY clause on the selected Sql. User can specify upto three ranking measures.

Returns:

  • (String)


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

def ranking_measure2
  @ranking_measure2
end

#ranking_measure3String

Specifies an ORDER BY clause on the selected Sql. User can specify upto three ranking measures.

Returns:

  • (String)


90
91
92
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 90

def ranking_measure3
  @ranking_measure3
end

#recursive_sqlString

Specifies that the filter must include recursive Sql in the Sql tuning set.

Returns:

  • (String)


65
66
67
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 65

def recursive_sql
  @recursive_sql
end

#result_limitInteger

The top limit Sql from the filtered source, ranked by the ranking measure.

Returns:

  • (Integer)


75
76
77
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 75

def result_limit
  @result_limit
end

#result_percentageFloat

Specifies a filter that picks the top n% according to the supplied ranking measure. Note that this parameter applies only if one ranking measure is supplied.

Returns:

  • (Float)


71
72
73
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 71

def result_percentage
  @result_percentage
end

Class Method Details

.attribute_mapObject

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



93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 93

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'credential_details': :'credentialDetails',
    'owner': :'owner',
    'name': :'name',
    'basic_filter': :'basicFilter',
    'recursive_sql': :'recursiveSql',
    'result_percentage': :'resultPercentage',
    'result_limit': :'resultLimit',
    'ranking_measure1': :'rankingMeasure1',
    'ranking_measure2': :'rankingMeasure2',
    'ranking_measure3': :'rankingMeasure3'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



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

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'credential_details': :'OCI::DatabaseManagement::Models::SqlTuningSetAdminCredentialDetails',
    'owner': :'String',
    'name': :'String',
    'basic_filter': :'String',
    'recursive_sql': :'String',
    'result_percentage': :'Float',
    'result_limit': :'Integer',
    'ranking_measure1': :'String',
    'ranking_measure2': :'String',
    'ranking_measure3': :'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



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 254

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

  self.class == other.class &&
    credential_details == other.credential_details &&
    owner == other.owner &&
    name == other.name &&
    basic_filter == other.basic_filter &&
    recursive_sql == other.recursive_sql &&
    result_percentage == other.result_percentage &&
    result_limit == other.result_limit &&
    ranking_measure1 == other.ranking_measure1 &&
    ranking_measure2 == other.ranking_measure2 &&
    ranking_measure3 == other.ranking_measure3
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



293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 293

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


273
274
275
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 273

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



282
283
284
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 282

def hash
  [credential_details, owner, name, basic_filter, recursive_sql, result_percentage, result_limit, ranking_measure1, ranking_measure2, ranking_measure3].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



326
327
328
329
330
331
332
333
334
335
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 326

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



320
321
322
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 320

def to_s
  to_hash.to_s
end