Home » Infrastructure » Unix » date of datebase throught Scrip
date of datebase throught Scrip [message #193707] Tue, 19 September 2006 01:44 Go to next message
prakashrao.k
Messages: 13
Registered: September 2006
Location: BANGALORE
Junior Member

Hi
I am trying to get the date but is not working can any one answer this,

Script is as follows

SCRIPT FILE(.ksh)
echo date chk >date.txt
echo "Backup Date is:" sqlplus -s server1<date.sql
cat date.lst>>date.txt
echo end >>date.txt

SQL FILE (date.sql)
whenever sqlerror exit failure
set termout off
spool date.lst
select sysdate as backupdate from dual;
spool off
exit

but this is not throwing any error but not giving any results

Please help me!!!!!!!

Thanks in Advance
Prakash
Re: date of datebase throught Scrip [message #193769 is a reply to message #193707] Tue, 19 September 2006 06:09 Go to previous message
ebrian
Messages: 2794
Registered: April 2006
Senior Member
SCRIPT FILE(.ksh)

echo `date` > date.txt
echo "Backup Date is:" `sqlplus -s "/ as sysdba" < date.sql` >> date.txt
echo end >> date.txt


SQL FILE (date.sql)

whenever sqlerror exit failure
set termout off head off
select sysdate as backupdate from dual;
exit
Previous Topic: Problem installing on OS X
Next Topic: Pagewise display of ls comand in Unix
Goto Forum:
  


Current Time: Sat Dec 03 04:14:09 CST 2016

Total time taken to generate the page: 0.14444 seconds