正确停止Oracle expdp/impdp 操作方法

发布时间 2023-04-03 16:45:08作者: 啊内哈赛哟

平时导入导出时由于命令错误想终止操作,于是就按ctr + c 中进入export交互界面,然后exit退出然后查
看操作系统进程发现没有expdp进程了以为就是停掉了,但发现导出的dmp文件还在一直增加,其实任务
并没有停止。
正确方法
1.查看视图dba_datapump_jobs
select job_name,state from dba_datapump_jobs;

发现任务确认还在执行
2.正确停止expdp导出任务使用stop_job
[oracle@database ~]$ expdp qnz65/Qnz#hzqdh0571@racdb attach=SYS_EXPORT_SCHEMA_08
Export: Release 11.2.0.4.0 - Production on Mon Jan 26 10:31:42 2015
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
Job: SYS_EXPORT_SCHEMA_02
Owner: SYS
…..
Total Objects: 1,400
Worker Parallelism: 1
3、Export> stop_job=immediate
Are you sure you wish to stop this job ([yes]/no): yes
[oracle@database ~]$
在此查看视图dba_datapump_jobs

发现SYS_EXPORT_SCHEMA_02已经是not runing状态了