1 # database_server.pp - oracle database server software 9i/10g
3 # Copyright (C) 2009 Jeremy Baumont
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 class oracle
::database_server {
20 # required user and groups
21 include oracle
::administrators
24 include oracle
::database_server::system_packages
26 # required directories
27 $oracle_base_path = "/opt/applications/oracle"
30 path
=> $oracle_base_path,
36 File
["oracle_major_version"],
37 File
["oracle_version"]
39 require => File
["/opt/applications"],
44 "oracle_major_version":
45 path
=> "${oracle_base_path}/${oracle_major_version}",
49 require => File
["oracle_base"],
52 File
["oracle_version"]
59 path
=> "${oracle_base_path}/${oracle_major_version}/${oracle_version}",
65 File
["oracle_major_version"]
67 before
=> File
["oracle_home"] ,
73 path
=> "${oracle_base_path}/${oracle_major_version}/${oracle_version}/${oracle_patch_version}",
79 File
["oracle_major_version"],
80 File
["oracle_version"]
87 path
=> "/data/oracle",
91 require => File
["/data"],
97 path
=> "/data/oracle/oralogs",
101 require => File
["oracle_data"],
106 "oracle_oralogs_${oracle_sid}":
107 path
=> "/data/oracle/oralogs/${oracle_sid}",
111 require => File
["oracle_oralogs"],
113 File
["oracle_oralogs_redo"],
114 File
["oracle_oralogs_ctl"],
115 File
["oracle_oralogs_arch"]
121 "oracle_oralogs_redo":
122 path
=> "/data/oracle/oralogs/${oracle_sid}/redo",
126 require => File
["oracle_oralogs_${oracle_sid}"],
131 "oracle_oralogs_ctl":
132 path
=> "/data/oracle/oralogs/${oracle_sid}/ctl",
136 require => File
["oracle_oralogs_${oracle_sid}"],
141 "oracle_oralogs_arch":
142 path
=> "/data/oracle/oralogs/${oracle_sid}/arch",
146 require => File
["oracle_oralogs_${oracle_sid}"],
152 path
=> "/data/oracle/oradata",
156 require => File
["oracle_data"],
157 before
=> File
["oracle_oradata_${oracle_sid}"],
162 "oracle_oradata_${oracle_sid}":
163 path
=> "/data/oracle/oradata/${oracle_sid}",
167 require => File
["oracle_oradata"],
174 path
=> "/logs/oracle",
178 require => File
["/logs"],
181 File
["oracle_dumps"],
182 File
["oracle_user_dumps"],
183 File
["oracle_background_dumps"],
184 File
["oracle_audit_dumps"],
185 File
["oracle_core_dumps"]
191 path
=> "/logs/oracle/oradumps",
195 require => File
["oracle_logs"],
197 File
["oracle_user_dumps"],
198 File
["oracle_background_dumps"],
199 File
["oracle_audit_dumps"],
200 File
["oracle_core_dumps"],
201 File
["oracle_pfile_dir"],
202 File
["oracle_dumps_${oracle_sid}"]
208 "oracle_dumps_${oracle_sid}":
209 path
=> "/logs/oracle/oradumps/${oracle_sid}",
213 require => File
["oracle_dumps"],
215 File
["oracle_user_dumps"],
216 File
["oracle_background_dumps"],
217 File
["oracle_audit_dumps"],
218 File
["oracle_core_dumps"],
219 File
["oracle_pfile_dir"]
226 path
=> "/logs/oracle/oradumps/${oracle_sid}/udump",
230 require => File
["oracle_dumps_${oracle_sid}"],
235 "oracle_background_dumps":
236 path
=> "/logs/oracle/oradumps/${oracle_sid}/bdump",
240 require => File
["oracle_dumps_${oracle_sid}"],
245 "oracle_audit_dumps":
246 path
=> "/logs/oracle/oradumps/${oracle_sid}/adump",
250 require => File
["oracle_dumps_${oracle_sid}"],
256 path
=> "/logs/oracle/oradumps/${oracle_sid}/cdump",
260 require => File
["oracle_dumps_${oracle_sid}"],
266 path
=> "/logs/oracle/oradumps/${oracle_sid}/pfile",
270 require => File
["oracle_dumps_${oracle_sid}"],
275 define
oracle_dir ( $path, $ensure, $owner, $group, $mode ) {
290 class oracle
::database_server::system_packages {
292 case $operatingsystem {
294 $sun_provider = "sun"
295 case $oracle_major_version {
299 $system_packages = ["SUNWarc", "SUNWbtool", "SUNWhea", "SUNWlibm", "SUNWlibms", "SUNWsprot", "SUNWtoo", "SUNWi1of", "SUNWi1cs", "SUNWi15cs", "SUNWxwfnt", "SUNWsprox"]
302 $system_packages = ["SUNWarc", "SUNWbtool", "SUNWhea", "SUNWlibm", "SUNWlibms", "SUNWsprot", "SUNWtoo", "SUNWi1of", "SUNWi1cs", "SUNWi15cs", "SUNWxwfnt"]
305 fail("oracle::database_server - the architecture $architecture is not
306 yet supported by class system_packages.")
313 $system_packages = ["SUNWarc", "SUNWbtool", "SUNWhea", "SUNWlibm", "SUNWlibms", "SUNWsprot", "SUNWtoo", "SUNWi1of", "SUNWxwfnt"]
316 $system_packages = ["SUNWarc", "SUNWbtool", "SUNWhea", "SUNWlibm", "SUNWlibms", "SUNWsprot", "SUNWtoo", "SUNWi1of", "SUNWxwfnt"]
320 fail("oracle::database_server - the architecture $architecture is not
321 yet supported by class system_packages.")
327 fail("oracle::database_server - the oracle version $oracle_major_version is not
328 yet support by class system_packages.")
333 fail("oracle::database_server - the operating system $operatingsystem is not
334 yet supported by class system_packages.")
339 notify
{"oracle::database_server - the operating system is ${operatingsystem}": }
340 notify
{"oracle::database_server - the architecture is ${architecture}": }
341 notify
{"oracle::database_server - the architecture is ${oracle_major_version}": }
342 notify
{"oracle::database_server - the list of packages required is ${system_packages}": }
344 package
{ $ystem_packages: ensure => installed
, provider
=> $sun_provider }