Quote:
Originally Posted by ust
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
if this really happens all the time, you should consider writing a script to automate this process for you. But if it does not happen all that often, you can use the following interactive procedure (which could also be a basis for a script).
In a shell, run
ps --user=oracle_usr --format=pid,user,comm,etime --sort etime
This will return all of the active processes owned by oracle_usr, sorting them by how long they have been running for (in [[dd-]hh:]mm:ss format). This elapsed time will be the last column in the table returned to you. The first column with be the PID (process id) of each process. Record the PID's of the proccesses with elapsed times of over 10 minutes (or whatever time you want). Then using the PID of each process, you can send it a signal to terminate it properly. But you should read the Oracle documentation to understand what would be the most appropriate signal to use.
Speaking in generic terms, you can terminate a process by sending it a TERM or KILL signal. E.g., for each process that you want to kill, you could try
kill -TERM <PID>, and if that does't work,
kill -KILL <PID> . By the way, to use kill on a process, you have to own it (i.e., here be oracle_usr) or be a privelaged user.