Shell Script
Introduction :
This Shell Script is developed to automatically get the .ctl (Control) file and .csv (Coma separated) file for SQL Loader.
And after successful uploading the .csv file is moved to another location.
This will facilitate user to put .csv file of any name.
I have registered a request in Oracle Application to call that script for data uploading.
Step 1:
Shell Script:
echo "Following are System Parameters"echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
p0=$0
p1=$1
p2=$2
p3=$3
p4=$4
echo "1st System Parameter :"$p0
echo "2nd System Parameter :"$p1
echo "3rd System Parameter :"$p2
echo "4th System Parameter :"$p3
echo "5th System Parameter :"$p4
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Following are User Parameters "
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
u1=$5
echo "1st User Parameter :"$u1
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
cd /home/oracle/alrazi
data_file=$(ls *.csv)
ctl_file=$(ls *.ctl)
echo $data_file
echo $ctl_file
sqlldr apps/**** control=$ctl_file data=$data_file
if [ $? -ne 0 ]
then
echo " Error Occured "
exit 1
else
mv $data_file /home/oracle/alrazi/alraziback
echo "Upload Successful"
echo "Moved File: " $data_file
echo "Successfully to Backup Folder "
exit 0
fi
Step 2:
save the shell script to $AP_TOP/bin as XXTEST.progStep 3:
create link as followsln -s $FND_TOP/bin/fndcpesr XXTEST
Step 4:
Create ExecutableStep 5:
Register as Concurrent ProgramStep 6:
Define User ParametersStep 7:
Run RequestLog file
When it is obvious that the goals cannot be reached, don't adjust the goals, adjust the action steps. See the link below for more info.
ReplyDelete#steps
www.ufgop.org
Good post. I be taught something more difficult on different blogs everyday. It should all the time be stimulating to read content material from other writers and observe slightly one thing from their store. I’d desire to make use of some with the content material on my weblog whether you don’t mind. Natually I’ll provide you with a hyperlink in your web blog. Thanks for sharing. casino online
ReplyDelete