I have two virtual machines ubuntu, one is a server when I installed oracle 11g express, and the other is a simple client. My goal is to run an sql query remotely from the client machine. So I prepared the query and I sent it to the server. But in the following of the script and after the establishment of the connection to the server, sqlplus dosen't work. And it shows me the following error:
Sqlplus: Command not found
in this work i use this scrpit:
#! /bin/bash read -p "saisir votre requete: " req printf "%s\n" "$req" > t1.txt sed -e 's/[;,()'\'']/ /g;s/ */ /g' t1.txt > t.txt `tr -s '[[:blank:]]' '\n' < t.txt `| while IFS= read -r word; do if ! [[ "$word" =~ $(echo ^\($(paste -sd'|' ./req.txt)\)$) ]]; then var=$(base64 <<< $word) sed -i -e "s/$word/$var/g" t1.txt fi done enter code here scp requete.sql firstname.lastname@example.org:/home/cloud1 #Conection to the Server ssh email@example.com '/home/cloud1/Cloud-Serv'
and the file Cloud-Serv contains the following code:
#! /bin/bash "echo "Connection is done !" sudo service oracle-xe start sqlplus / as sysdba exit