Class: MintPress::OracleDatabase::User

Inherits:
Object
  • Object
show all
Includes:
MintLogger, Mixins::Properties, Utils
Defined in:
src/oracle-database/lib/oracle-database/model/database/user.rb

Overview

An Oracle user object that represents an Oracle user of an Oracle Database Database This class provides a set of methods to manage an Oracle users in an Oracle Database. The attributes of this class closely resemble the DBA_USERS data dictionary view

Since:

  • 0.1.0

Properties (Read/Write)

  • #username ⇒ String
    Name of the database user

    Property Attributes
    • requiredtrue
    • alias:name
    
    
    23
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 23
    
    property :username, required: true, type: String, alias: :name
  • #user_id ⇒ Integer
    Numeric ID of the database user

    Property Attributes
    • fromBigDecimal
    
    
    25
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 25
    
    property :user_id, type: Integer, from: BigDecimal
  • #password ⇒ Mint::Secret
    Password of the database user

    Property Attributes
    • fromString
    
    
    27
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 27
    
    property :password, type: Mint::Secret, from: String
  • #account_status ⇒ String
    Status of the account

    Property Attributes
    • allowed_values[ "OPEN", "EXPIRED", "EXPIRED(GRACE)", "LOCKED(TIMED)", "LOCKED", "EXPIRED & LOCKED(TIMED)", "EXPIRED(GRACE) & LOCKED(TIMED)", "EXPIRED & LOCKED", "EXPIRED(GRACE) & LOCKED" ]
    
    
    29
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 29
    
    property :account_status, type: String, allowed_values: [ "OPEN", "EXPIRED", "EXPIRED(GRACE)", "LOCKED(TIMED)", "LOCKED", "EXPIRED & LOCKED(TIMED)", "EXPIRED(GRACE) & LOCKED(TIMED)", "EXPIRED & LOCKED", "EXPIRED(GRACE) & LOCKED" ]
  • #lock_date ⇒ Time
    When was the account locked?

    Property Attributes
    • fromString
    
    
    31
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 31
    
    property :lock_date, type: Time, from: String
  • #expiry_date ⇒ Time
    When does the account expire?

    Property Attributes
    • fromString
    
    
    33
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 33
    
    property :expiry_date, type: Time, from: String
  • #default_tablespace ⇒ String
    What is the default tablespace?

    Property Attributes
    • fromProc.new { r = nil if ! self.get_property(:default_tablespace).nil? and self.get_property(:default_tablespace).is_a?(MintPress::OracleDatabase::Tablespace) r = "#{self.get_property(:default_tablespace).tablespace_name}" end r }
    
    
    35
    36
    37
    38
    39
    40
    41
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 35
    
    property :default_tablespace, type: String, from: Proc.new { 
      r = nil
      if ! self.get_property(:default_tablespace).nil? and self.get_property(:default_tablespace).is_a?(MintPress::OracleDatabase::Tablespace)
        r = "#{self.get_property(:default_tablespace).tablespace_name}"
      end
      r
    }
  • #temporary_tablespace ⇒ String
    What is the default temporary tablespace?

    Property Attributes
    • fromProc.new { r = nil if ! self.get_property(:temporary_tablespace).nil? and self.get_property(:temporary_tablespace).is_a?(MintPress::OracleDatabase::Tablespace) r = "#{self.get_property(:temporary_tablespace).tablespace_name}" end r }
    
    
    43
    44
    45
    46
    47
    48
    49
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 43
    
    property :temporary_tablespace, type: String, from: Proc.new { 
      r = nil
      if ! self.get_property(:temporary_tablespace).nil? and self.get_property(:temporary_tablespace).is_a?(MintPress::OracleDatabase::Tablespace)
        r = "#{self.get_property(:temporary_tablespace).tablespace_name}"
      end
      r
    }
  • #local_temp_tablespace ⇒ String
    What is the local temporary table space?

    Property Attributes
    • fromProc.new { r = nil if ! self.get_property(:local_temp_tablespace).nil? and self.get_property(:local_temp_tablespace).is_a?(MintPress::OracleDatabase::Tablespace) r = "#{self.get_property(:local_temp_tablespace).tablespace_name}" end r }
    
    
    51
    52
    53
    54
    55
    56
    57
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 51
    
    property :local_temp_tablespace, type: String, from: Proc.new { 
      r = nil
      if ! self.get_property(:local_temp_tablespace).nil? and self.get_property(:local_temp_tablespace).is_a?(MintPress::OracleDatabase::Tablespace)
        r = "#{self.get_property(:local_temp_tablespace).tablespace_name}"
      end
      r
    }
  • #created ⇒ Time
    When was this user created?

    Property Attributes
    • fromString
    
    
    59
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 59
    
    property :created, type: Time, from: String
  • #profile ⇒ String
    What is the users default profile?

    Property Attributes
    
    
    61
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 61
    
    property :profile, type: String
  • #initial_rsrc_consumer_group ⇒ String

    Property Attributes
    
    
    63
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 63
    
    property :initial_rsrc_consumer_group, type: String
  • #external_name ⇒ String

    Property Attributes
    
    
    65
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 65
    
    property :external_name, type: String
  • #password_versions ⇒ String
    , allowed_values: [ "10G", "11G", "12C", "HTTP" ]

    Property Attributes
    
    
    67
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 67
    
    property :password_versions, type: String
  • #editions_enabled ⇒ [ TrueClass, FalseClass ] (Default Value: false)

    Property Attributes
    • defaultfalse
    • fromProc.new { |v| v.to_s.downcase == 'y' ? true : false }
    
    
    69
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 69
    
    property :editions_enabled, type: [ TrueClass, FalseClass ], default: false, from: Proc.new { |v| v.to_s.downcase == 'y' ? true : false }
  • #authentication_type ⇒ String

    Property Attributes
    • allowed_values%w{EXTERNAL GLOBAL PASSWORD NONE}
    
    
    71
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 71
    
    property :authentication_type, type: String, allowed_values: %w{EXTERNAL GLOBAL PASSWORD NONE}
  • #proxy_only_connect ⇒ [ TrueClass, FalseClass ] (Default Value: false)

    Property Attributes
    • defaultfalse
    • fromProc.new { |v| v.to_s.downcase == 'y' ? true : false }
    
    
    73
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 73
    
    property :proxy_only_connect, type: [ TrueClass, FalseClass ], default: false, from: Proc.new { |v| v.to_s.downcase == 'y' ? true : false }
  • #common ⇒ [ TrueClass, FalseClass ] (Default Value: false)

    Property Attributes
    • defaultfalse
    • fromProc.new { |v| v.to_s.downcase == 'yes' ? true : false }
    
    
    75
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 75
    
    property :common, type: [ TrueClass, FalseClass ], default: false, from: Proc.new { |v| v.to_s.downcase == 'yes' ? true : false }
  • #last_login ⇒ Time
    When did the user last login?

    Property Attributes
    • fromString
    
    
    78
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 78
    
    property :last_login, type: Time, from: String
  • #oracle_maintained ⇒ [ TrueClass, FalseClass ] (Default Value: false)
    Is this user an inbuilt oracle user, managed by the system?

    Property Attributes
    • defaultfalse
    • fromProc.new { |v| v.to_s.downcase == 'y' ? true : false }
    
    
    81
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 81
    
    property :oracle_maintained, type: [ TrueClass, FalseClass ], default: false, from: Proc.new { |v| v.to_s.downcase == 'y' ? true : false }
  • #inherited ⇒ [ TrueClass, FalseClass ] (Default Value: false)
    Is this user inherited from elsewhere?

    Property Attributes
    • defaultfalse
    • fromProc.new { |v| v.to_s.downcase == 'yes' ? true : false }
    
    
    84
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 84
    
    property :inherited, type: [ TrueClass, FalseClass ], default: false, from: Proc.new { |v| v.to_s.downcase == 'yes' ? true : false }
  • #default_collation ⇒ String

    Property Attributes
    
    
    86
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 86
    
    property :default_collation, type: String
  • #implicit ⇒ [ TrueClass, FalseClass ] (Default Value: false)

    Property Attributes
    • defaultfalse
    • fromProc.new { |v| v.to_s.downcase == 'yes' ? true : false }
    
    
    88
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 88
    
    property :implicit, type: [ TrueClass, FalseClass ], default: false, from: Proc.new { |v| v.to_s.downcase == 'yes' ? true : false }
  • #all_shard ⇒ [ TrueClass, FalseClass ] (Default Value: false)

    Property Attributes
    • defaultfalse
    • fromProc.new { |v| v.to_s.downcase == 'yes' ? true : false }
    
    
    90
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 90
    
    property :all_shard, type: [ TrueClass, FalseClass ], default: false, from: Proc.new { |v| v.to_s.downcase == 'yes' ? true : false }
  • #parent ⇒ MintPress::OracleDatabase::Database

    Property Attributes
    • prop_name:users
    
    
    92
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 92
    
    property :parent, type: MintPress::OracleDatabase::Database, prop_name: :users
  • #database ⇒ MintPress::OracleDatabase::Database (Default Value: Proc.new { r = nil if self.get_property(:parent).is_a?(MintPress::OracleDatabase::Database) r = self.get_property(:parent) end r })
    Which database does this user exist on?

    Property Attributes
    • defaultProc.new { r = nil if self.get_property(:parent).is_a?(MintPress::OracleDatabase::Database) r = self.get_property(:parent) end r }
    
    
    95
    96
    97
    98
    99
    100
    101
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 95
    
    property :database, type: MintPress::OracleDatabase::Database, default: Proc.new { 
      r = nil
      if self.get_property(:parent).is_a?(MintPress::OracleDatabase::Database)
        r = self.get_property(:parent)
      end
      r
    }
  • #permissions ⇒ Array of ⇒ String (Default Value: [])
    Default grants

    Property Attributes
    • default[]
    
    
    104
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 104
    
    property :permissions, type: String, array: true, default: []
  • #db_username (Default Value: 'sys')
    Username with sys privilege. Defaults to 'sys'

    Property Attributes
    • default'sys'
    • alias:dba_username
    
    
    107
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 107
    
    property :db_username, default: 'sys', alias: :dba_username
  • #db_password ⇒ Mint::Secret
    Password for the above user

    Property Attributes
    • fromString
    • alias:dba_password
    
    
    110
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 110
    
    property :db_password, type: Mint::Secret, from: String, alias: :dba_password
  • #db_role ⇒ String
    Role for the above user

    Property Attributes
    
    
    113
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 113
    
    property :db_role, type: String
  • #db_connect_descriptor ⇒ String
    'Database connect descriptor that will override with advanced DB connect string such as failover and other advanced settings'

    Property Attributes
    
    
    115
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 115
    
    property :db_connect_descriptor, type: String, description: 'Database connect descriptor that will override with advanced DB connect string such as failover and other advanced settings'
  • #host ⇒ MintPress::Infrastructure::Host (Default Value: Proc.new { MintPress::Infrastructure::LocalHost.new })
    Host used to acquire the OCI8 gem

    Property Attributes
    • requiredtrue
    • defaultProc.new { MintPress::Infrastructure::LocalHost.new }
    
    
    118
    119
    120
    # File 'src/oracle-database/lib/oracle-database/model/database/user.rb', line 118
    
    property :host, type: MintPress::Infrastructure::Host, required: true, default: Proc.new {
      MintPress::Infrastructure::LocalHost.new
    }

Properties (Read Only)

Constant Summary

Constants included from MintLogger

MintLogger::DEBUG, MintLogger::ERROR, MintLogger::FATAL, MintLogger::INFO, MintLogger::UNKNOWN, MintLogger::VERBOSE, MintLogger::WARN

Instance Attribute Summary

Attributes included from Mixins::Properties

#autopush_set_cache, #dynamic_create, #harvest_on_access, #harvest_undefined_only, #harvested, #tree_root

Instance Method Summary collapse

Methods included from Utils

#session, #sql_ruby_session, #to_hash

Methods included from Mixins::Properties

#[], #[]=, #add_validate_report_result, #armour_set_property, #array_contains?, #array_is_a?, #check_autopush, #check_stack_overflow, #clone_property_object, #cloner_handle_single_property, #coerce_single, #contains_as_string?, #display_validate_report_result, #double_initialize?, #dump_to_hash, #find_parent, #find_parent_by_identity, #generate_accessor_functions, #get_canonical_renamed, #get_from_opts, #get_my_name, #get_property, #get_property_item, #has?, included, #initialize_validate_report, #inspect, #is_cloned_object?, #is_mintpress_object?, #is_probably_canonical?, #is_set?, #local_debug, #local_info, #local_verbose, #mintpress_property_definitions, #place_object_by_identity, #process_properties, #prop_set?, #property, #property_definitions, #property_details, #property_is_simple_object?, #push_root!, #require_property, #require_update, #retrieve_docstring, #sanitize, #set_map_dirty, #set_property, #set_property_item, #show_short_array, #strip_defaults!, #synchronize, #uncloned_property_definitions, #update_map, #validate, #validate_generic, #validate_properties, #validate_property, #validate_required, #version_allowed?, #weakref

Methods included from MintLogger::Utils::Common

#boolean_val, #has_value?, #no_value?, #nvl, #path_as_symbol, #ruby_level_to_send

Constructor Details

#initialize(opts = {}) ⇒ User

Returns a new instance of User.

Since:

  • 0.1.0

Instance Method Details

#createvoid

This method returns an undefined value.

Create a user

Since:

  • 0.1.0

#dropvoid

This method returns an undefined value.

Drop a user

Since:

  • 0.1.0

#exist?Boolean

Returns:

  • (Boolean)

Since:

  • 0.1.0

#exists?Boolean

Returns:

  • (Boolean)

Since:

  • 0.1.0

#harvestMintPress::OracleDatabase::User

Harvest the configuration of a user in an Oracle database

Returns:

Since:

  • 0.1.0

#lockvoid

This method returns an undefined value.

Lock a user

Since:

  • 0.1.0

#unlockvoid

This method returns an undefined value.

Unlock a user

Since:

  • 0.1.0

#usageString

Example usage of the class

Returns:

Since:

  • 0.1.0