How to COnnect to Oracle database from UNIX Box | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

How to COnnect to Oracle database from UNIX Box

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 05-19-2009
angelarosh angelarosh is offline
Registered User
 
Join Date: May 2009
Last Activity: 12 June 2009, 9:06 AM EDT
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
PHP How to COnnect to Oracle database from UNIX Box

I am trying to connect to Oracle Databse from UNIX box using sqlplus command. But i get sqplus not found message.

$ sqlplus
sqlplus: not found

I have searched in forums and all are suggesting to set environment varaibles...can somebody tell me what variables to set and how to set.and the values that need to be assigned to those environment variables?

$ echo $ORACLE_HOME
/usr/oracle
$ echo $PATH
/usr/oracle/bin:/usr/bin:

This is what I get when I dispay the vlaues stored in these environment variables....
Sponsored Links
    #2  
Old 05-19-2009
panyam panyam is offline Forum Advisor  
Registered User
 
Join Date: Sep 2008
Last Activity: 24 July 2014, 3:48 AM EDT
Posts: 1,156
Thanks: 20
Thanked 104 Times in 99 Posts
Just go to


Code:
cd $ORACLE_HOME/bin

there you can find the sqlplus u directly execute from there.

Or include the above path
Code:
($ORACLE_HOME/bin)

in the path variable.
Sponsored Links
    #3  
Old 05-19-2009
angelarosh angelarosh is offline
Registered User
 
Join Date: May 2009
Last Activity: 12 June 2009, 9:06 AM EDT
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
$ cd $ORACLE_HOME/bin
/usr/oracle/bin: does not exist

This is what I get when I try to do as u suggested....

anyother way???
    #4  
Old 05-19-2009
panyam panyam is offline Forum Advisor  
Registered User
 
Join Date: Sep 2008
Last Activity: 24 July 2014, 3:48 AM EDT
Posts: 1,156
Thanks: 20
Thanked 104 Times in 99 Posts
ok do the following


Code:
 
cd $ORACLE_HOME

i hope above path exists.

There you search for the "sqlplus" executable.


Code:
 
find . -name "sqlplus" -print

Sponsored Links
    #5  
Old 05-19-2009
angelarosh angelarosh is offline
Registered User
 
Join Date: May 2009
Last Activity: 12 June 2009, 9:06 AM EDT
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
$ cd /usr/oracle
/usr/oracle: does not exist


Prev the .profile has only following contents
# This is the default standard profile provided to a user.
# They are expected to edit it to meet their own needs.
MAIL=/usr/mail/${LOGNAME:?}

After going through forums I have put following in it
# This is the default standard profile provided to a user.
# They are expected to edit it to meet their own needs.
PATH=/usr/oracle/bin:$PATH
export PATH
ORACLE_HOME=/usr/oracle
export ORACLE_HOME
MAIL=/usr/mail/${LOGNAME:?}


Is there anything i need to change here??
Sponsored Links
    #6  
Old 05-19-2009
panyam panyam is offline Forum Advisor  
Registered User
 
Join Date: Sep 2008
Last Activity: 24 July 2014, 3:48 AM EDT
Posts: 1,156
Thanks: 20
Thanked 104 Times in 99 Posts
are you sure that ORACLE is installed in your system ?..

if so search for the sqlplus from root


Code:
find / -name "sqlplus" -print 2>/dev/null

Sponsored Links
    #7  
Old 05-19-2009
angelarosh angelarosh is offline
Registered User
 
Join Date: May 2009
Last Activity: 12 June 2009, 9:06 AM EDT
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
/opt/PSscripts/clone/scripts/.0.6_BAK/bin/sqlplus
/opt/PSscripts/clone/scripts/.0.6_BAK/sqlplus
/dba58/d001/app/oracle/product/816/bin/sqlplus
/dba58/d001/app/oracle/product/816/sqlplus
/dba58/d001/app/oracle/product/817/bin/sqlplus
/dba58/d001/app/oracle/product/817/sqlplus
/dba58/d001/app/oracle/product/10gAgent/agent10g/sqlplus
/dba58/d034/app/oracle/product/920/bin/sqlplus
/dba58/d034/app/oracle/product/920/sqlplus
/dba58/d036/infa6qa/powertst/Scripts/AEROE01/sqlplus
/dba58/d037/staging/sqlplus
/dba58/d045/oracle9i/9idump/9ipatch/Disk1/orahomebkp/920/inventory/filemap/sqlplus
/dba58/d045/oracle9i/9idump/9ipatch/Disk1/orahomebkp/920/bin/sqlplus
/dba58/d045/oracle9i/9idump/9ipatch/Disk1/orahomebkp/920/sqlplus


I still see some more results coming as a result executing the find / -name "sqlplus" -print 2>/dev/null
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Shell scripting+connect to oracle database+spooling Mr Mo UNIX for Dummies Questions & Answers 14 05-20-2009 07:13 AM
Connect to Oracle from Unix rajesh_tns Shell Programming and Scripting 4 02-09-2009 11:17 PM
how will i connect postgres database from unix shell script jambesh Shell Programming and Scripting 3 07-16-2008 11:09 AM
How to connect oracle from unix ravi gongati Shell Programming and Scripting 2 03-24-2008 06:19 AM
How to connect to database db2 through Unix Shell Script ankitgupta Shell Programming and Scripting 3 10-31-2006 08:50 AM



All times are GMT -4. The time now is 07:42 AM.