ORACLE 数据库的导入导出

1、全数据库的导入与导出

exp username/password full=y file=crazyiter.dmp grants=y rows=y
imp username/password full=y ignore=y file=crazyiter.dmp grants=y

2、exp与imp的具体用法

exp username/password@crazyiter full=y file=crazyiter.dmp grants=y rows=y
imp username/password full=y ignore=y file=crazyiter.dmp grants=y

———— 用户级————————————————————————————————————–
1.把(用户)数据库导出到 C:\db_backup.dmp
exp 用户名/密码 file=C:\db_backup.dmp
2.通过文件xxxx.dmp 把数据库导入
imp 用户名/密码 fromuser=原始用户touser=现在的用户 file=xxxx.dmp ignore=y
注:
1、fromuser为所导出数据的owner。
2、exp时owner与tables不能同时使用,相互冲突。
3、imp时可以同时指定fromuser 和tables参数。
3.将数据库中system用户与sys用户的表导出
exp 用户名/密码@数据库 file=d:\daochu.dmp owner=(system,sys) :前提该用户的权限比system,sys大.

———— 表级 —————————————————————————————————————-
4.将某特定表导出
exp 用户名/密码@数据库 file=d:\daochu.dmp tables=(system,sys)
5 将d:\daochu.dmp中的表table1 导入
imp user/pass@database file=d:\daoru.dmp tables=(table1)

———— 数据级—————————————————————————————————————
6.将数据库中的表table1中的字段filed1以”00″http://www.aibeili.net打头的数据导出
expo user/pass@database file=d:\daochu.dmp tables=(table1) query=\” where filed1 like ”00%”\”

exp参数:
关键字 说明(默认)
———————————————-
userid 用户名/口令
full 导出整个文件 (n)
buffer 数据缓冲区的大小
owner 所有者用户名列表
file 输出文件 (expdat.dmp)
tables 表名列表
compress 导入一个范围 (y)
recordlength io 记录的长度
grants 导出权限 (y)
inctype 增量导出类型
indexes 导出索引 (y)
record 跟踪增量导出 (y)
rows 导出数据行 (y)
parfile 参数文件名
constraints 导出限制 (y)
consistent 交叉表一致性
log 屏幕输出的日志文件
statistics 分析对象 (estimate)
direct 直接路径 (n)
triggers 导出触发器 (y)
feedback 显示每 x 行 (0) 的进度
filesize 各转储文件的最大尺寸
query 选定导出表子集的子句
imp参数:
关键字 说明(默认)
———————————————-
userid 用户名/口令
full 导入整个文件 (n)
buffer 数据缓冲区大小
fromuser 所有人用户名列表
file 输入文件 (expdat.dmp)
touser 用户名列表
show 只列出文件内容 (n)
tables 表名列表
ignore 忽略创建错误 (n)
recordlength io 记录的长度
grants 导入权限 (y)
inctype 增量导入类型
indexes 导入索引 (y)
commit 提交数组插入 (n)
rows 导入数据行 (y)
parfile 参数文件名
log 屏幕输出的日志文件
constraints 导入限制 (y)
destroy 覆盖表空间数据文件 (n)
indexfile 将表/索引信息写入指定的文件
skip_unusable_indexes 跳过不可用索引的维护 (n)
analyze 执行转储文件中的 analyze 语句 (y)
===========================================

猜你喜欢

转载自jianggege.iteye.com/blog/1503855
今日推荐