How to import data to oracle database using SQL * loader, loaderoracle

Source: Internet
Author: User

How to import data to oracle database using SQL * loader, loaderoracle

When you need to import massive data into the database, the efficiency of using the graphical interface tool is very low. Here we will briefly introduce how to import the database using SQL * loader.

First, observe the table structure. If the current user does not have a data table available, create a data table with permissions.

Prepare a text file. Each row corresponds to a record of the data table, separated by spaces (or separated by commas, but all data must be consistent)

If the metadata contains an excel table, you can convert the excel file to a. csv file. Note that the default delimiter for converting the excel file to a csv file is a comma.

Write a control file with the extension:. ctl

Enter the dos window (win + r, cmd, and press Enter), and enter the command

Sqlldr userid = hr/123456 control = C: \ Users \ lujx01 \ Desktop \ iqms_ SQL \ testSQL. ctl

Userid indicates the user name and logon password of the data table owner.

Control indicates the absolute path of the control file (you can also use the relative path)

Log on to the hr user with sqlplus, query the data table, display the data, and import the data successfully. Here, the import method is append, which can be understood as splicing. That is, add the data in the original data table. If replace is used, this is to replace all the original data. If the default insert method is used, the data table must be empty.

A log file with the. log extension is stored in the current directory, which records the sqlloader operation process.

 

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.