How do you monitor SQL queries that your session is running? I know there's v$session and v$sqlarea views. What's the relationship between these two?
Any ideas?
Printable View
How do you monitor SQL queries that your session is running? I know there's v$session and v$sqlarea views. What's the relationship between these two?
Any ideas?
http://www.orafaq.com/node/758
v$session.saddr = v$open_cursor.saddr
v$open_cursor.hash_value = v$sqlarea.hash_value
Be mindful of performance hit when querying these tables though, e.g. don't try to select values for all sessions as other users may "hang".
Also, depending on oracle db version, v$sqlarea.sqltext may be incomplete/truncated. In which case you will have to retrieve query parts from v$sqltext