I have a simple shell script that has embedded sql statement inside.
sqlplus system/manager << EOD
create or replace directory data_pump_dir as '/u07';
The good thing for this script is you do not have to call another .sql program.
The bad thing is , I can not display spool logfile inside it? as I does not spool any?
Why is that so? Or how do I put spool command?
use text editor so file contains SPOOL command
You really should not be passing the username and password on the sqlplus command line as it makes it visible from a ps -ef command. You should be connecting after you call sqlplus:
sqlplus /nolog <<EOF
set echo on
create or replace directory data_pump_dir as '.u07';
I have a number of shell scripts that use spool after the sqlplus call and they all work just fine, generating the requested file without issue.