0

I am not able to pass ORACLE_HOME to remote server (slc05pzz.us.oracle.com ) echo does give the correct result but ssh -qt [email protected] 'export ORACLE_HOME=/u01/IDMTOP/products/dir/oid;export PATH=$ORACLE_HOME/bin:$PATH;echo $ORACLE_HOME;$ORACLE_HOME/ldapbind -h slc05pzz.us.oracle.com -p 3060 -D \"cn=orcladmin\" -w 'password';

above code gives below result bash: /u01/IDMTOP/products/dir/oid/ldapbind: No such file or directory as its searching for ldapbind on the server where the script is executed which is wrong and not on slc05pzz.us.oracle.com . What is that am missing here?

4
  • I think your quoted text above is missing a ' character. It would also seem to me that the -w 'password' could be interfering with things - I note that its not escaped. I don't think thats the problem. (Why not throw a hostname; command before and after the ldapbind command to check your theory that its running on the local system, rather then an error in the path?)
    – davidgo
    Jun 6, 2017 at 8:03
  • yeah ' character was a copy paste error, its there in the code. echo $HOSTNAME gives the remote server name (slc05pzz.us.oracle.com) before and after the ldapbind.I am also sure that remote connection is successful as the path bash: /u01/IDMTOP/products/dir/oid/ldapbind: No such file or directory does exists in remote and it should have not failed. Not sure why is env variable not getting passed
    – chayanika
    Jun 6, 2017 at 8:43
  • From what you describe, everything is behaving exactly as intended, save as the command (which is executed in the right place) is not working. To me this suggests that either there is a typo in the command (try copy and pasting the path/file in the bash error and see if that executes, if not compare closely with what it should be), or maybe SELinux or similar is messing with you. (Try turning selinux off temporarily)
    – davidgo
    Jun 6, 2017 at 8:51
  • ssh -qt [email protected] 'export ORACLE_HOME=/u01/IDMTOP/products/dir/oid;export PATH=$ORACLE_HOME/bin:$PATH;echo $ORACLE_HOME;echo $HOSTNAME;${ORACLE_HOME}/bin/ldapbind -h slc05pzz.us.oracle.com -p 3060 -D "cn=orcladmin" -w 'pasword' ; echo $HOSTNAME' is the correct command
    – chayanika
    Jun 6, 2017 at 9:47

1 Answer 1

0

below this is the correct solution ssh -qt [email protected] 'export ORACLE_HOME=/u01/IDMTOP/products/dir/oid;export PATH=$ORACLE_HOME/bin:$PATH;echo $ORACLE_HOME;echo $HOSTNAME;${ORACLE_HOME}/bin/ldapbind -h slc05pzz.us.oracle.com -p 3060 -D "cn=orcladmin" -w password ; echo $HOSTNAME;

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .