Search This Blog

Total Pageviews

Tuesday, 17 January 2012

Oracle session info

e.sql


select ses.sid ||','||ses.serial#,sqa.SQL_TEXT SQL from
v$session ses, v$sqlarea sqa, v$process proc
where ses.paddr=proc.addr
and ses.sql_hash_value=sqa.hash_value
and proc.spid=&1;


-bash-3.00$ cat s.sql
set pagesize 32000
set linesize 200
column sid format a12
column username format a10
column terminal format a10
column sql_text format a40 wrap
Select ''''||s.sid||','||s.serial#||'''' SID
,s.status
,s.username
,s.terminal
,q.SQL_TEXT
,q.command_type
,s.sql_id
from
v$session s
,(select distinct
address
,sql_text
,command_type
from v$sql) q
where
q.address=s.sql_address
order by s.sid
/
prompt >>>>>>>>>>>>>>>>>>>>>>>>>>>-- run e.sql for explain plan alter system kill session IMMEDIATE;

No comments:

Oracle DBA

anuj blog Archive