Installing the Perl DBD::Oracle on SPARC/Solaris 10
Installing the Perl DBD::Oracle driver on Solaris is traditionally a complete ballache. I hate most things about Oracle software packaging and installation instructions, so I thought I’d get my own instructions going.
So here goes;
Compilers
Start by ensuring you have Solaris 10, patched up to date. First thing we need is a compiler, so take yourself off to http://developers.sun.com/sunstudio/ and get them installed. Once you have done that you should be able to run “versions” and get something like this;
[root@cisapplive /]# version
Machine hardware: sun4u
OS version: 5.10
Processor type: sparc
Hardware: SUNW,SPARC-Enterprise
The following components are installed on your system:
Sun Studio 12 update 1
Sun Studio 12 update 1 C Compiler
Sun Studio 12 update 1 C++ Compiler
Sun Studio 12 update 1 Tools.h++ 7.1
Sun Studio 12 update 1 C++ Standard 64-bit Class Library
Sun Studio 12 update 1 Garbage Collector
Sun Studio 12 update 1 Fortran 95
Sun Studio 12 update 1 Debugging Tools (including dbx)
Sun Studio 12 update 1 IDE
Sun Studio 12 update 1 Performance Analyzer (including collect, ...)
Sun Studio 12 update 1 Performance Library
Sun Studio 12 update 1 Scalapack
Sun Studio 12 update 1 LockLint
Sun Studio 12 update 1 Building Software (including dmake)
Sun Studio 12 update 1 Documentation Set
Sun Studio 12 update 1 /usr symbolic links and GNOME menu item
version of "/opt/sunstudio12.1/bin/../prod/bin/../../bin/cc": Sun C 5.10 SunOS_sparc 2009/06/03
version of "/opt/sunstudio12.1/bin/../prod/bin/../../bin/CC": Sun C++ 5.10 SunOS_sparc 2009/06/03
version of "/opt/sunstudio12.1/bin/../prod/bin/../../bin/f90": Sun Fortran 95 8.4 SunOS_sparc 2009/06/03
version of "/opt/sunstudio12.1/bin/../prod/bin/../../bin/dbx": Sun DBX Debugger 7.7 SunOS_sparc 2009/06/03
version of "/opt/sunstudio12.1/bin/../prod/bin/../../bin/analyzer": Sun Analyzer 7.7 SunOS_sparc 2009/06/03
version of "/opt/sunstudio12.1/bin/../prod/bin/../../bin/dmake": Sun Distributed Make 7.9 SunOS_sparc 2009/06/03
Oracle Instant Client
Get the 32-bit SPARC Instant Client from http://www.oracle.com/technology/software/tech/oci/instantclient/index.html. Get the 32bit version even if you Solaris install is 64-bit (on SPARC, this doesn’t apply on x86-64). Your perl install is 32-bit (don’t believe me? Use file /usr/bin/perl to show you) and you need the 32 bit drivers.
You need the sqlplus, basic and sdk files from the Oracle site.
Extract the zip files into a directory. I put mine in /opt/instantclient. Then ensure your link loader knows where to find the libraries. You can use LD_LIBRARY_PATH although I generally don’t like that method and prefer to use crle instead.
crle -l /lib:/usr/lib:/opt/instantclient
Updating CPAN
The default install of CPAN on Solaris 10 has loads of out-dated modules. Fortunately, it is very easy to update them to current versions. You can start the CPAN shell by running (as root) perl -MCPAN -e shell.
The very first time you use CPAN it will ask you a lot of config questions. One thing I would strongly suggest doing is using gtar instead of the default Solaris tar. The default tar appears to have been written about the same time as Noah built the Ark and as such doesn’t support quite a few of the options modern tar files use (include the CPAN tar file which gets downloaded). Once you have finished answering the questions, you should be presented with a CPAN shell, where you can run;
install Bundle::CPAN
This will update CPAN and all the related modules. Answer “yes” to any questions it gives you and once it has completely finished use reload cpan to get it to refresh itself.
Installing DBD::Oracle
This is the last step. At the CPAN shell, use get DBD::Oracle to download the Oracle DBD interface and then make DBD::Oracle to build it. I do this as separate tests because it is very likely that the make test phase of the install will fail. Assuming that the compile is successful use force install DBD::Oracle to install the Oracle driver. The test-suite is very thorough and goes as far as checking for connectivity to a test database and the ability to perform operations on a test database (hence why I said it is likely to fail). Once the install phase is finished, you are done.






Recent Comments