Executing sql command in unix script

Executing sql command in unix script

 

  

I am trying to execute a sql command within a unix script.
Does anyone know how I would do this?

This is the line in the Unix script:
su - oracle -c "export ORACLE_SID=${db}; sqlplus '/as sysdba'
@${PWD}/audit_loc.sql" > ${PWD}/audit_loc.txt

The script is audit_loc.sql

I would like to execute the sql statement within Unix rather than using
this: @${PWD}/audit_loc.sql

The contents of the script is the following:
set heading off;
show parameter audit_file_dest;
exit;



Raquel Sikyala


Oracle LazyDBA home page