We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Oracle DBD build error: missing oracle.xsi

enotsin asked
Medium Priority
Last Modified: 2009-07-29
I tried to build DBI and DBD Oracle on Win NT using VC++ 4.2. I build and tested DBI successfully, but for DBD, it fails when the c compiler fails to find oracle.xsi (under the include in oracle.xs). I have sql net on my machine and can connect to oracle fine, and I have set oracle_home to c:\orant. Could anyone help me? I have no idea what this xs and xsi is. It seems that the xsi is constructed by concatenting a few files together (on solaris).

My Perl is 5.004 (standard perl).
Watch Question

Which perl are you using? (if you need to, send output of

perl -V

) Note that if you've got the ActiveWare version, you're out of luck, and you'll need to get the GURU version (see http://www.perl.com).  If you do have the GURU version, you need to have, well, some versions of 5.003 will work, but you're better off with 5.004 at the very least.

Also, what version of DBI and DBD::Oracle are you using?

Ack!  Forgot about something.  DBD::Oracle doesn't require the ORACLE_HOME variable, but Makefile.PL does....  You need to set it to your oracle home directory.


Thanks for the info. As I said in the first post, I am using standard perl, which means it is not the activeware version, yes, it is gnu perl.

I also have mentioned in my first post that I have set ORACLE_HOME already. I think it would be very helpful if you could tell me what is that .xsi and .xs file for, whether I really need it or how do I get it (the xsi, I have the .xs already)

Both my DBD and DBI are the lastest version.

You didn't say what specific versions of everything you're using.

By the way, perl is not gnu. It is liberally licensed, but doesn't necessarily fall under the GPL.

The xs file is split by MakeMaker to generate C and perl code for modules. xsi files are normally generated by MakeMaker...

One more thing.  Assuming you're using vc++ rather than the gnu compiler, (actually, even if you're using the gnu compiler), I hope you're using the standard command shell, rather than csh, zsh, or 4Dos....
Most Valuable Expert 2014
Top Expert 2015

Perl can be redistributed under the terms of either the GPL or the Artistic License.

By "GURU version", do you mean the development versions?
If you're not inclined to dig into the internals, I'd suggest sticking with the latest released version (5.004_04 when last I checked)


The versions I am using are:
Perl 5.004-02

So what do I need to do in order to build the DBD successfully? I built and tested the DBI successfully.
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview


I followed you instruction and built DBD, the make process was okay except that at the first time it complains about missing msvcrt.lib, I copied it to the oracle dbd installation directory and it links alright.

Then, I set the TWO_TASK env var to T:<my dbhost ip host name>:<sid> and
nmake test

It complains about
        C:\dev\bin\perl\bin\perl -Mblib -Ic:\dev\bin\perl\lib -Ic:\dev\bin\perl\
lib -e "use Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;" t
\base.t t\general.t t\plsql.t
Using C:/download/DBD-Oracle-0.50/blib
t\base..............Had to create DBD::Oracle::dr::imp_data_size unexpectedly at
 C:\dev\bin\perl\lib\site/DBI.pm line 614.
Use of uninitialized value at C:\dev\bin\perl\lib\site/DBI.pm line 614.
Driver has not implemented the disconnect_all method. at C:\dev\bin\perl\lib\sit
e/DBI.pm line 762
        DBD::_::dr::disconnect_all('DBI::dr=HASH(0x908ea8)') called at C:\dev\bi
n\perl\lib\site/DBI.pm line 388
        DBI::disconnect_all('DBI') called at C:\dev\bin\perl\lib\site/DBI.pm lin
e 313
        DBI::END() called at t\base.t line 0
        eval {...} called at t\base.t line 0
END failed--cleanup aborted.
        Test returned status 0 (wstat 2)
        after all the subtests completed successfully
Failed Test  Status Wstat Total Fail  Failed  List of failed
t\base.t          0     2     5    0   0.00%  ??
t\general.t       0     2    ??   ??       %  ??
t\plsql.t         0     2    ??   ??       %  ??
Failed 3/3 test scripts, 0.00% okay. 0/5 subtests failed, 100.00% okay.
NMAKE : fatal error U1077: 'C:\dev\bin\perl\bin\perl' : return code '0x2'

I omitted the middle part of the error report.
Here are my questions:

1. The perldoc info on oracle::dbd ask me to set TWO_TASK and then use
sqlplus user/password

but I guess that doesn't work on NT. Is there another way to specify the user / password info to the test prog?

2. When I simply tried
use DBI;

$dbh = DBI->connect('dbi:Oracle:T:host:sid',user,password);

similar errors are reported
Had to create DBD::Oracle::dr::imp_data_size unexpectedly at c:\dev\bin\perl\lib
\site/DBI.pm line 614.
Had to create DBD::Oracle::db::imp_data_size unexpectedly at c:\dev\bin\perl\lib
\site/DBI.pm line 614.
Undefined subroutine &DBD::Oracle::db::_login called at c:\dev\bin\perl\lib\site
/DBD/Oracle.pm line 190.
Driver has not implemented the disconnect_all method. at c:\dev\bin\perl\lib\sit
e/DBI.pm line 762
        DBD::_::dr::disconnect_all('DBI::dr=HASH(0x90e0cc)') called at c:\dev\bi
n\perl\lib\site/DBI.pm line 388
        DBI::disconnect_all('DBI') called at c:\dev\bin\perl\lib\site/DBI.pm lin
e 313
        DBI::END() called at dbtest.pl line 0
        eval {...} called at dbtest.pl line 0
END failed--cleanup aborted.

Please advice

This is getting ugly.  Are you sure you installed DBI ??
(i.e. you should have done

perl Makefile.PL
nmake test
nmake install

on DBI ...  Looking at all of that ugliness, and the fact that it couldn't find msvcrt.lib (which just should NOT happen) something is very wrong here...

Do you by any chance have two or more perl versions installed?


Your'e right, something must be quite wrong here. I am sure that I followed the steps
perl Makefile.PL
nmake test
nmake install
on DBI, and no errors were reported at all.
However, that was only true after I make minor modifications to the makefile. The reason is that the original makefile didn't specify the windows.h etc header file directory, so cl fails to compile. Then I added an extra -I switch to the makefile and the build was successful.

The next thing is that after perl Makfile.PL on DBD oracle, it complains failure to locate the windows.h header file again. That means I have to hand modify the makefile after I do perl Makefile.PL.

What's your opinion? why do you think the makefile has such error, failing to locate the windows.h file?
When I install perl 5.004_02, it asked me info about my VC++ library, headers etc, and I am sure I gave it all the correct information. Also, I do have more than one perl on my machine, the other one comes with the WindowsNT resource kit. However, when I typed perl -v, it is the 5.004_02 one, which means I should be working on the correct tool.

OK, here's what I'd do...

1.) Remove entirely DBI and DBD::Oracle ! (Frankly, I'd be tempted to remove perl entirely, and start over from scratch... In fact, unless you have a lot of packages installed, I'd definitely do that.  While you're at it, grab perl 5.004_04, which includes a new makemaker, I think.

2.) Get the latest versions of DBI and DBD::Oracle (0.93 and 0.51, respectively).

3.)  Remember to untar DBI and DBD in entirely separate and distinct directories (NOT in perl source, NOT in perl directory)

4.) Proceed as normal.  If you have to hand edit a make file, stop there, and figure out what's wrong.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.