Solved

Oracle DBD build error: missing oracle.xsi

Posted on 1998-07-06
11
389 Views
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).
0
Comment
Question by:enotsin
  • 6
  • 4
11 Comments
 
LVL 5

Expert Comment

by:b2pi
ID: 1208286
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?


0
 
LVL 5

Expert Comment

by:b2pi
ID: 1208287
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.
0
 

Author Comment

by:enotsin
ID: 1208288
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.
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1208289
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....
0
 
LVL 84

Expert Comment

by:ozo
ID: 1208290
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)
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:enotsin
ID: 1208291
The versions I am using are:
Perl 5.004-02
DBI-0.93
DBD-Oracle-0.50

So what do I need to do in order to build the DBD successfully? I built and tested the DBI successfully.
0
 
LVL 5

Accepted Solution

by:
b2pi earned 100 total points
ID: 1208292
I know that you BUILT DBI, but did you install it?  There's a file that comes with DBI called  Driver.xst.  If that's in the correct location (I suppose that could be win32 install problem, but I don't think so) it is used to create Oracle.xsi
 

If you feel like it, you might be able to successfully manufacture it by hand.  Copy the Driver.xst file into your DBD-Oracle directory.  Then do:

perl -p -e "s/~DRIVER~/Oracle/g" <Driver.xst >Oracle.xsi

Remove Driver.xst, and make a copy of Oracle.xsi (it's removed by make clean).

Driver.xst is in a hardware dependent location, however... I didn't see anything that gets done to the file other than the above, but it would be best if this just worked.

Good luck.
0
 

Author Comment

by:enotsin
ID: 1208293
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.
dubious
        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'
Stop.


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
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1208294
This is getting ugly.  Are you sure you installed DBI ??
(i.e. you should have done

perl Makefile.PL
nmake
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?
0
 

Author Comment

by:enotsin
ID: 1208295
Your'e right, something must be quite wrong here. I am sure that I followed the steps
perl Makefile.PL
nmake
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.


0
 
LVL 5

Expert Comment

by:b2pi
ID: 1208296
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.
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now