Use the oracle control file to import massive data into the database

Source: Internet
Author: User

Using oracle control files to store large amounts of data into the database is much more efficient than SQL script files.
A m data file, the ctl file is stored in about 20 mins, and the SQL script file takes about 2 hours.
 
To use the ctl control file, follow these steps:
 
1. Create a ctl File
 
Load data
Infile 'e: \ test. log' -- data file, which is exported from the previous article
Append into table fm. tb_team_info
 
Fields terminated by "," -- field separator
Optionally enclosed by '"' -- delimiter
Trailing nullcols -- allow skipping Columns
(
TEAMID,
AREA_ID,
CREATE_PERSONNEL_ID,
TEAM_CODE
)
 
E: \ test. log: data file. In this example, the log file is used as the data source.
Fm. tb_team_info: data table to be imported
 
2. Create a data source file
Files only contain data, and data columns are separated by commas (,).
 
3. Execute the ctl File
Cd to the oracle control file directory
Run the following command: sqlldr fm/zaixin @ 189 Ericsson control = input. ctl, ERRORS = 50000, LOAD = 450000
 
4. execution results,
The execution result will generate the log file (input. log) corresponding to the name of the control file for execution under the control file of oracle and record the operation result in detail.
 
5. When loading a large amount of data (about 10 GB), it is best to suppress log generation:
SQL> ALTER TABLE RESULTXT nologging;
In this way, no redo log is generated, which can improve the efficiency.

Author "zzhangyongjie"
 

Related Article

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.