LINUX/UNIX USTUNDEN BUTUN USERLARI KILL ETME

1.AMAÇ VE KAPSAM

 

Butun veritabanına bağlanan userları kill etme komutu

 

2.UYGULAMA

 

2.1. Local=No bağlantısı olanları kill etme. ( Makinada birden fazla instance calisiyorsa tekrardan grep le belirtilmesi gerekir)

 

kill -9 `ps -ef | grep LOCAL=NO | grep -v grep | awk ‘{print $2}’`

 

2.2. Bütün bağlantı kuran sessionları kill etme.

 

kill -9 `ps -ef|grep LOC|grep -v grep|awk ‘{print $2}’`

 

 

2.3. Belli bir zaman dilimi belirleyip, o dilimden daha fazla işlem yapam userları kill etme.

 

 

ps -ef | grep LOCAL=NO | awk ‘{ if ( $7 > “00:03:00” ) print $3 }’ | xargs kill -9

 

 

TEST

 

select  ‘ALTER SYSTEM KILL SESSION  ”’||B.SID||’,’||B.SERIAL#||”’ ;’  from v$lock a, V$SESSION B WHERE A.SID=B.SID AND UPPER(B.PROGRAM) LIKE ‘%EXE%’

  2  ;

 594 views last month,  3 views today

About tayfun inam

Computer Engineer -PostgreSql-Oracle Database Administrator I am about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 8+years experience.I have OCA,PostgreSql senior Certificates I have worked 50+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.

Leave a Reply