Oracle一個(gè)大事務(wù)的SQL往往不知道運(yùn)行到了哪里,可以使用如下SQL查看執(zhí)行進(jìn)度。
復(fù)制代碼 代碼如下:
set linesize 400;
set pagesize 400;
col sql_text format a100;
col opname format a15;
SELECT se.sid,
opname,
TRUNC (sofar / totalwork * 100, 2) pct_work,
elapsed_seconds elapsed,
ROUND (elapsed_seconds * (totalwork - sofar) / sofar) remain_time,
sql_text
FROM v$session_longops sl, v$sqlarea sa, v$session se
WHERE sl.sql_hash_value = sa.hash_value
AND sl.sid = se.sid
AND sofar != totalwork
ORDER BY start_time;
或者
復(fù)制代碼 代碼如下:
set linesize 400;
set pagesize 400;
set long 4000;
col sql_fulltext format a100;
col opname format a15;
SELECT se.sid,
opname,
TRUNC (sofar / totalwork * 100, 2) pct_work,
elapsed_seconds elapsed,
ROUND (elapsed_seconds * (totalwork - sofar) / sofar) remain_time,
sql_fulltext
FROM v$session_longops sl, v$sqlarea sa, v$session se
WHERE sl.sql_hash_value = sa.hash_value
AND sl.sid = se.sid
AND sofar != totalwork
ORDER BY start_time;
您可能感興趣的文章:- Oracle數(shù)據(jù)庫(kù)中基本的查詢(xún)優(yōu)化與子查詢(xún)優(yōu)化講解
- 一些Oracle數(shù)據(jù)庫(kù)中的查詢(xún)優(yōu)化建議綜合
- oracle跨庫(kù)查詢(xún)dblink的用法實(shí)例詳解
- Oracle數(shù)據(jù)庫(kù)中ORDER BY排序和查詢(xún)按IN條件的順序輸出
- Oracle 跨庫(kù) 查詢(xún) 復(fù)制表數(shù)據(jù) 分布式查詢(xún)介紹
- Oracle實(shí)現(xiàn)分頁(yè)查詢(xún)的SQL語(yǔ)法匯總
- ORACLE學(xué)習(xí)筆記-查詢(xún)篇
- 整理Oracle數(shù)據(jù)庫(kù)中數(shù)據(jù)查詢(xún)優(yōu)化的一些關(guān)鍵點(diǎn)