Operating System - HP-UX
1745890 Members
4748 Online
108723 Solutions
New Discussion юеВ

script in killing list fo unwanted sessions

 
SOLVED
Go to solution
Trng
Super Advisor

script in killing list fo unwanted sessions

i All,

i want a script in killing list fo unwanted sessions ..my requiremnet is

1-ps -ef | grep LOCAL=NO | wc -l is showing 1000 and machine is running slowly .i want to kill all the process listed above .how to make a simple scipt to kill these process one by one ....

2-how to kill pty/tty sessions which is not showing any process id in finger/who/w command


rgds,trng

administrator
3 REPLIES 3
Kenan Erdey
Honored Contributor
Solution

Re: script in killing list fo unwanted sessions

Hi,

for first one i can write it from my mind :)

ps -ef | grep "LOCAL=NO" | grep -v grep | awk '{print $2}' | xargs kill
Computers have lots of memory but no imagination
Kenan Erdey
Honored Contributor

Re: script in killing list fo unwanted sessions

for 2. do you mean you want to kill idle sessions in which no process spawned?

Computers have lots of memory but no imagination
Raynald Boucher
Super Advisor

Re: script in killing list fo unwanted sessions

That looks suspiciously like killing a bunch of oracle connections.

You should be carefull with that unless you don't care about unhappy users / customers.

Maybe, you should further investigate the origin, the status and the actions theses processes perform before starting a mass kill. Investigate the V$SESSION view in oracle for more info.