sqlplus within bash script not working properly when called remotely
ok, so this is probably not a beginner's question, but I cannot find another forum topic this would fit in.
I currently have a bash script which calls sqlplus to do a simple query and stores it into a variable.
I use this query to grep for processes that should be turned on in my system and then run some commands to check to make sure the processes are actually running. (I can't change the way the system works, it just works this way and I am writing scripts to do checks to make sure its running)
select stuff1,stuff2,stuff3 from table1;
Anyway, when my script is run from my local machine, it works perfectly. The problem is when I run it remotely from another machine. I now have to run it remotely because we have multiple machines that we need to be able to check all at once without having to manually log into each machine and run the script. Also, there is one DB machine with one schema that all our systems connect to. They have it so that you can log into SQLPLUS directly on our machines without having to log into the oracle server directly.
When I run it this way, the script runs, the SQLPLUS portion even runs, but instead of returning the proper query results, it returns "no rows selected".
ssh -x user@machine 'myScript.sh'
So i am confused as to why its connecting to SQLPLUS properly, but then not executing the query correctly or at all. I was under the assumption that when I run the script remotely like that, the script actually runs locally on that other machine.
I already have the environment set up properly and have double checked.
I guess the thing that confuses me most is the fact it is properly connecting to the database, but the query isn't executing properly. I assume it is maybe some setting or option in ssh or the way I am calling the script or something, but I have tried everything I know of and have run out of options.
thanks in advance,