oracle导入导出技巧

直接导出
exp system/manager FILE=exp_full.dmp LOG=exp_full.log compress=N FULL=y DIRECT=y RECORDLENGTH=65535
查看导出文件内容
 imp username/password show=y full=y file=a.dmp

导出选项:compress=N ,确保数据不会被合并到一个extent中

imp加速
(2)增加排序区
(3)调整BUFFER选项
imp user/pwd fromuser=user1 touser=user2 file=/tmp/imp_db_pipe1 commit=y feedback=10000 buffer=10240000

如果buffer太大,会出现 IMP-00032 IMP-00008等错误
(4)使用COMMIT=Y选项
  COMMIT=Y表示每个数据缓冲满了之后提交一次,而不是导完一张表提交一次。这样会大大减少对系统回滚段等资源的消耗,对顺利完成导入是有益的。
(5)使用INDEXES=N选项
  前面谈到增加排序区时,说明Imp进程会先导入数据再创建索引。
导入过程中我们就可以使用INDEXES=N 只导入数据不创建索引,从而加快导入速度。
  我们可以用INDEXFILE选项生成创建索引的DLL脚本,再手工创建索引。我们也可以用如下的方法导入两次,第一次导入数据,第二次导入索引。其用法如下:
imp user/pwd fromuser=user1 touser=user2 file=/tmp/imp_db_pipe1 commit=y feedback=10000 buffer=10240000 ignore=y rows=y indexes=n
imp user/pwd fromuser=user1 touser=user2 file=/tmp/imp_index_pipe1 commit=y feedback=10000 buffer=10240000 ignore=y rows=n indexes=y

删除表空间
drop tablespace dataflow including contents and datafiles cascade constraints;

posted on 2012-08-06 18:04  IT老友  阅读(918)  评论(0编辑  收藏  举报

导航