1.在前面已经说过了expdp和impd的部分命令,当我们执行expdp和impdp之后,怎样可以进入任务任务中查看执行的进度呢?
第一种方法:
可以用Crtl+c 命令进入到Export> 交互式命令行中,使用Crtl+c 不会影响数据库导出,这时我们我们可以用 Export > help 查看里面的帮助信息。比如:有status, start_jobs,stop_job,stop_job=immediate等等
第二种方法:
可以使用参数 attach,该参数语法:
ATTACH=[schema_name.]job_name Schema_name用户名,job_name任务名
Expdp scott/tiger ATTACH=scott.export_job
2.查看数据泵进程情况
看一下这两个视图
set linesize 1000; SELECT * FROM DBA_DATAPUMP_JOBS;
SELECT * FROM DBA_DATAPUMP_SESSIONS;
3.怎样彻底结束expdp进程
1.查看 ps -ef|grep expdp进程是否存在,若存在就给删除
2.查看上面的两个视图中是否有正在执行的任务,如果有,先用attach参数进入到要关闭的任务中,然后执行stop_jobs=immediate命令结束
3.如果会话中还存在执行的任务,可以如下进行删除
SYS@orclasm > SELECT * FROM DBA_DATAPUMP_SESSIONS; OWNER_NAME JOB_NAME INST_ID SADDR SESSION_TYPE ---------- ------------------------- ---------- ---------------- -------------- LHR SYS_EXPORT_SCHEMA_04 1 00000000A8B71D98 MASTER LHR SYS_EXPORT_SCHEMA_04 1 00000000AB98AFC8 WORKER SYS@orclasm > DROP TABLE LHR.SYS_EXPORT_SCHEMA_04 PURGE; Table dropped. SYS@orclasm > SELECT * FROM DBA_DATAPUMP_SESSIONS; no rows selected SYS@orclasm > SELECT * FROM DBA_DATAPUMP_JOBS; no rows selected
4.使用相同的办法也删除从视图DBA_DATAPUMP_JOBS中查询出来的表,直到这两个视图无记录
5.结束完了之后,要删除dmp文件,否则再次导入时会报错。。。
4.这里是常用的删除进程命令
---------------------------如何彻底停止expdp进程? SET LINE 9999 COL OWNER_NAME FOR A10 COL JOB_NAME FOR A25 COL OPERATION FOR A10 COL JOB_MODE FOR A10 COL STATE FOR A15 COL OSUSER FOR A10 COL "DEGREE|ATTACHED|DATAPUMP" FOR A25 COL SESSION_INFO FOR A20 SELECT DS.INST_ID, DJ.OWNER_NAME, DJ.JOB_NAME, TRIM(DJ.OPERATION) OPERATION, TRIM(DJ.JOB_MODE) JOB_MODE, DJ.STATE, DJ.DEGREE || ',' || DJ.ATTACHED_SESSIONS || ',' ||DJ.DATAPUMP_SESSIONS "DEGREE|ATTACHED|DATAPUMP", DS.SESSION_TYPE, S.OSUSER , (SELECT S.SID || ',' || S.SERIAL# || ',' || P.SPID FROM GV$PROCESS P WHERE S.PADDR = P.ADDR AND S.INST_ID = P.INST_ID) SESSION_INFO FROM DBA_DATAPUMP_JOBS DJ --GV$DATAPUMP_JOB FULL OUTER JOIN DBA_DATAPUMP_SESSIONS DS --GV$DATAPUMP_SESSION ON (DJ.JOB_NAME = DS.JOB_NAME AND DJ.OWNER_NAME = DS.OWNER_NAME) LEFT OUTER JOIN GV$SESSION S ON (S.SADDR = DS.SADDR AND DS.INST_ID = S.INST_ID) ORDER BY DJ.OWNER_NAME, DJ.JOB_NAME; select * from GV$DATAPUMP_SESSION; select * from GV$datapump_jobs; select * From dba_datapump_jobs;
转载:https://blog.csdn.net/lihuarongaini/article/details/101298839