LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-12-2003, 12:54 PM   #1
tornadoburn
LQ Newbie
 
Registered: Nov 2003
Location: Montreal, Canada
Distribution: RH 7.1
Posts: 23

Rep: Reputation: 15
Unix log file as source for Oracle DB


Hi,

I'm new to perl and was wondering, if there is a way for me to write a script that will retreive the need info out of a unix server log file, and write it to the appropriate Table & Field in an Oracle DB.

This must sound crazy, but its to automate a process which is lengthy and forces users to cut & paste alot in excel.
Could I maybe do this using PL/SQL - instead of perl?

Thanks in advance for any guidance.
 
Old 12-12-2003, 06:47 PM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
Yes. PL/SQL can read files (DBMS_OUTPUT package). Usually, the files it can read and write are in a controlled directory. V$PARAMETER view will tell you what the directory is. You will have to log into Oracle as oracle in order to read/write outside of that directory. Your DBA should be able to help you set things up.

If you use perl you have two choices: use DBI in perl to connect to the db, and then read the file and insert. Or create a well ordered file you can use with sqlldr.

One other option: sqlldr all by itself. Read up on the control file options for reading a text file, specifying record layouts, etc.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to log out from all instances of unix? u4u Linux - General 1 01-11-2005 07:22 AM
Creating a log file in unix?? linux_dejan Programming 3 09-03-2004 10:56 PM
Unix source code Scrag Programming 9 05-25-2004 02:28 AM
How is Open Source related to UNIX and LINUX? Smokey2001 Linux - Newbie 2 03-31-2004 10:45 PM
iptables, changing log file from /var/log/messages acid2000 Linux - Networking 3 03-11-2003 08:38 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration