Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

data upload to oracle DB using UNIX shell script

Posted on 2004-09-25
5
Medium Priority
?
987 Views
Last Modified: 2013-12-26
I have one flat file coming to server in a particular directory. I need to write a UNIX shell script to uplaod data from this file to Oracle database. What I am planning to do is , at a specified time this unix script will run and will search for 'flatdatafile.txt' in the ' /flatdatafiles/'  directory. When this script runs, automatically data from this file will get populated to the database in table 'invoice_data_tbl' .
 Please help...I am new to UNIX shell programming.
0
Comment
Question by:ushelke
  • 2
5 Comments
 
LVL 9

Expert Comment

by:HamdyHassan
ID: 12155191
Looks like you want to learn , here is some hints and I will try to help you to reach your goal
It's important to do it by yourself otherwise you will not learn


(Q1) at a specified time this unix script will run

(A1)
     You need to learn cron job
     man crontab
     or search google for "cron job guide"



(Q2) will search for 'flatdatafile.txt' in the ' /flatdatafiles/'

(A2) Learn how to use "if" at ksh
         if -f  /folder/file.txt


(Q3) populated to the database in table 'invoice_data_tbl' .

(A3) You need to take a look at example How Oracle upload flat files, your need to creat .ctl file
    again search google for guide
0
 

Author Comment

by:ushelke
ID: 12156172
thyanks Hamdy Hassan..
YOu are right I am learning. Since I am new to shell scripting and unix too...I am looking for sample scripts showing invoking SQL loader to load the data from flat file to the database. I am conversent the way SQL loader can be used to load flat file data to the Oracle DB.
0
 
LVL 9

Accepted Solution

by:
HamdyHassan earned 400 total points
ID: 12161193
Let's start

At your shell script you will have something like
sqlldr scott/tiger control=loader.ctl

Please read the whole doc at
http://www.orafaq.com/faqloadr.htm

0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Integration Management Part 2
Suggested Courses

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question