是的
v$session_longops只能监控MV的查询子句执行的进度
Session A:
SQL> analyze table mvtest compute statistics;
Table analyzed.
SQL> create materialized view mv_mvtest
2 refresh fast start with sysdate
3 next sysdate+1/144 with rowid
4 as
5 select * from mvtest;
Materialized view created.
SQL> SQL> select count(*) from mv_mvtest;
COUNT(*)
----------
2767104
这里做一次完整刷新 在Session B中监控刷新进度
SQL> exec dbms_mview.refresh('mv_mvtest','c');
PL/SQL procedure successfully completed.
SQL> SQL>
Session B:
SQL> l
1 select sid,OPNAME,TARGET_DESC,sofar,TOTALWORK,trunc(sofar/totalwork*100,2)||'%' as perwork
2* from v$session_longops where sofar!=totalwork
SQL> /
no rows selected
SQL> /
no rows selected
SQL> /
no rows selected
SQL> /
no rows selected
SQL> /
no rows selected
SQL> /
no rows selected
SQL> /
no rows selected
SQL> /
no rows selected
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 9376 37393 25.07%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 10993 37393 29.39%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 12153 37393 32.5%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 13391 37393 35.81%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 14530 37393 38.85%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 15512 37393 41.48%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 16493 37393 44.1%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 17481 37393 46.74%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 18420 37393 49.26%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 19261 37393 51.5%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 20106 37393 53.76%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 21104 37393 56.43%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 22323 37393 59.69%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 27401 37393 73.27%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 28390 37393 75.92%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 29282 37393 78.3%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 30272 37393 80.95%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 31261 37393 83.6%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 32251 37393 86.24%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 33211 37393 88.81%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 34251 37393 91.59%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 35057 37393 93.75%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 35596 37393 95.19%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 36141 37393 96.65%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 36568 37393 97.79%
SQL> /
SID OPNAME TARGET_DESC SOFAR TOTALWORK PERWORK
---------- -------------------------------- -------------------------------- ---------- ---------- ------------
12 Table Scan 37190 37393 99.45%
到这个时候select * from mvtest;子句执行完毕,开始做insert into 操作.
但是从这以后Oracle还有方法可以监控insert into 的进度么?
SQL> /
no rows selected