Search code examples
oracle-databaseplsqldeveloper

How to see real time SQL Monitor in PL/SQL developer?


In Oracle SQL developer , we have monitor session for real time SQL monitoring. Similarly how to look that in PL/SQL developer?

SCRENNSHOT


Solution

  • You can add it to the Session Browser, which is at Tools > Sessions and has an icon like this:

    plsqldev sessions icon

    You can launch it from the menu, or add it to the toolbar to make it easier to access in the future. From your screenshot it doesn't seem to be present, so add it:

    1. Right-click on the tool bar
    2. Choose "Customize"
    3. Under the "Toolbars" tab, ensure "Tools" is enabled (yours appears to be)
    4. Under the "Commands" tab, select "Tools", find the "Sessions" icon and drag it to the toolbar.

    The Sessions screen consists of a master-detail report where the main panel is (by default) select * from v$session with a couple of variations to filter on "My sessions" or "Active sessions". In my setup I change these to include some more useful information, place the things I want to see quickly near the top, etc. Click the spanner icon to edit the queries.

    The default detail tabs include a SQL Monitor report which is based on a query of v$sql_monitor for the current session and displays the HTML format.

    I prefer the interactive version so I change HTML to ACTIVE. I also like to be able to see at a glance which row corresponds the currently executing SQL, so I change it to:

    select m.status
         , m.sql_text
         , dbms_sqltune.report_sql_monitor
           ( sql_id => m.sql_id
           , sql_exec_id => m.sql_exec_id
           , type => 'ACTIVE'
           , report_level => 'ALL' ) as report
    from   v$sql_monitor m
    where  m.sid = :sid
    and    m.session_serial# = :serial#
    order by m.sql_exec_start desc
    

    For a RAC environment you might want to change this to gv$sql_monitor.

    (Note the 'Active' report includes an 'Overview' section at the top, which you can collapse to give more space to SQL execution details.)

    Full walkthrough here, though it was written a couple of years ago so refers to earlier versions of everything, Windows XP etc. (This was the second in the series, so perhaps you might as well start with plsqldeveloper-setup-1.)

    More details about DBMS_SQL_MONITOR.