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
oracle connection from shell script DILEEP410 Shell Programming and Scripting 4 07-01-2009 02:19 AM
Connecting to sybase via shell script. arvindcgi Shell Programming and Scripting 1 05-20-2008 10:30 AM
Connect to sybase database using Korn shell script bhgopi Shell Programming and Scripting 7 08-10-2005 09:34 AM
remote sybase connection and php error. lealyz Shell Programming and Scripting 4 08-23-2004 04:52 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 Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 03-03-2005
Amitabh Amitabh is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 1
sybase connection through shell-script

how do i connect to sybase through shell script written in linux
  #2 (permalink)  
Old 03-03-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Impossible to write a shell script in Linux. Linux is the OS, not a shell.

Here is an example of a startup/shutdown script for Sybase:
Code:
#!/bin/sh
#
# Startup script for Sybase SQL server
#

#
# Adjust tcp's keepalive param to 10 mins for PCs which disconnect unexpectedly.
# Sun recommend that the value be set no lower than 10 minutes or performance
# may be affected.
#
/usr/sbin/ndd -set /dev/tcp tcp_keepalive_interval 600000

#
# Path to Sybase and install.
#
SYBASE=/usr/sybase

ISQL=$SYBASE/bin/isql

INSTALL=$SYBASE/install

export SYBASE ISQL INSTALL

case "$1" in
'start')
	#
	# Sybase server startup.
	#
	su sybase -c "$INSTALL/startserver -f $INSTALL/RUN_FOO -f $INSTALL/RUN_FOO_BACKUP &"
	;;

'stop')
	#
	# Sybase server shutdown.
	#
	$ISQL -S FOO -U sa -P password > /dev/console 2>&1 <<-'END'
	shutdown SYB_BACKUP
	go
	shutdown
	go
	END
	;;

*)
	#
	# Invalid param.
	#
	echo "Usage: /etc/init.d/sybase { start | stop }"
	;;
esac
  #3 (permalink)  
Old 03-03-2005
ramaraju ramaraju is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 3
I am a bit confused with the reply.
Shell feature does not exist on Linux unline in UNIX?
  #4 (permalink)  
Old 03-03-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
It's really simple - Linux is not a shell - it's a operating system. So it's impossible to write a 'linux' shell script. You can write shell scripts on a linux system but they would be one of the normal shells (sh,ksh,csh,bash,tcsh,...).
  #5 (permalink)  
Old 05-20-2005
anthreedhr anthreedhr is offline
Registered User
  
 

Join Date: Sep 2003
Location: Indianapolis, IN USA
Posts: 10
su sybase -c command....

RTM,
what does the
su sybase -c "$INSTALL/startserver -f $INSTALL/RUN_FOO -f $INSTALL/RUN_FOO_BACKUP &"

command do? Would it allow me to change between several interface files (that contain the sybase host info)?

If so, I noticed that you had 2 of them, so does that mean that you can utilize 2 (or more) different interface files to use to connect with ISQL?


Thanks,
Harold
  #6 (permalink)  
Old 05-20-2005
RTM's Avatar
RTM RTM is offline Forum Advisor  
Hog Hunter
  
 

Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
Quote:
RTM,
what does the command do?
su sybase -c "$INSTALL/startserver -f $INSTALL/RUN_FOO -f $INSTALL/RUN_FOO_BACKUP &"
No clue - I don't know sybase! The assumption is that it starts both instances of sybase which I assume is the main database server and the backup service.
If it doesn't work with two -f instances, then create two different lines for each instead. The DBA who wrote this script doesn't work at my company anymore so I can't even ask him.
  #7 (permalink)  
Old 05-20-2005
jingi1234 jingi1234 is offline
Registered User
  
 

Join Date: Mar 2005
Posts: 48
I guess ..you are asking how to connect to sybase using shell script.

use here documents

ISQL -U -P -S -o output.txt ............ << EOF

Whatever you want to do in the sybase


EOF


The output will be written to that file specified with -o switch (in the above case --> output.txt).

Hope this helps.
Jingi
Sponsored Links
Closed Thread

Bookmarks

Tags
linux, solaris

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 05:02 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