The script used to be
shutdown abort
it has been replaced by
#shutdown abort
shutdown immediate
Let’s try !
SQL> #shutdown abort
ORACLE instance shut down.
SQL> shutdown immediate
ORA-01012: not logged on
sqlplus just silently ignored the # symbol and executed the first statement.
Thanks to Maxim comment, here is a new case to explain the sql prefix #
SQL> sho sqlpre
sqlprefix "#" (hex 23)
SQL> select
2 #prompt hello world
hello world
2 * from dual;
D
-
X
While within (or outside of) an sqlplus block, you can tell sqlplus to immediately run a sqlplus statement
The correct syntaxes to put comment are documented in Placing Comments in Scripts
SQL> remark shutdown abort
SQL> rem shutdown abort
SQL> -- shu abort
SQL> /* shutdown abort */
Slightly disagree with your ‘silently ignored the # symbol’ – in opposite, it has done exactly that, what sqlprefix stands for
http://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve040.htm#i2679105
Best regards
Maxim
Thank you Maxim ! I enhanced my post with your comment
Nice feature! 😉
another interesting usage of this “comment”
SQL> select owner,count(*)
2 from dba_objects
3 #shutdown abort
ORACLE instance shut down.
3 group by owner;
select owner,count(*)
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 26848
Session ID: 143 Serial number: 2467
Hi, I tend to use #desc when I am halfway through writing a select but have forgotten a column name. Then I can just carry on with the rest of my select. Very useful.
Really, I will think about it.
I used to
.[ENTER]
desc bla[ENTER]
i[ENTER]
but why not #desc 😉 it is actually much shorter to type !!!