Sometimes its very hard to join certain v$ viewes to get relevent information in oracle.
Here is some examples of joining v$ views which are used by DBAs most frequtntly,
V$session + v$process
**********************
Use:
1)For finding session trace files
2)To find OS id (SPID)
3)Info about User & BG Processes
select p.*,s.*
from V$process p,V$session s
where s.paddr = p.addr and s.status
v$session + v$sqltext
**********************
Use: which query the session is executing
select ses.*,st.*
from v$session ses, v$sqltext st
where st.address = ses.sql_address
and st.hash_value=ses.sql_hash_value
v$session + v$sql
***********************
Use:
1)SQL Query details in which the session is executing
select sess.*,ss.*
from v$session sess,v$sql ss.
where sess.sql_id = ss.sql_id
V$session + v$process + v$sql
*****************************
Use: More details about a session.
select s.*,p.*,ss.*
from v$session s,v$process p,v$sqlarea ss
where s.paddr=p.addr
and ss.sql_id(+)=s.sql_id
************
No comments:
Post a Comment