Pages

Showing posts with label expdp. Show all posts
Showing posts with label expdp. Show all posts

Monday, January 30, 2023

expdp error "ORA-39021: Database compatibility version 19.xx.0.0.0 is not supported."

=============
Issue
=============
Error during expdp version 19.x
Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
ORA-39001: invalid argument value
ORA-39021: Database compatibility version 19.4.0.0.0 is not supported.


=============
Investigation
=============
Per Oracle technote "DataPump Reports ORA-39021: Database compatibility version 19.X.0.0.0 is not supported (Doc ID 2610939.1)"

After upgrade to 19.x, compatible parameter is increased, because RU or an RUR changed the COMPATIBLE parameter.

SQL> show parameter compatible
NAME          TYPE        VALUE
------------- ----------- ----------
compatible    string      19.4.0

This is due to bug #30828205 - EXPDP IS FAILING WITH ORA-39021 WHEN COMPATIBLE IS SET AS 19.4.0.

Data Pump uses DBMS_UTILITY.DB_VERSION() to retrieve the current local database version.
Compatibility version was raised to the level of RU installation.
So database compatibility version was raised, but datapump version was not.
Thus the error "Database compatibility version 19.4.0.0.0 is not supported".

Solution

Upgrade to  19.11.0.0.210420DBRU.
In this version this bug was fixed

Workaround
Add parameter VERSION=19.0.0 to expdp command

Tuesday, February 2, 2021

expdp is slow. AWR showing Streams AQ: enqueue block as main wait event

===============
Issue
===============
expdp is running for several hours
AWR is showing Streams AQ: enqueue blocked as main Foreground Wait Event
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 

===============
AWR Evidences
===============

Foreground Wait Events                   DB/Inst: IGT/igt  Snaps: 39049-39050
-> s  - second, ms - millisecond -    1000th of a second
-> Only events with Total Wait Time (s) >= .001 are shown
-> ordered by wait time desc, waits desc (idle events last)
-> %Timeouts: value of 0 indicates value was < .5%.  Value of null is truly 0
                                                             Avg
                                        %Time Total Wait    wait    Waits   % DB
Event                             Waits -outs   Time (s)    (ms)     /txn   time
-------------------------- ------------ ----- ---------- ------- -------- ------
Streams AQ: enqueue blocke        1,767     0      2,656    1503      0.2   95.2
db file sequential read          74,898     0          8       0      6.8     .3
log file sync                     2,564     0          2       1      0.2     .1
enq: RO - fast object reus          216     0          1       5      0.0     .0
SQL*Net message to client     2,475,101     0          1       0    224.9     .0
local write wait                    504     0          0       1      0.0     .0
library cache: mutex X            4,931     0          0       0      0.4     .0
SQL*Net more data from cli       21,140     0          0       0      1.9     .0



SQL ordered by Elapsed Time              DB/Inst: IGT/igt  Snaps: 39049-39050
-> Resources reported for PL/SQL code includes the resources used by all SQL
   statements called by the code.
-> % Total DB Time is the Elapsed Time of the SQL statement divided
   into the Total Database Time multiplied by 100
-> %Total - Elapsed Time  as a percentage of Total DB time
-> %CPU   - CPU Time      as a percentage of Elapsed Time
-> %IO    - User I/O Time as a percentage of Elapsed Time
-> Captured SQL account for    3.0% of Total DB Time (s):           2,789
-> Captured PL/SQL account for  445.8% of Total DB Time (s):           2,789

        Elapsed                  Elapsed Time
        Time (s)    Executions  per Exec (s)  %Total   %CPU    %IO    SQL Id
---------------- -------------- ------------- ------ ------ ------ -------------
         3,536.5              0           N/A  126.8     .6     .0 bja07yskmzxn1
 BEGIN SYS.KUPW$WORKER.MAIN('SYS_EXPORT_FULL_01', 'SHDAEMON', 0); END;

         3,482.5          1,769          1.97  124.9     .1     .0 8rgw5q94paqsg
Module: Data Pump Master
BEGIN sys.kupc$que_int.send(:1, :2, :3); END;

         2,660.5              0           N/A   95.4     .1     .0 a103q4nq8cdj7
 BEGIN SYS.KUPM$MCP.MAIN('SYS_EXPORT_FULL_01', 'SHDAEMON', 0, 0); END;

         2,592.6          1,718          1.51   93.0     .0     .0 87nt40c5wj7y5
Module: Data Pump Master
BEGIN sys.kupc$que_int.put_status(:1, :2, :3); END;

====================
What to check
====================
1. streams_pool_size Parameter

COL name FOR A30
COL value FOR A30
SELECT name, value 
  FROM V$PARAMETER WHERE name LIKE '%stream%';

NAME                VALUE
------------------- ------------
streams_pool_size   0

2. streams pool size Hidden Parameters

set pagesize 35
set linesize 150
col NAME format a40
col VALUE format a20
col DESCRIPTION format a60
set pause on
set pause 'Hit enter to continue'

SELECT x.ksppinm NAME, y.ksppstvl VALUE, x.ksppdesc DESCRIPTION
FROM x$ksppi x, x$ksppcv y
WHERE x.inst_id = userenv('Instance')
AND y.inst_id = userenv('Instance')
AND x.indx = y.indx
AND SUBSTR(LOWER(x.ksppinm),1,1) = '_'
AND x.ksppinm LIKE '%streams%'
ORDER BY 1;

NAME                                     VALUE                DESCRIPTION
---------------------------------------- -------------------- 
------------------------------------------------------------
__streams_pool_size                      33554432             
Actual size in bytes of streams pool
_disable_streams_diagnostics             0                    
streams diagnostics
_disable_streams_pool_auto_tuning        FALSE                
disable streams pool auto tuning
_memory_broker_shrink_streams_pool       900                  
memory broker allow policy to shrink streams pool
_streams_pool_max_size                   0                    
streams pool maximum size when auto SGA enabled

_streams_pool_size is set to 32 Mb which is too small for this big DB
 

====================
Solution
====================
Although streams_pool_size is set to zero, Oracle does not really tune streams_pool_size.
It just is using the default value of hidden parameter __streams_pool_size.

Option A - Set a high value to streams_pool_size to override Oracle default.

SQL> ALTER SYSTEM SET STREAMS_POOL_SIZE=256M SCOPE=MEMORY;
System altered.

And check results

or
ALTER SYSTEM SET STREAMS_POOL_SIZE=256M SCOPE=SPFILE;
And restart Instance.


Option B - Alter hidden parameter _disable_streams_pool_auto_tuning set value to TRUE. 
This is will disable  Oracle tuning to streams pool size.

ALTER SYSTEM SET "_disable_streams_pool_auto_tuning"=TRUE SCOPE=SPFILE;
And restart Instance.


Backup to pfile:
CREATE PFILE = '/software/oracle/112/dbs/igt_init_pfile_20210202.ora' FROM SPFILE;

File created.

!ls /software/oracle/112/dbs/igt_init_pfile_20210202.ora
/software/oracle/112/dbs/igt_init_pfile_20210202.ora

====================
Oracle Metalink #1596645:
====================
Oracle has this issue documented:
EXPDP And IMPDP Slow Performance In 11R2 and 12R1 And Waits On Streams AQ: Enqueue Blocked On Low Memory (Doc ID 1596645.1)
Version: Oracle Release 11.2.0.4 

Issue:
There is high wait for "Streams AQ: enqueue blocked on low memory"

Solution:
Increase streams_pool_size.  Say to 256M
CONNECT / as sysdba
ALTER SYSTEM SET streams_pool_size=256m SCOPE=both;

If above does not help, perform:
ALTER SYSTEM SET "_disable_streams_pool_auto_tuning"=TRUE SCOPE=spfile;
SHUTDOWN IMMEDIATE
STARTUP

If increasing streams_pool_size, you may have to increase your SGA_TARGET or MEMORY_TARGET also.
SGA_TARGET or MEMORY_TARGET should be high enough

SELECT name, value 
  FROM V$PARAMETER 
WHERE name LIKE '%target%';

NAME                           VALUE
------------------------------ ------------------------------
sga_target                     0
memory_target                  8589934592
memory_max_target              8589934592



SELECT component, 
       ROUND(current_size/1024/1024)current_size_Mb, 
       ROUND(MAX_SIZE/1024/1024)max_size_mb, 
       ROUND(USER_SPECIFIED_SIZE/1024/1024) user_def_size_mb
  FROM V$SGA_DYNAMIC_COMPONENTS;


COMPONENT               CURRENT_SIZE_MB MAX_SIZE_MB USER_DEF_SIZE_MB
----------------------- --------------- ----------- ----------------
shared pool                        2944        2944                0
large pool                          640         768                0
java pool                           384         512                0
streams pool                       1152        1152              512
DEFAULT buffer cache              21376       21504                0
KEEP buffer cache                     0           0                0
RECYCLE buffer cache                  0           0                0
DEFAULT 2K buffer cache               0           0                0
DEFAULT 4K buffer cache               0           0                0
DEFAULT 8K buffer cache               0           0                0
DEFAULT 16K buffer cache           6144        6144             6144
DEFAULT 32K buffer cache              0           0                0
Shared IO Pool                      512         512              512
Data Transfer Cache                   0           0                0
In-Memory Area                        0           0                0
ASM Buffer Cache                      0           0                0

Tuesday, October 23, 2018

expdp estimate size for exported segments

==============================
General
==============================

Getting estimation for the size of exported segments before running expdp command.

Note, that when doing estimate, no dmp file is generated.

==============================
Estimate size for export file.
==============================
Syntax for getting estimate:
expdp user/pass@orainst directory=IG_EXP_DIR LOGFILE=test_exp.log estimate=BLOCKS ESTIMATE_ONLY=Y 
or
expdp user/pass@orainst directory=IG_EXP_DIR LOGFILE=test_exp.log estimate=STATISTICS ESTIMATE_ONLY=Y 

ESTIMATE_ONLY 
A parameter that tells expdp process to skip actual export, and only to estimate the size.
Values: Y/N
Default=N

ESTIMATE
Method to estimate the size of a segment. 
Values: BLOCKS/STATISTICS
Default: BLOCKS. Number of segment blocks * block size.



==============================
The Test
==============================

Same schema was tested with expdp estimate only
A. No up to date statistics, estimate=BLOCKS
B.  No up to date statistics, estimate=STATISTICS 
C. Gather DBMS_STATS for main three tables in the system
D. Up to date statistics, estimate=BLOCKS
E. Up to date statistics, estimate=STATISTICS 

==============================
The Results
==============================
A. No up to date statistics, estimate=BLOCKS


my_user@my_server:~/workarea/ora_exp>% less test_exp.log
Copyright (c) 2003, 2007, Oracle.  All rights reserved.
;;; 
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
Starting "user"."SYS_EXPORT_SCHEMA_01":  user/********@igt directory=IG_EXP_DIR LOGFILE=test_exp.log estimate=BLOCKS ESTIMATE_ONLY=Y 
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
.  estimated "user"."IPN_SUBSCRIBER_USAGE_B"   2.187 GB
.  estimated "user"."SGA_SUBSCRIBER_SFI"       2.127 GB
.  estimated "user"."CLOVER_SUBSCRIBER_USAGE"  1.781 GB
.  estimated "user"."SGA_W_IPN_SUBSCRIBER"       608 MB
.  estimated "user"."SUBSCRIBER_USAGE_INFO"      424 MB
.  estimated "user"."TAP_TEMP"                   256 MB


B.  No up to date statistics, estimate=STATISTICS 
Export: Release 11.1.0.7.0 - 64bit Production on Tuesday, 23 October, 2018 18:06:53

Copyright (c) 2003, 2007, Oracle.  All rights reserved.
;;; 
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
Starting "user"."SYS_EXPORT_SCHEMA_01":  user/********@igt directory=IG_EXP_DIR LOGFILE=test_exp_stats.log estimate=STATISTICS ESTIMATE_ONLY=Y 
Estimate in progress using STATISTICS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
.  estimated "user"."SGA_W_IPN_SUBSCRIBER"     554.4 MB
.  estimated "user"."CLOVER_SUBSCRIBER_USAGE"  341.5 MB
.  estimated "user"."IPN_SUBSCRIBER_USAGE_B"   227.5 MB
.  estimated "user"."SUBSCRIBER_USAGE_INFO"    71.95 MB
.  estimated "user"."IPN_W_PNLS"               27.16 MB
.  estimated "user"."SGA_SUBSCRIBER_COMMENTS"  27.01 MB
.  estimated "user"."DEBUG_IPN_USAGE_VALUES"   7.867 MB
.  estimated "user"."TAP_TEMP"                 7.188 MB


C. Gather DBMS_STATS for main three tables in the system
BEGIN
DBMS_STATS.unlock_table_stats('user', 'SGA_W_IPN_SUBSCRIBER');
DBMS_STATS.gather_table_stats('user', 'SGA_W_IPN_SUBSCRIBER', estimate_percent => 100);
DBMS_STATS.lock_table_stats('user', 'SGA_W_IPN_SUBSCRIBER');
END;
/

PL/SQL procedure successfully completed.

BEGIN
DBMS_STATS.unlock_table_stats('user', 'CLOVER_SUBSCRIBER_USAGE');
DBMS_STATS.gather_table_stats('user', 'CLOVER_SUBSCRIBER_USAGE', estimate_percent => 100);
DBMS_STATS.lock_table_stats('user', 'CLOVER_SUBSCRIBER_USAGE');
END;
/

PL/SQL procedure successfully completed.

BEGIN
DBMS_STATS.unlock_table_stats('user', 'IPN_SUBSCRIBER_USAGE_B');
DBMS_STATS.gather_table_stats('user', 'IPN_SUBSCRIBER_USAGE_B', estimate_percent => 50);
DBMS_STATS.lock_table_stats('user', 'IPN_SUBSCRIBER_USAGE_B');
END;

/


PL/SQL procedure successfully completed.

D. Up to date statistics, estimate=BLOCKS
;;; 
Export: Release 11.1.0.7.0 - 64bit Production on Tuesday, 23 October, 2018 19:11:42

Copyright (c) 2003, 2007, Oracle.  All rights reserved.
;;; 
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
Starting "user"."SYS_EXPORT_SCHEMA_01":  user/********@igt directory=IG_EXP_DIR LOGFILE=test_exp_blocks_correct.log estimate=BLOCKS ESTIMATE_ONLY=Y 
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
.  estimated "user"."IPN_SUBSCRIBER_USAGE_B"   2.187 GB
.  estimated "user"."SGA_SUBSCRIBER_SFI"       2.127 GB
.  estimated "user"."CLOVER_SUBSCRIBER_USAGE"  1.781 GB
.  estimated "user"."SGA_W_IPN_SUBSCRIBER"       608 MB
.  estimated "user"."SUBSCRIBER_USAGE_INFO"      424 MB
.  estimated "user"."TAP_TEMP"                   256 MB



E. Up to date statistics, estimate=STATISTICS 
Export: Release 11.1.0.7.0 - 64bit Production on Tuesday, 23 October, 2018 18:50:41

Copyright (c) 2003, 2007, Oracle.  All rights reserved.
;;; 
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, Oracle Label Security, OLAP, Data Mining,
Oracle Database Vault and Real Application Testing options
Starting "user"."SYS_EXPORT_SCHEMA_01":  user/********@igt directory=IG_EXP_DIR LOGFILE=test_exp_stats_correct.log estimate=STATISTICS ESTIMATE_ONLY=Y 
Estimate in progress using STATISTICS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
.  estimated "user"."IPN_SUBSCRIBER_USAGE_B"   1.531 GB
.  estimated "user"."CLOVER_SUBSCRIBER_USAGE"  1.053 GB
.  estimated "user"."SGA_W_IPN_SUBSCRIBER"     448.0 MB
.  estimated "user"."SUBSCRIBER_USAGE_INFO"    71.95 MB
.  estimated "user"."IPN_W_PNLS"               27.16 MB
.  estimated "user"."SGA_SUBSCRIBER_COMMENTS"  27.01 MB
.  estimated "user"."DEBUG_IPN_USAGE_VALUES"   7.867 MB
.  estimated "user"."TAP_TEMP"                 7.188 MB


==============================
Conclusion
==============================

1. Gathering table stats has change dramatically the estimated size when using STATISTICS method.

2. STATISTICS method estimate was significantly lower than the BLOCKS estimate.


When Using Blocks Estimate:
Before statistics gathering:

.  estimated "user"."IPN_SUBSCRIBER_USAGE_B"   2.187 GB
.  estimated "user"."SGA_SUBSCRIBER_SFI"       2.127 GB
.  estimated "user"."CLOVER_SUBSCRIBER_USAGE"  1.781 GB

After statistics gathering:
.  estimated "user"."IPN_SUBSCRIBER_USAGE_B"   2.187 GB
.  estimated "user"."SGA_SUBSCRIBER_SFI"       2.127 GB
.  estimated "user"."CLOVER_SUBSCRIBER_USAGE"  1.781 GB

When Using Statistics Estimate:

Before statistics gathering:

.  estimated "user"."SGA_W_IPN_SUBSCRIBER"     554.4 MB
.  estimated "user"."CLOVER_SUBSCRIBER_USAGE"  341.5 MB
.  estimated "user"."IPN_SUBSCRIBER_USAGE_B"   227.5 MB

After statistics gathering:
.  estimated "user"."IPN_SUBSCRIBER_USAGE_B"   1.531 GB
.  estimated "user"."CLOVER_SUBSCRIBER_USAGE"  1.053 GB
.  estimated "user"."SGA_W_IPN_SUBSCRIBER"     448.0 MB


Why was STATISTICS method estimate was significantly lower than the BLOCKS estimate?
That might be due to fragmentation of the table blocks in the OLTP system.
While BLOCKS represent the actual size of the segments, the STATISTICS represent the optimal size, when segments are not fragmented.

Sunday, January 10, 2016

expdp and crontab example. Export several schemas from script

=======================================
General
=======================================
Create a crontab task, that would expdb several schemas, and then zip the generated dmp and log files.

crontab task
user@xxx.xxx.xxx.121:~/workarea/EXP_IMP>% crontab -l
0 3 * * * /starhome/iu/workarea/EXP_IMP/main_exp.sh

main script
user@xxx.xxx.xxx.121:~/workarea/EXP_IMP>% less main_exp.sh
#!/bin/bash
./export_all_db.sh
./zip_all_export_files.sh

export all schemas
user@xxx.xxx.xxx.121:~/workarea/EXP_IMP>% less export_all_db.sh
#!/bin/bash
./exp.cmd parfile=exp_tza_vodac_ipnqq.prm
./exp.cmd parfile=exp_tza_vodac_ipnqq_reports.prm
./exp.cmd parfile=exp_tza_vodac_irmqq.prm
./exp.cmd parfile=exp_tza_vodac_irmqq_reports.prm
./exp.cmd parfile=exp_tza_vodac_rptqq.prm
./exp.cmd parfile=exp_tza_vodac_sfiqq.prm
./exp.cmd parfile=exp_tza_vodac_sparx.prm
./exp.cmd parfile=exp_tza_vodac_sparx_reports.prm
exit 0

single schema expdp command
user@xxx.xxx.xxx.121:~/workarea/EXP_IMP>% less exp.cmd
expdp system/pass@igt $1

single schema expdp parameters file
user@xxx.xxx.xxx.121:~/workarea/EXP_IMP>% less exp_tza_vodac_ipnqq.prm
DIRECTORY=IG_EXP_DIR
DUMPFILE=exp_tza_vodac_ipnqq.dmp
LOGFILE=exp_tza_vodac_ipnqq.log
SCHEMAS=TZA_VODAC_IPNQQ
REUSE_DUMPFILES=YES

zip generated files
user@xxx.xxx.xxx.121:~/workarea/EXP_IMP>% less zip_all_export_files.sh
#!/bin/bash
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_ipnqq.dmp
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_ipnqq.log
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_ipnqq_reports.dmp
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_ipnqq_reports.log
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_irmqq.dmp
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_irmqq.log
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_irmqq_reports.dmp
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_irmqq_reports.log
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_rptqq.dmp
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_rptqq.log
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_sfiqq.dmp
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_sfiqq.log
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_sparx.dmp
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_sparx.log
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_sparx_reports.dmp
gzip -f /starhome/iu/workarea/ora_exp/exp_tza_vodac_sparx_reports.log

Monday, December 14, 2015

Clean up objects and impdp/expdp jobs

Export Job Possible Statuses
Export job might be in several statuses:
- running
- orphaned table level export job
- stopped
- temporary stopped

The jobs used in this example:
- Export job SCOTT.EXPDP_20051121 is a schema level export that is running
- Export job SCOTT.SYS_EXPORT_TABLE_01 is an orphaned table level export job
- Export job SCOTT.SYS_EXPORT_TABLE_02 is a table level export job that was stopped
- Export job SYSTEM.SYS_EXPORT_FULL_01 is a full database export job that is temporary stopped


Step 1. Determine in SQL*Plus which Data Pump jobs exist in the database:
%sqlplus /nolog
CONNECT / as sysdba
SET lines 200
COL owner_name FORMAT a10;
COL job_name FORMAT a20
COL state FORMAT a12
COL operation LIKE state
COL job_mode LIKE state

-- locate Data Pump jobs:

SELECT owner_name, job_name, operation, job_mode, state, attached_sessions
FROM DBA_DATAPUMP_JOBS
WHERE job_name NOT LIKE 'BIN$%'
ORDER BY 1,2;

OWNER_NAME JOB_NAME            OPERATION JOB_MODE  STATE       ATTACHED
---------- ------------------- --------- --------- ----------- --------
SCOTT      EXPDP_20051121      EXPORT    SCHEMA    EXECUTING          1
SCOTT      SYS_EXPORT_TABLE_01 EXPORT    TABLE     NOT RUNNING        0
SCOTT      SYS_EXPORT_TABLE_02 EXPORT    TABLE     NOT RUNNING        0
SYSTEM     SYS_EXPORT_FULL_01  EXPORT    FULL      NOT RUNNING        0

Step 2. Ensure that the listed jobs in DBA_DATAPUMP_JOBS are not active export/import Data Pump jobs. i.e. status should be 'NOT RUNNING'.

Step 3. Check with the job owner that the job with status 'NOT RUNNING' in dba_datapump_jobs is not an export/import Data Pump job that has been temporary stopped, but is actually a job that failed. (E.g. the full database export job by SYSTEM is not a job that failed, but was deliberately paused with STOP_JOB).

Step 4. Determine in SQL*Plus the related master tables:
-- locate Data Pump master tables:

SELECT 'DROP TABLE '||OWNER_OBJECT||';' FROM
(
SELECT OBJECTS.status, 
       OBJECTS.object_id, 
       OBJECTS.object_type, 
       OBJECTS.owner||'.'||OBJECTS.object_name OWNER_OBJECT
  FROM DBA_OBJECTS OBJECTS, 
       DBA_DATAPUMP_JOBS JOBS
 WHERE OBJECTS.owner=JOBS.owner_name 
   AND OBJECTS.object_name=JOBS.job_name
   AND JOBS.job_name NOT LIKE 'BIN$%' 
ORDER BY 4,2
);


STATUS   OBJECT_ID OBJECT_TYPE  OWNER.OBJECT
------- ---------- ------------ -------------------------
VALID        85283 TABLE        SCOTT.EXPDP_20051121
VALID        85215 TABLE        SCOTT.SYS_EXPORT_TABLE_02
VALID        85162 TABLE        SYSTEM.SYS_EXPORT_FULL_01

Step 5. For jobs that were stopped in the past and won't be restarted anymore, delete the master table. E.g.:
DROP TABLE SCOTT.EXPDP_20051121;
DROP TABLE SCOTT.SYS_EXPORT_TABLE_02;
DROP TABLE SYSTEM.SYS_EXPORT_FULL_01;

-- For systems with recycle bin additionally run:
PURGE DBA_RECYCLEBIN;

Step 6. Re-run the query on DBA_DATAPUMP_JOBS and DBA_OBJECTS (step 1 and 4).
If there are still jobs listed in DBA_DATAPUMP_JOBS, and these jobs do not have a master table anymore, cleanup the job while connected as the job owner. E.g.:

CONNECT scott/tiger
SET serveroutput on
SET lines 100

DECLARE
   h1 NUMBER;
BEGIN
   h1 := DBMS_DATAPUMP.ATTACH('SYS_EXPORT_TABLE_01','SCOTT');
   DBMS_DATAPUMP.STOP_JOB (h1);
END;
/

Note that after the call to the STOP_JOB procedure, it may take some time for the job to be removed. Query the view USER_DATAPUMP_JOBS to check whether the job has been removed:

SELECT * FROM USER_DATAPUMP_JOBS;

Step 7. Confirm that the job has been removed:
CONNECT / as sysdba
SET lines 200 
COL owner_name FORMAT a10; 
COL job_name FORMAT a20 
COL state FORMAT a12 
COL operation LIKE state 
COL job_mode LIKE state 

-- locate Data Pump jobs: 

SELECT owner_name, job_name, operation, job_mode, state, attached_sessions 
FROM DBA_DATAPUMP_JOBS 
WHERE job_name NOT LIKE 'BIN$%' 
ORDER BY 1,2; 

OWNER_NAME JOB_NAME            OPERATION JOB_MODE  STATE       ATTACHED
---------- ------------------- --------- --------- ----------- --------
SCOTT      EXPDP_20051121      EXPORT    SCHEMA    EXECUTING          1
SYSTEM     SYS_EXPORT_FULL_01  EXPORT    FULL      NOT RUNNING        0

-- locate Data Pump master tables:
SELECT OBJECTS.status, 
       OBJECTS.object_id, 
       OBJECTS.object_type, 
       OBJECTS.owner||'.'||OBJECTS.object_name "OWNER.OBJECT"
  FROM DBA_OBJECTS OBJECTS, 
       DBA_DATAPUMP_JOBS JOBS
 WHERE OBJECTS.owner=JOBS.owner_name 
   AND OBJECTS.object_name=JOBS.job_name
   AND JOBS.job_name NOT LIKE 'BIN$%' 
ORDER BY 4,2;

STATUS   OBJECT_ID OBJECT_TYPE  OWNER.OBJECT
------- ---------- ------------ -------------------------
VALID        85283 TABLE        SCOTT.EXPDP_20051121
VALID        85162 TABLE        SYSTEM.SYS_EXPORT_FULL_01


Remarks:
1. Orphaned Data Pump jobs do not have an impact on new Data Pump jobs.
The view DBA_DATAPUMP_JOBS is a view, based on GV$DATAPUMP_JOB, OBJ$, COM$, and USER$.
The view shows the Data Pump jobs that are still running, or jobs for which the master table was kept in the database, or in case of an abnormal end of the Data Pump job (the orphaned job).
If a new Data Pump job is started, a new entry will be created, which has no relation to the old Data Pump jobs.

2. When starting the new Data Pump job and using a system generated name, we check the names of existing Data Pump jobs in the DBA_DATAPUMP_JOBS in order to obtain a unique new system generated jobname. Naturally, there needs to be enough free space for the new master table to be created in the schema that started the new Data Pump job.

3. A Data Pump job is not the same as a job that is defined with DBMS_JOBS.
Jobs created with DBMS_JOBS use there own processes.
Data Pump jobs use a master process and worker process(es).
In case a Data Pump still is temporary stopped (STOP_JOB while in interactive command mode), the Data Pump job still exists in the database (status: NOT RUNNING), while the master and worker process(es) are stopped and do not exist anymore. The client can attach to the job at a later time, and continue the job execution (START_JOB).

4. The possibility of corruption when the master table of an active Data Pump job is deleted, depends on the Data Pump job.

4.a. If the job is an export job, corruption is unlikely as the drop of the master table will only cause the Data Pump master and worker processes to abort. This situation is similar to aborting an export of the original export client.

4.b. If the job is an import job then the situation is different. When dropping the master table, the Data Pump worker and master processes will abort. This will probably lead to an incomplete import: e.g. not all table data was imported, and/or table was imported incomplete, and indexes, views, etc. are missing. This situation is similar to aborting an import of the original import client.

The drop of the master table itself, does not lead to any data dictionary corruption. If you keep the master table after the job completes (using the undocumented parameter: KEEP_MASTER=Y), then a drop of the master table afterwards, will not cause any corruption.