[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Suppressing all terminal output from Oracle when running an SQL query from a ksh script

Posted on 2005-03-22
4
Medium Priority
?
1,861 Views
Last Modified: 2008-08-05

I want to suppress all terminal output generated by Oracle / SQL when I run a query that resides in a ksh script.  This is because this is a crontab run and everything is spooled to files anyway.

Here is a snippet from my ksh script....

sqlplus -s .......
set pagesize 0 feedback off verify off termout off showmode off heading off echo off
insert into
...

When I run this interactively, I still see the Oracle version and other message on the terminal.  What settings should I be using ?
0
Comment
Question by:jmohsin
  • 2
4 Comments
 
LVL 29

Expert Comment

by:MikeOM_DBA
ID: 13604460

The options you posted (sqlplus -s and set ....) do the trick!
You should get no output except if you do have a select ... from ... that generates a result set.
0
 
LVL 29

Accepted Solution

by:
MikeOM_DBA earned 1800 total points
ID: 13604485
Example:

$ cat m2
#!/bin/ksh
sqlplus -s scott/tiger <<EOF
set pagesize 0 feedback off verify off termout off showmode off heading off echo
 off
select empno, ename, job from emp where job='CLERK';
exit
EOF

$ m2
      7369 SMITH      CLERK
      7876 ADAMS      CLERK
      7900 JAMES      CLERK
      7934 MILLER     CLERK
$

See...no messages.
0
 
LVL 6

Assisted Solution

by:makhan
makhan earned 200 total points
ID: 13608525
when u submit the program to cron just use the redirection to /dev/null

like this for ex.

0 8-22/1 * * *  /bin/dial ; kill -HUP `cat /var/run/crond.pid` >> /dev/null

This will nither report the cron job exectution in your mail nor any output from that.

Regards!

0
 

Expert Comment

by:vinit_kumar_chawla
ID: 22159105
I do not want, even the select results os select query. Can you please suggest me what should I do?
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

612 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question