oracle expdp後臺終止或者暫停

wanglinghua0907發表於2024-01-09

1.先匯出

expdp system/oracle directory=mydata dumpfile=wlh.dmp logfile=wlh.log full=y

Ctrl+c 掐斷匯出,發現並未真正斷開expdp


2.檢視會發現正在執行

SQL>  select job_name,state from dba_datapump_jobs;

JOB_NAME                       STATE

------------------------------ ------------------------------

SYS_EXPORT_FULL_01             EXECUTING

SYS_IMPORT_FULL_01             NOT RUNNING


3.進入這個後臺

expdp \'/ as sysdba\'  attach=SYS_EXPORT_FULL_01


4.操作

暫停

Export>stop_job=immediate 

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

刪除

Export>kill_job (會順便刪除dmp檔案的)

這句也可以刪除

SQL>drop table system.SYS_EXPORT_FULL_02 purge;


拼接好的刪除語句

select 'drop table ' || owner_name || '.' || job_name || ';' from dba_datapump_jobs where state = 'NOT RUNNING';


select 'drop table ' || owner_name || '.' || job_name || ';' from dba_datapump_jobs where state = 'EXECUTING';


來自 “ ITPUB部落格 ” ,連結:https://blog.itpub.net/69980685/viewspace-3003168/,如需轉載,請註明出處,否則將追究法律責任。

相關文章