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"