1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

No rows when running a query to know what a specific acive session is doing

Discussion in 'General' started by alexcol, Oct 18, 2017.

  1. alexcol

    alexcol Active Member

    Likes Received:
    Trophy Points:
    Good evening, i need your help please

    I run a specific query to show me what a specific Acive session is doing, ie inititally ive got t
    Code (SQL):
    SID    SERIAL# USERNAME                      PROGRAM                                          OSUSER                         STATUS   SCHEMANAME                     LOGON_TIME          MACHINE

    ---------- ---------- ------------------------------ ------------------------------------------------ ------------------------------ -------- ------------------------------ ------------------- ----------------------------------------------------------------

    12270      42329 OPS$XPFACTUR         pv_camplan_ctaseg@prosclbt00c (TNS V1-V3)        xpfactur      ACTIVE  SISCEL               17/10/2017 00:00:57 prosclbt00c

    I run the query in different timestamps and the SID is the same, so i run this query to know what this session is doing:

    Code (SQL):
    SELECT a.sid, a.serial#, b.sql_text
    FROM v$session a, v$sqlarea b
    WHERE a.sql_address=b.address
    AND a.username='OPS$XPFACTUR'
    AND a.sid= 12270;
    but it has no rows

    no rows selected
    So i cant see what this session is doing

    Its probably than an active session changes its SID number frequently. so I cant get what i want.
    dont know to get around this, mayble with pid, or spid process?

    and one more question the PID and SPID process is from ORACLE or OPERATING SYSTEM?

    I would appreciate your help in advanced
  2. zargon

    zargon Community Moderator Forum Guru

    Likes Received:
    Trophy Points:
    Aurora, CO
    BOTH sid and serial# must match to make it the same session;sid values can be duplicated by connections so it's the pair of values that defines a specific session.