[tkyte@dellpe ~]$ cat test.sh#!/bin/bash
cat > /tmp/$$.sql <<EOF
set pagesize 0 heading off feedback off verify off echo off trimspool on
spool test.log
select * from dual
/
spool off
exit
EOF
sqlplus / @/tmp/$$.sql
echo ----------------
cat test.log
echo ----------------
rm /tmp/$$.sql
[tkyte@dellpe ~]$ sh test.shSQL*Plus: Release 10.2.0.2.0 - Production on Wed Sep 3 11:52:45 2008
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
X
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
----------------
X
----------------
SUGGESTIONstop using sysdba, do not use it, just stop, quite powerful, quite DANGEROUS. Just don't use it - you don't need it and the only thing that could result will be a big bad accident some day.