Perl script raising oci.dll error, DBD - windows

I have perl script which connects to an Oracle database, opens a text file and loads the data from the file in a database table, the script works perfectly on my development machine (windows xp 32 bit), however when i load the script to the production server (windows 2003 64 bit) and run it from a command line, it opens a perl.exe - unable to locate component windows, the message says
This application has failed to start because OCI.dll was not found. Re-installing the application may fix this problem.
The command line output is:
install_driver(Oracle) failed: Can't load
'C:/Perl64/lib/auto/DBD/Oracle/Oracle.dll' for module DBD::Oracle:
load_file:%1 is not a valid Win32 application at
C:/Perl64/lib/DynaLoader.pm line 191. at (eval 14) line3 Compilation
failde in require at (eval 14) line 3. Perhaps a required shared
library or dll isn;t installde where expected at
c:\warranty\warrantyImport.pl line 15
I have reinstalled the oracle client, i have tried uninstalling both active perl and the oracle client and then installing the oracle client before perl as heard this might cause the issue.
I thought it could be permissions so i wrote a simple perl script to open to oci.dll and raised an error if unable, it was able to open it correctly.
I have ensured C:\oracle\product\10.2.0\client_1\bin is in the PATH enviroment variable.
I can connect to the database using SQLPlus
I have added the OCI.dll to the same directory as the perl script.
and i've now finally run out of ideas....can anyone suggest anything, i'm tearing my hair out trying to get it working.
Details
Server is running ActivePerl 5.14.1 Build 1401 (64-bit)
Oracle database is 10g
Oracle client is 10.2.0

I had a similar issue but for the 64bit version of Perl. I managed to resolve it by getting the correct client libraries and reading this guide:
http://www.pythian.com/news/11115/dbdoracle-and-windows-64bit/
Bascially, I’m running Oracle 11g XE R2, which only comes as 32bit. So I suspected that it was looking for the 64bit client libraries and not finding them. So I downloaded:
instantclient-basic-windows.x64-11.2.0.3.0.zip
instantclient-sqlplus-windows.x64-11.2.0.3.0.zip
instantclient-sdk-windows.x64-11.2.0.3.0.zip
From:
http://www.oracle.com/technetwork/topics/winx64soft-089540.html
And installed to c:\oraclexe\instantclient_11_2
I added these to my path:
C:>set PATH = c:\oraclexe\instantclient_11_2;%PATH%
But unfortunately the error persisted :(
On checking my PATH:
echo %PATH%
I could see that the set was getting ignored. I guess that was a permissions issue.
So I edited the system path variable and restarted the command prompt. This fixed the issue and allowed me to connect :)

Have you mixed some 32 bit and 64 bit components. Obviously you need 64 bit Perl, 64 bit DBI and DBD::Oracle and 64 bit dlls for Oracle client. I only suggest you check as the error says "is not a valid Win32 application at".

Related

ins-32025 oracle 11g error for windows

I am trying to install Oracle onto my VM for the first (1st) time, however, when I get to the setting install directories, I keep getting the following error:
INS-32025 Oracle 11g Error
I have tried changing the install from C: to D: but I keep getting the same error.
Google isn't of any help in this situation. The best I can find is to clear previous Oracle install data, but as I've said, this is the first time oracle is being installed onto my VM.
The VM is windows 7 32bit and I am using the 32bit installer for oracle, just for clarity sake.
Any help would be greatly appreciated.
I received the same error and it got resolved when i removed the line that contain new oracle home in inventory.xml file.
For windows, you can get the file at C:\Program Files\Oracle\Inventory\ContentsXML. Under this folder you should see the file inventory.xml. Just open this file and remove the line which contains the new oracle home path. For more information, that variable you can find after HOME_LIST. Just remove the complete line.

Perl script not able to connect to Oracle Database

I am getting the below error message while executing my Perl script.
Below is the error message that I am getting while compiling my scripts.
install_driver(Oracle) failed: Can't load '/xxx/usr/local/lib/perl5/site_perl/5.10.0/sun4-solaris/auto/DBD/Oracle/Oracle.so'
for module DBD::Oracle: ld.so.1: perl: fatal: libclntsh.so.10.1: open failed: No such file or directory at
/xxx/usr/local/lib/perl5/5.10.0/sun4-solaris/DynaLoader.pm line 203.
at (eval 99) line 3
Compilation failed in require at (eval 99) line 3.
Perhaps a required shared library or dll isn't installed where expected
at /xxx/xxxx/xxxx/xxxx/XXXX/CommonOracle.pm line 71
Recently Oracle have been upgraded from 10.2 to 11.0 in my system. Please help me to fix the issue? I am not the administrator of my system. Do i need to change LD_LIBRARRY_PATH? I am using Solaris OS.
You seem to have forgotten to ask a question. Let's assume it's "how can I fix this?"
Communicating with a database requires a number of things to be installed on your system.
You need the client libraries for the database system that you're using. This will be shared object (.so) files that are probably somewhere under /usr/lib.
You will need the Perl Database driver for your database engine (in your case, this is DBD::Oracle). If you install this by building it from scratch (as the cpan or cpanm commands do) then you'll almost certainly also need the development version of the above-mentioned client libraries. If you're installing pre-built binary versions (.rpm or .apt on Linux - I don't know the equivalent for Solaris) then you won't need these.
You will need the Perl DBI library.
It looks to me like DBD::Oracle is installed. And that means that DBI will be installed as well. But DBD::Oracle is having trouble finding the client libraries. This is surprising as they will hae been needed to install DBD::Oracle.
So, I suspect that either the Oracle client libraries are no longer installed or they are installed, but not in the place where DBD::Oracle is looking for them.
How was DBD::Oracle installed? Do you have a log of that installation that you can inspect for errors?
The issue has been resolved. The lib file "libclntsh.so.10.1" was missing in the library path. I have copied the file and the issue was resolved

Perl install_driver(Oracle) failed: - Can't load '../DBD/Oracle/Oracle.dll' for module DBD::Oracle Win64

Having issues with Perl 5.20.2 and Oracle::DBD, getting following error when trying to connect to Ora 12C DB, run out of ideas on how to identify what is wrong here.
install_driver(Oracle) failed: Can't load 'C:/Perl/site/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 194.
at (eval 72) line 3.
Compilation failed in require at (eval 72) line 3
My environment is as follows
Perl -v - This is perl 5, version 20, subversion 2 (v5.20.2) built for MSWin32-x86-multi-thread-64int
OS is Win 2008 R2 SP1
Ora client is 12.1.0 (64 bit)
Windows Environmental variables
ORACLE_HOME=C:\Oracle12c\product\12.1.0\client_1
Path=C:\Oracle12c\product\12.1.0\client_1\bin;C:\Perl\site\bin;C:\Perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPo
werShell\v1.0\;c:\dmake;D:\NTRESKIT
TNS_ADMIN=C:\Oracle12c\product\12.1.0\client_1\bin
Figured it out...issue was not a files permission issue, the clue was in the "...not a valid Win32 application" verbiage.
I was using Ora 64 bit client instead of 32-bit, removed the Oracle 12c 64-bit client and installed Oracle 12c 32-bit client (you can also install the 11g driver (apparently an Oracle client supports one version back and one version forward)).
I required the full 12c Ora client installer as I need access to the database tools like sqlloader, note that there is a bug in the 12c Oracle 32-bit installer, had to modify the install/oraparam.ini and replace MSVCREDIST_LOC=vcredist_x64.exe with MSVCREDIST_LOC=vcredist_x86.exe, took me a while to find the installer, link here, http://www.oracle.com/technetwork/database/enterpriseedition/downloads/database12c-win64-download-2297732.html , 32-bit driver at bottom of url, hopefully they will fix the installer)
Also, very important to also add an ORACLE_HOME Win env path, I also added the Oracle client to the Path and ensured that it was before the Perl entries in my Windows Path.
Along with the comment I made above, please look at the following here on stackoverflow:
Perl_and_Oracle_DBD

IBM Websphere ILog JRules Studio 7.1.1 Installation Failed Due to Error: Could not Java Virtual Machine

Has any one encountered the error: Could not create Java Virtual Machine error while installing IBM Websphere ILog JRules Studio 7.1.1? I have Windows 7 64 bit OS but this error could happen on any Windows machine. By default IBM ships the package for 32 bit so our installation team tried with 32 bit JDK 6 (with many minor versions) for many days but could not figure out. I have posted my own solution below. Check this out and save your life.
You usually start installation by running JRules_V711_CZLX7ML.exe file on windows. It will extract all resources on your temp directory and you might encounter error: "Could Not Create Java Virtual Machine". Just follow these steps and it "might" solve your problem:
1. Go to your temp directory by typing "%temp%" in Start-> Run or Windows Explorer.
2. Look for directory something like: I1403739667. Go inside this directory.
3. Open command prompt and go to I1403739667/Windows/resource/jre/bin
4. Run command: java -version
5. If you see following error, go further otherwise you might have some other problems:
JVMJ9VM011W Unable to load j9jpi24: The specified module could not be found.
Error: could not load Mercury Interactive support. Please run the setup again.
If the problem persists please contact Mercury's Customer support.
JVMJ9VM011W Unable to load j9jpi24: The specified module could not be found.
JVMJ9VM015W Initialization error for library jvmhook(-3): JVM_OnLoad failed
Could not create the Java virtual machine.
This happens if you have installed HP Quick Test Professional which used to be Mercury before HP bought over.
Right click on your computer icon on desktop and look for following environment variable: IBM_JAVA_OPTIONS
Either rename it to IBM_JAVA_OPTIONS_DONOTUSE or delete it.
Try installing again.
NOTE: I had tried to by pass this error by changing the vm property in Rule Studio.lax file to use JDK 6 32 bit installed on my windows machine and was able to install successfully but there were just too many Rules compilation errors which would not make any sense. So NEVER try to use your own JDK. You have to use the IBM JDK shipped as part of Rule Studio.

PHP 5.3.1 not loading php_oci8.dll on Windows

I'm trying to load the oracle extension on php but im having the error:
Warning: PHP Startup: Unable to load dynamic library 'D:\Program Files\xampp\php\ext\php_oci8.dll' - The specified procedure could not be found.
in Unknown on line 0
I have done so far:
Included on windows path the the fullpath of oracle instant client
on php.ini, the extension_dir is pointing to the right place
on php.ini extension=php_oci8.dll is ok
restarted the apache, and nothing works.
Problem solved by copying the files orannzsbb11.dll , oci.dll and oraociei11.dll to c:\windows\system32
I solved this problem by adding "C:\Program Files (x86)\PHP\v5.3\ext" to my Windows PATH environment variable. You'll just have to remember to change the path if you upgrade PHP. I think this is better than copying dlls which could lead to issues down the road if you end up with multiple dlls with different versions on the same machine.
You will need to download Oracle Instant client from this hyperlink http://www.oracle.com/technetwork/topics/winsoft-085727.html .
Add the path to the instant client on the user environment vriables and the system variables.
For me, this was caused by not having the Visual C++ Redistributable for Visual Studio 2008 SP1 (for VC9) installed. I had to get the x64 package as I'm running Windows 7 64bit. Hopefully this helps someone with the same problem. After installing it, PHP no longer reported those errors.
Possibly quite obvious to some, but wasn't initially for me: if you're still seeing this The specified procedure could not be found. in Unknown on line 0 error, even after installing the instant client, SDK, and so on - make sure you put the Oracle instant client path in your system "PATH" variable, not the user variable, as user obviously doesn't get used when Apache runs. You can verify that the instant client path is set properly by reviewing the PATH value shown in your phpinfo() output.
I found the main cause behind this issue is the oci8 driver version of oracle. Finally i was able to connect to oracle and the steps i described here at http://angularcode.com/connecting-php-to-oracle-database-10g/

Resources