SQL*Loader loading to Multiple partition.
Hello Gurus,
Can some one help me to load data using sqlldr into a partitioned table from a single file.
Right now it all goes to default partition. My table is partitioned based on the date column ( quarter wise).
how to specify that based on a column value which partition the data should go in?
I want to do it using Direct path method.
Appreciate your timely help.
Thanks advancved,
Regards,
Anantha
control file example with the partitionoption :
LOAD DATA
INFILE 'example.txt'
DISCARDFILE 'example.dsc'
REPLACE -- INSERT, APPEND, TRUNCATE
INTO TABLE Anantha.example
<b>-- PARTITION (Partition_table_name)</b>
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
..
Similar Messages
-
SQL*Loader with multiple files
Gurus,
I search the documentation and this forum and haven't found a solution to my issue yet...
I am not expert of SQL*Loader. I have used SQL*Loader to copy from one file to a table many times. But I have not copied multiple files into one table especially with different names.
More specifically....
I need to load data from multiple files into a table. But the file names will be different each time. A file will be created every hour. The file name will consist of the root file name appended by a time stamp. For example, a file created on 10/07/2010 at 2:15 P.M. would be filea100720101415.txt while a file created on 10/08/2010 at 8:15 A.M. would be filea100820100815.txt. All the files will be in one directory.How can I load the data from the files using SQL*Loader?
My database: Oracle 10g Release 2
Operating System: Windows 2003 Server
Please assist.
Robertsect55 wrote:
Gurus,
I search the documentation and this forum and haven't found a solution to my issue yet...
I am not expert of SQL*Loader. I have used SQL*Loader to copy from one file to a table many times. But I have not copied multiple files into one table especially with different names.
More specifically....
I need to load data from multiple files into a table. But the file names will be different each time. A file will be created every hour. The file name will consist of the root file name appended by a time stamp. For example, a file created on 10/07/2010 at 2:15 P.M. would be filea100720101415.txt while a file created on 10/08/2010 at 8:15 A.M. would be filea100820100815.txt. All the files will be in one directory.How can I load the data from the files using SQL*Loader?
My database: Oracle 10g Release 2
Operating System: Windows 2003 Server
Please assist.
RobertToo bad this isn't in *nix, where you get a powerful shell scripting capability.
That said, here is the core of the solution .... you will also need a way to identify files that have been processed vs. new ones. Maybe rename them, maybe move them. But with this sample you can see the basics. From there it is really an issue of DOS scripting, which would better be found by googling around a bit.
cd c:\loadfiles
FOR %%datfile IN (*.txt) DO SQLLDR CONTROL=sample.ctl, LOG=sample.log, BAD=baz.bad, DATA=%%datfileTry googling "dos scripting language". You'll find lots of tutorials and ideas on "advanced" (well, as advanced as DOS gets) techniques to solve your problem.
Edited by: EdStevens on Dec 1, 2010 5:03 PM -
SQL*Loader and multiple files
Hello, am tasked with loading tables with 21+ million rows. Will SQL*Loader perform better with one large file or many smaller files? Is there any ideal file size for optimal performance? Thank you
DavidDon, when I tried to loada 21M row table using direct, I get the following messages:
Record 2373: Rejected - Error on table STAGE_CUSTOMER.
ORA-03113: end-of-file on communication channel
SQL*Loader-926: OCI error while uldlfca:OCIDirPathColArrayLoadStream for table STAGE_CUSTOMER
SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.
SQL*Loader-925: Error while uldlgs: OCIStmtExecute (ptc_hp)
ORA-03114: not connected to ORACLE
SQL*Loader-925: Error while uldlgs: OCIStmtFetch (ptc_hp)
ORA-24338: statement handle not executed
Here is the SQL*Loader log:
SQL*Loader: Release 9.2.0.1.0 - Production on Thu Apr 26 15:38:29 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Control File: stage_customer.ctl
Character Set UTF8 specified for all input.
First primary datafile stage_Customer_20070301.csv has a
utf8 byte order mark in it.
Data File: stage_Customer_20070301.csv
Bad File: stage_Customer_20070301.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 1000
Continuation: none specified
Path used: Direct
Silent options: FEEDBACK
Table STAGE_CUSTOMER, loaded from every logical record.
Insert option in effect for this table: APPEND
TRAILING NULLCOLS option in effect
Column Name Position Len Term Encl Datatype
ROW_ID SEQUENCE (MAX, 1)
CUSTOMER_ACCT_NUM FIRST * , O(") CHARACTER
IS_DELETED NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN UPPER(:Is_Deleted) IN ('FALSE','0') THEN 0 ELSE 1 END"
NAME_PREFIX NEXT * , O(") CHARACTER
FIRST_NAME NEXT * , O(") CHARACTER
MIDDLE_NAME NEXT * , O(") CHARACTER
LAST_NAME NEXT * , O(") CHARACTER
NAME_SUFFIX NEXT * , O(") CHARACTER
NICK_NAME NEXT * , O(") CHARACTER
ALT_FIRST_NAME NEXT * , O(") CHARACTER
ALT_LAST_NAME NEXT * , O(") CHARACTER
MARKETING_SOURCE_ID NEXT * , O(") CHARACTER
HOME_PHONE NEXT * , O(") CHARACTER
WORK_PHONE NEXT * , O(") CHARACTER
MOBILE_PHONE NEXT * , O(") CHARACTER
ALTERNATE_PHONE NEXT * , O(") CHARACTER
EMAIL_ADDR NEXT * , O(") CHARACTER
ALT_EMAIL_ADDR NEXT * , O(") CHARACTER
BIRTH_DATE NEXT * , O(") CHARACTER
SQL string for column : "TRUNC(TO_DATE(:Birth_Date, 'MM/DD/YYYY HH24:MI:SS'))"
SALES_CHANNEL_ID NEXT * , O(") CHARACTER
SQL string for column : "decode(:Sales_Channel_id,NULL,NULL,NULL)"
ASSOCIATE_NUMBER NEXT * , O(") CHARACTER
ALT_ASSOCIATE_NUMBER NEXT * , O(") CHARACTER
UPDATE_LOCATION_CD NEXT * , O(") CHARACTER
UPDATE_DATE NEXT * , O(") CHARACTER
SQL string for column : "TRUNC(TO_DATE(:Update_Date, 'MM/DD/YYYY HH24:MI:SS'))"
CUSTOMER_LOGIN_NAME NEXT * , O(") CHARACTER
DISCOUNT_CD NEXT * , O(") CHARACTER
DISCOUNT_PERCENT NEXT * , O(") CHARACTER
BUSINESS_NAME NEXT * , O(") CHARACTER
POS_TAX_FLAG NEXT * , O(") CHARACTER
POS_TAX_PROMPT NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN UPPER(:POS_TAX_PROMPT) IN ('FALSE','0') THEN 0 ELSE 1 END"
POS_DEFAULT_TAX_ID NEXT * , O(") CHARACTER
POS_TAX_ID_EXPIRATION_DATE NEXT * , O(") CHARACTER
POS_AUTHORIZED_USER_FLAG NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN UPPER(:POS_AUTHORIZED_USER_FLAG) IN ('FALSE','0') THEN 0 ELSE 1 END"
POS_ALLOW_PURCHASE_ORDER_FLAG NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN UPPER(:POS_ALLOW_PURCHASE_ORDER_FLAG) IN ('FALSE','0') THEN 0 ELSE 1 END"
ADDRESS1 NEXT * , O(") CHARACTER
ADDRESS2 NEXT * , O(") CHARACTER
ADDRESS3 NEXT * , O(") CHARACTER
CITY NEXT * , O(") CHARACTER
STATE_CD NEXT * , O(") CHARACTER
POSTAL_CD NEXT * , O(") CHARACTER
COUNTRY_CD NEXT * , O(") CHARACTER
ALLOW_UPDATE NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN UPPER(:ALLOW_UPDATE) IN ('FALSE','0') THEN 0 ELSE 1 END"
ACTION_CODE NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN UPPER(:action_code) IN ('FALSE','0') THEN 0 ELSE 1 END"
ACCOUNT_TYPE_ID NEXT * , O(") CHARACTER
LOCALE_CD NEXT * , O(") CHARACTER
SQL string for column : "CASE WHEN :Locale_CD IS NOT NULL AND :Locale_CD LIKE '__-__' THEN :Locale_CD ELSE 'en-US' END"
IS_READY_FOR_PROCESSING CONSTANT
Value is '1'
IS_BUSINESS CONSTANT
Value is '0'
HAD_ERRORS CONSTANT
Value is '0'
Record 2373: Rejected - Error on table STAGE_CUSTOMER.
ORA-03113: end-of-file on communication channel
SQL*Loader-926: OCI error while uldlfca:OCIDirPathColArrayLoadStream for table STAGE_CUSTOMER
SQL*Loader-2026: the load was aborted because SQL Loader cannot continue.
SQL*Loader-925: Error while uldlgs: OCIStmtExecute (ptc_hp)
ORA-03114: not connected to ORACLE
SQL*Loader-925: Error while uldlgs: OCIStmtFetch (ptc_hp)
ORA-24338: statement handle not executed
Table STAGE_CUSTOMER:
0 Rows successfully loaded.
1 Row not loaded due to data errors.
0 Rows not loaded because all WHEN clauses were failed.
0 Rows not loaded because all fields were null.
Bind array size not used in direct path.
Column array rows : 5000
Stream buffer bytes: 256000
Read buffer bytes: 1048576
Total logical records skipped: 0
Total logical records read: 3469
Total logical records rejected: 1
Total logical records discarded: 0
Direct path multithreading optimization is disabled
Run began on Thu Apr 26 15:38:29 2007
Run ended on Thu Apr 26 15:38:30 2007
Elapsed time was: 00:00:01.18
CPU time was: 00:00:00.32 -
SQL statement for selecting multiple partitions
Hi All,
May i know how to Select data from a table having multiple partitions ?
Example : Owner = Scott, Table= Emp, Partitions (P1,P2,P3,P4,P5)
Thanksno...
SQL>
1 create table partition_test
2 (owner, object_name, object_id)
3 partition by list(owner)
4 (partition part_1 values ('SYS'),
5 partition part_2 values ('SYSTEM'),
6 partition part_3 values ('OUTLN')
7 ) as select owner, object_name, object_id from all_objects
8* where owner in ('SYS', 'SYSTEM', 'OUTLN')
9 /
Table created.
SQL> select count(*) from partition_test partition(part_1, part_2);
select count(*) from partition_test partition(part_1, part_2)
ERROR at line 1:
ORA-00933: SQL command not properly ended
SQL> select count(*) from partition_test partitions(part_1, part_2);
select count(*) from partition_test partitions(part_1, part_2)
ERROR at line 1:
ORA-00933: SQL command not properly ended
SQL> select count(*) from partition_test partitions(part_1 + part_2);
select count(*) from partition_test partitions(part_1 + part_2)
ERROR at line 1:
ORA-00933: SQL command not properly ended
SQL> select count(*) from partition_test partitions(part_1 between part_2
select count(*) from partition_test partitions(part_1 between part_2)
ERROR at line 1:
ORA-00933: SQL command not properly ended
SQL> select count(*) from partition_test partitions("part_1 part_2");
select count(*) from partition_test partitions("part_1 part_2")
ERROR at line 1:
ORA-00933: SQL command not properly endedand this is the documented behavior:
"partition_extension_clause
For PARTITION or SUBPARTITION, specify the name or key value of the partition or subpartition within table from which you want to retrieve data.
For range- and list-partitioned data, as an alternative to this clause, you can specify a condition in the WHERE clause that restricts the retrieval to one or more partitions of table. Oracle Database will interpret the condition and fetch data from only those partitions. It is not possible to formulate such a WHERE condition for hash-partitioned data."
from:
http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/statements_10002.htm#i2076542
Amiel -
Using sql load insert multiple fields data into a single column in database
Hi ,
I have my log file in sun OS box something like this
=======
(07/29/2009 00:02:24.467) 367518 (07/29/2009 00:02:26.214) 949384011
(07/29/2009 00:02:26.236) 3675 (07/29/2009 00:02:28.207) 949395117
(07/29/2009 00:02:28.240) 337710 (07/29/2009 00:02:30.621) 949400864
=============
I am trying to insert the data into oracle data base as follows.
=============================
column1 : (07/29/2009 00:02:24.467)
column2 : 367518
column3 : (07/29/2009 00:02:26.214)
column4 : 949384011
===========================
Can anyone help me with the control file format?
someone suggested me the code below.
==========
LOAD DATA
INFILE 'D:\work\load.txt'
INTO TABLE sample
(col1 POSITION(02:24) char,
col2 POSITION(27:32) INTEGER EXTERNAL,
col3 POSITION(35:57) CHAR,
col4 POSITION(60:68) INTEGER EXTERNAL
===========
but this works only for the fixed length data? Please helpuser11744904 wrote:
Hi ,
I have my log file in sun OS box something like this
=======
(07/29/2009 00:02:24.467) 367518 (07/29/2009 00:02:26.214) 949384011
(07/29/2009 00:02:26.236) 3675 (07/29/2009 00:02:28.207) 949395117
(07/29/2009 00:02:28.240) 337710 (07/29/2009 00:02:30.621) 949400864
=============
I am trying to insert the data into oracle data base as follows.
=============================
column1 : (07/29/2009 00:02:24.467)
column2 : 367518
column3 : (07/29/2009 00:02:26.214)
column4 : 949384011
===========================
Can anyone help me with the control file format?
someone suggested me the code below.
==========
LOAD DATA
INFILE 'D:\work\load.txt'
INTO TABLE sample
(col1 POSITION(02:24) char,
col2 POSITION(27:32) INTEGER EXTERNAL,
col3 POSITION(35:57) CHAR,
col4 POSITION(60:68) INTEGER EXTERNAL
===========
but this works only for the fixed length data? Please helpIs the requirement to load all data in a single column or multiple columns? The thread subject and body are conflicting. -
SQL Loader and multiple tables
I know how to load multiple tables using the same set of data, but is it possible to load multiple tables using a different set of data for each table? Can someone point me to an example or tell me how to set up the ctl file.
Thanks.http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10825/ldr_control_file.htm#sthref852
Distinguishing Different Input Record Formats
A single datafile might contain records in a variety of formats. Consider the following data, in which emp and dept records are intermixed:
1 50 Manufacturing — DEPT record
2 1119 Smith 50 — EMP record
2 1120 Snyder 50
1 60 Shipping
2 1121 Stevens 60
A record ID field distinguishes between the two formats. Department records have a 1 in the first column, while employee records have a 2. The following control file uses exact positioning to load this data:
INTO TABLE dept
WHEN recid = 1
(recid FILLER POSITION(1:1) INTEGER EXTERNAL,
deptno POSITION(3:4) INTEGER EXTERNAL,
dname POSITION(8:21) CHAR)
INTO TABLE emp
WHEN recid <> 1
(recid FILLER POSITION(1:1) INTEGER EXTERNAL,
empno POSITION(3:6) INTEGER EXTERNAL,
ename POSITION(8:17) CHAR,
deptno POSITION(19:20) INTEGER EXTERNAL) -
Sql*loader map multiple files to multiple tables
Can a single control file map multiple files to multiple different tables? If so, what does the syntax look like? I've tried variations of the following, but haven't hit the jackpot yet.
Also, I understand that a direct load will automatically turn off most constraint checking. I'd like to turn this back on when I'm done loading all tables. How/when do I do that? I can find multiple references to 'REENABLE DISABLED CONSTRAINTS', but I don't know where to say that.
TIA.
LOAD DATA
INFILE 'first.csv'
TRUNCATE
INTO TABLE first_table
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(a,b,c)
INFILE 'second.csv'
TRUNCATE
INTO TABLE second_table
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(x,y,z,xx,yy,zz)
etc.Here you go what you want..
http://www.psoug.org/reference/sqlloader.html
LOAD DATA
INFILE 'c:\temp\demo09a.dat'
INFILE 'c:\temp\demo09b.dat'
APPEND
INTO TABLE denver_prj
WHEN projno = '101' (
projno position(1:3) CHAR,
empno position(4:8) INTEGER EXTERNAL,
projhrs position(9:10) INTEGER EXTERNAL)
INTO TABLE orlando_prj
WHEN projno = '202' (
projno position(1:3) CHAR,
empno position(4:8) INTEGER EXTERNAL,
projhrs position(9:10) INTEGER EXTERNAL)
INTO TABLE misc_prj
WHEN projno != '101' AND projno != '202' (
projno position(1:3) CHAR,
empno position(4:8) INTEGER EXTERNAL,
projhrs position(9:10) INTEGER EXTERNAL)
Thanks
Aravindh -
SQL Loader choosing conventional path when direct path is requested
We have a mystery regarding SQL Loader choosing to load with conventional path even though direct path is requested.
We have a control file that produces direct-path loads and one which does not. The difference between them does not seem to account for the difference in behavior.
The following control file does not give us direct-path:
OPTIONS (
SKIP=0,
ERRORS=0,
DIRECT=TRUE,
NOLOGGING
LOAD DATA
INFILE "[file path]" "STR x'0A'"
BADFILE "[file path].bad"
DISCARDFILE "[file path].dsc"
DISCARDMAX 0
INSERT
INTO [schema name].[table name]
FIELDS TERMINATED BY X'2C'
OPTIONALLY ENCLOSED BY '?'
TRAILING NULLCOLS
C1_ACD_LINE_CD CHAR(2000),
[column specifications continue]
)When running with this control file, the log shows:
Number to load: ALL
Number to skip: 0
Errors allowed: 0
Bind array: 64 rows, maximum of 256000 bytes
Continuation: none specified
Path used: Conventional
Table [schema name].[table name], loaded from every logical record.
Insert option in effect for this table: INSERT
TRAILING NULLCOLS option in effectIf we use a control file that is modified as follows:
OPTIONS (
SKIP=0,
ERRORS=0,
DIRECT=TRUE,
PARALLEL=TRUE,
NOLOGGING
)Then we do get direct-path load:
Number to load: ALL
Number to skip: 0
Errors allowed: 0
Continuation: none specified
Path used: Direct
Table [schema name].[table name], loaded from every logical record.
Insert option in effect for this table: INSERT
TRAILING NULLCOLS option in effectSo there is nothing about the table (constraints, triggers, etc.) that is preventing direct-path loads.
Now, we stumbled into this PARALLEL thing by accident - we are not really trying to do parallel loads.
In my reading of the Utilities guide (http://docs.oracle.com/cd/E11882_01/server.112/e22490/ldr_modes.htm#autoId64 ), the PARALLEL option lets SQL Loader tolerate multiple sessions loading to the same segment at once, but does not perform parallel processing itself. So, is it possible there is some other lock on the table is causing SQL Loader to block direct-path loads to the table (because of a previous SQL Loader direct-path load, perhaps) unless the PARALLEL option is invoked? If so, how do we recognize that state and how do we resolve it?
Version information:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Solaris: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
Any thoughts or suggestions would be appreciated.
Thanks,
MikeFrom the same link
>
To use a direct path load (except for parallel loads), SQL*Loader must have exclusive write access to the table and exclusive read/write access to any indexes.
>
So I suspect that when using only DIRECT=TRUE, Oracle is not able to get an exclusive lock on the required objects, so it uses the conventional mode.
From a later section
>
- Segments to be loaded do not have any active transactions pending.
To check for this condition, use the Oracle Enterprise Manager command MONITOR TABLE to find the object ID for the tables you want to load. Then use the command MONITOR LOCK to see if there are any locks on the tables.
>
Would be interested in knowing what you find
HTH
Srini -
Sql Loader - Parallel Direct Path Loading
Hi,
I want to load a few million records into a table. I read from OTN site that we can make use of Parallel Direct Loading Option. As given in the site, I split my source file into two and tried loading the file from two different sqlldr sessions simultaniously. I used two seperate control files for each session. The sessions started first is getting completed successfully. But the session which started second is giving the following error.
Will anyone Pls help to sort out the problem.
Error
"SQL*Loader-951: Error calling once/load initialization
ORA-00604: error occurred at recursive SQL level 1
ORA-00054: resource busy and acquire with NOWAIT specified "
I'm using oracle 9.0.1.1.1.
The Options I tried with both the sessions are :
Direct=true parallel=true.
loading method is append.
Thanks in Advance,
TomI've got a similar problem.
I'm running Informatica which runs SQL*Loader via OCI.
With direct & parallel my Indexes give me ORA-26002 - quite understandable.
As its all wrapped up, I cannot say SKIP_INDEX_MAINTENANCE directly.
1) Is there a way to give SQL*Loader some Default-Parameters? I read something about a File shrept.lst but I cannot find a reference in the Oracle documentation.
Something useful down this road?
2) when I omit parallel, what am I losing? I load one file into one partition of one table. I read the SQL*Loader Documentation but didn't get the message of the 'Intrasegment Parallel Loading' Paragraph. Is this using parallel? Or is it just enabling to use parallel (if there will be a second SQL*Loader)? If its all about 'enabling' I can easily omit this - I know there won't be a second SQL*Loader for this partition.
regards,
Kathrin -
Odd Behaviour of Sql*Loader
Hi,
I am facing a bit odd behavior in Sql*loader,when I am trying to upload data using Sql*Loader into multiple tables.control file looks like following.
LOAD DATA
INFILE "C:\WINDOWS\system32\multi112.txt"
APPEND
INTO TABLE EDI_BROADCAST_HEADER_1
WHEN (1:4)='#10#'
(tag_number "seq_edi_broadcast_header.nextval",
processing_flag constant 'N'
,VIN POSITION (5:24) Char
,CSN_CHAR POSITION (26:35) Char
,OPERATION POSITION (37:46) Char
,PLANT POSITION (48:62) INTEGER EXTERNAL
,CHANNEL POSITION (64:78) Char
INTO TABLE EDI_BROADCAST_BODY_1
WHEN (1:4)='#20#'
(tag_number "seq_edi_broadcast_body.nextval",
Header_tag "seq_edi_broadcast_header.currval"
,FAMILY POSITION (5:19) Char
,NAME POSITION (21:45) Char
,VALUE POSITION (47:71) Char
,TYPE POSITION (73:78) Char
,QUANTITY POSITION (80:85) Char
and data files contains 200 lines in the following format
#10#6C218290 4132830 001 39395 SP14
#20#.......
#20#
#10#6C218290 4132830 002 39395 SP14
#20#.......
#20#.......
#10#6C218290 4132830 003 39395 SP14
#20#.......
#20#.......
So problem is happening for sequences ,if I use
sqlldr control=<controlfilename> userid=userid/pwd@conn
Then sequences in detail table goes for a toss ,as per my analysis since rows parameter by default is 64,so header_tag in body table is changing after 64 records only.
But in header table data is fine ,10 distinct sequences are inserted.
If i use the following then
sqlldr control=<controlfilename> userid=userid/pwd@conn rows=1
sequences is fine in body table.
So please let me know if its limitation of sql*loader or I am missing something.
In case you need more information ,please let me know the same.
Regards,
SSYou might ask your question in the Database-General-forum
-
Hi,
I have similar issue where i have requirement to load 270 million record per day into single table(having No constraints & Indexes), where every CTL file contain 37000 records.
I have machine having 16 CPU and 2 thread per CPU is set.I am using the PARALLEL=TRUE, MULTITHREADING=TRUE,DIRECT=TRUE option in sql loader.
E.g:- OPTIONS( ERRORS=100000, SILENT=all, MULTITHREADING=TRUE, DIRECT=TRUE, PARALLEL=TRUE, SKIP_INDEX_MAINTENANCE=TRUE,streamsize=1048576, readsize=1048576, columnarrayrows=8000 )
Also enable the PARALLEL degree and set the value to 32.
When i am running sqlloader 4 session with above configuration it was taking total 4-5 seconds to load 4 CTL files having 37000 records per file. Well for initial 50 million records sql loader behave normally to load the CTL files in 4-5 seconds, but after 50 million records in table, time taken to process the 4 CTL files was gradually increasing to 40 to 70 seconds and it was still increasing as the number of records more and more in table.
I don't know why sqlloader behave like this after 50 million record in table.
Below is the parallel parameter set on the machine
SQL> show parameter parallel;
NAME TYPE VALUE
fast_start_parallel_rollback string LOW
parallel_adaptive_multi_user boolean TRUE
parallel_automatic_tuning boolean FALSE
parallel_degree_limit string CPU
parallel_degree_policy string MANUAL
parallel_execution_message_size integer 16384
parallel_force_local boolean FALSE
parallel_instance_group string
parallel_io_cap_enabled boolean FALSE
parallel_max_servers integer 80
parallel_min_percent integer 0
NAME TYPE VALUE
parallel_min_servers integer 0
parallel_min_time_threshold string AUTO
parallel_server boolean FALSE
parallel_server_instances integer 1
parallel_servers_target integer 32
parallel_threads_per_cpu integer 2
recovery_parallelism integer 0
Kindly repl on the above queryI've got a similar problem.
I'm running Informatica which runs SQL*Loader via OCI.
With direct & parallel my Indexes give me ORA-26002 - quite understandable.
As its all wrapped up, I cannot say SKIP_INDEX_MAINTENANCE directly.
1) Is there a way to give SQL*Loader some Default-Parameters? I read something about a File shrept.lst but I cannot find a reference in the Oracle documentation.
Something useful down this road?
2) when I omit parallel, what am I losing? I load one file into one partition of one table. I read the SQL*Loader Documentation but didn't get the message of the 'Intrasegment Parallel Loading' Paragraph. Is this using parallel? Or is it just enabling to use parallel (if there will be a second SQL*Loader)? If its all about 'enabling' I can easily omit this - I know there won't be a second SQL*Loader for this partition.
regards,
Kathrin -
SQL Loader - Load multiple files in UNIX
HI all, I'm looking for a bit of help with using SQL LOADER to load multiple files into one table. I've had a look on the forums but still struggling with this one.
What I want to do is basically upload everything thats in /home/ib. I know you can use INFILE for several files in the control file but I have several hundred files to upload so this isn't practical. Can I pass the directory name as an INFILE parameter?
Any help would be appreciated.On Unix you shouldn't worry about that. See this example :
[ora102 work db102]$ cat test11.dat
aaaaa,bbbbb
ccccc,ddddd
eeeee,fffff
[ora102 work db102]$ cat test12.dat
ggggg,hhhhh
jjjjj,kkkkk
lllll,mmmmm
[ora102 work db102]$ cat test13.dat
nnnnn,ooooo
ppppp,qqqqq
rrrrr,sssss
[ora102 work db102]$ cat load.sh
CTL=load.ctl
echo "load data" > $CTL
for DAT in test1*.dat
do
echo "INFILE "$DAT >> $CTL
done
echo "replace" >> $CTL
echo "INTO TABLE test1" >> $CTL
echo "fields terminated by ','" >> $CTL
echo "trailing nullcols" >> $CTL
echo "( a, b )" >> $CTL
sqlldr test/test control=load.ctl
[ora102 work db102]$ ./load.sh
SQL*Loader: Release 10.2.0.1.0 - Production on Mon Oct 2 11:45:44 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Commit point reached - logical record count 3
Commit point reached - logical record count 6
Commit point reached - logical record count 9
[ora102 work db102]$ sqlplus test/test
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Oct 2 11:45:49 2006
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
TEST@db102 SQL> select * from test1 order by a,b;
A B
aaaaa bbbbb
ccccc ddddd
eeeee fffff
ggggg hhhhh
jjjjj kkkkk
lllll mmmmm
nnnnn ooooo
ppppp qqqqq
rrrrr sssss
9 rows selected.
TEST@db102 SQL> -
Loading from multiple flat files to same table using SQL Loader
Hi Gurus,
Can anyone please brief me the pros and cons of kicking of multiple sql loader sessions that reads multiple flat files but inserting it into just one table.
The table is not partitioned. Avg record counts for each flat file is about 5-6 million.
Oracle 11g,
OS: Linux
Regards
Cherrish VaidiyanVaidiyan wrote:
Hi Gurus,
Can anyone please brief me the pros and cons of kicking of multiple sql loader sessions that reads multiple flat files but inserting it into just one table.Cherrish,
Pros -> Faster loading of more data
Cons -> Potential performance degradation
Test to see how much resource consuming this task would be and do a priority comparison of that multi-multi load task with other stuff that will be happening in the database in the multi-multi load time so you could decide how to share resources in that time. -
How to handle Multiple date formats for the same date field in SQL*Loader
Dear All,
I got a requirement where I need to get data from a text file and insert the same into oracle table.
I am using SQL*Loader to populate the data from the text file into my table.
The file has one field where I am expecting date date data in multiple formats, like dd/mon/yyyy, yyyy/dd/mon, yyyy/mon/dd, ,mm/dd/yyyy, mon/dd/yyyy.
While using SQL*Loader, I can see Loading is failing for records where we have formats like yyyy/dd/mon, yyyy/mon/dd, mon/dd/yyyy.
Is there any way in SQL*Loader where we can mention all these date formats so that this date data should go smoothly into the underlying date column in the table.
Appreciate your response on this.
Thanks,
Madhu K.The point being made was, are you sure that you can uniquely identify a date format from the value you receieve? Are you sure that the data stored is only of a particular limited set of formats?
e.g. if you had a value of '07/08/03' how do you know what format that is?
It could be...
7th August 2003 (thus assuming it's DD/MM/RR format)
or
8th July 2003 (thus assuming it's MM/DD/RR format)
or
3rd August 2007 (thus assuming it's RR/MM/DD format)
or
8th March 2007 (thus assuming it's RR/DD/MM format)
or even more obscurely...
3rd July 2008 (MM/RR/DD)
or
7th March 2008 (DD/RR/MM)
Do you have any information to tell you what formats are valid that would allow you to be specific and know what date format is meant?
This is a classic example of why dates should be stored on the database using DATE datatype and not VARCHAR2. It can lead to corruption of data, especially if the date can be entered in any format a user wishes. -
Loading multiple files with SQL Loader
Hello.
I will appreciate your recommendation about the way to load multiple files (to multiple tables) using SQL Loader with only one Control file.
file1 to load to Table1, file2 to load to Table2 etc.
How the Control file should look like?
I was looking on Web, but didn't find exactly what I need.
Thanks!Ctl File : myctl.ctl
---------- Start ---------
LOAD DATA
INFILE 'F:\sqlldr\abc1.dat'
INFILE 'F:\sqlldr\abc2.dat'
INTO TABLE hdfc1
(TRANS_DATE CHAR,
NARRATION CHAR,
VALUE_DATE CHAR,
DEBIT_AMOUNT INTEGER,
CREDIT_AMOUNT INTEGER,
CHQ_REF_NUMBER CHAR,
CLOSING_BALANCE CHAR)
INTO TABLE hdfc2
(TRANS_DATE CHAR,
NARRATION CHAR,
VALUE_DATE CHAR,
DEBIT_AMOUNT INTEGER,
CREDIT_AMOUNT INTEGER,
CHQ_REF_NUMBER CHAR,
CLOSING_BALANCE CHAR)
-----------End-----------
Sqlldr Command
sqlldr scott/tiger@dbtalk control=F:\sqlldr\myctl.ctl log=F:\sqlldr\ddl_file1.txt
Regards,
Abu
Maybe you are looking for
-
Why isn't my site working yet?
I have my domain name all ready to go and plugged in but my site won't launch.
-
Import user defined class in JSP page
In my test.jsp page, I tried to display the user name using the value returned from a class UserInfo's static function getUsername(), like this: <%@page import="toystore.view.UserInfo" %> <html:text property="username" value="<%= UserInfo.getUsername
-
I have exported a couple of iphoto albums to an .mac web gallery using iphoto08. I can open them in safari ok. When I try to link to these within iweb 08 using web widgets or the menu, no albums are available. Anyone had similar experiences?
-
Hi All, In material master , I have a total stock qty of 31000nos and Total value 787.4/- which MAP comes 0.0254 for a material. But in MAP field in material master, the value is rounded off to 0.03. I have done 551 scrapping for that material in MB
-
JckechBox into JTable -- getselectedrow
I have a problem with Checkbox into JTable My table has checkbox into first column. If I select checkbox, the program open a new JPanel. To do this I have associated an ActionListener to CheckBox that seems to work fine. This is the related code: pub