Page 1 of 1

shell script permission denied error

Posted: Sun Apr 24, 2016 6:32 pm
by abc123
I have an execute command stage in a sequence job. I am running the following command in the execute command stage:

sqlplus Userid/Pwd@SrcName < /fullpath/MySqScript.sql

When I try to execute the sequence job, I get the following error:

seqJob..JobControl (@ExecCmd1): Executed:
sqlplus Userid/Pwd@SrcName < /fullpath/MySqScript.sql;
Reply=1
Output from command ====>
sh: /fullpath/MySqScript.sql: Permission denied

I tried doing the other way as well:
Command: sqlplus
Parameters: Userid/Pwd@SrcName < /fullpath/MySqScript.sql

Same result. The file, MySqScript.sql, has full chmod 777 permissions. Any ideas?

[Note: Title changed since this technically isn't a "SQL Plus" error - Andy]

Posted: Sun Apr 24, 2016 8:02 pm
by Mike
Also check the permissions at every level of /fullpath.

Mike

Posted: Sun Apr 24, 2016 9:59 pm
by abc123
I did. They all have:

drwxr-xr-x

Also, when I execute:

sqlplus Userid/Pwd@SrcName < /fullpath/MySqScript.sql

from within /fullpath/, it works fine.

Posted: Mon Apr 25, 2016 2:19 am
by priyadarshikunal
with limited information you have provided, i think if fullPath is a parameter, you are passing that incorrectly.

Posted: Mon Apr 25, 2016 11:43 am
by chulett
From a permissions standpoint when you say "when I execute" that's only a valid test if you are logged in as the same user that executes the job.

Posted: Tue Apr 26, 2016 8:52 am
by PaulVL
Long shot but... Go look in your project path to see if some dastardly person created a file called sqlplus.

Then type in "which sqlplus" to see where you are pulling it from.

Posted: Tue Apr 26, 2016 9:32 am
by UCDI
Try making a dummy script that does nothing except echo your username and password to the screen to see if those are coming to the script as expected?


As a side effect, if a script that does nothing except echo fails, you have a problem with permissions to run scripts?