![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Connecting to oracle database from shell script | satyakiran | Shell Programming and Scripting | 8 | 07-03-2009 03:22 PM |
| How to insert data into MYSql database from a text file | shirleyeow | Shell Programming and Scripting | 4 | 01-11-2008 05:00 AM |
| Shell Script to Load data into the database using a .csv file and .ctl file | Csmani | Shell Programming and Scripting | 3 | 05-24-2006 08:09 AM |
| how to insert data in database based on text file? | forevercalz | Shell Programming and Scripting | 9 | 12-20-2005 11:40 PM |
| unix script to export data from csv file to oracle database | vinayagan | Shell Programming and Scripting | 3 | 07-20-2005 04:16 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Need Shell Script to upload data from Text file to Oracle database
Hi
Does any one have any idea on uploading the data using Unix Shell script from text file to Oracle database. Requirement:- 1. Need to connect to Oracle database from Unix Shell script. 2. Need to pick Text file from some location on Unix Box. 3. Need to upload the data from text file to some table in Oracle Database. Any similar scripts matching above requirement is also highly appreciated. Or any one have any idea on shell scripts available on net. Advance Thanks JC |
|
||||
|
Quote:
Read this |
|
||||
|
a complete code
Example, here is a utility that will take the output from Linux vmstat utility and insert the output into an Oracle table:
PATH=$ORACLE_HOME/bin:$PATH export PATH SERVER_NAME=`uname -a|awk '{print $2}'` typeset -u SERVER_NAME export SERVER_NAME # sample every five minutes (300 seconds) . . . . SAMPLE_TIME=300 while true do vmstat ${SAMPLE_TIME} 2 > /tmp/msg$$ # run vmstat and direct the output into the Oracle table . . . cat /tmp/msg$$|sed 1,3d | awk '{ printf("%s %s %s %s %s %s\n", $1, $8, $9, 14, $15, $16) }' | while read RUNQUE PAGE_IN PAGE_OUT USER_CPU SYSTEM_CPU IDLE_CPU do $ORACLE_HOME/bin/sqlplus -s perfstat/perfstat@testsys1<<EOF insert into perfstat.stats\$vmstat values ( sysdate, $SAMPLE_TIME, '$SERVER_NAME', $RUNQUE, $PAGE_IN, $PAGE_OUT, $USER_CPU, $SYSTEM_CPU, $IDLE_CPU, 0 ); EXIT EOF done done rm /tmp/msg$$ (taken from this site) |
|
||||
|
Quote:
Last edited by dennis.jacob; 03-26-2007 at 02:27 AM.. |
|
||||
|
in that case...
use sqlloader, external table or pro*c
|
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Tags |
| linux |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|