Erro
ORA-31634: job already exists
ORA-31664: unable to construct unique job name when defaulted
Ver registros
1 2 3 4 5 6 7 |
SQL> col OWNER_NAME format a15 col OPERATION format a20 col JOB_MODE format a20 col STATE format a15 col OWNER_NAME format a10 col JOB_NAME format a25 SELECT owner_name, job_name, operation, job_mode, state FROM dba_datapump_jobs; |
Solução
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
SQL> DECLARE CURSOR CUR_TESTE IS SELECT o.status, o.object_id, o.object_type, o.owner||'.'||object_name "OWNER_OBJECT" FROM dba_objects o, dba_datapump_jobs j WHERE o.owner=j.owner_name AND o.object_name=j.job_name AND j.job_name NOT LIKE 'BIN$%' ORDER BY 4,2; BEGIN -- RECUPERANDO O CURSOR CUR_TESTE, E INSERINDO EM UM FOR FOR TESTE_RECORD IN CUR_TESTE LOOP -- BLOQUEANDO USUÁRIOS EXECUTE IMMEDIATE 'DROP TABLE '|| TESTE_RECORD.OWNER_OBJECT || ' PURGE'; END LOOP; END; / |
Parabéns!
Excelente profissional!