Find Active Sessions in Oracle Database

2008 June 8

There are times that you may need to issue a “SHUTDOWN IMMEDIATE” command to an Oracle Database. It is critical that you should consider checking who are the users that are currently running sessions on that Database. You don’t want to shutdown on your Boss or VP on Finance. Here’s a simple SQL to find all Active sessions in your Oracle Database:

  1. SELECT SID, Serial#, UserName, Status, SchemaName, Logon_Time
  2. FROM V$Session
  3. Status=‘ACTIVE’ AND
  4. UserName IS NOT NULL;

-Marlon Ribunal
kick it on DotNetKicks.com

Shameless Ad:

In need of Virtual Assistance? Visit Virtual IT Specialist Now!

4 Responses leave one →
  1. 2008 June 26
    Johanny permalink

    If you have a RAC configuration, you can use the next SQL to show the same information plus the instance identification on which the session is connected to:

    SELECT Inst_Id, SID, Serial#, UserName, Status, SchemaName, Logon_Time
    FROM GV_$Session
    WHERE Status=’ACTIVE’ AND
    UserName IS NOT NULL;

  2. 2009 March 3
    Alexwebmaster permalink

    Hello webmaster
    I would like to share with you a link to your site
    write me here preonrelt@mail.ru

  3. 2009 May 18
    Arshad permalink

    Cool….Thanks

  4. 2009 August 10
    Sopan permalink

    This functionality is readily available as a menu item in PL/SQL Developer (Tools->Sessions…).

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS

  • Archives



  • RSS SQLServerPedia

  • RSS SQL Crunch – Hot SQL Links

  • My Bookmarks

  • Category Cloud

    Business Career DBA Tool Events free ebook Humor IT News Members Only Microsoft MySQL Operating System Oracle Personal Reporting Services SQL Server SSIS TSQL Tutorial Uncategorized Video