sqlldr in shell script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sqlldr in shell script
# 1  
Old 07-28-2011
sqlldr in shell script

Hi

I'm using SQL*Loader in shell script as below

Code:
sqlldr $uname/$pword@$ORACLE_SID parfile=$test.par

for e.g. if $test is 'file1'

and getting the below error
Code:
LRM-00109: could not open parameter file 'file1'
LRM-00113: error when processing file 'file1'


SQL*Loader: Release 11.2.0.1.0 - Production on Thu Jul 28 14:37:59 2011

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

SQL*Loader-100: Syntax error on command-line

but the actual file which exists is file1.par Is it not recognising $test.par

Thanks

Last edited by pludi; 07-28-2011 at 11:41 AM..
# 2  
Old 07-28-2011
Try
Code:
${test}.par

# 3  
Old 07-28-2011
Still I'm getting the same error
# 4  
Old 07-28-2011
Are you running this from cron perhaps ?
If you are, please specify full path to par file
or cd into DIR where the par file is and execute sqlldr.
# 5  
Old 07-28-2011
I'm running by executing a shell script, given absolute path same error.

I ran in unix prompt sqlldr by giving just the name of the par file without path(ctl, par all in the same directory) it works. It did not work when executing in the shell script.

Thanks

Last edited by vinoth_kumar; 07-28-2011 at 01:08 PM..
# 6  
Old 07-28-2011
So you are saying :
You run sqlldr from command line with file1.par as parameter and it works ?
But after you put it in a shell script, you are getting error above ?

If above is true please :
Put set -x as second line of the script.
Put exec 2>>/path/to/log.log as next line
Also you might want to put some echo $test aswell.
Run the script and post the output of script and log.log here.

Regards
Peasant.
# 7  
Old 07-29-2011
I'm using the below command but .txt is appended to the beginning of the file names not in the end. how to display it like filename.txt?

for test in `cat files.lst`; do echo $test".txt"; done

.txtrce
.txt
.txtge
.txttion
.txt
.txtheist
.txtave
.txt_tion

Thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sqlldr call via shell script prompts error

Good morning, I'm attempting to call sqlldr via shell script and it is prompting endIf is unec #!/bin/sh cd /tmp/v_tst FILENAME_WANTED=`date +"HourlyData_%Y%m%d_%H00.txt"` echo "FILENAME_WANTED = ${FILENAME_WANTED}" LIST_OF_FILES=`ls -rt HourlyData*.txt |tail -1` LIST_OF_FILES=`basename... (4 Replies)
Discussion started by: V1l1h1
4 Replies

2. Shell Programming and Scripting

Script to create the SQLLDR control file from Oracle table.

I need to create the shell script load the few 100 table using the SQLLDR. Need to generate the control file for each table using oracle table. table has "table names" and "column names" using this need create the control file. example table rows below table_nme column_nme DEPT ... (2 Replies)
Discussion started by: pimmit22043
2 Replies

3. Shell Programming and Scripting

Facing problem in the sqlldr & shell script

Guys i am facing two problems : (1) when i create the sql loader file the date format i m getting is this 28-DEC-11 12.03.14.107137 AM; for this i m using this script but unable to load the files trailing nullcols ( SERIALNO, AMOUNT, CLASS, MDN, VDATE "to_date(:TIMESTAMP, 'DD-MON-YY... (6 Replies)
Discussion started by: xal_kaushi
6 Replies

4. Shell Programming and Scripting

Script to check if SQLLDR has been installed on Unix/Aix servers

How can i check if sqlldr has been installed on my AIX/UNIX mechine? Is there any unix script to check this one out.... (0 Replies)
Discussion started by: msrahman
0 Replies

5. Shell Programming and Scripting

Perl script to load data by calling sqlldr

Hello all, I know this is Unix forum, but i also know that there are some experts here who can help me out with this situation; I am loading a data file into oracle table using Perl script by calling sqlldr script. It does not do anything, and no data is getting loaded. Any help,... (2 Replies)
Discussion started by: msrahman
2 Replies

6. Shell Programming and Scripting

Shell con sqlldr

Hola, Genere un proceso en proC que me inserta registros a oracle, el cual ejecuto desde un shell en Unix. Por otro lado tengo un sqlldr que me hace el trabajo en un 25 % de tiempo que mi proceso en C. Se que puedo ejecutar mi sqlldr desde un shell, pero no se como hacer, alguien tiene un... (0 Replies)
Discussion started by: marcoinxs
0 Replies

7. Shell Programming and Scripting

sqlldr end of file

Hi, I've a batch program that load data from a file like: 00000013|FERRAN|JULIAN|GONZALEZ|1| 00000014|FRANCESC|NARVAEZ|PAZOS|1| 00000015|INMACULADA|MAYOL|BELTRAN|2| I used the sqlldr command in this way: sqlldr userid=U/P control=$SCRIPTS/CTRL.WCT data=$DATA/FILE log=$LOGS/FILE.LOG... (2 Replies)
Discussion started by: raippl
2 Replies

8. UNIX for Dummies Questions & Answers

how to know sqlldr error?

Hi all, Can anyone know how to get the error codes from 'sqlldr' ?While am trying to load some 'ISO-8859-1' data file into 'utf8' oracle database,some records are rejected.I want to know the reason,whether it is due to charset mismatch or some other issues.How come i to know that ? ... (3 Replies)
Discussion started by: DILEEP410
3 Replies

9. Shell Programming and Scripting

sqlldr help

1.The below script works perfectly fine in dev. However, i have been told that i cannot hardcode the password into the file during production impementation. Is their way i could ask the user to enter the password when the script is executed 2. I have seven different files each of which needs to... (1 Reply)
Discussion started by: systemsb
1 Replies
Login or Register to Ask a Question