(一)交互模式使用
注:虽然可以直接使用screen来替代的,但status命令可以看到更多信息
下面以expdp为例, impdp完全一样只是少了add_file以及filesize命令
ATTACH [=[schema_name.]job_name]
$ expdp ltxt/ltxt attach=LTXT.SYS_IMPORT_FULL_04
用于进义交互界面,如果不指定且当前schema只有一个job, 而且此job还必须是运行的,则连接此job
如果连接一个stopped job,则必须指定job name, 通过dba_datapump_jobs查看
You cannot attach to a job in another schema unless it is already running.
If the dump file set or master table for the job have been deleted, then the attach operation will fail.
Altering the master table in any way will lead to unpredictable results.
add_file=[directory_object:]file_name[,...]
仅用于expdp
Export> ADD_FILE=hr2.dmp, dpump_dir2:hr3.dmp
Export>add_file=expdat_%U.dmp
continue_client
Changes the Export mode from interactive-command mode to logging mode.
即切到前台运行,如果job处于stopped状态会被start
Export> continue_client
exit_client
Stops the export client session, exits Export, and discontinues logging to the terminal, but leaves the current job running. 即切到后台运行
Export> exit_client
FILESIZE=integer[B默认| KB | MB | GB | TB]
重定义filesize大小,设置为0则无限制, 仅用于expdp
Export> FILESIZE=100MB
Help
Export> HELP
kill_job
删除任务,只有expdp时有,无法被重启动, kill_job后会删除master table及dumpfile, 日志会保留
Export> kill_job
PARALLEL=integer
Export> parallel=4
增加或减小并行度,增加立刻生效,减少要等当前work process完成才行
An increase takes effect immediately if there are sufficient files and resources. A decrease does not take effect until an existing process finishes its current task. If the value is decreased, then workers are idled but not deleted until the job exits.
START_JOB
Export> start_job
STATUS[=integer]
不仅能看状态还可以重设置日志状态的显示间隔
You have the option of specifying how frequently, in seconds, this status should be displayed in logging mode. If no value is entered or if the default value of 0 is used, then the periodic status display is turned off and status is displayed only once.
This status information is written only to your standard output device, not to the log file (even if one is in effect).
STOP_JOB[=IMMEDIATE]
Export> stop_job
停止当前正在运行的任务,可以通过start_job重启
Stops the current job either immediately or after an orderly shutdown
An orderly shutdown stops the job after worker processes have finished their current tasks.
There is no risk of corruption or data loss when you specify STOP_JOB=IMMEDIATE. However, some tasks that were incomplete at the time of shutdown may have to be redone at restart time.
- 查看job状态
- 使用交互模式的status
- 通过日志logfile
- 通过datapump视图
DBA_DATAPUMP_JOBS --正在运行的数据泵作业
DBA_DATAPUMP_SESSION --使用导入导出作业中的用户会话
- 通过V$SESSION_LONGOPS --数据泵进度(in megabytes of table data transferred)
USERNAME - job owner
OPNAME - job name
TARGET_DESC - job operation
SOFAR - megabytes transferred thus far during the job
TOTALWORK - estimated number of megabytes in the job
UNITS - megabytes (MB)
MESSAGE - a formatted status message