Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

ERROR: ORA-12547: TNS:lost contact SP2-0306: Invalid option

user12063200Dec 20 2017 — edited Mar 1 2018

Does anyone have an explanation for this error?

I have a script that is invoked across a ssh connection, returning a string of values pulled from db connections...

We invoke the script on many servers and many oracle versions.

The script returns the appropriate rows when executed on this one IBM server

but when executed using the ssh command from another server we get the subject error for the 12c database.

The command is:

ssh -x -q ${server_name} $script_path/crawl_db >> $data_path/serverventory.dat

This is executed for each server in a list to fully populate serverventory.dat

The script will return a row for each db running on a server using information from pmon and oratab to set the environments.

On one IBM server we have two 11g databases and a 12c database.

ERROR: ORA-12547: TNS:lost contact SP2-0306: Invalid option. Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM|SYSRAC}] [edition=value]] where <logon> ::= <username>[/<password>][@<connect_identifier>] <proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>] SP2-0306: Invalid option. Usage: CONN[ECT] [{logon|/|proxy} [AS {SYSDBA|SYSOPER|SYSASM|SYSBACKUP|SYSDG|SYSKM|SYSRAC}] [edition=value]] where <logon> ::= <username>[/<password>][@<connect_identifier>] <proxy> ::= <proxyuser>[<username>][/<password>][@<connect_identifier>] SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus

A sample of code run on the databases:

p2=`$ORACLE_HOME/bin/sqlplus -S "/ as sysdba" <<END

set pages 0 trimsp on feed off timing off time off

whenever sqlerror exit 1

select name from v\\$database ;

exit;

END`

The echo that produces the rows added to the serverventory.dat file.

for i in $instlist ; do

  get_db_info $i

  echo $p1$x$p2$x$p3$x$p4$x$p5$x$p6$x$oh$x$p9

done

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 29 2018
Added on Dec 20 2017
5 comments
2,834 views