title: How to kill all active and inactive oracle sessions for user
body: <p>I am trying the below script to kill all active and inactive oracle sessions for user at once but it doesn't work. The script executes successfully but does not kill sessions for user.</p>
  
  <pre><code>BEGIN
    FOR r IN (select sid,serial# from v$session where username = 'USER')
    LOOP
      EXECUTE IMMEDIATE 'alter system kill session ''' || r.sid 
        || ',' || r.serial# || '''';
    END LOOP;
  END;
  </code></pre>