Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help to creat a batch file for deleting the applied archive in DB Server.

2 views
Skip to first unread message

rajesh

unread,
Jan 12, 2012, 7:02:35 AM1/12/12
to
Hi All,
I am sharing one Linux Script, Please help to get the windows
script on same scenario. Please help me. Below is the Linux Script
which is running in Linux Server. I would like to conert it in to
Windows bat script and used it in windows server. Please find the
script.......

---------------------------------------------------------Linux
Script--------------------------------------------------

#!/usr/bin/sh
cd /arch/archlogs
fir=`ls -ltr arch_1_* | awk '{print $9}'|head -1|tr _ . |tr . " " |
awk '{print $3}'`
appli=`sh /oracle/SCRIPTS/lastappli_remo.sh`
x=`expr $fir`
y=`expr $appli`
z=`expr $appli - 2`
while [ $x != $z ]
do
rm arch_1_$x*
x=`expr $x + 1`
done
exit

#########################################/oracle/SCRIPTS/
lastappli_remo.sh############################
#!/bin/sh
sqlplus -s "/as sysdba" <<EOF
set heading off
set feedback off
select max(sequence#) from v\$log_history;
EXIT
EOF
################################################################################


NOTE:- Please help me to conver this in Windows 2003 based script.
0 new messages