sql_id and sql_child_id not are null for SQL statement [message #550572] |
Tue, 10 April 2012 08:46 |
Andrey_R
Messages: 441 Registered: January 2012 Location: Israel
|
Senior Member |
|
|
Hi all,
i am trying to analyze a query i have and noticed that it does not show the sql_id in v$session.
preparing a test case:
create table t1(a number, b varchar(10));
insert into t1 values(123 , 'value1');
when i execute
select count(*) from dual;
select * from dual;
select count(*) from t1;
i can see the sql_id
by running
select
sql_id sql_id_,
sql_child_number sql_child_num,
module module_,
action action_,
logon_time lgtime,
v$session.*
from v$session
where
type='USER'
and username='MY_USER'
and osuser = 'OS_USER'
and module = 'SQL*Plus'
order by lgtime desc
however, when i'm running
sql_id and sql_child_id in v$session appears to be null,
and i can't analyze it.
Can anybody please explain why those columns are NULL?
Regards,
Andrey
[Updated on: Tue, 10 April 2012 08:49] Report message to a moderator
|
|
|
|
|
|
|
|
Re: sql_id and sql_child_id not are null for SQL statement [message #550581 is a reply to message #550576] |
Tue, 10 April 2012 10:24 |
|
Michel Cadot
Messages: 68732 Registered: March 2007 Location: Saint-Maur, France, https...
|
Senior Member Account Moderator |
|
|
Andrey_R wrote on Tue, 10 April 2012 17:01Thank you Michel.
Can you explain where that difference come from?
why count(*) inserts a value to sql_id whereas just * works upon prev_sql_id?
No I can't, I just noticed this which is true in all Oracle versions (using sql_hash_value... for versions before 10g).
So all my queries contains something like "nvl(sql_id,prev_sql_id)".
Regards
Michel
|
|
|