Errors when using sql loader direct path with a nvl functin on a date field
I thought I read in 10g that all sql functions now work in direct path mode.
the following function works without direct path mode. When we turn direct path mode on the load fails. When we take the function out in direct path mode it works.
mydate DATE "YYYY-MM-DD" "nvl(:mydatedate,to_date('9999-01-01','YYYY-MM-DD'))"
with direct path mode I get:
EVERY record gets rejected with this error.
Record 10: Rejected - Error on table MYTABLE
ORA-00604: error occurred at recursive SQL level 1
ORA-01861: literal does not match format string
again works fine without direct=true, works fine with direct=true if i get rid of the function.
any ideas?
Message was edited by:
Guess2
Message was edited by:
Guess2
like usual your posts are completely useless daniel.
I could have swarn that oracle advertised that you can use functions with 9i or 10g release in the new features guys or the first releases.
Similar Messages
-
Cannot get Oracle sequence to be used with SQL Loader direct path load.
I attempted to load approximately 3 million rows from a flat file into a 10g database using SQL Loader direct path load. In order to generate a primary key for each of these rows I used a simple SQL expression which gets the next number of an Oracle sequence and assigned that to my primary key column inside the control file. The strange thing is no primary key was generated for each of these columns as I see the sequence was not advanced. Furthermore when I try to run a query to find the count on those rows which have this column as NOT NULL ,I get the total of all the rows even though on inspection this column is empty in each of the rows.
As far as I know, in the control file for a direct path load I am able to use a SQL Expression that returns simple scalar data which a NEXTVAL on a sequence does. (Oreilly Oracle SQL Loader The Definitive Guide p.184)
Does anybody why my primary key was not generated and furthermore why is this column in a query appear to be NOT NULL when in fact it has nothing in it?Daniel,
I appreciate your response alot.
Now a follow on. You say that SQL*Loader is the fastest way to get data into Oracle Spatial even though the conventional path. How does SQL*Loader do this? Doesn't it use OCI?
I just can't help but think that coverting my data to SQL*Loader format, and then having it parse it and send it to the database in some form must be slower than me just sending whatever SQL Loader sends to the DB myself using OCI. Am I missing something?
The SQL Loader documentation seems to suggest that SQL*Loader just turns the input into alot of INSERT stateemnts. If so, can't I just do this?
My performance with OCI and INSERT statements isn't very good, but I believe I am doing one transaction per insert. Might I be as well off to concentrate on fine tuning my OCI based code using INSERTs?
I will actually do some time tests myself, but I would appreciate your opinion.
Once again thanks for the great info you have provided. -
Hi,
I am trying to load data using SQL Loader Direct Path. One of the tables has a REC_UPD_DT column which is of timestamp datatype. The table was created with default value of SYSTIMESTAMP on this column. However when I load the table, the REC_UPD_DT is null due to the behavior(bypasses the sqlfunctions, etc) of the Direct Path method.
What is the way out to achieve my objective?
I do not want to use the conventional path since that is proven to be slow for my case.
Thanks in advance
PavinHi,
My apologies for not providing requested information before. Here are the scripts:
I am testing from my windows m/c.
Database version: 10.2.0.3
Table creation script:
CREATE TABLE TXN_DEFAULT
(MAPPER_Q_ID NUMBER(1,0) NOT NULL,
TRANSACTION_SEQUENCE NUMBER(10,0) NOT NULL,
RECORD_COUNT NUMBER(4,0),
STATUS VARCHAR2(1 CHAR),
USER_ID VARCHAR2(20 CHAR),
USER_IP_ADDRESS VARCHAR2(35 CHAR),
REC_UPD_DT TIMESTAMP (6) DEFAULT SYSTIMESTAMP
Loader Control file script:
OPTIONS (DIRECT=TRUE)
load data
CHARACTERSET WE8ROMAN8
into table TXN_DEFAULT
append
FIELDS TERMINATED BY ' '
trailing nullcols
MAPPER_Q_ID,
TRANSACTION_SEQUENCE,
RECORD_COUNT,
STATUS,
USER_ID,
USER_IP_ADDRESS,
REC_UPD_DT
Sample Dat file contents:
0 251939112 3 N chowdsr 10.222.79.20
1 251939113 140 N zhuanre 146.222.52.176
2 251939114 41 N sombupo 146.222.187.155
0 251939116 75 N BaseAdmin 146.222.4.246
Log File contents:
SQL*Loader: Release 10.2.0.1.0 - Production on Mon Dec 7 13:22:23 2009
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Control File: Control.ctl
Character Set WE8ROMAN8 specified for all input.
Data File: Control.dat
Bad File: Control.bad
Discard File: none specified
(Allow all discards)
Number to load: ALL
Number to skip: 0
Errors allowed: 50
Continuation: none specified
Path used: Direct
Table TXN_DEFAULT, 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
MAPPER_Q_ID FIRST * WHT CHARACTER
TRANSACTION_SEQUENCE NEXT * WHT CHARACTER
RECORD_COUNT NEXT * WHT CHARACTER
STATUS NEXT * WHT CHARACTER
USER_ID NEXT * WHT CHARACTER
USER_IP_ADDRESS NEXT * WHT CHARACTER
REC_UPD_DT NEXT * WHT CHARACTER
Table TXN_DEFAULT:
4 Rows successfully loaded.
0 Rows 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: 4
Total logical records rejected: 0
Total logical records discarded: 0
Total stream buffers loaded by SQL*Loader main thread: 1
Total stream buffers loaded by SQL*Loader load thread: 0
Run began on Mon Dec 07 13:22:23 2009
Run ended on Mon Dec 07 13:22:23 2009
Elapsed time was: 00:00:00.75
CPU time was: 00:00:00.08
If I run using Conventional path, the REC_UPD_DT is populated with the a systimestamp value. However, this column values are null when I use the Direct path. Log files have no errors. What is the way out to achieve my objective?
Thanks in advance.
- Pavin -
Oracle Replication and SQL*Load direct Path
We are setting up Oracle replication and have a few tables which are loaded using SQL*Loader Direct path. I have following questions:
1. Can MultiMaster replication replicate direct patch sqlloaded data.
2. If the answer to the above question is no, should we set up a new snapshot replication group . All other tables are in the Multi Master replication.
3. Another question is on the number of replication groups. How many of these we should create. We have total of about 500 tables and database size is about 450 Gig. We plan to replicate all the tables and the refresh interval we want to be one minute for all the tables. Does having more/less replication groups help??
Thanks for your helpWe are setting up Oracle replication and have a few tables which are loaded using SQL*Loader Direct path. I have following questions:
1. Can MultiMaster replication replicate direct patch sqlloaded data.Yes, I don't think it should matter how the table is getting updated.
2. If the answer to the above question is no, should we set up a new snapshot replication group . All other tables are in the Multi Master replication.see above
3. Another question is on the number of replication groups. How many of these we should create. We have total of about 500 tables and database size is about 450 Gig. We plan to replicate all the tables and the refresh interval we want to be one minute for all the tables. Does having more/less replication groups help??
Thanks for your help I believe what Oracle recommends is that you split up your tables into replication groups transactionally. I personally have 6 replication groups supporting 700+ tables. They are broken up more by business function than by number and size. -
SQL Loader direct path loads and unusable indexes
sorry about all the questions. I am researching several issues. I am reading the Utilities document. It says that in certain circumstances indexes will become unusable. I have some questions about my scenario.
1. tables partitioned by range
2. local indexes
3. all tables have 1 primary key and other indexes are non-unique
4. all sql loads will go into the most recent partition
5. users will be querying tables while sql loader is occurring
6. only one sql loader session will run per table
7. no foreign keys, triggers, or other constrants other than primary keys.
The docs are not clear. Do I have a concern about unusable indexes with direct path loads? Will indexes function while the sql loader direct path is occurring(this I can't test since I have small data files now and they load fast, but I will have larger ones in production).
My understanding is that Extertnal tables using Insert append is exactly the same as sql loader direct path load. Is this true?if you dont have anything productive to say how about you don't post at all? you have made ignorant posts like this for years.
as far as reading the docs what do you think "the docs are not clear" means? By the docs I am referring to the utilities document.
As far as version number its 10.2 and I forgot that. However, it does not appear that sql loader has really changed all that much over the last few versions.
Finally I plan on testing it out and its more than a 2 minute test. I wanted to make sure I don't miss anythng in my tests.
don't respond to any threads or posts I make from now on. -
Hi All,
Can anyone confirm whether SQL loader DIRECT path option can load in clustered tables?
Also what is the difference between Clustered Server and Clustered Table? Will the clustered Server by default have clustered tables?That is 1/2 of the questions asked.
What do you mean by clustered server? Do you mean RAC or HACMP or Veritas something else?
What do you mean by clustered table? Do you mean like a single table hash cluster or something else?
Please be specific ... you don't want an answer based on a guess.
And what is 10g? Is that 10.1.0.3, or 10.2.0.1, or 10.2.0.5? Again this is computers please be precise.I am sorry. version is 10.2.0.1. its Oracle RAC. I am not sure what kind of table clustering exists. I believe its table cluster using a cluster key(what kind of table clustering is this?)
I just want to know if sql loader direct path option can load data in Oracle RAC / Clustered tables? If not, any workaround for that? -
Sql loader direct path leaving indexes unusuable
10.2.0.3
redhat 4.5
temp tablespace 6.5 GB
datafile size 33k
I thought in version 10 you can do direct path loads without indexes going unusuable?
i saw this, but we have plenty of temp space.
http://dbasolve.com/OracleError/ora/ORA-01502.txt
Oracle Error:
ORA-01502 Oracle Index in Unusable State
Cause and Solution:
When trying to perform query on Oracle tables with select SQL statement, Oracle returns this error.
The error indicates an attempt has been made to access an index or index partition that has been marked unusable by a direct load or by a DDL operation.
The problem usually happens when using the Direct Path for the SQL*Loader, Direct Load or DDL operations. This requires enough temporary space to build all indexes of the table. If there is no enough space in TEMP tablespace, all rows will still be loaded and imported, but the indices are left with STATUS = 'INVALID'.
Invalid indexes can be checked with down SQL statement.
SQL>SELECT * from USER_INDEXES WHERE STATUS = 'INVALID';
Solution to this error is simple. You can:
1. Drop the specified index and/or recreate the index
2. Rebuild the specified index
3. Rebuild the unusable index partition
Generally, the following SQL manipulation language will be able to rebuild the unusable index:
SQL>ALTER INDEX index_name REBUILD onlineHi Alan,
How big is this table and what sort of indexes are they?
An index update using SQL*Loader unrecoverable direct path load is achieved by an isolated sort followed by a nologging merge of the old index and the new mini-index into a new index segment (this according to seminar notes by Jonathan Lewis). This will conceivably take a long time for a large table / large index.
Performance improvements? Are you loading all records into a new partition?
Cheers,
Colin -
SQL Loader, direct path and indexes on partition tables
Hi,
I have a big partitioned table and I have two indexes on it.
When I use SQL Loader to upload data to my table with using OPTIONS (DIRECT=TRUE) UNRECOVERABLE , then it takes almost half hour to load just one record!!
When I remove OPTIONS (DIRECT=TRUE), then it takes just two seconds to upload the same one record.
Am I missing anything? Can I use direct path load on indexed partitioned tables and have reasonable load time ?
An scheduled external job loads almost 100,000 records into this table every hour and I am trying to make the sql*loader performance it as fast as possible.
Any help would be appreciated,
AlanHi Alan,
How big is this table and what sort of indexes are they?
An index update using SQL*Loader unrecoverable direct path load is achieved by an isolated sort followed by a nologging merge of the old index and the new mini-index into a new index segment (this according to seminar notes by Jonathan Lewis). This will conceivably take a long time for a large table / large index.
Performance improvements? Are you loading all records into a new partition?
Cheers,
Colin -
"ORA-00054 Resource Busy Error" when running SQL*Loader in Parallel
Hi all,
Please help me on an issue. We are using Datastage which uses sql*loader to load data into an Oracle Table. SQL*Loader invokes 8 parallel sessions for insert on the table. When doing so, we are facing the following error intermittently:
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 specifiedSince the control file is generated automatically by datastage, we cannot modify/change the options and test. Control File for the same is:
OPTIONS(DIRECT=TRUE, PARALLEL=TRUE, SKIP_INDEX_MAINTENANCE=YES)
LOAD DATA INFILE 'ora.2958.371909.fifo.1' "FIX 1358"
APPEND INTO TABLE X
x1 POSITION(1:8) DECIMAL(15,0) NULLIF (1:8) = X'0000000000000000',
x2 POSITION(9:16) DECIMAL(15,0) NULLIF (9:16) = X'0000000000000000',
x3 POSITION(17:20) INTEGER NULLIF (17:20) = X'80000000',
IDNTFR POSITION(21:40) NULLIF (21:40) = BLANKS,
IDNTFR_DTLS POSITION(41:240) NULLIF (41:240) = BLANKS,
FROM_DATE POSITION(241:259) DATE "YYYY-MM-DD HH24:MI:SS" NULLIF (241:259) = BLANKS,
TO_DATE POSITION(260:278) DATE "YYYY-MM-DD HH24:MI:SS" NULLIF (260:278) = BLANKS,
DATA_SOURCE_LKPCD POSITION(279:283) NULLIF (279:283) = BLANKS,
EFFECTIVE_DATE POSITION(284:302) DATE "YYYY-MM-DD HH24:MI:SS" NULLIF (284:302) = BLANKS,
REMARK POSITION(303:1302) NULLIF (303:1302) = BLANKS,
OPRTNL_FLAG POSITION(1303:1303) NULLIF (1303:1303) = BLANKS,
CREATED_BY POSITION(1304:1311) DECIMAL(15,0) NULLIF (1304:1311) = X'0000000000000000',
CREATED_DATE POSITION(1312:1330) DATE "YYYY-MM-DD HH24:MI:SS" NULLIF (1312:1330) = BLANKS,
MODIFIED_BY POSITION(1331:1338) DECIMAL(15,0) NULLIF (1331:1338) = X'0000000000000000',
MODIFIED_DATE POSITION(1339:1357) DATE "YYYY-MM-DD HH24:MI:SS" NULLIF (1339:1357) = BLANKS
)- it occurs intermittently. When this job runs, no one will be accessing the database or the tables.
- When we do not run in parallel, then we are not facing the error but it is very slow (obviously).Just in case, I am also attaching the Datastage Logs:
Item #: 466
Event ID: 1467
Timestamp: 2009-06-02 23:03:19
Type: Info
User Name: dsadm
Message: main_program: APT configuration file: /clu01/datastage/Ascential/DataStage/Configurations/default.apt
node "node1"
fastname "machine_name"
pools ""
resource disk "/clu01/datastage/Ascential/DataStage/Datasets" {pools ""}
resource scratchdisk "/clu01/datastage/Ascential/DataStage/Scratch" {pools ""}
node "node2"
fastname "machine_name"
pools ""
resource disk "/clu01/datastage/Ascential/DataStage/Datasets" {pools ""}
resource scratchdisk "/clu01/datastage/Ascential/DataStage/Scratch" {pools ""}
node "node3"
fastname "machine_name"
pools ""
resource disk "/clu01/datastage/Ascential/DataStage/Datasets" {pools ""}
resource scratchdisk "/clu01/datastage/Ascential/DataStage/Scratch" {pools ""}
node "node4"
fastname "machine_name"
pools ""
resource disk "/clu01/datastage/Ascential/DataStage/Datasets" {pools ""}
resource scratchdisk "/clu01/datastage/Ascential/DataStage/Scratch" {pools ""}
node "node5"
fastname "machine_name"
pools ""
resource disk "/clu01/datastage/Ascential/DataStage/Datasets" {pools ""}
resource scratchdisk "/clu01/datastage/Ascential/DataStage/Scratch" {pools ""}
node "node6"
fastname "machine_name"
pools ""
resource disk "/clu01/datastage/Ascential/DataStage/Datasets" {pools ""}
resource scratchdisk "/clu01/datastage/Ascential/DataStage/Scratch" {pools ""}
node "node7"
fastname "machine_name"
pools ""
resource disk "/clu01/datastage/Ascential/DataStage/Datasets" {pools ""}
resource scratchdisk "/clu01/datastage/Ascential/DataStage/Scratch" {pools ""}
node "node8"
fastname "machine_name"
pools ""
resource disk "/clu01/datastage/Ascential/DataStage/Datasets" {pools ""}
resource scratchdisk "/clu01/datastage/Ascential/DataStage/Scratch" {pools ""}
Item #: 467
Event ID: 1468
Timestamp: 2009-06-02 23:03:20
Type: Warning
User Name: dsadm
Message: main_program: Warning: the value of the PWD environment variable (/clu01/datastage/Ascential/DataStage/DSEngine) does not appear to be a synonym for the current working directory (/clu01/datastage/Ascential/DataStage/Projects/Production). The current working directory will be used, but if your ORCHESTRATE job does not start up correctly, you should set your PWD environment variable to a value that will work on all nodes of your system.
Item #: 468
Event ID: 1469
Timestamp: 2009-06-02 23:03:32
Type: Warning
User Name: dsadm
Message: Lkp_1: Input dataset 1 has a partitioning method other than entire specified; disabling memory sharing.
Item #: 469
Event ID: 1470
Timestamp: 2009-06-02 23:04:22
Type: Warning
User Name: dsadm
Message: Lkp_2: Input dataset 1 has a partitioning method other than entire specified; disabling memory sharing.
Item #: 470
Event ID: 1471
Timestamp: 2009-06-02 23:04:30
Type: Warning
User Name: dsadm
Message: Xfmer1: Input dataset 0 has a partitioning method other than entire specified; disabling memory sharing.
Item #: 471
Event ID: 1472
Timestamp: 2009-06-02 23:04:30
Type: Warning
User Name: dsadm
Message: Lkp_2: When checking operator: Operator of type "APT_LUTProcessOp": will partition despite the
preserve-partitioning flag on the data set on input port 0.
Item #: 472
Event ID: 1473
Timestamp: 2009-06-02 23:04:30
Type: Warning
User Name: dsadm
Message: SKey_1: When checking operator: A sequential operator cannot preserve the partitioning
of the parallel data set on input port 0.
Item #: 473
Event ID: 1474
Timestamp: 2009-06-02 23:04:30
Type: Warning
User Name: dsadm
Message: SKey_2: When checking operator: Operator of type "APT_GeneratorOperator": will partition despite the
preserve-partitioning flag on the data set on input port 0.
Item #: 474
Event ID: 1475
Timestamp: 2009-06-02 23:04:30
Type: Warning
User Name: dsadm
Message: buffer(1): When checking operator: Operator of type "APT_BufferOperator": will partition despite the
preserve-partitioning flag on the data set on input port 0.
Item #: 475
Event ID: 1476
Timestamp: 2009-06-02 23:04:30
Type: Info
User Name: dsadm
Message: Tgt_member: When checking operator: The -index rebuild option has been included; in order for this option to be
applicable and to work properly, the environment variable APT_ORACLE_LOAD_OPTIONS should contain the options
DIRECT and PARALLEL set to TRUE, and the option SKIP_INDEX_MAINTENANCE set to YES;
this variable has been set by the user to `OPTIONS(DIRECT=TRUE, PARALLEL=TRUE, SKIP_INDEX_MAINTENANCE=YES)'.
Item #: 476
Event ID: 1477
Timestamp: 2009-06-02 23:04:35
Type: Info
User Name: dsadm
Message: Tgt_member_idtfr: When checking operator: The -index rebuild option has been included; in order for this option to be
applicable and to work properly, the environment variable APT_ORACLE_LOAD_OPTIONS should contain the options
DIRECT and PARALLEL set to TRUE, and the option SKIP_INDEX_MAINTENANCE set to YES;
this variable has been set by the user to `OPTIONS(DIRECT=TRUE, PARALLEL=TRUE, SKIP_INDEX_MAINTENANCE=YES)'.
Item #: 477
Event ID: 1478
Timestamp: 2009-06-02 23:04:41
Type: Warning
User Name: dsadm
Message: Lkp_2,6: Ignoring duplicate entry at table record 1; no further warnings will be issued for this table
Item #: 478
Event ID: 1479
Timestamp: 2009-06-02 23:04:41
Type: Warning
User Name: dsadm
Message: Tgt_member_idtfr,0: SQL*Loader-951: Error calling once/load initialization
Item #: 479
Event ID: 1480
Timestamp: 2009-06-02 23:04:41
Type: Warning
User Name: dsadm
Message: Tgt_member_idtfr,0: ORA-00604: error occurred at recursive SQL level 1
Item #: 480
Event ID: 1481
Timestamp: 2009-06-02 23:04:41
Type: Warning
User Name: dsadm
Message: Tgt_member_idtfr,0: ORA-00054: resource busy and acquire with NOWAIT specified
Item #: 481
Event ID: 1482
Timestamp: 2009-06-02 23:04:41
Type: Warning
User Name: dsadm
Message: Tgt_member_idtfr,6: SQL*Loader-951: Error calling once/load initialization
Item #: 482
Event ID: 1483
Timestamp: 2009-06-02 23:04:41
Type: Warning
User Name: dsadm
Message: Tgt_member_idtfr,6: ORA-00604: error occurred at recursive SQL level 1
Item #: 483
Event ID: 1484
Timestamp: 2009-06-02 23:04:41
Type: Warning
User Name: dsadm
Message: Tgt_member_idtfr,6: ORA-00054: resource busy and acquire with NOWAIT specified
Item #: 484
Event ID: 1485
Timestamp: 2009-06-02 23:04:41
Type: Fatal
User Name: dsadm
Message: Tgt_member_idtfr,6: The call to sqlldr failed; the return code = 256;
please see the loader logfile: /clu01/datastage/Ascential/DataStage/Scratch/ora.23335.478434.6.log for details.
Item #: 485
Event ID: 1486
Timestamp: 2009-06-02 23:04:41
Type: Fatal
User Name: dsadm
Message: Tgt_member_idtfr,0: The call to sqlldr failed; the return code = 256;
please see the loader logfile: /clu01/datastage/Ascential/DataStage/Scratch/ora.23335.478434.0.log for details. -
SQL Loader Direct Path and Nulls
I'm using Sql Loader with Direct Path and I cannot find a way to remove trailing spaces in varchar2 fields.
I'm trying to avoid updating the tables after loading.
Any ideas?Hi Alan,
How big is this table and what sort of indexes are they?
An index update using SQL*Loader unrecoverable direct path load is achieved by an isolated sort followed by a nologging merge of the old index and the new mini-index into a new index segment (this according to seminar notes by Jonathan Lewis). This will conceivably take a long time for a large table / large index.
Performance improvements? Are you loading all records into a new partition?
Cheers,
Colin -
ORA-01003 when using SQL*Loader
Hi people,
Can anyone shed some light on this.
We have a multitasked dataload operation that is using SQL*Loader and on occasion we're seeing some rows failing due to ORA-01003 no statement parsed. Could this be due to some shortage of a database resource (cursors, connections ??) or are there other well known reasons for this.
Any help appreciated.
Regards
AndyCheck those registers ( rows ) in the bad file or in the discard file. If the register(s) are in the discard file is because the register ( row ) does not complete the requirements of denoted in the controlfile file and if those registers are in the error file is because the database is rejecting them according to constraints and so on.
Conclusion: realize in what file those rows are being stored after to be rejected.
Joel Pérez -
How to load a default value in to a column when using sql loader
Im trying to load from a flat file using sql loader.
for 1 column i need to update using a default value
how to go about this?Hi!
try this code --
LOAD DATA
INFILE 'sample.dat'
REPLACE
INTO TABLE emp
empno POSITION(01:04) INTEGER EXTERNAL NULLIF empno=BLANKS,
ename POSITION(06:15) CHAR,
job POSITION(17:25) CHAR,
mgr POSITION(27:30) INTEGER EXTERNAL NULLIF mgr=BLANKS,
sal POSITION(32:39) DECIMAL EXTERNAL NULLIF sal=BLANKS,
comm POSITION(41:48) DECIMAL EXTERNAL DEFAULTIF comm = 100,
deptno POSITION(50:51) INTEGER EXTERNAL NULLIF deptno=BLANKS,
hiredate POSITION(52:62) CONSTANT SYSDATE
)-hope this will solve ur purpose.
Regards.
Satyaki De. -
Loading VARRAY's with SQL loader, direct path in 9i?
Isn't it possible to load VARRAY's with SQLloader and direct path in a Oracle 9i database?
/Magnus Hornstrom
mailto:[email protected]Daniel,
I appreciate your response alot.
Now a follow on. You say that SQL*Loader is the fastest way to get data into Oracle Spatial even though the conventional path. How does SQL*Loader do this? Doesn't it use OCI?
I just can't help but think that coverting my data to SQL*Loader format, and then having it parse it and send it to the database in some form must be slower than me just sending whatever SQL Loader sends to the DB myself using OCI. Am I missing something?
The SQL Loader documentation seems to suggest that SQL*Loader just turns the input into alot of INSERT stateemnts. If so, can't I just do this?
My performance with OCI and INSERT statements isn't very good, but I believe I am doing one transaction per insert. Might I be as well off to concentrate on fine tuning my OCI based code using INSERTs?
I will actually do some time tests myself, but I would appreciate your opinion.
Once again thanks for the great info you have provided. -
Loading Data Error while using SQL Loader
Hi All,
I am facing another issue while loading the data from text file to oracle db.
I have a table in which data is loaded from multiple files. What i want the when i load the data i want to load the filename as well in the table in front of the record. the script which works fine when i load data in windows OS but i am getting error in Unix OS. My sql loader script is as follows.
source $HOME/. .bash_profile
export LOGFILE=/NSN/rawfiles/scripts/PAYMOBILE_LOAD/load.log
ORACLE_ACCESS=cdr/cdr123_awcc@$ORACLE_SID
FILES=`ls /NSN/rawfiles/bkp/PAYMOBILE/JAN2013/*.txt`;
for file in ${FILES[@]}
do
filename=`expr substr "$file" 43 50`
echo $filename
sqlldr $ORACLE_ACCESS control=/NSN/rawfiles/scripts/PAYMOBILE/CAT.ctl log=$LOGFILE data=/NSN/rawfiles/bkp/PAYMOBILE/JAN2013/$filename skip=0 direct=true
cd
mv /NSN/rawfiles/bkp/PAYMOBILE/JAN2013/$filename /NSN/backup/PAYMOBILE/JAN2013/
done
Control File for the same which i run on unix is :
Load data
INFILE "AR_101_1011_01-01-2013-01-32.txt"
Append
into table CDR.PAY_MOBILE_012013
fields terminated by "|" optionally enclosed by " "
trailing nullcols
VERSION, TICKETTYPE, GMT_TIME Date 'YYYY-MM-DD HH24:MI:SS' , LOCAL_TIME Date 'YYYY-MM-DD HH24:MI:SS', TRANSACID, EXTERNAL_TRANSACTION_ID, MEDIUM, ALIASCATEGORY, SERVICE, OPERATION, ACTORID,
ALIASNAME, SENDERACTORID, SENDERALIASNAME, RECIPIENTACTORID, RECIPIENTALIASNAME, THIRDACTORID, THIRDALIASNAME, ERRORHRN, CLASS, SNE,
MASTERSNE, VOUCHERCATEGORYID, VOUCHERSCENARIOID, EXPIRYDATE Date 'YYYY-MM-DD HH24:MI:SS', UNITVALUEID, CREDIT, VAT, IERROR, OPERSTATE, OPERERROR, CREATION_DATE Date 'YYYY-MM-DD HH24:MI:SS',
LAST_UPDATE Date 'YYYY-MM-DD HH24:MI:SS', BRANDID, CREDIT_PERIOD, CREDIT_EXPIRY_DATE Date 'YYYY-MM-DD HH24:MI:SS', SENDER_ACCOUNT, SENDER_TRANSAC, SENDER_ACCOUNT_TYPE, RECIPIENT_ACCOUNT,
RECIPIENT_TRANSAC, RECIPIENT_ACCOUNT_TYPE, RECIPIENT_MEDIUM, TIMESTAMP Date 'YYYY-MM-DD HH24:MI:SS', SENDERBILLINGTYPE, RECIPIENTBILLINGTYPE
Control file which works fine in windows is as follows:
Load data
Append
into table CDR.PAY_MOBILE_012013
fields terminated by "|" optionally enclosed by " "
trailing nullcols
VERSION, TICKETTYPE, GMT_TIME Date 'YYYY-MM-DD HH24:MI:SS' , LOCAL_TIME Date 'YYYY-MM-DD HH24:MI:SS', TRANSACID, EXTERNAL_TRANSACTION_ID, MEDIUM, ALIASCATEGORY, SERVICE, OPERATION, ACTORID,
ALIASNAME, SENDERACTORID, SENDERALIASNAME, RECIPIENTACTORID, RECIPIENTALIASNAME, THIRDACTORID, THIRDALIASNAME, ERRORHRN, CLASS, SNE,
MASTERSNE, VOUCHERCATEGORYID, VOUCHERSCENARIOID, EXPIRYDATE Date 'YYYY-MM-DD HH24:MI:SS', UNITVALUEID, CREDIT, VAT, IERROR, OPERSTATE, OPERERROR, CREATION_DATE Date 'YYYY-MM-DD HH24:MI:SS',
LAST_UPDATE Date 'YYYY-MM-DD HH24:MI:SS', BRANDID, CREDIT_PERIOD, CREDIT_EXPIRY_DATE Date 'YYYY-MM-DD HH24:MI:SS', SENDER_ACCOUNT, SENDER_TRANSAC, SENDER_ACCOUNT_TYPE, RECIPIENT_ACCOUNT,
RECIPIENT_TRANSAC, RECIPIENT_ACCOUNT_TYPE, RECIPIENT_MEDIUM, TIMESTAMP Date 'YYYY-MM-DD HH24:MI:SS', SENDERBILLINGTYPE, RECIPIENTBILLINGTYPE, FILENAME CONSTANT "AR_101_1011_01-12-2012-23-32.txt"
and the sql loader script which works fine in windows is as follows:
cd K:\paymobilefiles\DEC2012\1
for %%f in (*.txt) do (K:\paymobilefiles\DEC2012\1\LOAD\REPTEXT K:\paymobilefiles\DEC2012\1\LOAD\TEST.ctl "%%f">K:\paymobilefiles\DEC2012\1\LOAD\MYMOBILE.ctl
sqlldr userid=cdr/cdr123_awcc@tsiindia control=K:\paymobilefiles\DEC2012\1\LOAD\MYMOBILE.ctl rows=50000 bindsize=20000000 readsize=20000000 data=%%f log=K:\paymobilefiles\DEC2012\1\LOAD\MYMOBILE.log
move %%f K:\paymobilefiles\DEC2012\backup\1
when using windows based scripts i am getting filename in the filename column but when running the above mentioned scripts i am not able to get the filenames in the filename column.
Can anyone help over the same pleaseHI,
There is Difference in Control files , no INFILE & FILENAME CONSTANT values
Load data
Append
into table CDR.PAY_MOBILE_012013
fields terminated by "|" optionally enclosed by " "
trailing nullcols
VERSION, TICKETTYPE, GMT_TIME Date 'YYYY-MM-DD HH24:MI:SS' , LOCAL_TIME Date 'YYYY-MM-DD HH24:MI:SS', TRANSACID, EXTERNAL_TRANSACTION_ID, MEDIUM, ALIASCATEGORY, SERVICE, OPERATION, ACTORID,
ALIASNAME, SENDERACTORID, SENDERALIASNAME, RECIPIENTACTORID, RECIPIENTALIASNAME, THIRDACTORID, THIRDALIASNAME, ERRORHRN, CLASS, SNE,
MASTERSNE, VOUCHERCATEGORYID, VOUCHERSCENARIOID, EXPIRYDATE Date 'YYYY-MM-DD HH24:MI:SS', UNITVALUEID, CREDIT, VAT, IERROR, OPERSTATE, OPERERROR, CREATION_DATE Date 'YYYY-MM-DD HH24:MI:SS',
LAST_UPDATE Date 'YYYY-MM-DD HH24:MI:SS', BRANDID, CREDIT_PERIOD, CREDIT_EXPIRY_DATE Date 'YYYY-MM-DD HH24:MI:SS', SENDER_ACCOUNT, SENDER_TRANSAC, SENDER_ACCOUNT_TYPE, RECIPIENT_ACCOUNT,
RECIPIENT_TRANSAC, RECIPIENT_ACCOUNT_TYPE, RECIPIENT_MEDIUM, TIMESTAMP Date 'YYYY-MM-DD HH24:MI:SS', SENDERBILLINGTYPE, RECIPIENTBILLINGTYPE, FILENAME CONSTANT "AR_101_1011_01-12-2012-23-32.txt"
)Thanks,
Ajay More
http://moreajays.blogspot.com -
Error when using SQL Developer to IMPORT Access data into Oracle
Hello,
I am using SQL Develoepr to export Access mdb file into Oracle. When I try to use Tools ---? Migration---> Microsssfot access exported -->
I am getting an error message upon attaching the Access database file, the error states
"Error#40179 - XMLExporter - Methiod'AddFromFile' of object'_References failed. Export did not complete successfully.
What could be the reason for this error please advise.
ThanksHi,
Try searching for:Re: 30EA2 - No Available Databases in Capture step with MS Access Migration
Thread: 30EA2 - No Available Databases in Capture step with MS Access Migration
Posted: Dec 20, 2010 11:04 AM
Also note that copy to oracle - (for just table/column information) is available on right click.
-Turloch
SQLDeveloper team
Maybe you are looking for
-
List is not empty but ListIterator is not working?
Hello all, I am adding items to a List<String[]> object. The thing is when I check the object for null, it shows that the object is not null. But when I try using ListIterator, it shows that the List has no elements. what could be going wrong? Here i
-
Smart Resizing not working for RDWEB Published desktop
I have a working RDS deployment, I am able to change the screen resolution of the published desktops both in powershell and registry. However if I add the 'smart sizing' option, this does not get published in the .rdp file. I have added the entries i
-
Help 3 diferent answers from apple
I'm very frustrated with not getting a clear answer from apple ! I'm about to get a new mac pro most likely bto from the online store. I also have a $600 dollar gift card for best buy that I want to use for a 23'' ACD. My question is if I buy the app
-
No more WIFI on wireless radio
Lenovo R61i - 8932 - AEG - XP Pro SP 3. The wireless radio on ThinkVantage Access Connections (TVAC) has lost the WIFI icon and only shows the Bluetooth connection. However the adapter Intel PRO Wireless 3945ABG is visible (and active) in windows net
-
Hai to set pass word for my company code
hai how can i set password to my company code while doing practice in sap lap Edited by: pavankumarkota on Jun 26, 2011 5:18 PM