***********************************************************************
* Description: SQL for Querying Long Operation Running within Database
* Compatiablity: RDBMS 10g, 11g, 12c
* Date: 23:14 PM EST, 01/15/2017
***********************************************************************



<1> SQL for querying long operation:
    |
    |__ SQL> set linesize 200;
             col username format a20;
             col OPNAME format a40;
             col UNITS format a20;
             select sid, serial#, username, opname, sofar, totalwork, units, (sofar/totalwork)*100 from v$session_longops where username is not null and sofar < totalwork;
			 
                                                                                 
                  SID        SERIAL#    USERNAME             OPNAME                       SOFAR  TOTALWORK UNITS                (SOFAR/TOTALWORK)*100
                  ---------- ---------- -------------------- ----------------------- ---------- ---------- -------------------- ---------------------
                  100        28347      APP_COLLECTION       Table Scan                   20871      77792 Blocks                          26.8292369

			
			
<2> Reference: 
    |
    |__ https://docs.oracle.com/cd/B19306_01/server.102/b14237/dynviews_2092.htm#REFRN30227
    |
    |__ http://www.dba-oracle.com/t_v_dollar_session_longops.htm