Solved

data upload to oracle DB using UNIX shell script

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
deburging in oracle form 12 76
Detect CR LF to each line 12 137
viewing source code from eclipse 13 74
either24  challenge 19 84
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now