0

我有一个可以运行的 ANT build.xml,它执行 sqlplus 来编译 PL/SQL。我在 MacOSX 上开发。我的同事将开始为同一个应用程序做出贡献。他在 WinXP 上开发。来自 ANT 的 sqlplus exec 在 WinXP 上返回 TNS ORA-12560 错误。相同的 build.xml 适用于 MacOSX。ANT 应该在 WinXP 上构建的运行字符串在 DOS shell 中工作。我们已经在 WinXP 中设置了 TNS_ADMIN 环境变量。我会错过什么?

4

1 回答 1

1

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.

于 2011-04-14T19:32:00.817 回答