I have successfully compiled and installed DBD::Oracle on Windows 2008 Server 64bit operating system today.
I used the latest version of DBD::Oracle 1.24, version 11.2.0.1.0 for 64bit Windows of Oracle’s Instant Client Package – Basic along with the Instant Client Package – SQL*Plus and finally the Instant Client Package – SDK.
Preparation and Tool Installation
To get it to make and compile correctly I had to download Microsoft’s Visual Studio Ultimate which should contain all the files you need. It is rather portly at 2+gb so you might want to grab lunch while you are downloading it.
After all the above downloading DBD::Oracle installed right out of the box.
Setting Up the Command Environment
All one has to do is select ‘Start Menu->All Programs->Microsoft Visual Studio 2010->Visual Studio Tools->Visual Studio x64 Win64 Command Prompt (2010)’ which will open a good old ‘dos’ window.
At this point CD to the directory where you downloaded DBD::Oracle: c:\DBD-Oracle
Environment Variables and Initialization
Then set your ‘ORACLE_HOME to the Instant Client directory:
c:\DBD-Oracle set ORACLE_HOME=c:\IC_11
You should also set your NLS like this: c:\DBD-Oracle set NLS_LANG=.WE8ISO8859P15
Compilation and Build Process
Once the above setting are done do a: c:\DBD-Oracle perl Makefile.PL
And then a: c:\DBD-Oracle nmake install
Which will produce a whole of warnings (these you can ignore, as they do not seem to effect DBD::Oracle at all) and near the end it should output something like this;
Plaintext
Generating code Finished generating code if exist blib\arch\auto\DBD\Oracle\Oracle.dll.manifest mt -nologo -manifest blib\arch\auto\DBD\Oracle\Oracle.dll.manifest -outputresource:blib\arch\auto \DBD\Oracle\Oracle.dll;2 if exist blib\arch\auto\DBD\Oracle\Oracle.dll.manifest del blib\arch\auto\DBD\Oracle\Oracle.dll.manifest C:\Perl64\bin\perl.exe -MExtUtils::Command -e "chmod" -- 755 blib\arch\auto\DBD\Oracle\Oracle.dll C:\Perl64\bin\perl.exe -MExtUtils::Command -e "cp" -- Oracle.bs blib\arch\auto\DBD\Oracle\Oracle.bs C:\Perl64\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 blib\arch\auto\DBD\Oracle\Oracle.bs C:\Perl64\bin\perl.exe "-Iblib\arch" "-Iblib\lib" ora_explain.PL ora_explain Extracted ora_explain from ora_explain.PL with variable substitutions. C:\Perl64\bin\perl.exe -MExtUtils::Command -e "cp" -- ora_explain blib\script\ora_explain pl2bat.bat blib\script\ora_explain
At this point you are all done. Well almost.
Post-Installation Testing and Verification
It is important that you test your code before you install but you will have to set a few things up first to get it to fully test correctly.
Configuring Database Connectivity for Tests
You will need a TNSNAMES.ORA file that points to a valid DB in the Instant Client Directory. Next you will need to set the ORACLE_USER_ID to a valid user: c:\DBD-Oracle set ORACLE_USER_ID=system/system@XE
You will have to set up TNS_ADMIN to point to the Instant Client Directory: c:\DBD-Oracle set TNS_ADMIN=c:\IC_11
Troubleshooting the DynaLoader Error
Most importantly you will have to add the Instant Client directory to your path like this: c:\DBD-Oracle path = c:\IC_11;%path%
If you do not do this step you will run into the dreaded: Can’t load ‘C:/Perl/lib/auto/DBD/Oracle/Oracle.dll’ for module DBD::Oracle: load_file:%1 is not a valid Win32 application at C:/Perl/lib/DynaLoader.pm line 202.
Error later on after the compile when you try to use DBD::Oracle. What is actually going on is that Perl cannot find oci.dll (or one of the other .dlls it needs to run).
The C:/Perl/lib/auto/DBD/Oracle/Oracle.dll and the DynaLoader error is just a false trail as perl is very limited in what it Windows errors it can report on. For more complet info on this sort of error check out this page; Oracle Troubleshooter HOWTO by Alexander Foken. It is rather dated but the facts of why perl did not find a dll are still valid.
Final Execution
Now you can do this: c:\DBD-Oracle nmake test
And all the tests should run and it will report. Finally simply do a:
c:\DBD-Oracle nmake install
And you are all set.
Cleanup and Final Recommendations
That is about it. At this point you might want to add the Instant Client directory permanently to your path so you will not run into the Dynaloader error again. As well you do not need to keep Visual Studio around to use DBD::Oracle so you can uninstall that as well.
Oracle Database Consulting Services
Ready to optimize your Oracle Database for the future?
Share this
Share this
More resources
Learn more about Pythian by reading the following blogs and articles.
Silent Installation of RAC 12c database
How to install a brand new Exadata X5 (Part 1)
How to install 18c Grid Infrastructure in Silent Mode on Linux 7
Ready to unlock value from your data?
With Pythian, you can accomplish your data transformation goals and more.