FAQ
Dear list members,

I am trying to find out more about the sql_opcode column in
gv$active_session_history. The reference is not very helpful by stating
the obvious (command type executed).

I was hoping to get more clues from the view defition, but all it does
(from v$fixed_view_definition) is telling me that
v$active_session_history references x$ash and x$kewash.

I found x$ash in v$fixed_table but can't see how it's defined. Maybe
that's a dead end anyway...

Any pointers appreciated.

Martin

Search Discussions

  • A. Coskan Gundogar at Mar 3, 2010 at 10:49 am
    Martin,

    Another Martin did good posts about this subject.

    http://mwidlake.wordpress.com/2009/12/10/command_type-values/<http://mwidlake.wordpress.com/2009/12/10/>
    http://mwidlake.wordpress.com/2010/01/08/more-on-command_type-values/

    Hope it helps
    On 3 March 2010 10:38, Martin Bach wrote:

    Dear list members,

    I am trying to find out more about the sql_opcode column in
    gv$active_session_history. The reference is not very helpful by stating
    the obvious (command type executed).

    I was hoping to get more clues from the view defition, but all it does
    (from v$fixed_view_definition) is telling me that
    v$active_session_history references x$ash and x$kewash.

    I found x$ash in v$fixed_table but can't see how it's defined. Maybe
    that's a dead end anyway...

    Any pointers appreciated.

    Martin

    --
    Martin Bach
    OCM 10g
    http://martincarstenbach.wordpress.com
    http://www.linkedin.com/in/martincarstenbach
    --
    http://www.freelists.org/webpage/oracle-l

    --
    Coskan GUNDOGAR

    Oracle DBA

    Email: gundogar_at_gmail.com
    Blog: http://coskan.wordpress.com
    Twitter: http://www.twitter.com/coskan
    Linkedin: http://uk.linkedin.com/in/coskan

    --
    http://www.freelists.org/webpage/oracle-l
  • Tanel Poder at Mar 3, 2010 at 11:08 am
    You can just DESC X$ASH to see its columns. X$ tables are not views, so they
    don't have view SQL hardcoded like V$ do.

    Also, you can use my x$ describe script (xde2.sql, attached), which
    describes x$ tables, shows you the data offsets and also any fixed indexes
    available for the X$ table (the last column):

    SQL> _at_xde2 x$kglna%
    Describe X$ tables and show indexed columns...

    TABLE_NAME COLUMN_NAME DATA_TYPE
    KQFCOSIZ OFFSET OFF_HEX IDX
    ---------------------- ------------------------------ --------------------
    ---------- ---------- --------- ----
    X$KGLNA ADDR RAW(8)
    8 0 0x0
    INDX NUMBER(4)
    4 0 0x0
    INST_ID NUMBER(4)
    4 0 0x0
    KGLHDADR RAW(8)
    8 0 0x0
    KGLNAHSH NUMBER(4)
    4 8 0x8 1
    KGLOBOCT NUMBER(2)
    2 12 0xC
    KGLNASQLID VARCHAR2(13)
    13 14 0xE 2
    PIECE NUMBER(2)
    2 28 0x1C
    NAME VARCHAR2(64)
    64 31 0x1F
    X$KGLNA1 ADDR RAW(8)
    8 0 0x0
    INDX NUMBER(4)
    4 0 0x0
    INST_ID NUMBER(4)
    4 0 0x0
    KGLHDADR RAW(8)
    8 0 0x0
    KGLNAHSH NUMBER(4)
    4 8 0x8 1
    KGLOBOCT NUMBER(2)
    2 12 0xC
    KGLNASQLID VARCHAR2(13)
    13 14 0xE 2
    PIECE NUMBER(2)
    2 28 0x1C
    NAME VARCHAR2(64)
    64 31 0x1F

    18 rows selected.

    The OCI command types are documented in Oracle docs and from Oracle 11.2
    there's also a new view V$SQLCOMMAND which lists all commands and their
    types.

    --
    Tanel Poder
    http://tech.e2sn.com

    On Wed, Mar 3, 2010 at 6:38 PM, Martin Bach
    wrote:
    Dear list members,

    I am trying to find out more about the sql_opcode column in
    gv$active_session_history. The reference is not very helpful by stating
    the obvious (command type executed).

    I was hoping to get more clues from the view defition, but all it does
    (from v$fixed_view_definition) is telling me that
    v$active_session_history references x$ash and x$kewash.

    I found x$ash in v$fixed_table but can't see how it's defined. Maybe
    that's a dead end anyway...

    Any pointers appreciated.

    Martin

    --
    Martin Bach
    OCM 10g
    http://martincarstenbach.wordpress.com
    http://www.linkedin.com/in/martincarstenbach
    --
    http://www.freelists.org/webpage/oracle-l

    --
    http://www.freelists.org/webpage/oracle-l

    application/octet-stream attachment: xde2.sql

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouporacle-l @
categoriesoracle
postedMar 3, '10 at 10:38a
activeMar 3, '10 at 11:08a
posts3
users3
websiteoracle.com

People

Translate

site design / logo © 2022 Grokbase