On 20/12/06 17:58, [EMAIL PROTECTED] wrote:
I am migrating an Oracle 9i to Oracle 10g database, and Perl 5.0.4 to
Perl 5.8.7 in Sun Solaris environment.

My old Perl/DBI script was able to connect via this method:
use DBI;
$dbd = 'Oracle';
$user = '/'; $password = '/';
$dbh = DBI->connect ($dbname, $user, $password, $dbd);

This is not working with new version of Perl/DBI.

You need to leave both the user and password blank. Also,
the connection must be local (i.e. via the bequeather q.v.),
you need to set the environment variable ORACLE_SID and
not to set TWO_TASK. ORACLE_HOME should, of course, also be
set.

The following is copied from known working code. (ORACLE_HOME
is already set before this is called.)

sub our_connect {
 my $sid = shift;
 local $ENV{ORACLE_SID} = $sid;
 DBI->connect("dbi:Oracle:", "", "",
    {AutoCommit=>0, RaiseError=>1, PrintError=>0, ShowErrorStatement=>1});
};



--
Charles Jardine - Computing Service, University of Cambridge
[EMAIL PROTECTED]    Tel: +44 1223 334506, Fax: +44 1223 334679

Reply via email to