@@header

/*
*
*  Author        : Vishal Gupta
*  Purpose       : Display DataPump  Jobs
*  Compatibility : 
*  Parameters    : NONE
*
*  Revision History:
*  ===================
*  Date       Author        Description
*  ---------  ------------  --------------------------------------------------------
*  23-Dec-15  Vishal Gupta  Combined owner and job_name as owner.job_name in output
*  20-JUN-14  Vishal Gupta  Created
*
*/


PROMPT **************************************************
PROMPT * DataPump  Jobs
PROMPT **************************************************

COLUMN owner_name          HEADING  "Owner"              FORMAT a20
COLUMN job_name            HEADING  "JobName"            FORMAT a40
COLUMN operation           HEADING  "Operation"          FORMAT a10 TRUNCATE
COLUMN state               HEADING  "State"              FORMAT a15 TRUNCATE
COLUMN job_mode            HEADING  "Mode"               FORMAT a15 TRUNCATE
COLUMN degree              HEADING  "Degree"             FORMAT 999
COLUMN attached_sessions   HEADING  "Attached|Sessions"  FORMAT 9999
COLUMN datapump_sessions   HEADING  "DataPump|Sessions"  FORMAT 9999
COLUMN created             HEADING  "Created"            FORMAT a18 

SELECT j.owner_name || '.' || j.job_name job_name
     , j.operation
     , j.job_mode
     , j.state
     , j.degree
     , j.attached_sessions
     , j.datapump_sessions
     , TO_CHAR(o.created,'DD-MON-YY HH24:MI:SS') created
  FROM dba_datapump_jobs j
       LEFT OUTER JOIN dba_objects o ON o.owner = j.owner_name 
                                    AND o.object_name = j.job_name 
                                    AND o.object_type = 'TABLE'
ORDER BY j.owner_name
       , j.operation
       , j.job_mode
       , o.created desc       
;  

@@footer
