kill -9 for making Tablespace READ ONLY


SELECT 'kill -9 ' || p.spid
 FROM v$session s, v$process p
 WHERE p.addr = s.paddr 
 AND s.type = 'USER'
 AND s.taddr IN (SELECT addr
 FROM v$transaction
 WHERE start_time <
 (SELECT t.start_time
 FROM v$transaction t, v$session s
 WHERE s.taddr = t.addr AND s.SID = &1));
 
 
SELECT 'ps -ef | grep ' || p.spid
 FROM v$session s, v$process p
 WHERE p.addr = s.paddr
 AND s.taddr IN (SELECT addr
 FROM v$transaction
 WHERE start_time <
 (SELECT t.start_time
 FROM v$transaction t, v$session s
 WHERE s.taddr = t.addr AND s.SID = &1))
Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: