Kill the RMAN backup session in Oracle

Kill the RMAN backup session in Oracle

Fetch the SID, Serial# or SPID for RMAN running Backup.
Note: If backup is running in multiple channels then it return multiple rows.

col sid for 9999
col serial# for 9999999
col spid for a5
col client_info for a20
select b.sid, b.serial#, a.spid, b.client_info
from v$process a, v$session b
where a.addr=b.paddr and client_info like 'rman%';

  SID  SERIAL# SPID  CLIENT_INFO
----- -------- ----- --------------------
  487    29899 8140  rman channel=ch00
   28    19185 6148  rman channel=ch01

Kill all the session with commands from SQLPLUS

select 'Alter system kill session '''||b.sid||','||b.serial#||''' immediate;'
from v$process a, v$session b
where a.addr=b.paddr and client_info like 'rman%';

'ALTERSYSTEMKILLSESSION'''||B.SID||','||B.SERIAL#||'''IMMEDIATE;'
------------------------------------------------------------------
Alter system kill session '487,29899' immediate;
Alter system kill session '28,19185' immediate;

OR

You can kill with OS command provided by Oracle (ORAKILL)
Syntax: ORAKILL SID Thread(SPID)

select 'orakill '||c.instance_name||' '||SPID
from v$process a, v$session b, v$instance c
where a.addr=b.paddr and client_info like 'rman%';

'ORAKILL'||C.INSTANCE_NAME||''||SPID
--------------------------------------
orakill xe 6916
orakill xe 6148

SQL> host orakill xe 6916
Kill of thread id 6916 in instance xe successfully signalled.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.