State column's purpose?
John Cantu, January 25, 2016 - 1:26 pm UTC
Hi Connor,
It seems like that column is unnecessary since the session state is almost always "waiting". That field isn't providing any useful information to the DBA or am I missing something?
The event field provides the wait event while the wait_time_micro field provides the amount of time it waits. Now those two fields provide valuable information.
January 25, 2016 - 3:41 pm UTC
Chris here. From the docs, state can be:
- WAITING - Session is currently waiting
- WAITED UNKNOWN TIME - Duration of the last wait is unknown; this is the value when the parameter TIMED_STATISTICS is set to false
- WAITED SHORT TIME - Last wait was less than a hundredth of a second
- WAITED KNOWN TIME - Duration of the last wait is specified in the WAIT_TIME column
http://docs.oracle.com/cd/E11882_01/server.112/e40402/dynviews_3024.htm#REFRN30229
John Cantu, January 25, 2016 - 5:41 pm UTC
Hi Chris,
I have seen those possible values for the 'state' column. It is just seems useless and it would confuse a DBA trying to figure out what the session is doing.
If session isn't doing anything, status is waiting.
If session is "waiting" on a lock, the status is waiting.
If session is has a lock, the status is waiting.
Its like saying the obvious like
you are a human.
i am a human
connor is a human.
- WAITING - Session is currently waiting
- WAITED UNKNOWN TIME - Duration of the last wait is unknown; this is the value when the parameter
TIMED_STATISTICS is set to false
- WAITED SHORT TIME - Last wait was less than a hundredth of a second.
What does it really matter if it was less than a hundredth of a second or a more.
- WAITED KNOWN TIME - Duration of the last wait is specified in the WAIT_TIME column
Okay, i planned to look at that column anyway. it is pointing out the obvious.
thanks, but it is clear to me that 'state' column provides little if any help.
please correct me if i am wrong.
thanks for your help, Chris.
January 26, 2016 - 12:57 am UTC
Dont forget that a session may change state 100's of times in a second, and v$session_wait is merely a instantaneous snapshot of that.
So a session may be on cpu, or it may have been waiting for a long time or short time etc... *Most* of the time, you'll probably see it as waiting because that whats most sessions typically do (unless the are batch processes etc and a belting away at your CPU)