Current directory?
Christian COMMARMOND, January 10, 2017 - 1:39 pm UTC
Hi,
I thought that the current directory is where Oracle will try to read the files?
So
cd /lobdata
then run sqlldr from there.
And tell us if it solves the problem...
Regards,
Christian
Ratna Vemuri, January 10, 2017 - 3:21 pm UTC
Right, if I change the .dat with the path it works. But the problem is with volume. I have 150-200k rows in that table and I have around 25 tables where I need to do this.
Isn't there any way I can just change the control file?
Christian
Keeping everything in one dir works but that makes it hard for us to process. We have thousands of lob files and multiple tables we are targeting to load from DB2 to Oracle. So keeping everything in one dir makes it hard for us.
January 11, 2017 - 6:09 am UTC
You could approach it the other way - since you have 1000's of files I'm assuming you are *generating* the control file, ie the list of files to be loaded ?
If that is the case, then why not generate the control file with the fully qualified path ?
Ratna Vemuri, January 11, 2017 - 3:28 pm UTC
Ok but how?
I can specify the path for the .dat file but how do I specify the path for the lob file?
.ctl file
load data
infile 'ENROLLMENT_MESSAGE.dat'
into table PQMINST1.AUTO_ENROLLMENT_MESSAGE
trailing nullcols
(
ID,
MESSAGE_CONTENT_ref FILLER ,
MESSAGE_CONTENT LOBFILE(MESSAGE_CONTENT_ref) TERMINATED BY EOF,
)
January 12, 2017 - 2:01 am UTC
So I see two possible scenarios here
1) all your files are in 1 directory
In that case, just run sqlldr from that directory
2) all of your files are spread across many directories
In that case, you must have some means of identifying which file is in which directory no ?
That means you have a *listing* of them in some form that *includes* the directory, or if not, it would trivial to create one, eg "find . -ls" or "dir /s /b"
That list becomes the input into your control file, and since the directory name is included for each file, the LOBFILE clause works without issue