Solved

data upload to oracle DB using UNIX shell script

Posted on 2004-09-25
5
981 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
[X]
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
  • 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: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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…
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.

738 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