Wednesday, November 13, 2013

ORA-31634: job already exists

ORA-31634: job already exists

Error : Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options
ORA-31634: job already exists
ORA-31664: unable to construct unique job name when defaulted

tail: cannot open input
Compressing exportfile..

Solution :
1. select owner_name,job_name,operation,state from DBA_DATAPUMP_JOBS ;
2. select owner_name,job_name,operation,state from DBA_DATAPUMP_JOBS where owner_name=’SCHEMA_NAME’; and output like
SCHEMA_NAME SYS_EXPORT_SCHEMA_60 EXPORT NOT RUNNING
SCHEMA_NAME SYS_EXPORT_SCHEMA_03 EXPORT NOT RUNNING
3. If output count of the above query Is 99 then
4. Either change the script and execute it using user "SYSTEM" instead of provided SCHEMA_NAME or connect to the provided schema and drop table SYS_EXPORT_SCHEMA_01; to drop table SYS_EXPORT_SCHEMA_99; (use the below script
5. select 'DROP TABLE '||owner||'.'||table_name||';'
from dba_tables
where table_name like '%SYS%EXPORT%';

'DROPTABLE'||OWNER||'.'||TABLE_NAME||';'
-------------------------------------------------------------------------
DROP TABLE TRINTA.SYS_EXPORT_FULL_01;

6. Re-execute the script.

The reason was : if the enteries in DBA_DATAPUMP_JOBS table become equals to 99 for any particular schema then "ORA-31634 : job already exists" occurs so make sure the entries must be below 99 in order to avoid above error .
How to find out failed jobs:


select job, what from dba_jobs where broken = 'Y' or failures > 0;


No comments: