怎麼看衝突的查詢
在企業版,則可以使用企業管理跟蹤bloking會議,並參與查詢。 (Enterprise Manager for 10g documentation)
你也可以寫SQL查詢,對於這一點,就像本文詳細說明:Tracking Oracle blocking sessions從文章
SQL(上市阻塞會話):
select blocking_session, sid, serial#, wait_class, seconds_in_wait
from v$session
where blocking_session is not NULL
order by blocking_session;
清單活動查詢(從Ask Anantha):
SELECT a.USERNAME, a.STATUS, b.sql_text
FROM V$SESSION a
INNER JOIN V$SQLAREA b ON a.SQL_ADDRESS= b.ADDRESS;
如何查看由variuos查詢獲取的鎖定。
這個查詢會告訴你的會話ID(從Oracle forum):
集LINESIZE 150; 套頭; col sid_serial form a13 col ora_user for a15; col object_name for a35;對於a10,col object_type爲 ; col lock_mode for a15;對於a8,col last_ddl爲 ; a10的col狀態;
break on sid_serial;
SELECT l.session_id||','||v.serial# sid_serial,
l.ORACLE_USERNAME ora_user,
o.object_name,
o.object_type,
DECODE(l.locked_mode,
0, 'None',
1, 'Null',
2, 'Row-S (SS)',
3, 'Row-X (SX)',
4, 'Share',
5, 'S/Row-X (SSX)',
6, 'Exclusive',
TO_CHAR(l.locked_mode)
) lock_mode,
o.status,
to_char(o.last_ddl_time,'dd.mm.yy') last_ddl
FROM dba_objects o, gv$locked_object l, v$session v
WHERE o.object_id = l.object_id
and l.SESSION_ID=v.sid
order by 2,3;
需要多長時間才能完成一個查詢
您可以從SearchOracle
SELECT *
FROM
(select
username,opname,sid,serial#,context,sofar,totalwork ,round(sofar/totalwork*100,2) "% Complete"
from v$session_longops)
WHERE "% Complete" != 100
任何其他建議或任何其他方法或工具與此SQL跟蹤它,我可能使用
那麼,谷歌想到...
您使用的是10g企業版嗎? – ppeterka