Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Oracle DBD.

Status
Not open for further replies.

StickyBit

Technical User
Jan 4, 2002
264
CA
Folks,

I'm receiving the following error after running a perl script on a client Solaris 8 Intel server:

unix:/# dbfetchrow_array.pl
DBI->connect(ORACLE) failed: ORA-01017: invalid username/password; logon denied (DBD ERROR: OCISessionBegin) at ./dbfetchrow_array.pl line 11
Segmentation Fault

The script is trying to connect to a Oracle 8.1.7 Database running on a Solaris 8 Sparc server. I can connect to the database from the Intel box using sqlplus /nolog connect scott/tiger@Oracle (So I think tnsnames.ora is configured properly on client)

Here is the script:

#!/usr/bin/perl -w

use DBI;
my ($sth, $dbh, @row);
unlink 'dbitrace.log' if -e 'dbitrace.log';

DBI->trace(2, 'dbitrace.log');

#perform the database connection
$dbh = DBI->connect("dbi:Oracle:ORACLE","scott", "tiger", {
PrintError => 0,
RaiseError => 1
} );

#prepare a sql statement for execution
$sth = $dbh->prepare("select author.author_number, author_last,
author_first, book_code, sequence_number
from author, wrote
where author.author_number = wrote.author_number");

#execute the statement in the oracle database
$sth->execute();

#retreive the returned rows of data from the array
while (@row = $sth->fetchrow_array()){
print "@row\n";
}

#disconnect from the database
$dbh->disconnect();

Any help would be appreciated.

StickyBit.
 
Have you tried sqlplus from the solaris box to the machine. Also in your code

#perform the database connection
$dbh = DBI->connect("dbi:Oracle:ORACLE","scott", "tiger", {
PrintError => 0,
RaiseError => 1
} );

You have the db name different than what you used in your sqlplus login code.

sqlplus /nolog connect scott/tiger@Oracle

Hopefully that helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top