var=$(sqlplus -s username/pwd$@SID <<EOF
set heading on
set trimspool off
set linesize 200
set feedback off
SET MARKUP HTML ON
spool output.htmL
SELECT * FROM V$SESSION where username='FSUSER' and PROGRAM='SQL Developer' and OSUSER NOT IN ('username');
spool off;
exit;
EOF)
echo "$var" > output.txt
exit 0
but the output files shows as ORA error , manual connect is working without any issues from same server .
ERROR: ORA-12162: TNS:net service name is incorrectly specified
SP2-0306: Invalid option. Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM}] [edition=value]] where ::= [/][@<connect_identifier>] ::= [][/][@<connect_identifier>]
Any help here is appreciated