Operating System - HP-UX
1752783 Members
5591 Online
108789 Solutions
New Discussion юеВ

Re: Is OK to kill an ORACLE process?

 
SOLVED
Go to solution
Randy Hagedorn
Regular Advisor

Is OK to kill an ORACLE process?

Hi,

I'm a bit of a nervous Nellie, when it comes to killing processes in HP-UX. But it appears that I may have a run-away ORACLE process that is consuming 100% of one of our 4 processors in a K460 system, and I was wondering if I could safely kill it.

The Oracle Instance is called 'ORD' and the process in the ps -ef command is 'oracle 20610 1 255 16:59:20 ? 316:52 oracleORD (LOCAL=NO)'.

I'm thinking that this is a just an ORACLE connection from someplace.

Can anyone confirm my thoughts about being able to kill this?

Thanks in advance,
Randy

13 REPLIES 13
RAC_1
Honored Contributor

Re: Is OK to kill an ORACLE process?

ps -ef|grep "process" If the process's priority is the range 128-153, the process is in kernel mode and can be killed. If it is not in kernel mode, you can kill as follows.

kill "pid"
kill -1 "pid"
kill -2 "pid"
kill -3 "pid"
kill -11 "pid"
If everything above failes, use -9 signal.
Do not use -9 signal to start with.

Anil
There is no substitute to HARDWORK
Randy Hagedorn
Regular Advisor

Re: Is OK to kill an ORACLE process?

Maybe I should clarify my question, as "If I were to kill this process, would the ORACLE database be affected adversely?".

Thanks,
Randy
Fred Ruffet
Honored Contributor

Re: Is OK to kill an ORACLE process?

I would prefer to kill it first from Oracle. It would be clean. If you can't, then go through Anil's process of OS kill. Oracle background processes will ensure rollback of the session (CPU and IO comsumption may not stop right after killing).

Regards,

Fred
--

"Reality is just a point of view." (P. K. D.)
Rick Garland
Honored Contributor

Re: Is OK to kill an ORACLE process?

ORACLE itself would not be adversely affected but you could be stepping on somebody who might be running a report.

I would double check with the DBA for more insight into the process you are looking at. The DBA should be able to associate the UNIX PID with the ORACLE process and tell you what that ORACLE process is and if it safe to kill.
Jean-Luc Oudart
Honored Contributor

Re: Is OK to kill an ORACLE process?

Hi,

Oracle is robust enough to recover from a killed process.

as mentioned in other post, you should kill the session with the oracle console.
alter system kill ','

Then Oracle will have to rollback the transaction, and this may take sometimes.
Therefore, you may 1st check what this transaction is all about.

Check the size of rollback segment.


Regards
Jean-Luc
fiat lux
Steven E. Protter
Exalted Contributor

Re: Is OK to kill an ORACLE process?

If its a runaway process it might be doing damage to the databae by letting it run.

It's likely to trigger an automatic recovery. You may need to do a shutdown abort, bring up the database and then down again to get it to run normally after such and event.

Oracle is pretty robust and survives sudden failures or process kills reasonably well. If you have a major write operation going on, see about stopping that prior to doing a process kill.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Jean-Luc Oudart
Honored Contributor

Re: Is OK to kill an ORACLE process?

Also check Metalink Note:161794.1 :
Should Sessions be Killed in OS or Using Alter System Kill Session?

Regards
Jean-Luc
fiat lux
Patti Johnson
Respected Contributor
Solution

Re: Is OK to kill an ORACLE process?

A couple comments from a DBA. It's ok to kill user processes (LOCAL=YES or LOCAL=NO) but don't kill a background process - dbwr, lgwr, pmon - Oracle will crash and recovery can be time consuming.
Before killing the processess you can find out who the owner is and it if is truly a run-away process, or just a very long month end report.
From sqlplus you can run this script to get more information on the process.

select spid, s.sid, p.serial#, s.terminal , pid, machine, s.program, osuser,
p.program, w.event from v$session s, v$process p,
v$session_wait w where addr = paddr and (spid like '%&&OSID%' or
process like '%&&OSID%')
and w.sid(+) = s.sid;

OSID is your unix process id. This will give you information to kill the process in Oracle before killing the unix process, or to contact the owner to see what they are running. You can also use the sid to query the v$session_wait table to determine the resource that the process is waiting on. A good indicator of a runaway process is that the seconds_in_wait time in v$session_wait is growing, but the wait event is not changing. I've hit a few bugs that behaved this way and the only option is to kill the processes.

Patti
KapilRaj
Honored Contributor

Re: Is OK to kill an ORACLE process?

Hello,

What I would prefer is to use lsof to get the remote or local socket address. Then using lsof find the batch program or the sql process which has created this oracle process. I would stop if possible else kill it.

lsof -p # Note down the socket and host name

On that hostname, lsof -i tcp:

will tell me the process id of the batch or the sql script.

Regds,

Kaps
Nothing is impossible