Nov 13, 2012

Clearing failed datapump jobs


Check the jobs which are not running, query as below.

SQL> select * from dba_datapump_jobs;

OWNER_NAME     JOB_NAME                       OPERATION  JOB_MODE   STATE               DEGREE ATTACHED_SESSIONS DATAPUMP_SESSIONS
-------------- ------------------------------ ---------- ---------- --------------- ---------- ----------------- -----------------
USER1          SYS_IMPORT_FULL_02             IMPORT     FULL       NOT RUNNING              0                 0                 0
USER1          SYS_IMPORT_FULL_03             IMPORT     FULL       NOT RUNNING              0                 0                 0
USER1          SYS_IMPORT_FULL_04             IMPORT     FULL       NOT RUNNING              0                 0                 0
SCOTT          SYS_IMPORT_FULL_01             IMPORT     FULL       NOT RUNNING              0                 0                 0
USER1          SYS_IMPORT_FULL_01             IMPORT     FULL       NOT RUNNING              0                 0                 0
USER1          SYS_IMPORT_SCHEMA_01           IMPORT     SCHEMA     NOT RUNNING              0                 0                 0



Identify the master_tables which are created for these jobs, query as below.

SELECT do.status, do.object_id, do.object_type,
       do.owner||'.'||object_name "OBJECT_NAME"
  FROM dba_objects do, dba_datapump_jobs dj
 WHERE do.owner=dj.owner_name AND do.object_name=dj.job_name;

   AND j.job_name NOT LIKE 'BIN$%' ORDER BY 4,2;


STATUS   OBJECT_ID OBJECT_TYPE         OWNER.OBJECT
------- ---------- ------------------- --------------------------------------------------
VALID       116625 TABLE               USER1.SYS_IMPORT_FULL_01
VALID       118731 TABLE               USER1.SYS_IMPORT_FULL_02
VALID       126869 TABLE               USER1.SYS_IMPORT_FULL_03
VALID       131992 TABLE               USER1.SYS_IMPORT_FULL_04
VALID       137115 TABLE               USER1.SYS_IMPORT_SCHEMA_01
VALID       121746 TABLE               SCOTT.SYS_IMPORT_FULL_01


drop these objects to clean the failed/ not running jobs


crosscheck by querying (select * from dba_datapump_jobs;) again, to find no jobs in state of "NOT RUNNING"

No comments:

Post a Comment