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

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



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
219
220
221
222
223
224
225
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 150

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

  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)


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

def basic_filter
  @basic_filter
end

#credential_detailsOCI::DatabaseManagement::Models::SqlTuningSetAdminCredentialDetails



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

def credential_details
  @credential_details
end

#database_credentialOCI::DatabaseManagement::Models::DatabaseCredentialDetails



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

def database_credential
  @database_credential
end

#nameString

[Required] The name of the Sql tuning set.

Returns:

  • (String)


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

def name
  @name
end

#ownerString

[Required] The owner of the Sql tuning set.

Returns:

  • (String)


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

def owner
  @owner
end

#ranking_measure1String

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

Returns:

  • (String)


83
84
85
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 83

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)


88
89
90
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 88

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)


93
94
95
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 93

def ranking_measure3
  @ranking_measure3
end

#recursive_sqlString

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

Returns:

  • (String)


68
69
70
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 68

def recursive_sql
  @recursive_sql
end

#result_limitInteger

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

Returns:

  • (Integer)


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

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)


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

def result_percentage
  @result_percentage
end

Class Method Details

.attribute_mapObject

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



96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 96

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'credential_details': :'credentialDetails',
    'database_credential': :'databaseCredential',
    '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.



115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 115

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'credential_details': :'OCI::DatabaseManagement::Models::SqlTuningSetAdminCredentialDetails',
    'database_credential': :'OCI::DatabaseManagement::Models::DatabaseCredentialDetails',
    '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



266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 266

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

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



306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 306

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


286
287
288
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 286

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



295
296
297
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 295

def hash
  [credential_details, database_credential, 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



339
340
341
342
343
344
345
346
347
348
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 339

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



333
334
335
# File 'lib/oci/database_management/models/fetch_sql_tuning_set_details.rb', line 333

def to_s
  to_hash.to_s
end