Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: sqlplus from a perl script is giving ORA-12545 error.
Tim X <timx_at_spamto.devnul.com> schreef in berichtnieuws
87k7csegb7.fsf_at_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.
What you say is correct but if I may add something.
sqlplus un/pw_at_db will connect to the database using sqlnet.
You can omit the alias name (@db) when you set the variable $TWO_TASK=db.
TWO_TASK prevails upon ORACLE_SID.
ORACLE_SID can only connect you to a local database running in the same
ORACLE_HOME only.
Received on Sun May 18 2003 - 04:25:46 CDT