MySQL database import to Oracle database

Source: Internet
Author: User

First, write a cmd script xx.cmd

sqlldr username/password control=xx.ctl errors=10000000 direct=y

Write a bat script again Xx.bat servicename is generally ORCL

sqlplus username/password@serviceName

To load the SQL

call xx.cmdsqlplus username/password@serviceName @xx.sql

Write a CTL file Xx.ctl

LOAD DATAINFILE ‘xx.txt‘ BADFILE ‘ismpbill.bad‘DISCARDFILE ‘ismpbill.dsc‘INTO TABLE "table1"APPENDFIELDS TERMINATED BY X‘09‘TRAILING NULLCOLS(column 1,column 2,column3)

Specify the delimiter, the field terminates at X ' 09 ' (very important), is a tab (tab), if separated by commas, X ' 09 ' is replaced with ', '

insert,为缺省方式,在数据装载开始时要求表为空append,在表中追加新记录replace,删除旧记录,替换成新装载的记录truncate,同上
BY ‘|‘

means the field terminates at ' | '

MySQL database import to Oracle database

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.