imp工具命令详解

来源:互联网 发布:电子相册视频软件 编辑:程序博客网 时间:2024/04/27 21:48

1 命令格式

1.1 命令格式

通过输入imp命令和您的用户名/口令, 导出

例如: imp scott/tiger

1.2 关键字格式

格式: imp keyword=value keyword=(value1,value2,...,valueN)

例如: imp scott/tiger grant=y tables=(emp, dept, mgr) tables=(t1:p1, t1:p2), 如果t1是分区表

2 命令关键字

userid 必须是命令行中的第一个参数。

 

关键字

说明(默认值)

关键字

说明(默认值)

userid

用户名/口令

full

导入整个文件 (n)

fromuser

所有者用户名列表

touser

用户名列表

file

输入文件(expdat.dmp)

log

屏幕输出的日志文件

tables

表名列表

rows

导入数据行(y)

constraints

导入的约束条件(y)

indexes

导入索引(y)

grants

导入权限(y)

 

 

buffer

数据缓冲区大小,单位字节

只有常规导出时生效

recordlength

io 记录的长度

parfile

参数文件名

statistics

指定当导入导出文件时生成优化统计信息的类型(默认estimate; compute, none

show

只列出文件内容(n)

ignore

忽略创建错误(n)

commit

提交数组插入(n)

inctype

增量导出类型

 

关键字

说明

feedback

x 行显示进度(0)

filesize

指定存储文件的最大尺寸,如果不指定则所有对象和数据会放到一个导出文件中

indexfile

指定生成存放索引建立语句的文件名称

resumable

指定是否要激活空间继续分配特征(n)

resumable_name

指定错误被修改的最大时间间隔(默认7200)

resumable_timeout

resumable 的等待时间

destroy

指定在导入时是否要覆盖已存在的数据文件(n)

skip_unusable_indexes

跳过不可用索引的维护(n)

toid_novalidate

跳过指定类型ID的验证

compile

指定导入包、过程、函数时是否要进行编译(y)

streams_configuration

导入流的一般元数据(y)

streams_instantiation

导入流实例化元数据(y)

 

下列关键字仅用于可传输的表空间

关键字

说明

transport_tablespace

导入可传输的表空间元数据 (N)

tablespaces

指定导入特定表空间上的所有对象

datafiles

指定要搬移到目标数据库的数据文件列表(transport_tablespace=y)

tts_owners

拥有可传输表空间集中数据的用户

2.1 1

parm.txt的内容:

tables=dept,emp

indexes=n

constraints=n

grants=n

file=a.dmp

imp scott/tiger parfile=parm.txt

2.2 2

imp scott/tiger tables=emp file=a.dmp indexfile=index.sql

2.3 3

imp system/manager tables=scott.emp file=a.dmp resumable=y

2.4 4

imp system/manager tables=scott.emp file=a.dmp resumable=y resumable_name=whl

2.5 5

imp system/manager tablespaces=user01 file=a.dmp full=y