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

    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    55
    Location:
    Colombia
    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
    his:

    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

    Messages:
    2,531
    Likes Received:
    360
    Trophy Points:
    1,430
    Location:
    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.