Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: sqlplus from a perl script is giving ORA-12545 error.

Re: sqlplus from a perl script is giving ORA-12545 error.

From: Tim X <timx_at_spamto.devnul.com>
Date: 15 May 2003 18:59:24 +1000
Message-ID: <87k7csegb7.fsf@tiger.rapttech.com.au>


>>>>> "pdqd" == pdqd <pdqd_at_rediffmail.com> writes:

 pdqd> yong321_at_yahoo.com (Yong Huang) wrote in message  pdqd> news:<b3cb12d6.0305131212.76bb4c93_at_posting.google.com>...
>> pdqd_at_rediffmail.com (pdqd) wrote in message
>> news:<1bd79fdb.0305130509.5d2bc495_at_posting.google.com>... > Hi
>> Friends, > - > Using a perl script i am running 'sqlplus'
>> command(sqlplus > <dbuid>/<dbpasswd>@DB1 @oracle.sql ). I get the
>> following error > message... > - > ORA-12545: Connect failed
>> because target host or object does not exist
>>
>> Why not post the part of your code that connects to the database?
>> At least we can tell whether you're missing backslash in front of
>> @.
>>
>> Yong Huang

 pdqd> Thanks a lot. There wasn't '\' infront of '@'. I made the
 pdqd> change and it is working now.  I have another question. In the
 pdqd> documentation on sqlplus it is given that the command to run
 pdqd> the sql script is as follows..  sqlplus <dbuid>/<dbpasswd>
 pdqd> @<sql_script_name> but this fails with the same error
 pdqd> message(ORA-12545), but if i add the database name (@DB1 - as
 pdqd> in the one i posted in my original post above ) it works. Could
 pdqd> this be because of setup problem? or it is an expected
 pdqd> behaviour?  - Kindly suggest.  - Thanks and Regards, Parimal.

The syntax sqlplus user/pass will connect to the database specified in the $ORACLE_SID environment variable. The syntax sqlplus user/pass_at_DB will connect to the database specified by DB. If the second form is working, but the first is not, I would check to see what value $ORACLE_SID had.

Tim

-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!
Received on Thu May 15 2003 - 03:59:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US