sqlplus invocation

sqlplus -s /nolog <<! set serveroutput on size 100000 @/path_of_my_script exit !

hi, i encountered the above statment in a unix script file and i have some questions, would appreciate if someone can enlighten me.

  1. What is the purpose of <<! ?
  2. What is the purpose of exit ? does it exit the sqlplus program?
  3. Why does the statment ends with a ! ? The '!' probably is to match the one at the beginning of the statement, i guess. Would appreciate if someone explaines the meaning of the !!. Thank you.

Your understanding is right.

sqlplus user/password@SID <<!

This statement means give input to the sqlplus command until you encounter a !. The '<<' operator is called the here document. You can get more information on this from other threads too. exit is the exit command of sqlplus to exit from the sql prompt.

Rahul.

so it means 'set serveroutput on size 100000 @/path_of_my_script exit' is fed into the sqlplus command? the (!) just acts as a delimiter.

Would you mind explaining:

  1. What does the -s stands for ?
  2. i read from another post about /nolog. One of the replies was that, it means no initial connection is made to the db. I do not understand it. If not conenction is made, how does it query the db later on?

-s stands for silent connection.

The post was correct /nolog does not actually connect to the database. The connection to the DB is probably done by your script (@/pathOfMyScript)

Try the following on your system.

$ sqlplus --help

SQL*Plus: Release 9.2.0.6.0 - Production

Usage: SQLPLUS [ [<option>] [<logon>] [<start>] ]
where <option> ::= -H | -V | [ [-L] [-M <o>] [-R <n>] [-S] ]
<logon> ::= <username>[/<password>][@<connect_string>] | / | /NOLOG
<start> ::= @<URI>|<filename>[.<ext>] [<parameter> ...]
"-H" displays the SQLPlus version banner and usage syntax
"-V" displays the SQL
Plus version banner
"-L" attempts log on just once
"-M <o>" uses HTML markup options <o>
"-R <n>" uses restricted mode <n>
"-S" uses silent mode

Rahul.

Rahul, thank you for the detailed explaination. Greatly appreciated.