{\rtf1\ansi\deff0{\fonttbl{\f0\fmodern\fcharset0 Courier New;}}
{\colortbl ;\red0\green0\blue0;}
\viewkind4\uc1\pard\cf1\lang1033\f0\fs20 Hi,\par
I \protect did \cf0 not get a solution to my problem however I did get a workaround from\par
Mark LoBue:\par
\par
"This all sounds like environment issues, why not just use:\par
\par
$dbh_ispec =\par
DBI->connect('DBI:Oracle:host=vspeclive;sid=VSPEC','cupid','cupid')\par
\par
Then you don't have to worry if all the environment variables are set when\par
you run your script.  Barring that, I would check all environment variables\par
when it works against all variables when it does not (print them within\par
your\par
perl script)".\par
\par
I tried the above and it works:\par
Many thanks to all who replied.\par
Julian\par
\par
> -----Original Message-----\par
> From: Julian Rogan [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 07, 2003 3:48 AM\par
> To: '[EMAIL PROTECTED]'\par
> Subject: Strange connect problem using DBI\par
> \par
> \par
> \par
> \par
> Hi,\par
> I have a strange problem using DBI. Firstly let me say I am a \par
> unix support\par
> person and I am very hazy on perl. However I have inherited a \par
> script that uses the\par
> following string to connect to a database:\par
> \par
> \par
> $dbh_ispec = DBI->connect('DBI:Oracle:VSPEC','cupid','cupid')\par
> or die "Couldn't connect to database: " . DBI->errstr;\par
> \par
> \par
> In tnsnames.ora I have the stanza:\par
> \par
> \par
> VSPEC =\par
>   (DESCRIPTION =\par
>     (ADDRESS_LIST =\par
>         (ADDRESS =\par
>           (COMMUNITY = VdBF.world)\par
>           (PROTOCOL = TCP)\par
>           (Host = vspeclive)\par
>           (Port = 1521)\par
>         )\par
>     )\par
>     (CONNECT_DATA =\par
>       (SID = VSPEC)\par
>          (GLOBAL_NAME = VSPEC)\par
>     )\par
> \par
> \par
> Usually the code and the database exist on the same server \par
> (serverA) and\par
> there is no problem connecting. However I had to move the database to\par
> another server (moving the interface name vspeclive  as well \par
> ) and I now\par
> get "can't connect" messages.\par
> \par
> If I switch on oracle tracing it is trying to use protocol \par
> "bequeath" as\par
> it appears to expect the database to be on the same server.\par
> \par
> If I login to the oracle user on serverA and use sqlplus to \par
> connect as the\par
> cupid account to the VSPEC instance on vspeclive it connects.\par
> \par
> If I change the string VSPEC in the script to be different \par
> e.g. VSPECJR or VSPOC\par
> and change the corresponding line in tnsnames.ora e.g. \par
> "VSPECJR =" or "VSPOC ="  then\par
> connect succeeds from serverA to vspeclive.\par
> \par
> Have you any idea what is causing this? Can the string \par
> "VSPEC" be embedded\par
> somewhere in the perl DBI module?\par
> \par
> \par
> with regards,\par
> \par
> Julian\par
> \par
>  << File: ATT00030.htm >>  << File: ATT00031.att >> \objattph\'20\objattph\'20\par
}

Attachment: ATT00036.att
Description: ATT00036.att



Reply via email to