@@header

/*
*
*  Author     : Vishal Gupta
*  Purpose    : Display RMAN Session running
*  Parameters : 
*
*  Revision History:
*  ===================
*  Date       Author        Description
*  ---------  ------------  -----------------------------------------
*  19-MAY-14  Vishal Gupta  Created
*
*/


PROMPT *******************************
PROMPT *  RMAN Running Sessions
PROMPT *******************************

COLUMN inst_id                             HEADING "INST_ID"            FORMAT 99999
COLUMN sid                                 HEADING "SID"             FORMAT 999999
COLUMN status                              HEADING "Status"             FORMAT a12
COLUMN output_device_type                  HEADING "Output|Device|Type" FORMAT a10
COLUMN start_time                          HEADING "StartTime"          FORMAT a20
COLUMN end_time                            HEADING "EndTime"            FORMAT a20
COLUMN operation                           HEADING "Operation"          FORMAT a10
COLUMN mbytes_processed                    HEADING "MB Processed"       FORMAT 99,999,999     JUSTIFY RIGHT


SELECT r.inst_id
     , r.sid
     , r.status
     , TO_CHAR(r.start_time,'DD-MON-YY HH24:MI:SS') start_time
     , TO_CHAR(r.end_time,'DD-MON-YY HH24:MI:SS') end_time
     , r.row_level
     , r.row_type
     , r.operation
     , r.mbytes_processed
FROM gv$rman_status_current r
ORDER BY r.start_time  
;



@@footer