Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Very useful for dropping the repository schema when you are the repo user is logged in. It helps overcome this error message for example:

Code Block
DROP USER SEMARCHY_REPOSITORY CASCADE
Error report -
SQL Error: ORA-01940: cannot drop a user that is currently connected
01940. 00000 - "cannot drop a user that is currently connected"
*Cause: Attempt was made to drop a user that is currently logged in.
*Action: Make sure user is logged off, then repeat command.

– More info here:

http://www.oracle-base.com/articles/misc/killing-oracle-sessions.php

Code Block
SELECT s.inst_id,
s.sid,
s.serial#,
p.spid,
s.username,
s.program
FROM gv$session s
JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
WHERE s.type != 'BACKGROUND';

...