The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
unix script to takes the old data from a TXT file and compress them into new file vpandey Shell Programming and Scripting 2 03-05-2008 07:10 AM
How to fetch data from a text file in Unix shikhakaul Shell Programming and Scripting 4 01-25-2008 07:20 AM
help for writing shell script to export table data sankarg Shell Programming and Scripting 3 10-18-2006 03:01 AM
unix script to export data from csv file to oracle database vinayagan Shell Programming and Scripting 3 07-20-2005 01:16 AM
How to copy data file from UNIX and put it on PC BillyT UNIX for Dummies Questions & Answers 3 01-22-2001 06:09 AM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-23-2005
whatisthis's Avatar
Registered User
 

Join Date: Aug 2004
Posts: 175
Smile How to export data file from Unix

Hi,
I am searching a way to export data file on Unix to SQL server on a daily bases.
Any one has any ideas?

Thanks in advance!
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-23-2005
Registered User
 

Join Date: Jan 2005
Posts: 682
Quote:
Originally Posted by whatisthis
Hi,
I am searching a way to export data file on Unix to SQL server on a daily bases.
Any one has any ideas?
Without more specifics and in general terms:

1. Create a delimited flat file on UNIX
2. ftp or rcp the file to your SQL Server database server
3. Use bcp to load the data into SQL Server

Alternatively for a hands-free approach:

1. Create a delimited flat file on UNIX
2. Define a DTS jobs that ftps your data from UNIX and then loads your SQL Server database however often you wish

Thomas
Reply With Quote
  #3 (permalink)  
Old 02-23-2005
deckard's Avatar
Registered User
 

Join Date: Jul 2002
Location: Ohio
Posts: 107
What I do at work

We have an application on the Unix side that has a job that creates a comma delimited file every night. That file gets written to a specific directory. I have that directory shared out using Samba. Our Microsoft SQL admin then has a daily job that imports the data file into the SQL tables using a UNC path to the Samba share on the Unix box. Works like a charm.

As the other comment noted, we need more specifics to really address your particular situation, but... the basics are:

1. Set up a script or use the functionality of your Unix application to generate a comma delimited data file
2. Use cron to schedule that job to happen at a specified interval (daily, hourly, etc...)
3. Use some kind of file transfer protocol (Samba, FTP, SCP, NFS) to allow your SQL server to grab that data file
4. Set up a script or use the functionality of your SQL application to import the comma delimited data file
Reply With Quote
  #4 (permalink)  
Old 02-23-2005
whatisthis's Avatar
Registered User
 

Join Date: Aug 2004
Posts: 175
Thumbs up Thanks!

I will try it out!
Reply With Quote
  #5 (permalink)  
Old 02-24-2005
whatisthis's Avatar
Registered User
 

Join Date: Aug 2004
Posts: 175
Red face ftp authentication problem

Our Unix server is not configureed to allow ftp from SQL server side to Unix side.
But I can ftp files from Unix to Windows server.
I have a cron job to write pipe deliminated file on certain directory.
I am trying to write a script to ftp the log files to windows shared drive folder every night automatically.
It seemed like unless the server allows anonymous user, I can't pass auto authentication step.

Can I write script to ftp file automatically with correct user name and password?
Reply With Quote
  #6 (permalink)  
Old 02-24-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 2,999
ftp -n hostName <<EOF
user userName userPasswd
.....ftp commands here.......
EOF
Reply With Quote
  #7 (permalink)  
Old 02-24-2005
whatisthis's Avatar
Registered User
 

Join Date: Aug 2004
Posts: 175
Thumbs up it worked!

Thanks a lot!
Reply With Quote
Google UNIX.COM
Reply

Tags
linux

Thread Tools
Display Modes




All times are GMT -7. The time now is 09:06 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0