terminate process


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting terminate process
# 1  
Old 06-21-2005
terminate process

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
# 2  
Old 06-21-2005
Tuning Oracle scripts is better than killing processes - FWIW.

Remove the # from in front of
Code:
#     . ./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.
Code:
#!/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

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Terminate a process using shell script

Hi, I am writing a shell script to run a process and write the output of the process to a file. Inside program.sh: ./process.sh > tempfile .. open tempfile do the following But the problem is that process.sh is running indefinitely and program.sh is not executed completely. Can... (4 Replies)
Discussion started by: dreamgirl314
4 Replies

2. Shell Programming and Scripting

Terminate initially if error found...

Hi, I have written a shell script which is a combination of 5 scripts into one. We have a Record Claim indicator in the scpt ($rc) with which we can come to an conclusion if the script failed to load the data or if the data loaded successfully. Can any one please help me as to how to... (16 Replies)
Discussion started by: msrahman
16 Replies

3. UNIX for Dummies Questions & Answers

Terminate a port connection

I have executed a command which has ports that have to be assigned. then I deleted the files. Now I need to reinstall the command. but it says the ports are not free How to terminate the port connections and reinstall in solaris unix ---------- Post updated at 09:07 PM ----------... (7 Replies)
Discussion started by: sriki32
7 Replies

4. Solaris

Application terminate

OS : Solaris X86 gcc version 3.4.6 when i run my application, C with Motif application crashed and formed core. I collected the truss ouput. Incurred fault #6, FLTBOUNDS %pc = 0xFE8B35CD siginfo: SIGSEGV SEGV_MAPERR addr=0x00000275 Received signal #11, SIGSEGV siginfo:... (2 Replies)
Discussion started by: satish@123
2 Replies

5. Programming

command to terminate

hi all how to terminate command eecution process. can you please show me the way thank you (2 Replies)
Discussion started by: munna_dude
2 Replies

6. UNIX for Advanced & Expert Users

Interrupt signal Control C takes too long to terminate a process

I have a process to terminate, and when keying Control C/ kill -int , it takes 15 minutes to half an hour to terminate the process. I've tried using kill -2, or keying control c twice, however the process seem to be killed abruptly, without writing into the log file. So the only way in order to... (8 Replies)
Discussion started by: paqui
8 Replies

7. Shell Programming and Scripting

Terminate process

We have a system user "oracle_usr" always run some process in the system , but sometimes , these processes will not stop automatically until we terminate the process , can suggest the method how to terminate the process that is run by "oracle_usr" and run over 10 minutes ? thx (5 Replies)
Discussion started by: ust
5 Replies

8. Shell Programming and Scripting

terminate the process

In my system , there are a system user "cronusr" , it is mainly to run the crontab job in the database .Sometimes the cronjob process will be failure ( due to some reason ) so that many cronusr process are in the system , it affect other process in the system , I want to have a script that can... (2 Replies)
Discussion started by: ust
2 Replies

9. Shell Programming and Scripting

Terminate session on completing script

Hai all.. How do i terminate my telnet session automatically when my java applicatiion exits. i have a file run which executes my java application and takes care of all class and library path settings prior to the execution. I would like to terminate my session when my application exits. The... (4 Replies)
Discussion started by: deepsteptom
4 Replies

10. Shell Programming and Scripting

How to terminate a tail -f

I am developing a script with a tail -f in it. My problem is how to terminate it and execute the next line. (4 Replies)
Discussion started by: DonVince
4 Replies
Login or Register to Ask a Question