Running SQLPLUS - A simple example...
Submitted by dave on Sat, 10/11/2008 - 21:40
The following script runs a simple query and appends the result to a file.
Query.sql:
SET FEEDBACK OFF SET HEADING OFF SET PAGESIZE 0 SET SERVEROUTPUT ON SELECT COUNT(*) FROM v$SESSION; EXIT
runQuery.sh:
#!/bin/sh if [ -f ~/.bashrc ]; then . ~/.bashrc fi sqlplus -S perfstat/perfstat @query.sql > output.txt