How to manage lost Datapump jobs
We’re running an export (full, for example) and that takes a very long time but then our connection to the server is closed for some reason. It can be a server policy or it can be that we did it by mistake but my most common reason is just loosing the network connection between my client and the server.
In this post we will look at the solution given to us by the datapump processes and understand how the fact that we’re using data pump jobs, actually makes those issues very simple to solve.
1-Finding the Job name :
Edit the expdb or impdb log file to get out the job name:
Export: Release 11.2.0.4.0 - Production on Thu MAI 17 11:12:37 2018
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "AHMEDENG"."SYS_EXPORT_FULL_01": AHMEDENG/******** full=y directory=DATA_PUMP_DIR dumpfile=AHMEDENG.dmp logfile=AHMEDENG.log
In this case, the name job is "SYS_EXPORT_FULL_01".
we can also use the sqlplus prompt to extract the job name by exécuting the queriy below:
SQL>Select owner_name, job_name, operation, job_mode, state FROM dba_datapump_jobs;
OWNER_NAME JOB_NAME OPERATION JOB_MODE STATE
AHMEDENG SYS_EXPORT_FULL_01 EXPORT FULL EXECUTING
Export: Release 11.2.0.4.0 - Production on Thu Feb 19 11:19:20 2015Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.Password:Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit ProductionWith the Partitioning, OLAP, Data Mining and Real Application Testing optionsJob: SYS_EXPORT_FULL_01Owner: AHMEDENGOperation: EXPORTCreator Privs: TRUEGUID: 0F6E661235961287E0530100007FB4DAStart Time: Thursday, 17 Mai, 2018 17:56:03Mode: FULLInstance: orcldgMax Parallelism: 1EXPORT Job Parameters:Parameter Name Parameter Value:CLIENT_COMMAND AHMEDENG/******** full=y directory=DATA_PUMP_DIR dumpfile=AHMEDENG.dmp logfile=AHMEDENG.logState: EXECUTINGBytes Processed: 0Current Parallelism: 1Job Error Count: 0Dump File: /u01/app/oracle/product/11.2.0/dbhome_11204/rdbms/log/AHMEDENG.dmp bytes written: 4,096Worker 1 Status:Process Name: DW00State: EXECUTINGObject Schema: SYSMANObject Name: EM_TARGETObject Type: DATABASE_EXPORT/SCHEMA/PACKAGE_BODIES/PACKAGE/PACKAGE_BODYCompleted Objects: 76Worker Parallelism: 1Export>At this point we can make several commands: changing the original command to use parallel process, we can add file dump files, investigate the current state, cease the export process or even reconnecting the running client interface.Export> help------------------------------------------------------------------------------The following commands are valid while in interactive mode.Note: abbreviations are allowed.ADD_FILEAdd dumpfile to dumpfile set.CONTINUE_CLIENTReturn to logging mode. Job will be restarted if idle.EXIT_CLIENTQuit client session and leave job running.FILESIZEDefault filesize (bytes) for subsequent ADD_FILE commands.HELPSummarize interactive commands.KILL_JOBDetach and delete job.PARALLELChange the number of active workers for current job.REUSE_DUMPFILESOverwrite destination dump file if it exists [N].START_JOBStart or resume current job.Valid keyword values are: SKIP_CURRENT.STATUSFrequency (secs) job status is to be monitored wherethe default [0] will show new status when available.STOP_JOBOrderly shutdown of job execution and exits the client.Valid keyword values are: IMMEDIATE.Export> killAre you sure you wish to stop this job ([yes]/no): y----------- --------------------- ---------- -------------- -------------
AHMEDENG SYS_EXPORT_FULL_01 EXPORT FULL NOT RUNNING
Export: Release 11.2.0.4.0 - Production on Thu Feb 19 11:33:06 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Password:
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Job: SYS_EXPORT_FULL_01
Owner: AHMEDENG
Operation: EXPORT
Creator Privs: TRUE
GUID: 0F6E8EA07E7A1310E0530100007F8CBB
Start Time: Thursday, 19 February, 2015 11:32:17
Mode: FULL
Instance: orcldg
Max Parallelism: 1
EXPORT Job Parameters:
Parameter Name Parameter Value:
CLIENT_COMMAND AHMEDENG/******** full=y directory=DATA_PUMP_DIR dumpfile=AHMEDENG.dmp logfile=AHMEDENG.log
State: IDLING
Bytes Processed: 0
Current Parallelism: 1
Job Error Count: 0
Dump File: /u01/app/oracle/product/11.2.0/dbhome_11204/rdbms/log/AHMEDENG.dmp bytes written: 4,096
Worker 1 Status:
Process Name: DW00
State: UNDEFINED
Export> startExport> statusJob: SYS_EXPORT_FULL_01Operation: EXPORTMode: FULLState: EXECUTINGBytes Processed: 0Current Parallelism: 1Job Error Count: 0Dump File: /u01/app/oracle/product/11.2.0/dbhome_11204/rdbms/log/AHMEDENG.dmp bytes written: 94,208Worker 1 Status:Process Name: DW00State: EXECUTINGExport>Import> help------------------------------------------------------------------------------The following commands are valid while in interactive mode.Note: abbreviations are allowed.CONTINUE_CLIENTReturn to logging mode. Job will be restarted if idle.EXIT_CLIENTQuit client session and leave job running.HELPSummarize interactive commands.KILL_JOBDetach and delete job.PARALLELChange the number of active workers for current job.START_JOBStart or resume current job.Valid keywords are: SKIP_CURRENT.STATUSFrequency (secs) job status is to be monitored wherethe default [0] will show new status when available.STOP_JOBOrderly shutdown of job execution and exits the client.Valid keywords are: IMMEDIATE.Import> statJob: SYS_IMPORT_SCHEMA_01 Operation: IMPORT Mode: SCHEMA State: EXECUTING Bytes Processed: 0 Current Parallelism: 1 Job Error Count: 0 Dump File: /u01/app/oracle/product/11.2.0/dbhome_11204/rdbms/log/AHMEDENG.dmpWorker 1 Status: Process Name: DW00 State: EXECUTING Object Schema: AHMEDENG1 Object Name: MGMT_METRIC_DETAILS_ARRAY Object Type: DATABASE_EXPORT/SCHEMA/TYPE/TYPE_SPEC Completed Objects: 312 Worker Parallelism: 1