ba6.us - Dave's Database Related Stuff

  • home
  • blog
  • notebooks
  • projects
  • recent
  • about
  • manifesto
  • !
Home › Unix Shell Scripting

Tag Cloud

apex Application Express Auditing data dbi development export funnies HTML Java linux monitoring oem oracle performance perl rman scripting sql SQL Developer sqlplus tuning unix windows
more tags

Search

RSS Feed

Blog Posts :

Navigation

  • Feed aggregator

User login

  • Request new password

Running SQLPLUS - A simple example...

dmann — Sat, 10/11/2008 - 20: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
‹ Gathering Data from a Query up Scheduling a Cron Job ›
  • Printer-friendly version


Cornify
  • home
  • blog
  • notebooks
  • projects
  • recent
  • about
  • manifesto
  • !

Content Copyright 2006-2010. Links are copyright of respective owners.