The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 11:10 AM
How to fetch data from a text file in Unix shikhakaul Shell Programming and Scripting 4 01-25-2008 11:20 AM
help for writing shell script to export table data sankarg Shell Programming and Scripting 3 10-18-2006 06:01 AM
unix script to export data from csv file to oracle database vinayagan Shell Programming and Scripting 3 07-20-2005 04:16 AM
How to copy data file from UNIX and put it on PC BillyT UNIX for Dummies Questions & Answers 3 01-22-2001 10:09 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 02-23-2005
whatisthis's Avatar
whatisthis whatisthis is offline
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!
  #2 (permalink)  
Old 02-23-2005
tmarikle tmarikle is offline Forum Advisor  
Registered User
  
 

Join Date: Jan 2005
Posts: 683
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
  #3 (permalink)  
Old 02-23-2005
whatisthis's Avatar
whatisthis whatisthis is offline
Registered User
  
 

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

I will try it out!
  #4 (permalink)  
Old 02-24-2005
whatisthis's Avatar
whatisthis whatisthis is offline
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?
  #5 (permalink)  
Old 02-24-2005
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
ftp -n hostName <<EOF
user userName userPasswd
.....ftp commands here.......
EOF
  #6 (permalink)  
Old 02-24-2005
whatisthis's Avatar
whatisthis whatisthis is offline
Registered User
  
 

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

Thanks a lot!
  #7 (permalink)  
Old 02-23-2005
deckard's Avatar
deckard deckard is offline
Registered User
  
 

Join Date: Jul 2002
Location: Ohio
Posts: 135
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
Closed Thread

Bookmarks

Tags
linux

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:26 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0