Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

data upload to oracle DB using UNIX shell script

Posted on 2004-09-25
5
979 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 100 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

840 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