ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Tracking the progress of a long running statement[akadia]

Tracking the progress of a long running statement[akadia]

原创 Linux操作系统 作者:jlandzpa 时间:2019-07-19 07:39:01 0 删除 编辑

Sometimes you run an INSERT or DELETE statement that takes a long time to complete. You have wondered how many rows have already been inserted or deleted so that you can decide whether or not to abort the statement. Is there a way to display how many rows have been deleted while the statement is occurring ?

You can query the V$SESSION_LONGOPS table to track the progress of the statement.

Example: Starting the following long running INSERT

INSERT INTO bigemp SELECT * FROM bigemp;

Check the progress:

SELECT sid,sofar,totalwork,time_remaining
FROM v$session_longops
WHERE sid = 10 and time_remaining > 0;

SID SOFAR TOTALWORK TIME_REMAINING
---------- ---------- ---------- --------------
10 8448 11057 20
10 8832 11057 17
10 9024 11057 16
10 9184 11057 14
10 9536 11057 12
10 9646 11057 11
10 9920 11057 9
10 10421 11057 5
10 10529 11057 4
10 10814 11057 2


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/936/viewspace-60602/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2001-10-12

  • 博文量
    240
  • 访问量
    172295