dcsimg
ANT sshexec and sqlplus
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anindita_Das
Posted On:   Monday, January 26, 2009 11:45 AM

Hi, I am trying to execute a sqlplus command using the following piece of code: property name="command.create.synonym" value="sqlplus ${name.db.username}/${name.db.password}@${name.db.instance} @${name.create.synonym.sql};"/> sshexec host="${name.unix.hostname}" username="${name.unix.user}" keyfile="${user.home}/.ssh/id_dsa" command="${command.create.synonym}" outputproperty="out.synonym" /> The build is executed using the admin a/c. Hence the need to ssh to the user a/c and execute sqlplus. But this co   More>>

Hi,

I am trying to execute a sqlplus command using the following piece of code:

			

property name="command.create.synonym" value="sqlplus ${name.db.username}/${name.db.password}@${name.db.instance} @${name.create.synonym.sql};"/>

sshexec host="${name.unix.hostname}"
username="${name.unix.user}"
keyfile="${user.home}/.ssh/id_dsa"
command="${command.create.synonym}"
outputproperty="out.synonym"
/>



The build is executed using the admin a/c. Hence the need to ssh to the user a/c and execute sqlplus.

But this code fails with the following error:

[sshexec] Error 6 initializing SQL*Plus

[sshexec] Message file sp1 .msb not found

[sshexec] SP2-0750: You may need to set ORACLE_HOME to your Oracle software directory

$ORACLE_HOME has been set to the correct ORACLE directory. But it still does not work.

Can anyone suggest the solution?

Thanks in advance.

Annie

   <<Less

Re: ANT sshexec and sqlplus

Posted By:   Nik_Golosin  
Posted On:   Tuesday, March 17, 2009 09:03 AM

Hm... I had the same problem (worked with Oracle DB over Oracle instant client)

Try to set LD_LIBRARY_PATH
and NLS_LANG variables in your environment (in the ~/.bashrc).



In my case, its mean (oracle slice :-) of ~/.bashrc):
ORACLE_HOME=/usr/lib/oracle/10.2.0.4/client
LD_LIBRARY_PATH=$ORACLE_HOME/lib:${LD_LIBRARY_PATH}; export LD_LIBRARY_PATH
SQLPATH=$ORACLE_HOME/bin:${SQLPATH}; export SQLPATH
NLS_LANG=AMERICAN_AMERICA.CL8MSWIN1251; export NLS_LANG
TNS_ADMIN=$ORACLE_HOME; export TNS_ADMIN



Also you can use full oracle instance name instead synonym.
For example:

sqlplus vttest/vttest@127.0.0.1:1521/orcl

So, you didn't set any TNS synonyms. Use full address.
About | Sitemap | Contact