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"),
44 mode
=> 0644, owner
=> oracle
, group
=> dba
48 oracle_system_profile
{
49 "/users/oracle/.bash_profile.oracle":
51 $oracle::database_server::directories::oracle_base_path,
53 $oracle::database_server::directories::oracle_version, oracle_home_path
=>
54 $oracle::database_server::directories::oracle_home_path,
56 $oracle::database_server::directories::oracle_sid, oracle_dumps
=>
57 $oracle::database_server::directories::oracle_dumps,
59 $oracle::database_server::directories::oracle_oralogs
61 } # end of class oracle::database_server::system_profile
64 class oracle
::database_server::directories {
67 define
oracle_dir ( $path, $ensure, $owner, $group, $mode ) {
81 # required directories
85 # ensure => directory,
88 # before => File["var_opt_oracle"],
94 # path => "/var/opt/oracle",
95 # ensure => directory,
97 # group => "oinstall",
98 # require => File["var_opt"],
103 # "/var/opt/oracle/oraInst.loc":
107 # group => "oinstall",
111 $oracle_base_path = "/opt/applications/oracle"
114 path
=> $oracle_base_path,
120 File
["oracle_major_version"],
121 File
["oracle_version"]
123 require => File
["/opt/applications"],
127 # $oracle_inventory_path = "${oracle_base_path}/oraInventory"
129 # "oracle_inventory":
130 # path => $oracle_inventory_path,
131 # ensure => directory,
133 # group => "oinstall",
138 "oracle_major_version":
139 path
=> "${oracle_base_path}/${oracle_major_version}",
143 require => File
["oracle_base"],
146 File
["oracle_version"]
153 path
=> "${oracle_base_path}/${oracle_major_version}/${oracle_version}",
159 File
["oracle_major_version"]
161 before
=> File
["oracle_home"] ,
165 $oracle_home_path = "${oracle_base_path}/${oracle_major_version}/${oracle_version}/${oracle_patch_version}"
168 path
=> "${oracle_home_path}",
174 File
["oracle_major_version"],
175 File
["oracle_version"]
182 path
=> "/data/oracle",
186 require => File
["/data"],
190 $oracle_oralogs = "/data/oracle/oralogs"
193 path
=> "${oracle_oralogs}",
197 require => File
["oracle_data"],
202 "oracle_oralogs_${oracle_sid}":
203 path
=> "${oracle_oralogs}/${oracle_sid}",
207 require => File
["oracle_oralogs"],
209 File
["oracle_oralogs_redo"],
210 File
["oracle_oralogs_ctl"],
211 File
["oracle_oralogs_arch"]
217 "oracle_oralogs_redo":
218 path
=> "${oracle_oralogs}/${oracle_sid}/redo",
222 require => File
["oracle_oralogs_${oracle_sid}"],
227 "oracle_oralogs_ctl":
228 path
=> "${oracle_oralogs}/${oracle_sid}/ctl",
232 require => File
["oracle_oralogs_${oracle_sid}"],
237 "oracle_oralogs_arch":
238 path
=> "${oracle_oralogs}/${oracle_sid}/arch",
242 require => File
["oracle_oralogs_${oracle_sid}"],
248 path
=> "/data/oracle/oradata",
252 require => File
["oracle_data"],
253 before
=> File
["oracle_oradata_${oracle_sid}"],
258 "oracle_oradata_${oracle_sid}":
259 path
=> "/data/oracle/oradata/${oracle_sid}",
263 require => File
["oracle_oradata"],
268 $oracle_logs = "/logs/oracle"
271 path
=> "${oracle_logs}",
275 require => File
["/logs"],
278 File
["oracle_dumps"],
279 File
["oracle_user_dumps"],
280 File
["oracle_background_dumps"],
281 File
["oracle_audit_dumps"],
282 File
["oracle_core_dumps"]
286 $oracle_dumps = "${oracle_logs}/oradumps"
289 path
=> "${oracle_dumps}",
293 require => File
["oracle_logs"],
295 File
["oracle_user_dumps"],
296 File
["oracle_background_dumps"],
297 File
["oracle_audit_dumps"],
298 File
["oracle_core_dumps"],
299 File
["oracle_pfile_dir"],
300 File
["oracle_dumps_${oracle_sid}"]
306 "oracle_dumps_${oracle_sid}":
307 path
=> "/logs/oracle/oradumps/${oracle_sid}",
311 require => File
["oracle_dumps"],
313 File
["oracle_user_dumps"],
314 File
["oracle_background_dumps"],
315 File
["oracle_audit_dumps"],
316 File
["oracle_core_dumps"],
317 File
["oracle_pfile_dir"]
324 path
=> "/logs/oracle/oradumps/${oracle_sid}/udump",
328 require => File
["oracle_dumps_${oracle_sid}"],
333 "oracle_background_dumps":
334 path
=> "/logs/oracle/oradumps/${oracle_sid}/bdump",
338 require => File
["oracle_dumps_${oracle_sid}"],
343 "oracle_audit_dumps":
344 path
=> "/logs/oracle/oradumps/${oracle_sid}/adump",
348 require => File
["oracle_dumps_${oracle_sid}"],
354 path
=> "/logs/oracle/oradumps/${oracle_sid}/cdump",
358 require => File
["oracle_dumps_${oracle_sid}"],
364 path
=> "/logs/oracle/oradumps/${oracle_sid}/pfile",
368 require => File
["oracle_dumps_${oracle_sid}"],
373 } # end of class oracle::database_server::directories
376 class oracle
::database_server::system_packages {
378 case $operatingsystem {
380 $sun_provider = "sun"
381 case $oracle_major_version {
385 $system_packages = ["SUNWarc", "SUNWbtool", "SUNWhea", "SUNWlibm", "SUNWlibms", "SUNWsprot", "SUNWtoo", "SUNWi1of", "SUNWi1cs", "SUNWi15cs", "SUNWxwfnt", "SUNWsprox"]
388 $system_packages = ["SUNWarc", "SUNWbtool", "SUNWhea", "SUNWlibm", "SUNWlibms", "SUNWsprot", "SUNWtoo", "SUNWi1of", "SUNWi1cs", "SUNWi15cs", "SUNWxwfnt"]
391 fail("oracle::database_server - the architecture $architecture is not
392 yet supported by class system_packages.")
399 $system_packages = ["SUNWarc", "SUNWbtool", "SUNWhea", "SUNWlibm", "SUNWlibms", "SUNWsprot", "SUNWtoo", "SUNWi1of", "SUNWxwfnt"]
402 $system_packages = ["SUNWarc", "SUNWbtool", "SUNWhea", "SUNWlibm", "SUNWlibms", "SUNWsprot", "SUNWtoo", "SUNWi1of", "SUNWxwfnt"]
406 fail("oracle::database_server - the architecture $architecture is not
407 yet supported by class system_packages.")
413 fail("oracle::database_server - the oracle version $oracle_major_version is not
414 yet support by class system_packages.")
419 fail("oracle::database_server - the operating system $operatingsystem is not
420 yet supported by class system_packages.")
425 notify
{"oracle::database_server - the operating system is ${operatingsystem}": }
426 notify
{"oracle::database_server - the architecture is ${architecture}": }
427 notify
{"oracle::database_server - the architecture is ${oracle_major_version}": }
428 notify
{"oracle::database_server - the list of packages required is ${system_packages}": }
430 package
{ $ystem_packages: ensure => installed
, provider
=> $sun_provider }
432 } # end of class oracle::database_server::system_packages