DBI
installing perl dbi, must be done as root
perl -MCPAN -e shell
If running cpan for the first time, it will ask you a bunch of questions. For the most
part, just accept the defaults. The only thing I change is to make sure to automatically
include all dependent modules. If it asks for some mirrors to connect to, pick ones in
North America. I usually choose mirrors that look like they are ISPs, not .edu domain
mirrors. Choose at least 4 or 5. With 5.12, it seems to choose for you.
once you are at the cpan> prompt, install DBI:
cpan> install DBI
it downloads and installs and tests DBI. If there are any other modules it relies on that we don't have yet, they
will be downloaded and installed also. DBI install should be pretty simple.
DBD
To install DBD::oracle we will not use the CPAN shell environment. The big
prerequsite for DBD::oracle is to have the Oracle binaries already installed on the host.
Download DBD::oracle from here: http://search.cpan.org/search%3fmodule=DBD::Oracle, then ungzip/untar it. Make
the directory that it creates and everything underneath writeable and accessible by user oracle.
At a minimum, this is what will need to be done:
1. Become user oracle and source one of the most recent .profile_* files in the Oracle homedir.
2. run these commands successfully:
perl Makefile.PL
make
If these 2 commands run, you are almost home free.
3. Try to run "make test". It will fail anyways because there is no database account set up, this is ok.
If it fails at a step before that, then you have some other problem.
4. Become root and cd back into the DBD::oracle install directory, and run "make install".
Complications:
1) The C compiler version that the above commands are run under must be the
same version that was used to build perl. Use "perl -V" to see the compiler
version used to build perl. Either gcc or perl might need to be upgraded in
order to get them to match.
2) There may not be an existing .profile_* file to use. You can try copying one from
another host, and then modifying it as needed to change to existing dirs for ORACLE_HOME
and LD_LIBRARY_PATH and similar vars. Or you can ask a DBA to create a .profile_something
for you. They may ask which DB instance this is for. To be honest, we don't really care.
One env var that Perl DBI::DBD does not use is ORACLE_SID.
3) Not all of the oracle code has been installed, such that DBD::oracle does not compile.
Ask a DBA to install more of the oracle code.
4) Conflicts between 32 and 64 bit versions of libraries and code. Everything needs to be
either 32 bit or 64 bit, you can't mix and match. If the perl we are using is 32 bit, then
the libraries DBD::oracle needs to bring in must also be 32 bit. if I do "file /usr/bin/perl",
it will report the whether it is 32bit or 64 bit. re-ordering of env vars like LD_LIBRARY_PATH
may be necessary so that 32 bit libraries are first. You may also need to go in and tweak the
Makefile so that it refers to 32 bit libraries instead of 64 bit libraries. A very painful solution might
be that we have to recompile perl as a 64 bit application.
5) Whenever there are complications, and you want to make another attempt to reinstall, you should
do a “make clean”, and then begin again by running “perl Makefile.PL”.
0 comments:
Post a Comment