Class: MintPress::OracleUtils::SQLSessionImpl
- Inherits:
-
Object
- Object
- MintPress::OracleUtils::SQLSessionImpl
- Includes:
- MintLogger, Mixins::Properties
- Defined in:
- src/oracle-utils/lib/oracle-utils/sql-session.rb
Properties (Read/Write)
-
#host ⇒ MintPress::Infrastructure::Host
Host on which to run the sqlplus commands - this host must have an available SQLplus available to connect_user
Property Attributes- no_backref ⇒ true
- parallel ⇒ true
- disposition ⇒ :requires
138
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 138 property :host, type: MintPress::Infrastructure::Host, no_backref: true, parallel: true, disposition: :requires
-
#oracle_home ⇒ Pathname (Default Value: Proc.new { self.find_oracle_home })
'Oracle Home location for the client installation. If this is not specified, it will attempt to find it using oraenv'
Property Attributes- default ⇒ Proc.new { self.find_oracle_home }
140
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 140 property :oracle_home, type: Pathname, description: 'Oracle Home location for the client installation. If this is not specified, it will attempt to find it using oraenv', default: Proc.new { self.find_oracle_home }
-
#db_username ⇒ String
'Database username'
Property Attributes142
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 142 property :db_username, type: String, description: 'Database username'
-
#db_password ⇒ Mint::Secret
'Password credential for database user'
Property Attributes- from ⇒ String
144
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 144 property :db_password, type: Mint::Secret, from: String, description: 'Password credential for database user'
-
#db_role ⇒ String
'User role'
Property Attributes146
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 146 property :db_role, type: String, description: 'User role'
-
#db_host ⇒ String
'Database connection host'
Property Attributes148
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 148 property :db_host, type: String, description: 'Database connection host'
-
#db_port ⇒ Integer
'Database connection port'
Property Attributes149
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 149 property :db_port, type: Integer, description: 'Database connection port'
-
#db_service_name ⇒ String (Default Value: Proc.new { self.get_property(:oracle_sid, disable_proc: true) })
'Database connection service name'
Property Attributes- default ⇒ Proc.new { self.get_property(:oracle_sid, disable_proc: true) }
151
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 151 property :db_service_name, type: String, description: 'Database connection service name', default: Proc.new { self.get_property(:oracle_sid, disable_proc: true) }
-
#oracle_sid ⇒ String (Default Value: Proc.new { self.get_property(:db_service_name, disable_proc: true) })
'Database SID'
Property Attributes- default ⇒ Proc.new { self.get_property(:db_service_name, disable_proc: true) }
152
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 152 property :oracle_sid, type: String, description: 'Database SID', default: Proc.new { self.get_property(:db_service_name, disable_proc: true) }
-
#db_connect_descriptor ⇒ String (Default Value: Proc.new { "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=#{self.get_property(:db_host)})(PORT=#{self.get_property(:db_port)})))(CONNECT_DATA=(SERVICE_NAME=#{self.get_property(:db_service_name, disable_proc: true)})))" })
'Database connect descriptor that will override with advanced DB connect string such as failover and other advanced settings'
Property Attributes- default ⇒ Proc.new { "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=#{self.get_property(:db_host)})(PORT=#{self.get_property(:db_port)})))(CONNECT_DATA=(SERVICE_NAME=#{self.get_property(:db_service_name, disable_proc: true)})))" }
154
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 154 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', default: Proc.new { "(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=#{self.get_property(:db_host)})(PORT=#{self.get_property(:db_port)})))(CONNECT_DATA=(SERVICE_NAME=#{self.get_property(:db_service_name, disable_proc: true)})))" }
-
#local ⇒ [TrueClass, FalseClass] (Default Value: false)
'Connection type'
Property Attributes- default ⇒ false
156
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 156 property :local, type: [TrueClass, FalseClass], default: false, description: 'Connection type'
-
#connected ⇒ [TrueClass, FalseClass] (Default Value: false)
'Connection state of the session'
Property Attributes- default ⇒ false
158
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 158 property :connected, type: [TrueClass, FalseClass], default: false, description: 'Connection state of the session'
-
#state ⇒ String (Default Value: 'UNKNOWN')
'Database state'
Property Attributes- default ⇒ 'UNKNOWN'
160
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 160 property :state, type: String, default: 'UNKNOWN', description: 'Database state'
-
#use_tnsnames ⇒ [TrueClass, FalseClass] (Default Value: false)
Property Attributes- default ⇒ false
- deprecated ⇒ true
162
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 162 property :use_tnsnames, type: [TrueClass, FalseClass], default: false, deprecated: true
-
#connect_timeout ⇒ Integer (Default Value: 30)
'Connection timeout'
Property Attributes- default ⇒ 30
164
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 164 property :connect_timeout, type: Integer, default: 30, description: 'Connection timeout'
-
#timeout ⇒ Integer (Default Value: 36000)
'Session timeout'
Property Attributes- default ⇒ 36000
166
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 166 property :timeout, type: Integer, default: 36000, description: 'Session timeout'
-
#environment_variables ⇒ Hash of ⇒ String (Default Value: {})
"Environment variables to be set when calling sqlplus. These will be in addition to ORACLE_HOME, LD_LIBRARY_PATH and ORACLE_SID that we set by default. Passing those variables again will override the default ones. Any new variable will be appended."
Property Attributes- default ⇒ {}
174
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 174 property :environment_variables, type: String, hash: true, default: {}, description: "Environment variables to be set when calling sqlplus. These will be in addition to ORACLE_HOME, LD_LIBRARY_PATH and ORACLE_SID that we set by default. Passing those variables again will override the default ones. Any new variable will be appended."
-
#default_directory ⇒ String
"If set, we will set the PWD to this directory before executing sqlplus, e.g. if this value is set to '/tmp/mysql-scripts', MintPress will do a 'cd /tmp/mysql-scripts' and then run sqlplus. This comes in handy with SQLPATH environment variable which you can set with the environment_variables property. If the directory does not exists, MintPress will create it."
Property Attributes176
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 176 property :default_directory, type: String, description: "If set, we will set the PWD to this directory before executing sqlplus, e.g. if this value is set to '/tmp/mysql-scripts', MintPress will do a 'cd /tmp/mysql-scripts' and then run sqlplus. This comes in handy with SQLPATH environment variable which you can set with the environment_variables property. If the directory does not exists, MintPress will create it."
-
#sql_properties ⇒ Hash of ⇒ [String,Integer,TrueClass,FalseClass] (Default Value: { })
"This property allows you to set SQL properties inside the SQLPLUS session, e.g. setting this value to {'feedback' => 'off', 'verify' => 'on'} will set these two properties before running the SQL file/commands. MintPress also sets up some default properties as defined by the 'default_sql_props' property viz. [ 'feedback' => 'off', 'heading' => 'off', 'verify' => 'off', 'pagesize' => 0, 'linesize' => 2000, 'trimspool' => 'on', 'echo' => 'off']. Passing those properties again will override the default ones. Any new property will be appended."
Property Attributes- default ⇒ { }
180
# File 'src/oracle-utils/lib/oracle-utils/sql-session.rb', line 180 property :sql_properties, type: [String,Integer,TrueClass,FalseClass], hash: true, default:{ }, description: "This property allows you to set SQL properties inside the SQLPLUS session, e.g. setting this value to {'feedback' => 'off', 'verify' => 'on'} will set these two properties before running the SQL file/commands. MintPress also sets up some default properties as defined by the 'default_sql_props' property viz. [ 'feedback' => 'off', 'heading' => 'off', 'verify' => 'off', 'pagesize' => 0, 'linesize' => 2000, 'trimspool' => 'on', 'echo' => 'off']. Passing those properties again will override the default ones. Any new property will be appended."
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
- #abort_database ⇒ Object
- #archivelog ⇒ Object
- #check_error(stdout, pattern:) ⇒ Object
- #check_errors(stdout) ⇒ Object
- #close ⇒ Object
-
#connect ⇒ Object
where proxy has the syntax: proxyuser[username][/password][@connect_identifier] NOTE: Brackets around username in proxy are required syntax.
- #connect_admin(role: "sysdba") ⇒ Object
- #connected? ⇒ Boolean
- #execute(sql, ignore_failure: false, ignore_regex: nil, props: {}, wait_for_exit: true, assume_quit: false) ⇒ Object
-
#find_binary(oracle_home) ⇒ Object
Find SQL*Plus executable.
- #find_oracle_home ⇒ Object
- #flashback ⇒ Object
- #flashback? ⇒ Boolean
- #force_logging ⇒ Object
- #force_logging? ⇒ Boolean
-
#initialize(opts = {}) ⇒ SQLSessionImpl
constructor
When SQL*Plus starts, and after CONNECT commands, the site profile (e.g. $ORACLE_HOME/sqlplus/admin/glogin.sql) and the user profile (e.g. login.sql in the working directory) are run.
- #log_mode? ⇒ Boolean
- #mount_database ⇒ Object
- #no_force_logging ⇒ Object
- #noarchivelog ⇒ Object
- #nomount_database ⇒ Object
- #open_database ⇒ Object
- #reinit ⇒ Object
- #restart_database ⇒ Object
- #shutdown_database ⇒ Object
- #sql_file(sql_file, ignore_failure: false, ignore_regex: nil, properties: {}) ⇒ Object
- #state? ⇒ Boolean
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