Parameters (login/password) getting lost when running sqlplus script using su and ksh

Solution Verified - Updated -

Issue

When running the following sqlplus remotely using ssh, we run into problems because some parameter disappears.

ssh servername "su linus -c \". /opt/local/bin/.tools.sh >/dev/null 2>&1;ORACLE_HOME=/opt/3rdpty/oracle/product/10.2.0; export ORACLE_HOME;ORACLE_SID=PSMF;export ORACLE_SID; /opt/3rdpty/oracle/product/10.2.0/bin/sqlplus -s username/password@connect_identifier  @/tmp/fileAsSFq3.sql\""

ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified

Having a look at the processes during the runtime of the script:

# ps -ef | grep sqlplus
root 5729 5727 0 03:27 ? 00:00:00 su linus -c . /opt/local/bin/.tools.sh >/dev/null 2>&1;ORACLE_HOME=/opt/3rdpty/oracle/product/10.2.0; export ORACLE_HOME;ORACLE_SID=PSMF;export ORACLE_SID; /opt/3rdpty/oracle/product/10.2.0/bin/sqlplus -s username/password@connect_identifier @/tmp/fileAsSFq3.sql
linus 5730 5729 0 03:27 ? 00:00:00 /opt/3rdpty/oracle/product/10.2.0/bin/sqlplus -s @/tmp/fileAsSFq3.sql
                                                                                  ^^^ 

The issue is that between -s and @/tmp/fileAsSFq3.sql the login/password disappears:

sqlplus -s @/tmp/fileAsSFq3.sql
         ^^^

Environment

  • Red Hat Enterprise Linux 5.2
  • ksh-20060214-1.7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content