Excited to tell you that our welfare activity has been upgraded - Paying only $5.00 + Freight to get JCOP J3H145 card and A40CR card.
Please check this post for more details.

Moreover, if you want to get Free Samples by Paying Freight only , please check this page.

Oracle database big data volume import (SqlLoader method)

JavaCard Applet Development Related Questions and Answers.
youyou
Posts: 19
Joined: Fri Jul 06, 2018 3:42 am
Points :142
Contact:

Oracle database big data volume import (SqlLoader method)

Post by youyou » Tue Sep 18, 2018 11:18 pm

When using oracle database to import large amounts of data, this tool is very fast. According to my test, 100W data is imported into a table in about 7 minutes (about 35 table fields).
The specific implementation method is as follows:

youyou
Posts: 19
Joined: Fri Jul 06, 2018 3:42 am
Points :142
Contact:

Re: Oracle database big data volume import (SqlLoader method)

Post by youyou » Tue Sep 18, 2018 11:19 pm

1. The control file run.ctl needed to create the sqlloader command is as follows
Load data --1. Control file identification
Infile 'F:\sqldata.csv' --2, the data file to be entered can be named.txt or.csv, note the path
Append records into table Table_Name --3. Append records to oracle tables
Fields terminated by ',' --4. Each field is separated
Fields terminatedby X'09' --5. The field terminates in X'09, which is a TAB (delete this line if there is an error)
(Col1, Col2...). 6. Define the corresponding order of columns
Note: the above third command is as follows
A, insert, by default, requires the table to be empty at the start of data loading
B. append, append new records in the table
C, replace, delete the old record and replace the newly loaded record
D. truncate
Control file demo: individual successful cases:
Load data infile 'F:\sqldata.csv' append into table ftotp_tokeninfo Fields terminated by ',' (token,enabled,locked)

youyou
Posts: 19
Joined: Fri Jul 06, 2018 3:42 am
Points :142
Contact:

Re: Oracle database big data volume import (SqlLoader method)

Post by youyou » Tue Sep 18, 2018 11:21 pm

2. Prepare the data file sqldata.csv or sqldata.txt
Note the format in the data file - demo
Data file Demo
00000000000001 0,
00000000000002 0,
00000000000003 0,
Note: 1. The data position in the content file should correspond to the position of the field in the control file above
2. Do not distinguish Numbers and strings in the data file, just separate them with commas
3. After the control file (run.ctl) and data file (sqldata.csv) are ready, enter this directory location under the DOS window
The 2013-3-21 14:53:52 upload
Download the attachment (892 Bytes)
Type the command:
The 2013-3-21 14:53:52 upload
Download attachments (1.69kb)
Carriage return execution;
Note: the userid= Scott/tiger-@orcl orcl in the command is the database (service) name;
The default log file is named: input. Log
The default bad record file is: input. Bad
The result of execution can be viewed in the sqllog.out file under F:\oracle product 10.2.0\db_2\BIN\.

youyou
Posts: 19
Joined: Fri Jul 06, 2018 3:42 am
Points :142
Contact:

Re: Oracle database big data volume import (SqlLoader method)

Post by youyou » Tue Sep 18, 2018 11:23 pm

The following section provides a quick way to create a data file:
public static void main(String[] args) {
try {
// Create the data that will be imported into the database File
String dataFile = "F:/sqldata.csv";
File file = new File(dataFile);
if(file.exists()){
file.delete();
}else{
file.createNewFile();
}
OutputStream output = new FileOutputStream(file);
String dataStr = "{0}, 0, 0\n";
for (int i = 1; i < 100; i++) {
String tokenNum = String.format("%014d", i);
// The first way
output.write(MessageFormat.format(dataStr, tokenNum).getBytes());
// The second way
//IOUtils.write(MessageFormat.format(dataStr, tokenNum), output, "utf-8");
}
if(output!=null){
output.flush();
output.close();
}
} catch (Exception e) {
// TODO: handle exception
}
}

summer
Posts: 3
Joined: Fri Sep 28, 2018 3:52 am
Points :20
Contact:

Re: Oracle database big data volume import (SqlLoader method)

Post by summer » Fri Sep 28, 2018 3:57 am

Very good,Thanks for sharing

youyou
Posts: 19
Joined: Fri Jul 06, 2018 3:42 am
Points :142
Contact:

Re: Oracle database big data volume import (SqlLoader method)

Post by youyou » Fri Sep 28, 2018 4:08 am

Thank you for your support :P

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: Google [Bot] and 3 guests

JavaCard OS : Disclaimer