(: dname )",
LOC "upper (: loc )",
LAST_UPDATED date 'dd/mm/yyyy'
)
BEGINDATA
10, Sales, // In fact, the three rows are regarded as a row of 10, Sales, Virginia, 1/5/2000
Virginia,
1/5/2000
// This column uses continueif list = "," or
Tell sqlldr to find a comma at the end of each line and then append the next line to the previous line.
LOAD DATA
INFILE *
Continueif this () = '-' // find whether there are connection characters at the beginning of eac
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
(: dname )",
Loc "upper (: Loc )",
Last_updated date 'dd/MM/yyyy'
)
Begindata
10, sales, // In fact, the three rows are regarded as a row of 10, sales, Virginia, 1/5/2000
Virginia,
1/5/2000
// This column uses continueif list = "," or
Tell sqlldr to find a comma at the end of each line and then append the next line to the previous line.
Load data
Infile *
Continueif this () = '-' // find whether there are connection characters at the beginning of ea
Label:1, the command is written in one line: for example, Sqlldr sh/[email protected]connect_string control=ctl_file data=dat_file log= Log_file Direct=yes rows=100000.2, note the file newline character, if it is wind, it is cr/lf, if it is a Mac, then CR, if it is UNIX, then LF, and finally converted to 16, for example, RECORDS delimited by 0X ' 0A '.3, note the
rows are actually occupying a size that exceeds the maximum available value of bindsize. OPTIONS (skip=1,rows=128)Load dataInFile ' E:\ldr\ldr.csv 'Append into table Lp_ldrFields terminated by ","Optionally enclosed by ' "'(OWNER,object_name,Subobject_name,object_id INTEGER EXTERNAL,data_object_id INTEGER EXTERNAL,Object_type,CREATED DATE "Yyyy-mm-dd HH24:MI:SS",Last_ddl_time DATE "Yyyy-mm-dd HH24:MI:SS",TIMESTAMP,STATUS,Temporary,GENERATED,Secondary,NAMESPACE,Edition_name) When you define a
Import data to Oracle
When importing data in Oracle, the file suffix is *. CTL
The command is sqlldr.
Sqlldr username/password control = 'tbl _ EMP, CTL'
Export part of data from postgre
Psql Saison-C 'select user_id, user_name from user order by 1, 2 'user_list.txt-a-f,-T
Generated file user_list.txt
100001, Xiaoming
100002, Xiaowang
CTL File
Load data
Infile user_list.txt
Append into Table tbl_emp
F
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 TERMINATED by ', '--- file to ' , ' SplitTRAILING Nullcols-- NULL is allowed when the table field does not have a corresponding value(Sub
Tags: Oracle Sqlldr
BackgroundTXT text for 900W data, the contents of the file are in the fields "|" Delimited, use Nevicat import too slow
SolutionsUsing SQLLDR to import data,1) Setting up the configuration file Test.ctl[email protected] ~]$ cat Test.ctlLoad dataInFile ' Data.txt 'into table CMCCFields terminated by "|"(id,phone,service_id,time,cmcc_num,cmcc_s)Explanation: Data.txt The data file
old data, insert new,truncate----> Clear table First, then insert. General error: For example: column not found before logical record ends (using TRAILING nullcols) Indicates the number of columns in your control file that do not match the number of columns in the data file , and has not specified trailing nullcols parameter, which prevents some columns from being inserted, first check the control file and data file, and then consider w
loadfilename= $data _dir "/" $fileThis will Loadfilename (import Oracle text, absolute path) This variable export to the Linux environment, so that the Sqlload control file can read this variable and import2.sqlldr Control text Dayflow.log.ctlLoad Datacharacterset al32utf8infile ' $LoadFileName ' APPEND into table User_1.bil_flux_high_curfields terminated by ' | ' Trailing Nullcols (ACCS_NBR "trim (: ACCS_NBR)", date_id "trim (:D ate_id)", Total_flux
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 onSET feedback onSET term on SET echo on
Step 0 initialize the environment:
Createobject. SQL
There should be a lot of ways to import data into Oracle, and there are different ways to import different requirements, and the recent use of Oracle's SQLLDR command to import database data feels like a pretty good technical point. Using the SQLLDR command to import a text file into Oracle takes roughly two steps:First step: Write the CTL control fileLoad Data--loading (in the second step, the source locat
Load: oracle tool: sqlldr consists of four steps: creating a table with a source data file (test.txt) and creating a control file (test. ctl), create a bat file (or shell file) focuses on: If the table has the number type, or the date data type can also load the number, the key point is in step 3. The procedure is as follows: 1. Create a table (SCRIPT ):
-- Create tablecreate table TBL_TEST1 (NAME VARCHAR2 (50), PASSWORD VARCHAR2 (10), CREATE_DT DATE
Use the Oracle client load data and sqlldr commands in Java to execute data import to the database, oraclesqlldr
Test code in Windows:Import java. io. file; import java. io. fileNotFoundException; import java. io. fileWriter; import java. io. IOException; import java. io. inputStream; import java. io. printWriter; import java. util. role; public class testTimer {/*** @ param args */public static void main (String [] args) {// TODO Auto-generated metho
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
1, the establishment of Oracle installation directory, generally/opt/oracle;2, put the installation package instantclient-basic-linux.x64-11.2.0.3.0.zip into the directory, and extract: Unzip XXX, generate directory:/opt/oracle/instantclient_11 _2;;3. Create a new Tnsnames.ora file in the/opt/oracle/instantclient_11_2 directory to write the database connection information;4. Configure environment variables:/ect/profile fileExport Oracle_home=/opt/oracleexport Nls_lang=american_america. ZHS16GBKE
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.