Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Oracle and Perl

by notsoevil (Pilgrim)
on Mar 28, 2001 at 23:38 UTC ( [id://67921]=note: print w/replies, xml ) Need Help??


in reply to Oracle and Perl

I msg'd arturo about this, so I'll mention it here as well:

It was a mistake putting use DBD::Oracle in there, as I was just typing my example up, not a direct copy n' paste. My actual code wasn't doing that, but when I was typing here it just snuck in there.

I am awaiting information ... --insert pause-- ... ah, it just arrived. Well I plugged in the ORACLE_HOME bit and the error has not changed.

So I don't mistype this time, I'll copy and paste my script below:

BEGIN { $ENV{ORACLE_HOME} = 'g:\orant'; } use DBI; use strict; my $host = 'myhost'; my $sid = 'PROD'; my $user = 'foo'; my $pass = 'bar'; my $db = DBI->connect('dbi:Oracle:host="$host";sid="PROD"', $user, $pa +ss) or die "Can't connect to server: $DBI::errstr\n"; print "Content-type: text/plain\n\n"; print "Hey, I got this far!";

Any further suggestions?

--
notsoevil
--
Jeremiah 49:32 - And their camels shall be a booty. . .

Replies are listed 'Best First'.
Re: Re: Oracle and Perl
by agoth (Chaplain) on Mar 29, 2001 at 14:42 UTC
    A few things,
    • I've trawled through my back catalog of code and seem to have lost examples of Oracle connections across a network from windows, oops.
    • This is possible and even easy when your settings are correct so don't give up.
    • I've never had to set ORACLE_SID like that in the connect string. If it is not in the environment of the user that is running the script, then SID is settable in the begin block.
    • Try using DBI's installed_drivers method to loop through the hash of drivers before attempting your connect
    • Keep plugging away, change vars / permissions / I would stake 200xp theres a simple solution to this one :)
      I am almost positive there is a permissions problem.

      I had the guy down there run the script from the DOS prompt, and no error occured. So, on recap seeing that both errors said 'Access Denied' I am thinking:

      The 'user' the script is running under (inherited from webserver) is not able to access the database (via Oracle module or ODBC).

      .. or ..

      The 'user' the script is running under is not able to access any module, due in part perhaps to restrictive permissions on the Perl installation directories. I would have checked other modules (say, CGI for instance) today had I not taken the day off. I'll try tomorrow.

      .. or ..

      Something else along these lines. My problem is my sys admin knowledge does not stretch across to the NT platform this is sitting on. I'll have to remotely try to figure this out with the guy over the phone.

      If anyone has suggestions along these 'permissions' lines, why it would be so, and such forth, please advise.

      --
      notsoevil
      --
      Jeremiah 49:32 - And their camels shall be a booty. . .

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://67921]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-04-19 10:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found