Tuesday, September 20, 2022

Stop / Kill Datapump Job (EXPDP and IMPDP)

1. Check the datapump job status

SQL> select * from dba_datapump_jobs;
                      
OWNER_NAME JOB_NAME OPERATION JOB_MODE STATE DEGREE ATTACHED_SESSIONS DATAPUMP_SESSIONS
---------- ---------- ---------- ---------- ---------- ---
SYS SYS_EXPORT_FULL_01 EXPORT FULL NOT RUNNING 		0		0		0

2. Attach the job which need to kill

[oracle@dporadb01 dba]$ expdp \"/ as sysdba\" attach=SYS_EXPORT_FULL_01
Export: Release 12.1.0.2.0 - Production on Wed Mar 23 10:37:01 2022

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit                                                                                         Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing opt                                                                                        ions

Job: SYS_EXPORT_FULL_01
  Owner: SYS
  Operation: EXPORT
  Creator Privs: TRUE
  GUID: DAD2C6D266D0A795E0530D19020A2BD5
  Start Time: Wednesday, 23 March, 2022 10:37:02
  Mode: FULL
  Instance: finres
  Max Parallelism: 4
  Timezone: +10:00
  Timezone version: 18
  Endianness: LITTLE
  NLS character set: US7ASCII
  NLS NCHAR character set: AL16UTF16
  EXPORT Job Parameters:
  Parameter Name      Parameter Value:
     CLIENT_COMMAND        "/******** AS SYSDBA" full=y directory=DBA_DUMP_DIR d                                                                                        umpfile=expdp_ussprd_20220321_%U.dmp logfile=expdp_ussprd.log parallel=4
  State: IDLING
  Bytes Processed: 1,466,272,712
  Percent Done: 3
  Current Parallelism: 4
  Job Error Count: 0
  Dump File: /slims/exports/dba/expdp_ussprd_20220321_%u.dmp
  Dump File: /slims/exports/dba/expdp_ussprd_20220321_01.dmp
    bytes written: 2,988,707,840
  Dump File: /slims/exports/dba/expdp_ussprd_20220321_02.dmp
    bytes written: 139,264

Worker 1 Status:
  Instance ID: 1
  Instance name: finres
  Host name: dporadb01.its.utas.edu.au
  Process Name: DW00
  State: UNDEFINED
  Object Schema: SYS
  Object Name: TSDP_POLICY$
  Object Type: DATABASE_EXPORT/NORMAL_OPTIONS/TABLE
  Completed Objects: 1
  Worker Parallelism: 1

Worker 2 Status:
  Instance ID: 1
  Instance name: finres
  Host name: dporadb01.its.utas.edu.au
  Process Name: DW01
  State: UNDEFINED
  Object Schema: SYS
  Object Name: AUD$
  Object Type: DATABASE_EXPORT/NORMAL_OPTIONS/TABLE_DATA
  Completed Objects: 1
  Total Objects: 41
  Completed Rows: 3,212,545
  Completed Bytes: 2,044,985,344
  Percent Done: 6
  Worker Parallelism: 1

Worker 3 Status:
  Instance ID: 1
  Instance name: finres
  Host name: dporadb01.its.utas.edu.au
  Process Name: DW02
  State: UNDEFINED
  Object Schema: K2
  Object Name: UNIT_OFFERING_ENROL_20210401
  Object Type: DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
  Completed Objects: 7
  Total Objects: 3,241
  Completed Rows: 2,456,997
  Completed Bytes: 288,557,936
  Percent Done: 85
  Worker Parallelism: 1

3. Check the status

Export> status

Job: SYS_EXPORT_FULL_01
  Operation: EXPORT
  Mode: FULL
  State: IDLING
  Bytes Processed: 1,466,272,712
  Percent Done: 3
  Current Parallelism: 4
  Job Error Count: 0
  Dump File: /slims/exports/dba/expdp_ussprd_20220321_%u.dmp
  Dump File: /slims/exports/dba/expdp_ussprd_20220321_01.dmp
    bytes written: 2,988,707,840
  Dump File: /slims/exports/dba/expdp_ussprd_20220321_02.dmp
    bytes written: 139,264

Worker 1 Status:
  Instance ID: 1
  Instance name: finres
  Host name: dporadb01.its.utas.edu.au
  Process Name: DW00
  State: UNDEFINED
  Object Schema: SYS
  Object Name: TSDP_POLICY$
  Object Type: DATABASE_EXPORT/NORMAL_OPTIONS/TABLE
  Completed Objects: 1
  Worker Parallelism: 1

Worker 2 Status:
  Instance ID: 1
  Instance name: finres
  Host name: dporadb01.its.utas.edu.au
  Process Name: DW01
  State: UNDEFINED
  Object Schema: SYS
  Object Name: AUD$
  Object Type: DATABASE_EXPORT/NORMAL_OPTIONS/TABLE_DATA
  Completed Objects: 1
  Total Objects: 41
  Completed Rows: 3,212,545
  Completed Bytes: 2,044,985,344
  Percent Done: 6
  Worker Parallelism: 1

Worker 3 Status:
  Instance ID: 1
  Instance name: finres
  Host name: dporadb01.its.utas.edu.au
  Process Name: DW02
  State: UNDEFINED
  Object Schema: K2
  Object Name: UNIT_OFFERING_ENROL_20210401
  Object Type: DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
  Completed Objects: 7
  Total Objects: 3,241
  Completed Rows: 2,456,997
  Completed Bytes: 288,557,936
  Percent Done: 85
  Worker Parallelism: 1

4. Kill Attached job

Export> kill_JOB
Are you sure you wish to stop this job ([yes]/no): yes

5. Check the datapump job status again to verify

SQL> select * from dba_datapump_jobs;
                      
OWNER_NAME JOB_NAME OPERATION JOB_MODE STATE DEGREE ATTACHED_SESSIONS DATAPUMP_SESSIONS
---------- ---------- ---------- ---------- ---------- ---

No comments:

Post a Comment