Module: OraUtils::Directories

Defined in:
lib/orabase/utils/directories.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(parent) ⇒ Object



4
5
6
# File 'lib/orabase/utils/directories.rb', line 4

def self.included(parent)
  parent.extend(Directories)
end

Instance Method Details

#create_directories(placeholder = nil, options = {}) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/orabase/utils/directories.rb', line 15

def create_directories( placeholder = nil, options = {})
  make_oracle_directory oracle_base
  make_oracle_directory oracle_home
  make_oracle_directory "#{oracle_home}/dbs"
  make_oracle_directory "#{oracle_base}/admin"
  make_oracle_directory "#{oracle_base}/cfgtoollogs"
  make_oracle_directory "#{oracle_base}/admin/#{name}"
  make_oracle_directory "#{oracle_base}/admin/#{name}/adump"
  make_oracle_directory "#{oracle_base}/admin/#{name}/ddump"
  make_oracle_directory "#{oracle_base}/admin/#{name}/dpdump"
  make_oracle_directory "#{oracle_base}/admin/#{name}/hdump"
  make_oracle_directory "#{oracle_base}/admin/#{name}/pfile"
  make_oracle_directory "#{oracle_base}/admin/#{name}/scripts"
  make_oracle_directory "#{oracle_base}/admin/#{name}/scripts/log"
  make_oracle_directory "#{oracle_base}/cfgtoollogs/dbca/#{name}"
end

#make_oracle_directory(path) ⇒ Object



32
33
34
35
36
# File 'lib/orabase/utils/directories.rb', line 32

def make_oracle_directory(path)
  Puppet.debug "creating directory #{path}"
  FileUtils.mkdir_p path
  owned_by_oracle(path)
end

#owned_by_oracle(*path) ⇒ Object



38
39
40
41
42
# File 'lib/orabase/utils/directories.rb', line 38

def owned_by_oracle(*path)
  Puppet.debug "Setting ownership for #{path}"
  FileUtils.chmod 0775, path
  FileUtils.chown oracle_user, install_group, path
end

#remove_directories(placeholder = nil, options = {}) ⇒ Object



9
10
11
12
13
# File 'lib/orabase/utils/directories.rb', line 9

def remove_directories( placeholder = nil, options = {})
  FileUtils.rm_rf "#{oracle_base}/admin/#{name}"
  FileUtils.rm_rf "#{oracle_home}/dbs/init#{name}.ora"
  FileUtils.rm_rf "#{oracle_base}/cfgtoolslog/dbca/#{name}"
end