python - RUnning shell script through sqlplus -
i logged in oracle in prod env , have requirement run shell scripts on remote hosts while in sqlplus. trying via python. there way it? i able run sql scripts or sql commands sqlplus following :- session = popen(['sqlplus','-s','abc/abc@'+str(hostname)+':1000/'+str(dbname)+''], stdin=pipe, stdout=pipe, stderr=pipe) session.stdin.write('spool '+str(op_file)+' \n' ' '+str(data)+ '\n'); session.stdin.write(' ; \n') session.stdin.write('exit \n') session.stdin.flush() stdout, stderr = session.communicate() but when want run shell script there way of doing through sqlplus itself, coz other way of logging in via ssh , sudoing in oracle not possible i think 1 of ways of doing using plsql:- http://www.dba-oracle.com/t_execute_shell_script_plsql_procedure.htm but not sure. sql*plus client application. can spawn processes on client machine