查找处理oracle数据库中僵死进程

查找数据库中僵死进程 
Col terminal format a20
select pid, spid, username, terminal, program
from v$process
where addr not in (select paddr from v$session); 


杀进程:
Shutdown abort之前应该杀掉的一些进程:
ps -ef | grep ora | grep LOCAL=NO |cut -c 9-15 |xargs kill -9


杀掉全部LOCAL=No的Oracle进程:
ps -ef|grep oracle$ORACLE_SID|grep LOCAL=NO|grep -v grep|awk '{print $2}'|xargs kill -9 

杀指定一台机器过来的连接
select 'kill -9 ' || spid  from v$process where addr in (select paddr from v$session where machine LIKE 'ACCT_APP%');

查看是否有僵死进程
select spid from v$process where addr not in (select paddr from v$session);

杀僵死进程
select 'kill -9 ' || spid  from v$process where addr  not in (select paddr from v$session );

察看操作系统级的制定相关进程
rzyzdb2:/oracle/app/oracle/product/9.2.0/network/admin>ps -ef |grep lsnr
  oracle 192870 168578   0 12:16:13  pts/9  0:00 grep lsnr
  oracle 254244 274714   0 11:06:44  pts/0  0:00 lsnrctl
  oracle 242390      1   0 11:06:57  pts/0  0:00 /oracle/app/oracle/product/9.2.0/bin/tnslsnr LISTENER -inherit

杀掉不正常的进程
kill -9 242390

杀会话
ALTER SYSTEM KILL SESSION '<sid#>, <serial#>';

 

你可能感兴趣的:(oracle,数据库)