Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: SQL loader unix script with multiple files
"sybrandb" <sybrandb_at_gmail.com> wrote in message
news:1167734720.854648.306820_at_48g2000cwx.googlegroups.com...
>
>
> On Jan 2, 11:17 am, mnemoni..._at_hotmail.com wrote:
>> Hello
>> What I have to doe is create for a large set of control en datafile 1
>> shellscripts which starts te actual load.
>>
>> My problem is :
>>
>> I use variables and check which control files and datafiles are
>> present. That goes well.
>>
>> But what I want is seperate logfiles for each control file so I
>> specified a variable for this to take over then name of the
>> controlfile, but what happens is that only the log file of the last
>> control file is beinig processed.
>> here some code:
>>
>> for LOG_FL in `ls ${DATADIR}/ctl/*.CTL | sed
>> 's/\.[^.]*$//'>${DATADIR}/ctl/filelist.txt |cat
>> ${DATADIR}/ctl/filelist.txt`
>> do
>> export LOG_FL
>> done
>>
>> for file in `ls ${DATADIR}/ctl/*.CTL|sort -rn -k 5,5 | awk '{print
>> $NF}'`
>> do
>> sqlldr $SCHEMA/$SCHEMAPWD control=$file log=$LOG_FL
>>
>> What am I doing wrong here?
>>
>> regards
>>
>> Michel
>
> Shouldn't the latter FOR not be included in the former FOR
> ie
> for LOG_FL in `ls ${DATADIR}/ctl/*.CTL | sed
> 's/\.[^.]*$//'>${DATADIR}/ctl/filelist.txt |cat
> ${DATADIR}/ctl/filelist.txt`
> do
> export LOG_FL
> for file in `ls ${DATADIR}/ctl/*.CTL|sort -rn -k 5,5 | awk '{print
> $NF}'`
> do
> sqlldr $SCHEMA/$SCHEMAPWD control=$file log=$LOG_FL
> done
> done
... only if you want to run for every .CTL something like this:
sqlldr control=1.CTL log=1
sqlldr control=2.CTL log=1
..........
sqlldr control=1.CTL log=2
sqlldr control=2.CTL log=2
....
Regards
Dimitre
Received on Tue Jan 02 2007 - 05:14:10 CST
![]() |
![]() |