,nil,ov0001,2005,09,21,17,32,07,i,d,main Door,product,Sammy,mow,sa02322,2005,09,21,17,32,09,i,d,main Door,sales,Emily,fu,cm06024,2005,09,21,17,32,10,i,d,main Door,communications,Stella,chow,pt02145,2005,09,21,17,32,11,i,d,main Door,product,?is a regular data, the middle is "," separate, and now I want to import this file into Oracle:?The first step, of course, is to build a table that has several fields on it with a few rows.?Two, write a *.ctl file,
This is a small example of sqlldr in the exercise thinking book. It is to save the excel file as csv and load it into the Oracle database through sqlldr. The purpose was to demonstrate the processing method of sqlldr In the csv file and strings in the csv file that contain commas (,) and double quotation marks ("). How
Setp-1 to generate data files:
GetObject. SQL
SELECT a.owner||',"'||a.object_name||'",'||a.object_id||','||to_char(a.created,'yyyy-mm-dd hh24:mi:ss')||','||a.statusFROM dba_objects a, (SELECT rownum rn FROM dual connect BY rownum
Call. SQL
SET echo offSET term offSET line 100 pages 0SET feedback offSET heading offspool C:\oracle\script\ldr_object.csv@C:\oracle\script\getobject.sqlspool offSET heading onSE
Tags: copy val composite star speed Mina Loader unit controlBefore the restoration of a unit in Shandong to restore the Oracle database, the data contained in the date type, at that time to provide customers with the Sqlldr way, because the volume of data is larger, with sqlldr loaded faster, so the use of this way, the result is also in the loading error, The so
Tags: control Oracle Databasein the the txt text method is imported into the Oracle database , as you now need to import data from t_user_mobile_list.txt into Oracle Database in the T_user_mobile_list table. 1. the ctl file is required firstThe CTL file format is as follows:Load dataInFile *Append into table t_user_mobile_list--- inserted tables nameFields TER
Here we use excel Data for the simplest test.
1) Save the excel data as a t.txt file. Note that the file suffix is. txt.
1 jhchen 11/07/2005 20:04:00 2005-11-7 20:04
2 jhchen 11/07/2005 20:04:00 2005-11-7 20:04
3 jhchen 11/07/2005 20:04:00 2005-11-7 20:04
2)SQL> create table t_load (
Id number,
Name varchar2 (10 ),
Dat1 date,
Dat2 date,
Dat3 date
);
Table created.
3) The control file t. ctl is as follows:
Load data
Infile 't.txt'
Badfile 't. bad'
Append into table t_load
Fields terminated b
The test machine is loaded into the data found in the text field all become???????, the preliminary judgement of the character set problem change update sys.props$set VALUE$= ' We8iso8859p1 ' where name like ' nls% ' and value$= ' ZHS16GBK '; commit; Sqlldr sql*loader-704:internal Error:ulmtsyn:OCIStmtExecute (tabhp) when the data is collected /sql:compilation Unit Analysis Terminatedora-06553:pls-553:character set name was not recognized found that t
) 4, import successfully, But open a look garbled through the select * from V$nls_parameters; View Nls_characterset as Al32utf8, and my machine is GBK, so this machine through the DOS window for the following settings: Set Nls_lang=american_america. Al32utf8 also change the control file as follows: Load dataCHARACTERSET Al32utf8 (in the CTL file with the character set, the same as the Oracle character set, select * from V$nls_parameters t where T.par
tab_column_ora=tab_column_ora| | v_column_ora| | ', ' where table_name=c1.table_name;ElseUpdate Tab_column_union Set tab_column_ora=tab_column_ora| | c1.column_name| | ', ' where table_name=c1.table_name;End If;End If;END LOOP;Update Tab_column_union t set Tab_column_db2=substr (T.tab_column_db2,1,length (T.TAB_COLUMN_DB2)-1);Update Tab_column_union t set Tab_column_ora=substr (T.tab_column_ora,1,length (T.tab_column_ora)-1);COMMIT;End Gy_etl_download;----------------------------------------2.
Label:Sqlldr as the data import tool brought by Oracle, it can provide better function in the import of rule data. function use: Under Windows Platform, command:Sqlldr userid=user/[email protected] control=loader.ctl log=loade.log Bad=loader.bad Where log file, bad is the wrong data file, can not display the note, the default will be generated in the current directory, the same control file path does not indicate that the command is also in the dire
Tags: scott suffix into style match explain control load numberRequirements: Data migration, import the contents of TXT file into the table of Oracle database, the data format of the text file is as follows (data is separated by space) 1. Create a table that matches the text data format (created here under the Scott user) Create Table Li_an
(
varchar2(+),
varchar2(),
Number ,
varchar2 (+),
Label:Reference Document: http://askjoey.blog.51cto.com/7594056/1671852 Environment: Oracle11g,redhat Linux 1. Create a base table CREATE TABLE Tab_column_union(Tab_column_ora VARCHAR2 (4000),Tab_column_source VARCHAR2 (4000),TABLE_NAME VARCHAR2 (500))Tablespace SDATAPctfree 10Initrans 1Maxtrans 255Storage(Initial 16Next 8Minextents 1Maxextents Unlimited); Insert the name of the table that needs to generate the control file in table_name. Tab_column_ora each column corresponding to the table thr
In order to facilitate the use of the reprinted article: http://www.oracle.com.cn/viewthread.php? Tid = 13979 extra = page = 1sql Load
Sqlldr userid = lgone/tiger control = A. CTL
Load data
Infile't. dat // file to be imported
// Infile 'tt. date' // import multiple files
// Infile * // the content to be imported is after begindata in the control file.
Into Table table_name // specify the mounted table
Badfile 'C:/bad.txt '// specify the bad file
Only the commands in the sqlldr control file used during learning are recorded.
Fixed-length string processingInto Table(Col1 position (), -- 1st to charactersCol2 position (* + 6th), -- (5 + 1, * indicates the last ending position, + 1 is offset) to the 7, 2 Characters...)
String processing commandExample...Into Table(A position (1:10 ),B "substr (: A, 1, 2 )")Here "" can add various string processing commands substr replace or something. The Conver
is retained, the inserted data is binary name "upper (: Name)", converting the inserted value to uppercase con ": id| |:name", The value of the Con column in the table is the combined value of the ID and name dt date "YYYY-MM-DD" to insert datetime data) in the Append location can also be used for one of the values in the following list: Insert inserts a value into the table, but requires that the table be empty replace Delete the data in the table, and then insert the new val
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.