0
votes

Each time I start a new sql script in sqlplus (Oracle) I receive such an output:

 [exec] Connected to:
     [exec] Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
     [exec] With the Partitioning, Automatic Storage Management, OLAP, Data Mining
     [exec] and Real Application Testing options
     [exec]
     [exec]
     [exec] PL/SQL procedure successfully completed.
     [exec]
     [exec] SQL> Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
     [exec] With the Partitioning, Automatic Storage Management, OLAP, Data Mining
     [exec] and Real Application Testing options

I'd like to get only information which is in the middle, namely:

     [exec] PL/SQL procedure successfully completed.

Is it possible to do it somehow ?

Btw. I know the -S option but it prevents me from displaying the SQL command which is going to be executed in next step. With -S those settings:

set serveroutput on size 1000000;
set echo on;

don't work.

1
No, sqlplus gives you all-or-nothing option. You either keep banner, command prompt and echoing of commands by starting sqlpplus without -s option, or none of them by starting sqlp*lus with -s option.Nick Krasnov

1 Answers

0
votes

You can use the SPOOL command to write the output to a file, ECHO works in this case.

SET SERVEROUTPUT ON SIZE 1000000
SET ECHO ON
SPOOL logfile.txt
[...]