Home » RDBMS Server » Server Utilities » SqlLoader Insert Data - Automatic
SqlLoader Insert Data - Automatic [message #127473] Mon, 11 July 2005 16:31 Go to next message
sam20
Messages: 3
Registered: July 2005
Junior Member
Hi all,

I have a data in a text file which is updated once in a while. I want to load data from that text file to oracle database when either there is new data in a text file text file or every hour (any criteria will do). Can i write a cntl file for that? If yes can i write a scheduled Cntl file to do that? Because i want to run that Cntl file automatically.

Please help me with this.
Sam
Re: SqlLoader Insert Data - Automatic [message #127477 is a reply to message #127473] Mon, 11 July 2005 18:36 Go to previous messageGo to next message
William Robertson
Messages: 1643
Registered: August 2003
Location: London, UK
Senior Member
I would go for an external table and a materialized view. Have the MV refresh every hour.
Re: SqlLoader Insert Data - Automatic [message #127594 is a reply to message #127473] Tue, 12 July 2005 07:56 Go to previous messageGo to next message
smartin
Messages: 1803
Registered: March 2005
Location: Jacksonville, Florida
Senior Member
Some of this depends on the specifics, but that sounds like a nice approach. Other options that came to my mind were:

1) having an external table and using a merge statement on a schedule

2) scheduling a sqlldr session to truncate into target table every hour

But, for large quantities of data, the MV approach would only need to worry with data that had changed, which would be better than option 2 reloading all of it; and it wouldn't need any extra coding as it would use the built-in mv refresh feature, which would be better to create and maintain than option 1.
Re: SqlLoader Insert Data - Automatic [message #127601 is a reply to message #127473] Tue, 12 July 2005 08:20 Go to previous messageGo to next message
sam20
Messages: 3
Registered: July 2005
Junior Member
Thank you all. Please give me some example or link where i can learn abt external tables and MV because that is something new to me.
Re: SqlLoader Insert Data - Automatic [message #127617 is a reply to message #127473] Tue, 12 July 2005 09:19 Go to previous messageGo to next message
smartin
Messages: 1803
Registered: March 2005
Location: Jacksonville, Florida
Senior Member
See below for info on external tables. It contains further links to the data warehouse guide, which has info on MV's.

http://download-west.oracle.com/docs/cd/B14117_01/server.101/b10739/tables.htm#sthref2070
Re: SqlLoader Insert Data - Automatic [message #127641 is a reply to message #127473] Tue, 12 July 2005 11:33 Go to previous messageGo to next message
sam20
Messages: 3
Registered: July 2005
Junior Member
I have a table in oracle. How can i make it external table and how can i uses MV's to refresh table so that it inserts data from txt file every hour. This is something new to me that's why i am not very clear how to do it.
Re: SqlLoader Insert Data - Automatic [message #127645 is a reply to message #127473] Tue, 12 July 2005 11:39 Go to previous message
smartin
Messages: 1803
Registered: March 2005
Location: Jacksonville, Florida
Senior Member
The table in oracle would not be the external table. An external table is one where the data does not reside in the database, but instead resides in a flat file on the filesystem. So your external table would be your text file.

Please read a bit in the link supplied above where it talks about managing external tables. It tells you how to do it and shows examples.
Previous Topic: Unix pipe and SQLLDR
Next Topic: Importing Oracle 8.1.7 into Oracle 9.0.2
Goto Forum:
  


Current Time: Wed Dec 25 19:59:41 CST 2024