Tag: kill

Process Information

Process Information - Powershell has feature allows one to list process information, list process by name. Also one can terminate process using "Stop-Process" PS>Get-Process -Name <program name> Example: PS>Get-Process -Name gvim Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName ------- ------ ----- ----- ----- ------ -- ----------- 95 7 3208 9496 65 0.16 172 gvim … Continue reading Process Information

Script to kill/terminate sessions connected to a specific database

DECLARE @dbName VARCHAR(100) SET @dbName = 'AdventureWorks' DECLARE @sql VARCHAR(50) DECLARE @spid SMALLINT DECLARE @loginame NVARCHAR(256) DECLARE @hostname NVARCHAR(256) DECLARE @open_connections INT DECLARE db_cursor CURSOR FOR SELECT spid, loginame, hostname FROM master.sys.sysprocesses WHERE dbid = DB_ID(@dbName) SELECT @open_connections = count(1) FROM master.sys.sysprocesses WHERE dbid = DB_ID(@dbName) PRINT 'Killing ' + RTRIM(@open_connections) + ' connections to … Continue reading Script to kill/terminate sessions connected to a specific database

How to set keys (backspace, interrupt, suspend, kill)?

Using stty one can set some of keys like backsapce, interrupt, suspend and kill. $ stty -a # shows the current terminal settings intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = ; eol2 = ; start = ^Q; stop = ^S; susp = ^Z; rprnt = … Continue reading How to set keys (backspace, interrupt, suspend, kill)?

Script to generate SQLs to terminate rman sessions

Killing the rman main process from the command line doesn't immediately kill the rman sessions using the script below which will create SQL statements to kill your RMAN sessions in Oracle and in most cases it will also terminate the oracle shadow process. The script below generates ALTER statements to kill oracle session(s) and a … Continue reading Script to generate SQLs to terminate rman sessions

Killing an Oracle thread on Windows

On Windows for each instance all oracle sessions are thread based and are part of one Oracle process (oracle.exe), so killing oracle.exe would crash your entire instance. Therefore using the utility orakill.exe one can kill user's session. Using the following SQL one can find the thread id of the oracle process. SQL> SELECT a.username, a.osuser, … Continue reading Killing an Oracle thread on Windows