Oracle Sql*loader Detailed (1) overview

Source: Internet
Author: User

Sql*loader principle

Sql*loader is a tool provided by Oracle for data loading, it is more suitable for business analysis type database (Data Warehouse), can handle multiple format flat files, bulk data loading is more efficient than traditional data insertion. The schematic diagram is as follows:

Control file (. ctl): A file (the most important file) used to control how data is imported

Parameter file (optional) (Parameter file) (. Par): You can write parameters directly in the control file, or you can write a separate parameter file

Data files: Flat files that place source data (you can import multiple data files at once)

Bad file (. Wicked): Put data that cannot be loaded correctly into an error file (for example, data format, data type problem, etc.) when data is loaded

Discard file (optional) (discard file) (. DSC): Some data, although the data format, data type is not a problem, but it is filtered out by the logical conditions (by the control file when set), will be put into the lost file

Log file (. log): Record Sql*loader Data loading process

Sql*loader Data Loading method

Sql*loader supports 3 kinds of data loading methods, respectively:

Traditional path Loading (Direct=false): equivalent to insert statement

Direct path Loading (direct=true): Bypass the SGA, direct the data directly into the high watermark (HWM) above, can set up parallel loading, performance is higher than the traditional path loading, but also more restrictive

External table loading (less): first create an external table on the data file, and then insert the data from the external table into the destination table

Record format for data files

From a sql*loader point of view, data in the data file is organized into records, grouped into the following three record formats (set by the infile parameter of the control file):

Fixed-length record format

This approach is the least flexible, but the performance is best, and its syntax is as follows:

INFILE datafile_name "Fix n"

Indicates that each record in the data file has a fixed length of n bytes.

Variable length record format

INFILE "Datafile_name" "var n"

The variable length record is divided into two parts: the length of the record and the record itself, see the following example:

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.