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 include oracle
::database_server::directories
29 # required system profile
30 include oracle
::database_server::system_profile
32 } # end of class oracle::database_server
35 class oracle
::database_server::system_profile {
38 define
oracle_system_profile ($oracle_base_path, $oracle_version,
39 $oracle_home_path, $oracle_sid,
40 $oracle_dumps, $oracle_oralogs) {
43 content
=> template("oracle/bash_profile.oracle-template.erb")
47 oracle_system_profile
{
48 "/users/oracle/.bash_profile.oracle":
50 $oracle::database_server::directories::oracle_base_path,
52 $oracle::database_server::directories::oracle_version, oracle_home_path
=>
53 $oracle::database_server::directories::oracle_home_path,
55 $oracle::database_server::directories::oracle_sid, oracle_dumps
=>
56 $oracle::database_server::directories::oracle_dumps,
58 $oracle::database_server::directories::oracle_oralogs
60 } # end of class oracle::database_server::system_profile
63 class oracle
::database_server::directories {
66 define
oracle_dir ( $path, $ensure, $owner, $group, $mode ) {
80 # required directories
81 $oracle_base_path = "/opt/applications/oracle"
84 path
=> $oracle_base_path,
90 File
["oracle_major_version"],
91 File
["oracle_version"]
93 require => File
["/opt/applications"],
98 "oracle_major_version":
99 path
=> "${oracle_base_path}/${oracle_major_version}",
103 require => File
["oracle_base"],
106 File
["oracle_version"]
113 path
=> "${oracle_base_path}/${oracle_major_version}/${oracle_version}",
119 File
["oracle_major_version"]
121 before
=> File
["oracle_home"] ,
125 $oracle_home_path = "${oracle_base_path}/${oracle_major_version}/${oracle_version}/${oracle_patch_version}"
128 path
=> "${oracle_home_path}",
134 File
["oracle_major_version"],
135 File
["oracle_version"]
142 path
=> "/data/oracle",
146 require => File
["/data"],
150 $oracle_oralogs = "/data/oracle/oralogs"
153 path
=> "${oracle_oralogs}",
157 require => File
["oracle_data"],
162 "oracle_oralogs_${oracle_sid}":
163 path
=> "${oracle_oralogs}/${oracle_sid}",
167 require => File
["oracle_oralogs"],
169 File
["oracle_oralogs_redo"],
170 File
["oracle_oralogs_ctl"],
171 File
["oracle_oralogs_arch"]
177 "oracle_oralogs_redo":
178 path
=> "${oracle_oralogs}/${oracle_sid}/redo",
182 require => File
["oracle_oralogs_${oracle_sid}"],
187 "oracle_oralogs_ctl":
188 path
=> "${oracle_oralogs}/${oracle_sid}/ctl",
192 require => File
["oracle_oralogs_${oracle_sid}"],
197 "oracle_oralogs_arch":
198 path
=> "${oracle_oralogs}/${oracle_sid}/arch",
202 require => File
["oracle_oralogs_${oracle_sid}"],
208 path
=> "/data/oracle/oradata",
212 require => File
["oracle_data"],
213 before
=> File
["oracle_oradata_${oracle_sid}"],
218 "oracle_oradata_${oracle_sid}":
219 path
=> "/data/oracle/oradata/${oracle_sid}",
223 require => File
["oracle_oradata"],
228 $oracle_logs = "/logs/oracle"
231 path
=> "${oracle_logs}",
235 require => File
["/logs"],
238 File
["oracle_dumps"],
239 File
["oracle_user_dumps"],
240 File
["oracle_background_dumps"],
241 File
["oracle_audit_dumps"],
242 File
["oracle_core_dumps"]
246 $oracle_dumps = "${oracle_logs}/oradumps"
249 path
=> "${oracle_dumps}",
253 require => File
["oracle_logs"],
255 File
["oracle_user_dumps"],
256 File
["oracle_background_dumps"],
257 File
["oracle_audit_dumps"],
258 File
["oracle_core_dumps"],
259 File
["oracle_pfile_dir"],
260 File
["oracle_dumps_${oracle_sid}"]
266 "oracle_dumps_${oracle_sid}":
267 path
=> "/logs/oracle/oradumps/${oracle_sid}",
271 require => File
["oracle_dumps"],
273 File
["oracle_user_dumps"],
274 File
["oracle_background_dumps"],
275 File
["oracle_audit_dumps"],
276 File
["oracle_core_dumps"],
277 File
["oracle_pfile_dir"]
284 path
=> "/logs/oracle/oradumps/${oracle_sid}/udump",
288 require => File
["oracle_dumps_${oracle_sid}"],
293 "oracle_background_dumps":
294 path
=> "/logs/oracle/oradumps/${oracle_sid}/bdump",
298 require => File
["oracle_dumps_${oracle_sid}"],
303 "oracle_audit_dumps":
304 path
=> "/logs/oracle/oradumps/${oracle_sid}/adump",
308 require => File
["oracle_dumps_${oracle_sid}"],
314 path
=> "/logs/oracle/oradumps/${oracle_sid}/cdump",
318 require => File
["oracle_dumps_${oracle_sid}"],
324 path
=> "/logs/oracle/oradumps/${oracle_sid}/pfile",
328 require => File
["oracle_dumps_${oracle_sid}"],
333 } # end of class oracle::database_server::directories
336 class oracle
::database_server::system_packages {
338 case $operatingsystem {
340 $sun_provider = "sun"
341 case $oracle_major_version {
345 $system_packages = ["SUNWarc", "SUNWbtool", "SUNWhea", "SUNWlibm", "SUNWlibms", "SUNWsprot", "SUNWtoo", "SUNWi1of", "SUNWi1cs", "SUNWi15cs", "SUNWxwfnt", "SUNWsprox"]
348 $system_packages = ["SUNWarc", "SUNWbtool", "SUNWhea", "SUNWlibm", "SUNWlibms", "SUNWsprot", "SUNWtoo", "SUNWi1of", "SUNWi1cs", "SUNWi15cs", "SUNWxwfnt"]
351 fail("oracle::database_server - the architecture $architecture is not
352 yet supported by class system_packages.")
359 $system_packages = ["SUNWarc", "SUNWbtool", "SUNWhea", "SUNWlibm", "SUNWlibms", "SUNWsprot", "SUNWtoo", "SUNWi1of", "SUNWxwfnt"]
362 $system_packages = ["SUNWarc", "SUNWbtool", "SUNWhea", "SUNWlibm", "SUNWlibms", "SUNWsprot", "SUNWtoo", "SUNWi1of", "SUNWxwfnt"]
366 fail("oracle::database_server - the architecture $architecture is not
367 yet supported by class system_packages.")
373 fail("oracle::database_server - the oracle version $oracle_major_version is not
374 yet support by class system_packages.")
379 fail("oracle::database_server - the operating system $operatingsystem is not
380 yet supported by class system_packages.")
385 notify
{"oracle::database_server - the operating system is ${operatingsystem}": }
386 notify
{"oracle::database_server - the architecture is ${architecture}": }
387 notify
{"oracle::database_server - the architecture is ${oracle_major_version}": }
388 notify
{"oracle::database_server - the list of packages required is ${system_packages}": }
390 package
{ $ystem_packages: ensure => installed
, provider
=> $sun_provider }
392 } # end of class oracle::database_server::system_packages