Migrating ANT sqlplus execution from MacOSX to Windows, getting TNS error

294 views Asked by At

I have a working ANT build.xml that executes sqlplus to compile PL/SQL. I develop on MacOSX. My coworker is going to start contributing to the same application. He develops on WinXP. The sqlplus exec from ANT returns a TNS ORA-12560 error on WinXP. The identical build.xml works on MacOSX. The run string that ANT should be constructing on WinXP works in the DOS shell. We have set up the TNS_ADMIN environment variable in WinXP. What could I be missing?

1

There are 1 answers

0
Dwayne King On

I'm not sure from your description whether you're using the ANT SQL Task (http://ant.apache.org/manual/Tasks/sql.html) or if your using the exec task to call Sqlplus. Can you please clarify?

If you're calling sqlplus as an external command, you will be at the mercy of two main things: a) environment variables b) tnsnames.ora file

Windows and unix are different in how they handle specifying where you want to connect. In OSX you'll have the ORACLE_HOME and ORACLE_SID environment variables set. In Windows this would be in the registry. You may also have TNS_ADMIN set which determines where your tnsnames.ora file will be found.

First thing to check would be if you are both using the same tnsnames.ora file.

If you are, have both of you try to run tnsping to verify that the alias is configured properly.

Get back to us with the results of those tests.