process不釋放,檢查指令碼

xychong123發表於2016-12-13
select INST_ID,count(*) from gv$session group by INST_ID;






select INST_ID,count(*) cnt from gv$session where status='INACTIVE'  group by INST_ID order by cnt desc;




select INST_ID,count(*) cnt from gv$process group by INST_ID;






==============
select USERNAME,PROGRAM,PNAME,count(*) cnt from v$process group by USERNAME,PROGRAM,PNAME order by cnt;






select count(*)  from  v$session where status='INACTIVE'
select  program,machine,count(*) cnt from  v$session where status='INACTIVE' group by program,machine order by cnt;




統計1521資訊
 netstat -antpl|grep 1521 |awk '{print $5}'|awk -F: '{a[$1]++;}END{for(i in a) print i,a[i]}'|sort -n -k 2








 




刪除空的process:
set linesize 1000
set pagesize 0
select 'kill -9 '||a.SPID,a.PROGRAM,a.USERNAME FROM V$PROCESS A, V$SESSION B WHERE A.ADDR=B.PADDR(+) and  b.username is null  and  a.USERNAME='grid';


select b.sid,b.serial#,b.sql_id, b.username,B.PROGRAM ,b.command,b.osuser FROM V$PROCESS A, V$SESSION B WHERE A.ADDR=B.PADDR(+) and  b.username is null;


select 'kill -9 '||a.spid,a.USERNAME FROM V$PROCESS A, V$SESSION B WHERE A.ADDR=B.PADDR(+) and  b.username is null and  a.USERNAME='grid';
 
select a.USERNAME,count(*) from  V$PROCESS A, V$SESSION B WHERE A.ADDR=B.PADDR(+) and  b.username is null group by a.USERNAME;





來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20747382/viewspace-2130433/,如需轉載,請註明出處,否則將追究法律責任。

相關文章