Help with Oracle Installer manifest

1,036 views
Skip to first unread message

Corey Osman

unread,
Jan 13, 2011, 9:26:48 PM1/13/11
to Puppet Users
Hi,

I am somewhat new to puppet and I wanted to show a demo that automated the install of oracle to my DBA in hopes to entice him to start automating his procedures.

I have linked my manifest code below for review. In the code I have attempted to automate a complete oracle install by following the instructions provided by my DBA. Its very rough code as I am not an expert yet.

http://pastebin.com/Qw39iP7z

The code assumes that the oracle pre-install checklist has been completed via another class called oraclebase. I am using oracle generated response files to automate the actual oracle install. However since oracle doesn't come inside an rpm I don't know of a good way to check if oracle is installed. Using du is probably the worst way since after an install it will take too long to determine if the size is bigger than 5 (line 16).

I thought about using NFS to install which would change my cwd to /net/nfsserver/oracle_install/database which would save bandwidth but there may be times when NFS is unavailable or slow WAN links.

How can I tell if oracle is install or any program when its install without rpm?
How can I tell when the untar command is finished?
What happens when it takes a while to transfer 1.8GB file?
Does the "user => oracle" give me the environment of the user like su - oracle would?
Is there a provider for patching oracle? Is there a patch type?
Is it bad to have lots of exec statements?


Let me know if you have any insight or possibly interested in this code. I would eventually like to turn this into a module.


thanks,


Corey

Patrick

unread,
Jan 13, 2011, 10:19:53 PM1/13/11
to puppet...@googlegroups.com

On Jan 13, 2011, at 6:26 PM, Corey Osman wrote:

> What happens when it takes a while to transfer 1.8GB file?

Just a quick warning before I leave, don't even think of copying this using puppet if you have version 0.25.x or below. Those version load the whole file into RAM before copying. This might be fixed in 2.6.x.

Mohamed Lrhazi

unread,
Jan 13, 2011, 10:44:34 PM1/13/11
to puppet...@googlegroups.com
Look at this example I wrote to install a netbackup client on redhat...

am no expert, but it might help you...: http://pastebin.com/QLk14h6s

Mohamed.

> --
> You received this message because you are subscribed to the Google Groups "Puppet Users" group.
> To post to this group, send email to puppet...@googlegroups.com.
> To unsubscribe from this group, send email to puppet-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
>
>

--
يوم نلقاك يوم فرحي و هنايا

Corey Osman

unread,
Jan 14, 2011, 12:55:34 AM1/14/11
to Puppet Users
Yikes! Thanks for the quick notice
How does it transfer the file? Https? ssh? rsync?

Sven Sporer

unread,
Jan 14, 2011, 4:39:49 AM1/14/11
to Puppet Users
> How can I tell if oracle is install or any program when its install without rpm?
> How can I tell when the untar command is finished?  
> What happens when it takes a while to transfer 1.8GB file?  
> Does the "user => oracle" give me the environment of the user like su - oracle would?
> Is there a provider for patching oracle?  Is there a patch type?
> Is it bad to have lots of exec statements?

Hi, I have a similar use case. I like the idea of installing via RPM,
where the RPM is only a meta package which contains the install
routine, but not the install media. The steps in the manifest are:

1) check if Oracle is not installed (ex: unless => "rpm -q
oracle_database"; Facter fact)
2) if not installed, Mount[oracle_sources]
3) ensure Package[oracle_database] is installed
4a) in RPM: start runInstaller
4b) alternatively, you could place a script (containing the
runInstaller command) with the software sources, and the RPM only
calls "/sources/mount/oracle_install.cmd"

What do you think?

Patrick

unread,
Jan 14, 2011, 4:52:00 AM1/14/11
to puppet...@googlegroups.com

Umn, is this really better than putting it in a repository? A repository will take care of 1, 2, and 4a for you.

Avi Miller

unread,
Jan 14, 2011, 5:16:27 AM1/14/11
to puppet...@googlegroups.com
Hi,

Corey Osman wrote:
> I am somewhat new to puppet and I wanted to show a demo that automated the install of oracle to my DBA in hopes to entice him to start automating his procedures.

An automated Oracle install is pretty complicated. I've been a Linux
Sysadmin for about 10 years and I've worked for Oracle for about 3 years
and even my automated Puppet-based installation isn't perfect. Sadly,
it's also currently not shareable as I do a few bad things. :)

You've also not specified which version of Oracle you're installing:
10g? 11gR1? 11gR2? I've automated 11gR2 Enterprise Edition with Grid
Infrastructure and Real Application Clusters, which is one of the more
complex deployments, and also one of the most expensive. :)

> The code assumes that the oracle pre-install checklist has been completed via another class called oraclebase.

You should take a look at the oracle-validated RPM [1] provided by
Oracle to automate the pre-requisites. This configures users, groups,
sysctl parameters, ulimits, etc. Pretty much everything you need to run
the Oracle Universal Installer.

> How can I tell if oracle is install or any program when its install without rpm?

There are a few utilities you can use. tnsping will tell you if the
listener has come online. sqlplus can be used to see if the database
instance has started. However, you didn't pastie the contents of the
response file, so I don't know if either of those things would actually
occur at the end of your install.

> Does the "user => oracle" give me the environment of the user like su - oracle would?

No, it doesn't. Thus, I would recommend not using the execs -- you
should rather create an installation script and deliver that with a File
resource and then use the Exec to run that script. You can then do much
better logging of the installation process, including things like
wget/rsync'ing the installation files, etc. This is how we do the
installation of most Oracle products including Database and the
Enterprise Manager agent.

> Is there a provider for patching oracle? Is there a patch type?

Not for Puppet. You should be looking at using Oracle Enterprise Manager
11g Grid Control for provisioning and patching Oracle databases. I know
this is the puppet list and I know that I've automated the installation
of Oracle with Puppet, but it would be unfair of me not to say that
provisioning database with Grid Control is much, much easier and
simpler. However, it's much, much more expensive. :)

> Is it bad to have lots of exec statements?

In my experience, yes. The way I do my non-RPM based installations,
primarily of Oracle products, is via File[] delivered scripts and then
just a single Exec to run that script. Or, in some cases I get Puppet to
add a cron entry to run the script and I don't run it with Puppet at all.

Hope that gives you a few ideas. I'm sorry I can't share my Puppet code,
but it really would only be useful for someone installing Oracle
Database 11gR2 Enterprise Edition with Grid Infrastructure and Real
Application Clusters. And really, once you're at that level, you've
probably got Grid Control anyway.

Cheers,
Avi

[1] http://oss.oracle.com/el5/oracle-validated/

Sven Sporer

unread,
Jan 14, 2011, 6:19:40 AM1/14/11
to Puppet Users
Right, but given the size of those RPMs, it's sometimes not feasible
to put a 2.4gb package into a repository. Every client first needs to
fetch that RPM to /var/cache/yum (or similar) and then install it the
same way.

Of course the typical package (including the source) should live in a
repository.

Corey Osman

unread,
Jan 14, 2011, 1:06:28 PM1/14/11
to Puppet Users
Well based on all the feedback, I have decided to go the RPM route. I
had thought about it earlier and it sounded silly to package a 1.8GB
gz file into an rpm.
However, below is what I have decided to do:

1. Install oracle with patches
2. Tar+gzip entire /opt/oracle directory (954MB) vs 1.8GB install
files
3. Create an rpm spec file using the following script
http://www.mindtwist.de/main/linux/3-linux-tipps/32-how-to-convert-tar-gz-archive-to-rpm-.html
4. Require oracle-validated (currently using already )
5. Install via yum provider in puppet

The spec file is 1.4mb and has about 20K lines of code due to 19,500
files being put on disk on install.
The only improvement I could make on this is to split the big rpm into
four smaller rpms that require all the smaller rpms.
Is there a better way?

I found this script that will turn a tar.gz into an rpm spec file.
http://www.mindtwist.de/main/linux/3-linux-tipps/32-how-to-convert-tar-gz-archive-to-rpm-.html

Brian

unread,
Jan 14, 2011, 5:36:01 PM1/14/11
to Puppet Users

On Jan 13, 9:26 pm, Corey Osman <co...@logicminds.biz> wrote:
> Hi,
>
> I am somewhat new to puppet and I wanted to show a demo that automated the install of oracle to my DBA in hopes to entice him to start automating his procedures.
>
> I have linked my manifest code below for review.  In the code I have attempted to automate a complete oracle install by following the instructions provided by my DBA.  Its very rough code as I am not an expert yet.
>
> http://pastebin.com/Qw39iP7z
>
> The code assumes that the oracle pre-install checklist has been completed via another class called oraclebase.  I am using oracle generated response files to automate the actual oracle install.  However since oracle doesn't come inside an rpm I don't know of a good way to check if oracle is installed.  Using du is probably the worst way since after an install it will take too long to determine if the size is bigger than 5 (line 16).  
>
> I thought about using NFS to install which would change my cwd to /net/nfsserver/oracle_install/database which would save bandwidth but there may be times when NFS is unavailable or slow WAN links.

It was the very first module I wrote back in 2009, so no guarantees
that it is the best or prettiest approach, but the set of classes
linked to below can install either the oracle server or client.

http://pastebin.com/nVnrkf2J

I was not aware of the oracle-validated rpm, I'll have to check it
out. I wouldn't trust it for the oracle user and groups, since those
IDs should be consistent across systems and rpm won't ensure that. For
some of the other setup (e.g. sysctl) I worry that it would clobber
existing configuration.

> How can I tell if oracle is install or any program when its install without rpm?

Check for a file it creates, like lsnrctl. For example, from my
oracle::install_base class.

exec { run_installer:
cwd => "$tmp",
creates => "$oracle_home/bin/$installer_creates",
command => "su - oracle -c \"$tmp/$pkg/runInstaller -
ignoreSysPrereqs -waitforcompletion -silent -responseFile $tmp/
$response_file &> $tmp/runInstaller.log\"",
require => [ Class["oracle::packages"], Exec["extract_installer"],
File["response"], File["inventory"]];
}

> How can I tell when the untar command is finished?

This strikes me as the wrong way of thinking about things. Anything
that can't happen before the untar should require the exec that
performs the untar.

> What happens when it takes a while to transfer 1.8GB file?

As far as I know while one step in your manifest is being done, puppet
won't do anything else. As others have said, be wary of using a file
resource for this.

> Does the "user => oracle" give me the environment of the user like su - oracle would?

No.

> Is there a provider for patching oracle?  Is there a patch type?

No. This is something the DBAs where I work handle themselves using
oracle-specific tools.

> Is it bad to have lots of exec statements?

It's messy, but sometimes there's no an obviously better way, or the
amount of work required to do it more cleanly can't be justified. I'm
not sure that I see the advantage of your rpm scheme, for instance,
since you're clearly not going to upgrade oracle by putting newer rpms
in your repository and running yum. If you do go the route of
installing oracle and copying files, rather than running the installer
on each server, be sure not to miss files, like /etc/oratab, that will
end up outside of your oracle base directory. Also, be sure to discuss
this thoroughly with your DBAs and test to make sure it doesn't break
any of their tools; I wonder if there might be identifiers in the
oracle inventory catalog that are supposed to be globally unique, for
example.

All the best,
Brian Pitts
Reply all
Reply to author
Forward
0 new messages