Class: OCI::DatabaseManagement::Models::DatabasePlanDirective

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

Overview

Manages resource allocation among databases. Besides the name, at least one other property must be available.

Constant Summary collapse

TYPE_ENUM =
[
  TYPE_DATABASE = 'DATABASE'.freeze,
  TYPE_PROFILE = 'PROFILE'.freeze,
  TYPE_OTHER = 'OTHER'.freeze,
  TYPE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze
ROLE_ENUM =
[
  ROLE_PRIMARY = 'PRIMARY'.freeze,
  ROLE_STANDBY = 'STANDBY'.freeze,
  ROLE_NONE = 'NONE'.freeze,
  ROLE_UNKNOWN_ENUM_VALUE = 'UNKNOWN_ENUM_VALUE'.freeze
].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ DatabasePlanDirective

Initializes the object

Parameters:

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

    Model attributes in the form of hash

Options Hash (attributes):

  • :name (String)

    The value to assign to the #name property

  • :share (Integer)

    The value to assign to the #share property

  • :level (Integer)

    The value to assign to the #level property

  • :allocation (Integer)

    The value to assign to the #allocation property

  • :limit (Integer)

    The value to assign to the #limit property

  • :is_flash_cache_on (BOOLEAN)

    The value to assign to the #is_flash_cache_on property

  • :is_pmem_cache_on (BOOLEAN)

    The value to assign to the #is_pmem_cache_on property

  • :is_flash_log_on (BOOLEAN)

    The value to assign to the #is_flash_log_on property

  • :is_pmem_log_on (BOOLEAN)

    The value to assign to the #is_pmem_log_on property

  • :flash_cache_limit (String)

    The value to assign to the #flash_cache_limit property

  • :flash_cache_min (String)

    The value to assign to the #flash_cache_min property

  • :flash_cache_size (String)

    The value to assign to the #flash_cache_size property

  • :pmem_cache_limit (String)

    The value to assign to the #pmem_cache_limit property

  • :pmem_cache_min (String)

    The value to assign to the #pmem_cache_min property

  • :pmem_cache_size (String)

    The value to assign to the #pmem_cache_size property

  • :asm_cluster (String)

    The value to assign to the #asm_cluster property

  • :type (String)

    The value to assign to the #type property

  • :role (String)

    The value to assign to the #role property



242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 242

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

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

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

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

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

  self.is_flash_cache_on = attributes[:'isFlashCacheOn'] unless attributes[:'isFlashCacheOn'].nil?

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

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

  self.is_pmem_cache_on = attributes[:'isPmemCacheOn'] unless attributes[:'isPmemCacheOn'].nil?

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

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

  self.is_flash_log_on = attributes[:'isFlashLogOn'] unless attributes[:'isFlashLogOn'].nil?

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

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

  self.is_pmem_log_on = attributes[:'isPmemLogOn'] unless attributes[:'isPmemLogOn'].nil?

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

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

  self.flash_cache_limit = attributes[:'flashCacheLimit'] if attributes[:'flashCacheLimit']

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

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

  self.flash_cache_min = attributes[:'flashCacheMin'] if attributes[:'flashCacheMin']

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

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

  self.flash_cache_size = attributes[:'flashCacheSize'] if attributes[:'flashCacheSize']

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

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

  self.pmem_cache_limit = attributes[:'pmemCacheLimit'] if attributes[:'pmemCacheLimit']

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

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

  self.pmem_cache_min = attributes[:'pmemCacheMin'] if attributes[:'pmemCacheMin']

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

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

  self.pmem_cache_size = attributes[:'pmemCacheSize'] if attributes[:'pmemCacheSize']

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

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

  self.asm_cluster = attributes[:'asmCluster'] if attributes[:'asmCluster']

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

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

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

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

Instance Attribute Details

#allocationInteger

The resource allocation as a percentage (0-100) within the level.

Returns:

  • (Integer)


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

def allocation
  @allocation
end

#asm_clusterString

Starting with Oracle Exadata System Software release 19.1.0, you can use the asmcluster attribute to distinguish between databases with the same name running in different Oracle ASM clusters.

Returns:

  • (String)


146
147
148
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 146

def asm_cluster
  @asm_cluster
end

#flash_cache_limitString

Defines a soft limit for space usage in Exadata Smart Flash Cache. If the cache is not full, the limit can be exceeded. You specify the value for flashcachelimit in bytes. You can also use the suffixes M (megabytes), G (gigabytes), or T (terabytes) to specify larger values. For example, 300M, 150G, or 1T. The value for flashcachelimit must be at least 4 MB. The flashcachelimit and flashcachesize attributes cannot be specified in the same directive. The value for flashcachelimit cannot be smaller than flashcachemin, if it is specified.

Returns:

  • (String)


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

def flash_cache_limit
  @flash_cache_limit
end

#flash_cache_minString

Specifies a minimum guaranteed space allocation in Exadata Smart Flash Cache. You specify the value for flashcachemin in bytes. You can also use the suffixes M (megabytes), G (gigabytes), or T (terabytes) to specify larger values. For example, 300M, 150G, or 1T. The value for flashcachemin must be at least 4 MB. In any plan, the sum of all flashcachemin values cannot exceed the size of Exadata Smart Flash Cache. If flashcachelimit is specified, then the value for flashcachemin cannot exceed flashcachelimit. If flashcachesize is specified, then the value for flashcachemin cannot exceed flashcachesize.

Returns:

  • (String)


101
102
103
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 101

def flash_cache_min
  @flash_cache_min
end

#flash_cache_sizeString

Defines a hard limit for space usage in Exadata Smart Flash Cache. The limit cannot be exceeded, even if the cache is not full. In an IORM plan, if the size of Exadata Smart Flash Cache can accommodate all of the flashcachemin and flashcachesize allocations, then each flashcachesize definition represents a guaranteed space allocation. However, starting with Oracle Exadata System Software release 19.2.0 you can use the flashcachesize attribute to over-provision space in Exadata Smart Flash Cache. Consequently, if the size of Exadata Smart Flash Cache cannot accommodate all of the flashcachemin and flashcachesize allocations, then only flashcachemin is guaranteed.

Returns:

  • (String)


113
114
115
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 113

def flash_cache_size
  @flash_cache_size
end

#is_flash_cache_onBOOLEAN

Controls use of Exadata Smart Flash Cache by a database. This ensures that cache space is reserved for mission-critical databases. flashcache=off is invalid in a directive that contains the flashcachemin, flashcachelimit, or flashcachesize attributes.

Returns:

  • (BOOLEAN)


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

def is_flash_cache_on
  @is_flash_cache_on
end

#is_flash_log_onBOOLEAN

Controls use of Exadata Smart Flash Log by a database. This ensures that Exadata Smart Flash Log is reserved for mission-critical databases.

Returns:

  • (BOOLEAN)


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

def is_flash_log_on
  @is_flash_log_on
end

#is_pmem_cache_onBOOLEAN

Controls use of the persistent memory (PMEM) cache by a database. This ensures that cache space is reserved for mission-critical databases. pmemcache=off is invalid in a directive that contains the pmemcachemin, pmemcachelimit, or pmemcachesize attributes.

Returns:

  • (BOOLEAN)


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

def is_pmem_cache_on
  @is_pmem_cache_on
end

#is_pmem_log_onBOOLEAN

Controls use of persistent memory logging (PMEM log) by a database. This ensures that PMEM log is reserved for mission-critical databases.

Returns:

  • (BOOLEAN)


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

def is_pmem_log_on
  @is_pmem_log_on
end

#levelInteger

The allocation level. Valid values are from 1 to 8. Resources are allocated to level 1 first, and then remaining resources are allocated to level 2, and so on.

Returns:

  • (Integer)


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

def level
  @level
end

#limitInteger

The maximum I/O utilization limit as a percentage of the available resources.

Returns:

  • (Integer)


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

def limit
  @limit
end

#nameString

[Required] The name of a database or a profile.

Returns:

  • (String)


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

def name
  @name
end

#pmem_cache_limitString

Defines a soft limit for space usage in the persistent memory (PMEM) cache. If the cache is not full, the limit can be exceeded. You specify the value for pmemcachelimit in bytes. You can also use the suffixes M (megabytes), G (gigabytes), or T (terabytes) to specify larger values. For example, 300M, 150G, or 1T. The value for pmemcachelimit must be at least 4 MB. The pmemcachelimit and pmemcachesize attributes cannot be specified in the same directive. The value for pmemcachelimit cannot be smaller than pmemcachemin, if it is specified.

Returns:

  • (String)


124
125
126
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 124

def pmem_cache_limit
  @pmem_cache_limit
end

#pmem_cache_minString

Specifies a minimum guaranteed space allocation in the persistent memory (PMEM) cache.

Returns:

  • (String)


129
130
131
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 129

def pmem_cache_min
  @pmem_cache_min
end

#pmem_cache_sizeString

Defines a hard limit for space usage in the persistent memory (PMEM) cache. The limit cannot be exceeded, even if the cache is not full. In an IORM plan, if the size of the PMEM cache can accommodate all of the pmemcachemin and pmemcachesize allocations, then each pmemcachesize definition represents a guaranteed space allocation. However, you can use the pmemcachesize attribute to over-provision space in the PMEM cache. Consequently, if the PMEM cache size cannot accommodate all of the pmemcachemin and pmemcachesize allocations, then only pmemcachemin is guaranteed.

Returns:

  • (String)


140
141
142
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 140

def pmem_cache_size
  @pmem_cache_size
end

#roleString

Enables you to specify different plan directives based on the Oracle Data Guard database role.

Returns:

  • (String)


164
165
166
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 164

def role
  @role
end

#shareInteger

The relative priority of a database in the database plan. A higher share value implies higher priority and more access to the I/O resources. Use either share or (level, allocation). All plan directives in a database plan should use the same setting. Share-based resource allocation is the recommended method for a database plan.

Returns:

  • (Integer)


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

def share
  @share
end

#typeString

Enables you to create a profile or template, to ease management and configuration of resource plans in environments with many databases.

  • type=database: Specifies a directive that applies to a specific database. If type in not specified, then the directive defaults to the database type.

  • type=profile: Specifies a directive that applies to a profile rather than a specific database.

To associate a database with an IORM profile, you must set the database initialization parameter db_performance_profile to the value of the profile name. Databases that map to a profile inherit the settings specified in the profile.

Returns:

  • (String)


159
160
161
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 159

def type
  @type
end

Class Method Details

.attribute_mapObject

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



167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 167

def self.attribute_map
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'name',
    'share': :'share',
    'level': :'level',
    'allocation': :'allocation',
    'limit': :'limit',
    'is_flash_cache_on': :'isFlashCacheOn',
    'is_pmem_cache_on': :'isPmemCacheOn',
    'is_flash_log_on': :'isFlashLogOn',
    'is_pmem_log_on': :'isPmemLogOn',
    'flash_cache_limit': :'flashCacheLimit',
    'flash_cache_min': :'flashCacheMin',
    'flash_cache_size': :'flashCacheSize',
    'pmem_cache_limit': :'pmemCacheLimit',
    'pmem_cache_min': :'pmemCacheMin',
    'pmem_cache_size': :'pmemCacheSize',
    'asm_cluster': :'asmCluster',
    'type': :'type',
    'role': :'role'
    # rubocop:enable Style/SymbolLiteral
  }
end

.swagger_typesObject

Attribute type mapping.



193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 193

def self.swagger_types
  {
    # rubocop:disable Style/SymbolLiteral
    'name': :'String',
    'share': :'Integer',
    'level': :'Integer',
    'allocation': :'Integer',
    'limit': :'Integer',
    'is_flash_cache_on': :'BOOLEAN',
    'is_pmem_cache_on': :'BOOLEAN',
    'is_flash_log_on': :'BOOLEAN',
    'is_pmem_log_on': :'BOOLEAN',
    'flash_cache_limit': :'String',
    'flash_cache_min': :'String',
    'flash_cache_size': :'String',
    'pmem_cache_limit': :'String',
    'pmem_cache_min': :'String',
    'pmem_cache_size': :'String',
    'asm_cluster': :'String',
    'type': :'String',
    'role': :'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



362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 362

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

  self.class == other.class &&
    name == other.name &&
    share == other.share &&
    level == other.level &&
    allocation == other.allocation &&
    limit == other.limit &&
    is_flash_cache_on == other.is_flash_cache_on &&
    is_pmem_cache_on == other.is_pmem_cache_on &&
    is_flash_log_on == other.is_flash_log_on &&
    is_pmem_log_on == other.is_pmem_log_on &&
    flash_cache_limit == other.flash_cache_limit &&
    flash_cache_min == other.flash_cache_min &&
    flash_cache_size == other.flash_cache_size &&
    pmem_cache_limit == other.pmem_cache_limit &&
    pmem_cache_min == other.pmem_cache_min &&
    pmem_cache_size == other.pmem_cache_size &&
    asm_cluster == other.asm_cluster &&
    type == other.type &&
    role == other.role
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



409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 409

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


389
390
391
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 389

def eql?(other)
  self == other
end

#hashFixnum

Calculates hash code according to all attributes.

Returns:

  • (Fixnum)

    Hash code



398
399
400
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 398

def hash
  [name, share, level, allocation, limit, is_flash_cache_on, is_pmem_cache_on, is_flash_log_on, is_pmem_log_on, flash_cache_limit, flash_cache_min, flash_cache_size, pmem_cache_limit, pmem_cache_min, pmem_cache_size, asm_cluster, type, role].hash
end

#to_hashHash

Returns the object in the form of hash

Returns:

  • (Hash)

    Returns the object in the form of hash



442
443
444
445
446
447
448
449
450
451
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 442

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



436
437
438
# File 'lib/oci/database_management/models/database_plan_directive.rb', line 436

def to_s
  to_hash.to_s
end