How to hide terminal output in Linux [message #260527] |
Mon, 20 August 2007 04:21 |
shilpa.rajput
Messages: 31 Registered: May 2006 Location: Pune
|
Member |
|
|
Hello All,
Here is another query regarding the database health check shell script I'm writing.
Actually, in the script I'm redirecting the output to a file(temp) as :
sqlplus -s $usnm/$passw@$ORACLE_SID >> temp << EOF
The script works fine unless I turn to get the chained rows count.
In this shell script,I've spooled a sqlscript so as to analyze the tables to list the chained rows
& then have make it run immediately as -
set feedb off
spool anlz.sql
select 'analyze table '||owner ||'.'||table_name||' list chained rows;'
from all_tables;
spool off;
@/home/test/anlz.sql
Now the problem is, the output of the spooled sql file appears as a terminal output giving the feedback of the analyze commands executed.
Do anyone has idea how can I hide the output from terminal?
(It redirects all the output in the 'temp' file as well)
Thanks in advance.
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: How to hide terminal output in Linux [message #260614 is a reply to message #260603] |
Mon, 20 August 2007 08:10 |
shilpa.rajput
Messages: 31 Registered: May 2006 Location: Pune
|
Member |
|
|
Well,I respect the solution posted by u.
Let me clarify :
Have a look at part of my shell script :
sqlplus -s $usnm/$passw@$ORACLE_SID >> temp << EOF
SET heading off;
SET termout off;
SET feedback off;
SET linesize 90;
spool anlz.sql
select 'analyze table '||owner ||'.'||table_name||' list chained rows;'
from all_tables;
spool off;
@/home/test/anlz.sql
SELECT ' Database Health Check Report ' from dual;
SELECT 'Instance Name :', instance_name FROM v\$instance;
SELECT 'Version :',banner
FROM v\$version
WHERE banner LIKE '%Oracle%';
.
.
.
.
.
.
..
.
likewise.
Actually I was writing the SQL script only, but in the shell script.
Now see what I've done with the same script.
I took,
Toggle Spoiler
SET heading off;
SET termout off;
SET feedback off;
SET linesize 90;
spool anlz.sql
select 'analyze table '||owner ||'.'||table_name||' list chained rows;'
from all_tables;
spool off;
this code into a SQL script as anlzsrpt.sql
and then called that in my original script as follows:
Toggle Spoiler
sqlplus -s $usnm/$passw@$ORACLE_SID >> temp << EOF
setd off;
set termout off;
set feedb off;
@/home/shilpa/anlzsrpt.sql;
Actually the whole procedure is taking lot of time but at least purpose is solved.
[Updated on: Mon, 20 August 2007 08:15] Report message to a moderator
|
|
|