Problem connecting to orcl with Perl DBD:Oracle
am 13.08.2007 16:58:39 von itissandeep
--===============1482864335==
Content-Type: multipart/alternative;
boundary="----=_Part_41365_3294398.1187017119039"
------=_Part_41365_3294398.1187017119039
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi all,
I'm new to perl and oracle.
I have Oracle 10g R2 installed (not XE) on Win XP. I also installed Perl
5.6.1 from AS. Then downloaded DBI and DBD:Oracle and installed them using
PPM. Now, I want to test dbd:oracle. I used to following (that I got from
some source online):
$ORACLE_SID = "orcl";
$ORACLE_USERID = "system";
$ORACLE_PASSWORD = "...."; (the actual password will be here)
$ENV{'ORACLE_SID'} = "$ORACLE_SID";
$ENV{'ORACLE_HOME'} = "c:\\oracle";
.....
.....
.....
local ($oracle_sid, $username, $password) = @_;
local ($temp_dbh);
local($tempID, $tempPassword, $tempKey);
print " (*) Attempting Oracle Login ...\n";
unless ( $temp_dbh = DBI->connect("dbi:Oracle:$oracle_sid", "$username",
$password, {AutoCommit => 0}) ) {
&programError("Oracle Login Failed as $username", "", "$DBI::errstr",
"dba-mail", "dba-pager");
exit;
}
print " OK\n\n";
The output I got is:
Oracle login failed
ORA-01017: invalid username/password; logon denied
The system cannot find the path specified.
The system cannot find the path specified.
Please note that I can use the same username and password to log into Oracle
using SQL*Plus and SQL*Loader.
First when I got this error there was no Oracle_HOME as an environment
variable. I added that to C:\Oracle and rebooted the system. Also, the Perl
that came with Oracle 10g R2 was 5.8.3. So, I renamed that folder (in Oracle
home) from perl to perl1. After doing these changes too I got the same
error.
Can somebody please throw some light on this and tell me what I have to do ?
Thanks a lot
------=_Part_41365_3294398.1187017119039
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Hi all,
I'm new to perl and oracle.
I have
Oracle 10g R2 installed (not XE) on Win XP. I also installed Perl 5.6.1
from AS. Then downloaded DBI and DBD:Oracle and installed them using
PPM. Now, I want to test dbd:oracle. I used to following (that I got
from some source online):
$ORACLE_SID = "orcl";
$ORACLE_USERID = "system";
$ORACLE_PASSWORD = "...."; (the actual password will be here)
$ENV{'ORACLE_SID'} = "$ORACLE_SID";
$ENV{'ORACLE_HOME'} = "c:\\oracle";
....
....
....
local ($oracle_sid, $username, $password) = @_;
local ($temp_dbh);
local($tempID, $tempPassword, $tempKey);
print " (*) Attempting Oracle Login ...\n";
unless ( $temp_dbh = DBI->connect("dbi:Oracle:$oracle_sid", "$username", $password, {AutoCommit => 0}) ) {
&programError("Oracle Login Failed as $username", "", "$DBI::errstr", "dba-mail", "dba-pager");
exit;
}
print " OK\n\n";
The output I got is:
Oracle login failed
ORA-01017: invalid username/password; logon denied <DBD: login failed>
The system cannot find the path specified.
The system cannot find the path specified.
Please note that I can use the same username and password to log into Oracle using SQL*Plus and SQL*Loader.
First
when I got this error there was no Oracle_HOME as an environment
variable. I added that to C:\Oracle and rebooted the system. Also, the
Perl that came with Oracle 10g R2 was 5.8.3. So, I renamed that folder
(in Oracle home) from perl to perl1. After doing these changes too I
got the same error.
Can somebody please throw some light on this and tell me what I have to do ?
Thanks a lot
------=_Part_41365_3294398.1187017119039--
--===============1482864335==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============1482864335==--
RE: Problem connecting to orcl with Perl DBD:Oracle
am 13.08.2007 17:51:45 von Brian Raven
From: activeperl-bounces@listserv.ActiveState.com
[mailto:activeperl-bounces@listserv.ActiveState.com] On Behalf Of
Sandeep Mudigonda
Sent: 13 August 2007 15:59
To: activeperl@listserv.ActiveState.com
Subject: Problem connecting to orcl with Perl DBD:Oracle
> Hi all,
> I'm new to perl and oracle.
> I have Oracle 10g R2 installed (not XE) on Win XP. I also installed
Perl 5.6.1 from AS. Then downloaded DBI and > DBD:Oracle and installed
them using PPM. Now, I want to test dbd:oracle. I used to following
(that I got from =
> some source online):
It might have been better to install the latest version, rather than
5.6.1, unless you have a good reason to install something that old.
> =
> $ORACLE_SID =3D "orcl";
> $ORACLE_USERID =3D "system";
> $ORACLE_PASSWORD =3D "...."; (the actual password will be here)
> =
> $ENV{'ORACLE_SID'} =3D "$ORACLE_SID";
> $ENV{'ORACLE_HOME'} =3D "c:\\oracle";
> ....
> ....
> ....
> local ($oracle_sid, $username, $password) =3D @_;
> local ($temp_dbh); =
> local($tempID, $tempPassword, $tempKey);
> =
> print " (*) Attempting Oracle Login ...\n";
> =
> =
> unless ( $temp_dbh =3D DBI->connect("dbi:Oracle:$oracle_sid",
"$username", $password, {AutoCommit =3D> 0}) ) { =
> &programError("Oracle Login Failed as $username", "", "$DBI::errstr",
"dba-mail", "dba-pager");
> exit;
> }
> =
> print " OK\n\n";
The above code seems rather confused. If this is copied from "some
source online", then perhaps you could say where that was, so that I
could recommend that people avoid it.
> =
> The output I got is:
> Oracle login failed
> ORA-01017: invalid username/password; logon denied
> The system cannot find the path specified.
> The system cannot find the path specified.
> =
> Please note that I can use the same username and password to log into
Oracle using SQL*Plus and SQL*Loader.
> =
> First when I got this error there was no Oracle_HOME as an environment
variable. I added that to C:\Oracle and > rebooted the system. Also, the
Perl that came with Oracle 10g R2 was 5.8.3. So, I renamed that folder
(in =
> Oracle home) from perl to perl1. After doing these changes too I got
the same error. =
> Can somebody please throw some light on this and tell me what I have
to do ?
You shouldn't need to rename the perl that comes with Oracle, as there
shouldn't be any conflicts. If anything, it might be better to use that
Perl, if it has all of the other modules that you need, as it is a later
version than the one you are using.
Try the following, after setting the ORACLE_* environment variables, or
initialising the Perl variables another way if you prefer.
-----------------------------------------------
use strict;
use warnings;
use DBI;
my $user =3D $ENV{ORACLE_USER};
my $pass =3D $ENV{ORACLE_PASS};
my $sid =3D $ENV{ORACLE_SID};
print "Attempting connection: user=3D'$user' password=3D'$pass'
sid=3D'$sid'\n"; =
my $dbh =3D DBI->connect("dbi:Oracle:$sid", $user, $pass)
or die "Failed to connect: $DBI::errstr\n";
print "Connected OK\n";
------------------------------------------------
I strongly suggest reading the documentation that comes with Activestate
Perl, particularly for the DBI module.
HTH
-- =
Brian Raven
==================== =====3D=
================
Atos Euronext Market Solutions Disclaimer
==================== =====3D=
================
The information contained in this e-mail is confidential and solely for the=
intended addressee(s). Unauthorised reproduction, disclosure, modification=
, and/or distribution of this email may be unlawful.
If you have received this email in error, please notify the sender immediat=
ely and delete it from your system. The views expressed in this message do =
not necessarily reflect those of Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited - Registered in England & Wales with=
registration no. 3962327. Registered office address at 25 Bank Street Lon=
don E14 5NQ United Kingdom. =
Atos Euronext Market Solutions SAS - Registered in France with registration=
no. 425 100 294. Registered office address at 6/8 Boulevard Haussmann 750=
09 Paris France.
L'information contenue dans cet e-mail est confidentielle et uniquement des=
tinee a la (aux) personnes a laquelle (auxquelle(s)) elle est adressee. Tou=
te copie, publication ou diffusion de cet email est interdite. Si cet e-mai=
l vous parvient par erreur, nous vous prions de bien vouloir prevenir l'exp=
editeur immediatement et d'effacer le e-mail et annexes jointes de votre sy=
steme. Le contenu de ce message electronique ne represente pas necessaireme=
nt la position ou le point de vue d'Atos Euronext Market Solutions.
Atos Euronext Market Solutions Limited Soci=E9t=E9 de droit anglais, enregi=
str=E9e au Royaume Uni sous le num=E9ro 3962327, dont le si=E8ge social se =
situe 25 Bank Street E14 5NQ Londres Royaume Uni.
Atos Euronext Market Solutions SAS, soci=E9t=E9 par actions simplifi=E9e, e=
nregistr=E9 au registre dui commerce et des soci=E9t=E9s sous le num=E9ro 4=
25 100 294 RCS Paris et dont le si=E8ge social se situe 6/8 Boulevard Hauss=
mann 75009 Paris France.
==================== =====3D=
================
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
RE: Problem connecting to orcl with Perl DBD:Oracle
am 16.08.2007 00:03:26 von John Costello
On Mon, 13 Aug 2007, Brian Raven wrote:
> > Sandeep wrote;
> > Hi all,
> > I'm new to perl and oracle.
> > [snip]
> > The output I got is:
> > Oracle login failed
> > ORA-01017: invalid username/password; logon denied
> > The system cannot find the path specified.
> > The system cannot find the path specified.
> >
> > Please note that I can use the same username and password to log into
> Oracle using SQL*Plus and SQL*Loader.
> [snip]
> my $user = $ENV{ORACLE_USER};
> my $pass = $ENV{ORACLE_PASS};
> my $sid = $ENV{ORACLE_SID};
>
> print "Attempting connection: user='$user' password='$pass'
> sid='$sid'\n";
> my $dbh = DBI->connect("dbi:Oracle:$sid", $user, $pass)
> or die "Failed to connect: $DBI::errstr\n";
> print "Connected OK\n";
> ------------------------------------------------
>
> I strongly suggest reading the documentation that comes with Activestate
> Perl, particularly for the DBI module.
Another helpful DBI tools is the trace function, though you should use
this only in testing and not in production. Trace spews a lot of
information, with increasing amounts as the trace level increases.
After your 'use' statements, add the line
DBI->trace( 2, 'dbitrace.log');
The '2' represents the logging level. Read the DBI documentation for more
information.
If you are connecting locally rather than through the TNS Names Listener,
you should not need to set $ENV{TWO_TASK} to the database name. Look at
the DBI and DBD::Oracle documentation for more information about that
environment variable.
John
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs