everyone!I want to know what this line does:

sqlplus -s /nolog <<EOF

Any ideas? Thanks for the help!

3

Best Answer


From the information that you provided in the comments:

sqlplus -s /nolog <<EOF

Fires up an instance of sqlplus with silent mode enabled (which, I believe, doesn't send out any output to the console screen), and without a login explicitly provided (hence the /nolog), and it's taking input from the string contained in the EOF heredoc (which probably contains login credentials).

Here is a quick overview of Oracle's documentation on sqlplus.

From HERE:

-s The silent option: it suppreses the output of the SQL*Plus banner, the command prompt and the echoing of commands.

/nolog Starts SQL*Plus but does not log on (connect) a user/session.


So it seems that starts SQL*PLUS without logging on a user/session (nolog option) and don't display info (silent option).

The full excerpt should probably be:

sqlplus -s /nolog << ABCDECONNECT user/pwd@database-- DO SQL AND PLSQL STUFFEXITABCDE

Which is similar to running sqlplus -s user/pwd@database @script.sql where script.sql contains the sql, plsql stuff and the exit command. The << syntax is shell operator for heredoc, which means all following lines are variable-expanded if ${variables} are found, and the first line beginning with ABCDE (at the very beginning of the line, no spaces, no tabs) ends the input.