How to COnnect to Oracle database from UNIX Box


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to COnnect to Oracle database from UNIX Box
# 1  
Old 05-19-2009
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....
# 2  
Old 05-19-2009
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.
# 3  
Old 05-19-2009
$ 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
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

# 5  
Old 05-19-2009
$ 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??
# 6  
Old 05-19-2009
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

# 7  
Old 05-19-2009
/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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Connect to Oracle database

could someone please help me in shell scripting. i want to connect to oracle database which is on remote sever. requirement: 1 want to check files in source directory if file exist then a execute a corresponding batch jobs on unix sever and fetch data from oracle database which is on remote... (2 Replies)
Discussion started by: refi123
2 Replies

2. UNIX and Linux Applications

Identify a specific environment Oracle variable to connect a remote Oracle database ?

Good evening I nned your help pls, In an unix server i want to connect to a remote oracle databse server by sqlplus. I tried to find out the user/passwd and service name by env variable and all Ive got is this: ORACLE_SID_REPCOL=SCL_REPCOL ORACLE_SID=xmeta ORACLE_SID_TOL=SCL_PROTOLCOL... (2 Replies)
Discussion started by: alexcol
2 Replies

3. Shell Programming and Scripting

Connect to Oracle database with JDBC drivers.

Hi All, We are having LINUX server. I would like to connect to oracle database from server to with the help of shell script and execute a procedure. We dont have oracle installed to use sqlplus and connect to database. Do we have any command to connect to database using JDBC drivers. ... (1 Reply)
Discussion started by: Girish19
1 Replies

4. Shell Programming and Scripting

How to connect to Oracle database using shell script?

Hi All, I am newbie to unix shell scripting. I want to connect to oracle database using shell script. I know how to connect DB using user name and password but my question is if my password is having '@' sign then how to connect. I have tried like below, cnt=`sqlplus -s /nolog << EOFSQL ... (3 Replies)
Discussion started by: pmotewar
3 Replies

5. Shell Programming and Scripting

Shell Script to connect to the oracle database

Hi Unix Gurus, I have a requirement to write a script, Oracle DB gets referesh every 6hrs, hence we need write a script to connect to the database , if it connects it should generate a file to proceed the next job application or when an error when connectiong to DB it should not generate any... (8 Replies)
Discussion started by: bshivali
8 Replies

6. Shell Programming and Scripting

Korn Script to connect and query oracle database

I've been sent the following script to finish. It's supposed to connect to an oracle database, query it, and send an email if the query result value is one or more. Currently it isn't connecting properly, just giving the following error: ERROR: ORA-01017: invalid username/password; logon denied... (2 Replies)
Discussion started by: jackmorgan2007
2 Replies

7. Shell Programming and Scripting

connect Clearcase from unix box

Hi am using unix box and am always download code from clearcase. I need to connect clearcase server from my unix box using shell script.I need to create view baseline everything using the sript. am not mention I need a code. Just anyone help me start the concept to write a code. Thanks,... (1 Reply)
Discussion started by: ckchelladurai
1 Replies

8. Shell Programming and Scripting

Connect to database from different unix box

Hi Friends, I have a one unix box "x.y.z" on SunOS , where oracle is not installed. And another machine "a.b.c" on AIX , where oracle is installed. Now i want to make a script on x.y.z , that can connect to database on a.b.c, using sqlplus command. and then generate a report based on the... (5 Replies)
Discussion started by: gauravgarg
5 Replies

9. Shell Programming and Scripting

How to connect with oracle database using unix...

Hi all I am working in datawarehouse project and use DB2 database . shell scripting is written to connect with DB2 database in my application but i dont know how to connect with oracle databse or other databases.Is there any command in unix to connect any of these datbases? (6 Replies)
Discussion started by: vijays3
6 Replies

10. UNIX for Dummies Questions & Answers

Shell scripting+connect to oracle database+spooling

Hi! Everyone I am new to the shell scripting basically.I have been asked to create a shell script that connect to a oracle database to read data from a particular schema then spool it into a csv file then email to customer. Can anybody let me know how to go about that. I have create... (14 Replies)
Discussion started by: Mr Mo
14 Replies
Login or Register to Ask a Question