Skip to Main Content

SQLcl: MCP Server & SQL Prompt

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!

Sql Plus Connection Issues

Chandhan S JNov 16 2021

I am having some issues when connecting using Command Line in Unix.
rm -rf /home/oracle/Desktop/Unix_Sample_Files/Test1.txt
sqlplus -s hr/hr@oracle <<EOF
set linesize 32767
set pagesize 50000
spool /home/oracle/Desktop/Unix_Sample_Files/Test1.txt
select * from employees;
spool off
exit
EOF
This is working fine and giving the output.
But the below is not working and giving the error. Tried all the methods but was unable to resolve them.
rm -rf /home/oracle/Desktop/Unix_Sample_Files/Test2.txt
sqlplus -s sys as sysdba/oracle@oracle <<EOF
spool /home/oracle/Desktop/Unix_Sample_Files/Test2.txt
set linesize 32767
set pagesize 50000
select * from v$database;
spool off
exit
EOF
The error is
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>]

Comments

Processing

Post Details

Added on Nov 16 2021
3 comments
216 views