表session查询

----查询谁在操作这个表

SELECT

        

        T.SQL_TEXT,

        H.OSUSER,

        h.logon_time

FROM   

        V$SQL T,

        V$SESSION H

WHERE 

    H.SQL_ID         = T.SQL_ID

   and  t.sql_text like '%HCPMS_BI_ETL_JOB%'

 

 

 

---------

-- 查看进程...
SELECT DISTINCT
G.USERNAME,
G.SID,
ROUND(SOFAR*100/TOTALWORK,0)||'%' AS PROGRESS,
TIME_REMAINING,
T.SQL_ID,
T.SQL_TEXT,
H.OSUSER
FROM V$SESSION_LONGOPS G,
V$SQL T,
V$SESSION H
WHERE TIME_REMAINING <> 0
AND G.SQL_ADDRESS = T.ADDRESS
AND G.SQL_HASH_VALUE = T.HASH_VALUE
AND H.SQL_HASH_VALUE = G.SQL_HASH_VALUE
AND H.SQL_ADDRESS = G.SQL_ADDRESS
AND H.SQL_ID = T.SQL_ID
ORDER BY H.OSUSER ASC

posted on 2016-04-23 10:02  zhaoshuzhan  阅读(1041)  评论(0编辑  收藏  举报

导航