Why doesn't output display SQL statement when using sqlplus in bash script?

From: Nan Xiao <xiaonan830818_at_gmail.com>
Date: Mon, 7 Mar 2016 16:08:15 +0800
Message-ID: <CA+MhoaO1d722WSaEP+QuFH-oJK3cAogV=dCdmcT=ZyWTwWk=hQ_at_mail.gmail.com>



Hi all,

I am writing a Bash script which using sqlplus to connect Oracle database:

#!/bin/bash

sqlplus / as sysdba <<EOF
select group#,members,bytes/1024/1024,status from v\$log; exit
EOF Executing it, the output is:

$ ./test.sh

SQL*Plus: Release 12.1.0.2.0 Production on Mon Mar 7 02:57:57 2016

Copyright (c) 1982, 2014, Oracle. All rights reserved.

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL>
    GROUP# MEMBERS BYTES/1024/1024 STATUS
---------- ---------- --------------- ----------------

         1          1          102400 CURRENT
         3          1          102400 UNUSED
         2          1          102400 INACTIVE

SQL> Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

The SQL statement runs successfully. But I am curious about why the statement doesn't display in output: There is empty after `SQL> `.

Best Regards
Nan Xiao

--

http://www.freelists.org/webpage/oracle-l Received on Mon Mar 07 2016 - 09:08:15 CET

Original text of this message