1 Reply Latest reply on May 21, 2015 1:06 AM by aJohny

    Why is 'echo on' during spooling?

    henryfg42

      When I execute some commands as a script (using F5) the script output is correct, but the contents of the file being spooled to is not consistent: the 'select' and 'spool off' are echoed.

      Can I turn 'echo off' for the spooled component?

       

      Script:

      set heading off

      set linesize 120

      set pagesize 999

      set feedback off

      set echo off

      set termout off

      column inst_id format 999 heading "Id"

      column name format a40 heading "Name"

      column value format a60 heading "Value"

      spool test1.txt

      SELECT Vdin.Inst_Id , Vdin.Name , Vdin.Value FROM V$DIAG_INFO vdin;

      spool off

       

      Script output (perfect):

         1 Diag Enabled                             TRUE                                                       

         1 ADR Base                                 /u04/app/oracle                                            

         1 ADR Home                                 /u04/app/oracle/diag/rdbms/pji/PJI                         

         1 Diag Trace                               /u04/app/oracle/diag/rdbms/pji/PJI/trace                   

         1 Diag Alert                               /u04/app/oracle/diag/rdbms/pji/PJI/alert                   

         1 Diag Incident                            /u04/app/oracle/diag/rdbms/pji/PJI/incident                

         1 Diag Cdump                               /u04/app/oracle/diag/rdbms/pji/PJI/cdump                   

         1 Health Monitor                           /u04/app/oracle/diag/rdbms/pji/PJI/hm                      

         1 Default Trace File                       /u04/app/oracle/diag/rdbms/pji/PJI/trace/PJI_ora_15323.trc 

         1 Active Problem Count                     0                                                          

         1 Active Incident Count                    0 

       

      Contents of spool file (not so perfect):

      SQL> SELECT Vdin.Inst_Id , Vdin.Name , Vdin.Value FROM V$DIAG_INFO vdin;

       

       

         1 Diag Enabled                             TRUE                                                       

         1 ADR Base                                 /u04/app/oracle                                            

         1 ADR Home                                 /u04/app/oracle/diag/rdbms/pji/PJI                         

         1 Diag Trace                               /u04/app/oracle/diag/rdbms/pji/PJI/trace                   

         1 Diag Alert                               /u04/app/oracle/diag/rdbms/pji/PJI/alert                   

         1 Diag Incident                            /u04/app/oracle/diag/rdbms/pji/PJI/incident                

         1 Diag Cdump                               /u04/app/oracle/diag/rdbms/pji/PJI/cdump                   

         1 Health Monitor                           /u04/app/oracle/diag/rdbms/pji/PJI/hm                      

         1 Default Trace File                       /u04/app/oracle/diag/rdbms/pji/PJI/trace/PJI_ora_15323.trc 

         1 Active Problem Count                     0                                                          

         1 Active Incident Count                    0                                                          

      SQL> spool off