I want to have a script to terminate the system process that generated by user oracle_usr and have already processed for over 10 minutes , could suggest the script ? thx
Tuning Oracle scripts is better than killing processes - FWIW.
Remove the # from in front of
# . ./temp.sh
line
after you have reviewed the temp.sh file and you are sure it is getting right processes.
This code loops with a one minute sleep - you may wabnt to change it not to loop.
#!/bin/ksh
while true
do
ps -ef | awk '{if($1=="oracle"){
sub(/:/,"",$7)
if($7 > 1000 ){
printf("kill -9 %s # %s\n",$2, $0)
}
}} ' > temp.sh
if [ -s temp.sh ]; then
chmod +x temp.sh
# . ./temp.sh
fi
sleep 60
done
exit