denrepo

OracleSessions

Long-running operations in progress

Full scans, sorts, RMAN and index builds that Oracle tracks in V$SESSION_LONGOPS, with percent done and estimated seconds remaining.

Not yet verified. How scripts are tested

ora-longops.sql
1CLEAR COLUMNS2SET LINESIZE 180 PAGESIZE 100 TRIMOUT ON TAB OFF3COLUMN sid_serial HEADING "SID,SERIAL#" FORMAT A144COLUMN opname     HEADING "OPERATION"   FORMAT A30 TRUNCATE5COLUMN target     FORMAT A35 TRUNCATE6COLUMN pct_done   HEADING "DONE %"      FORMAT 990.97COLUMN elapsed_s  HEADING "ELAPSED S"   FORMAT 999,9908COLUMN remain_s   HEADING "REMAINING S" FORMAT 999,9909COLUMN sql_id     FORMAT A1310 11SELECT sid || ',' || serial# AS sid_serial,12       opname, target,13       ROUND(100 * sofar / NULLIF(totalwork, 0), 1) AS pct_done,14       elapsed_seconds AS elapsed_s,15       time_remaining AS remain_s,16       sql_id17FROM v$session_longops18WHERE sofar < totalwork19ORDER BY start_time;

Save it as ora-longops.sql and run it with SQL> @ora-longops.

Open in denrepo

Part of these runbooks

More Oracle scripts: Sessions