RE: DBI:ORACLE with Oracle XE
- From: pgriffin@xxxxxxxxxxxxxxxxxxxx (Paul Griffin)
- Date: Mon, 10 Jul 2006 00:05:38 -0400
Gerard,
Tnsping does work.
I have also managed to connect using the code below. But I'm unable to
connect any other way. I'm missing something obvious so if any one can tell
me what this is it would really be appreciated
$dbh = DBI->connect('dbi:Oracle:', q{uid/pwd@(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = LDPM2001AUS)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = XE)
)
)},"") or die DBI::errstr;
@tables = $dbh->tables();
foreach $table (@tables) {
print "Table : $table\n";
}
Regards Paul...
-----Original Message-----
From: Gerard [mailto:GerardHoran@xxxxxxxxx]
Sent: Monday, 10 July 2006 12:59 PM
To: Paul Griffin
Subject: Re: DBI:ORACLE with Oracle XE
Does tnsping work?
What OS are you on?
gerard
Paul Griffin wrote:
I can connect to an Oracle XE database with dbi:ODBC using :DBI::errstr;
$dbh = DBI->connect("dbi:ODBC:PSTORA01", "uid", "pwd") or die DBI::errstr;
But am unable to connect with dbi:ORACLE using :
$dbh = DBI->connect("dbi:Oracle:PSTORA01", "uid", "pwd") or die
line
Each time I get the following error :
DBI connect('PSTORA01','system',...) failed: ORA-12154: TNS:could not
resolve the connect identifier specified (DBD ERROR: OCIServerAttach) at
C:\Projects\PST-Repository\Perl\oracle_01.pl line 10
ORA-12154: TNS:could not resolve the connect identifier specified (DBD
ERROR: OCIServerAttach) at C:\Projects\PST-Repository\Perl\oracle_01.pl
10..
*** Process "C:\Perl\bin\perl.exe" terminated. Return code=255
med>
I'm using XP SP2 with Perl v5.8.8 and DBD-Oracle v1.17.
Any suggestions/help appreciated.
Regards Paul...
------_=_NextPart_001_01C69FB3.69C5A240
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Google-AttachSize: 4849
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 11 (filtered medium)">
<style>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
div.Section1
{page:Section1;}
-->
</style>
</head>
<body lang=3DEN-US link=3Dblue vlink=3Dpurple>
<div class=3DSection1>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I can connect to an Oracle XE database with dbi:ODBC =
using :<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>$dbh =3D =
DBI->connect("dbi:ODBC:PSTORA01", "uid",
"pwd") or die DBI::errstr;<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>But am unable to connect with dbi:ORACLE using =
:<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>$dbh =3D =
DBI->connect("dbi:Oracle:PSTORA01",
"uid", "pwd") or die =
DBI::errstr;<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Each time I get the following error =
:<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>DBI connect('PSTORA01','system',...) failed: =
ORA-12154:
TNS:could not resolve the connect identifier specified (DBD ERROR:
OCIServerAttach) at C:\Projects\PST-Repository\Perl\oracle_01.pl line =
10<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>ORA-12154: TNS:could not resolve the connect =
identifier specified
(DBD ERROR: OCIServerAttach) at =
C:\Projects\PST-Repository\Perl\oracle_01.pl
line 10.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>*** Process "C:\Perl\bin\perl.exe" =
terminated.
Return code=3D255<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>med><o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>I’m using XP SP2 with Perl v5.8.8 and =
DBD-Oracle v1.17.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'>Any suggestions/help =
appreciated.<o:p></o:p></span></font></p>
<p class=3DMsoNormal><font size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;
font-family:Arial'><o:p> </o:p></span></font></p>
<p class=3DMsoNormal =
style=3D'mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3D2 face=3DArial><span =
style=3D'font-size:10.0pt;font-family:Arial'>Regards
Paul…<o:p></o:p></span></font></p>
</div>
<u1:PersonName u2:st=3D"on">
</body>
</html>
------_=_NextPart_001_01C69FB3.69C5A240--
- Prev by Date: LAST_INSERT_ID and Global Variable
- Next by Date: Re: Using DBD::ODBC in a CGI script under Apache
- Previous by thread: Re: DBI:ORACLE with Oracle XE
- Next by thread: RE: sth->do()
- Index(es):
Relevant Pages
|
|