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 > Shell Programming and Scripting
.
google unix.com



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
oracle connection from shell script DILEEP410 Shell Programming and Scripting 4 07-01-2009 02:19 AM
sybase connection through shell-script Amitabh UNIX for Dummies Questions & Answers 9 04-10-2009 10:34 PM
how to check DB connection in unix shell script kmanivan82 Shell Programming and Scripting 1 10-31-2008 09:22 AM
Shell Script: want to insert values in database when update script runs ring Shell Programming and Scripting 1 10-25-2007 03:06 AM
shell script- oracle connection problem nattynatty Shell Programming and Scripting 4 08-14-2002 09:48 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-08-2009
ravi214u ravi214u is offline
Registered User
  
 

Join Date: Jul 2008
Posts: 19
Connection to database through shell script

Hi

when i am calling the shell script with two parameter like id and date it works fine.But the same shell script is call by java application it gives the error as shown below
Code:
Thu Jan  8 04:13:22 EST 2009|The Get Segment Process Failed: SP2-0306:
Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] where <logon>  ::= <username>[/<password>][@<connect_identifier>] | /
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] where <logon>  ::= <username>[/<password>][@<connect_identifier>] | /
SP2-0306: Invalid option.
Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER}] where <logon>  ::= <username>[/<password>][@<connect_identifier>] | /
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
The code for calling the data base as given below
Code:
RUNID=$1
BUS_DT=$2
sleep 10
auth=`cat ..pass`
STD_LOGFILE=/temp/logs
DT=`date +%Y%m%d:%H%M%I`

returnedvalue=`sqlplus -s $auth <<EOF set 
serveroutput on 
WHENEVER SQLERROR EXIT 1 
exec mapping_runid_to_segment($1) 
set serveroutput OFF EXIT; 
EOF` 
the main problem is accepting userid/pass($auth) by parameter.If i hardcoded than also its working fine with java application any suggestions
  #2 (permalink)  
Old 01-08-2009
adderek adderek is offline
Registered User
  
 

Join Date: Sep 2007
Location: Poland
Posts: 111
Please, be more specific about your questions.
I can see no JAVA here. Only shell (might be something else as shell...) script that seems to be calling sqlplus. By the way: you can call a script from the sqlplus using command line...
Closed Thread

Bookmarks

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:04 PM.


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