mysql,oracle表数据相互导入

mysql导入oracle:

  例如mysql中有ts_user_info表,现在要导入到oracle中的user_info表

1:导出mysql表数据到data.txt文件

  mysql> select * from ts_user_info into outfile 'data.txt' fields terminated by ',';
  Query OK, 2 rows affected (0.00 sec)

  说明: fields terminated by ',':将数据字段中的,号去掉

2:修改data.txt的权限(待测)

  chown oracle:oinstall data.txt

3:将data.txt导入到oracle中user_info表

  >load data characterset 'UTF8'  infile '/mysql/mysql5.5.8/data/thinksns/data.txt' append into table user_info
 
  trailing nullcols
  ( 表字段
)
  说明:append :表示表中有数据,加在后面,insert载入空表,replace原表数据直接删除,truncate载入的数据替换原有数据

     trailing nullcols:允许空列导入,空列为null

posted @ 2017-06-07 12:18  x_jingxin  阅读(906)  评论(0编辑  收藏  举报