Re: Session

From: Lothar Flatz <l.flatz_at_bluewin.ch>
Date: Mon, 02 Mar 2015 17:46:54 +0100
Message-ID: <54F493FE.1010107_at_bluewin.ch>



Hi Paul,

I believe querying v$session will only work while the statement is running. You might want to query the session for the previous sql id. (look upthe exact column name, please).

Thanks

Lothar
Am 02.03.15 um 17:42 schrieb Paul Harrison:
>
> Hi All,
>
> The sql_hash_value and sql_id is 0 and null from the v$session view.
> Any idea why ?
>
> sqlplus scott/scott
>
> select * from cust where cust_id = 998;
>
> CUST_ID LAST_NAME FIRST_NAME
>
> ---------- ------------------------------ ------------------------------
>
> 998 998 998
>
> 998 998 998
>
> 998 998 998
>
> 998 998 998
>
> select HASH_VALUE,SQL_TEXT from v$sql where sql_text = 'select * from
> cust where cust_id = 998';
>
> HASH_VALUE SQL_TEXT
>
> ---------- --------------------------------------------------
>
> 270457607 select * from cust where cust_id = 998
>
> SQL> select sql_hash_value,sql_id
>
> 2 from v$session
>
> 3 where username = 'SCOTT'
>
> 4 ;
>
> SQL_HASH_VALUE SQL_ID
>
> -------------- -------------
>
> 0 NULL
>
> Thanks,
>
> Paul
>



--
http://www.freelists.org/webpage/oracle-l
Received on Mon Mar 02 2015 - 17:46:54 CET

Original text of this message