Unable to connect to SQL through unix


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unable to connect to SQL through unix
# 1  
Old 04-01-2012
Unable to connect to SQL through unix

I am trying to connect to SQL plus through unix but i am getting below error

Code:
'ksh: sqlplus:  not found'

note i am running this from /home/xxx

do i need to set any environmental variable for this. below is my code

Code:
echo " hello world"
sqlplus -s apps/CAF78GEN<<EOF
          set heading off
          set feedback off
          set pagesize 0
          set linesize 32767
          VARIABLE l_object_type  VARCHAR2(20)
          VARIABLE l_last_ddl     VARCHAR2(50)
          VARIABLE l_owner        VARCHAR2(50)
             exec xxat_sox_proc('$file_name',:l_out_put,:l_change_flag);
          print l_ouput
          print l_change_flag
       exit
       EOF
echo "test hi"


Last edited by Scrutinizer; 04-01-2012 at 03:21 AM.. Reason: Please Use [code] tags [/code], thank you..
# 2  
Old 04-01-2012
Quote:
do i need to set any environmental variable for this
Yes. You need to set the oracle home.

Code:
ORACLE_HOME
ORACLE_SID
LD_LIBRARY_PATH (optional)

# 3  
Old 04-01-2012
The second EOF needs to be at the very beginning of the line (this construction is called a here-document). Also, you need to set $file_name somewhere beforehand.
# 4  
Old 04-02-2012
Thanks Scruitin

Can you/some one tell how to set below variables in order to connect to sqlplus

ORACLE_HOME ORACLE_SID
# 5  
Old 04-02-2012
Code:
export ORACLE_something=whatever

The actual values will depend on your system.

You'll also need the Oracle client bin directory in your $PATH (probably export PATH=$PATH:$ORACLE_HOME/bin).
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. AIX

Unable to connect ASMI

After following the instructions given by resident moderator Bakunin over here https://www.unix.com/aix/279862-installed-memory-32gb-but-shows-only-16gb.html #1 Connect to ASMI #2 Configure the deconfigured memory #3 Start the machine OK, everything is fine, however now cannot connect to... (5 Replies)
Discussion started by: filosophizer
5 Replies

2. Solaris

Unable to connect using ftp

hi I am having issues when trying to connect using ftp, I am having the following error: User (10.100.48.73:(none)): moz 331 Password required for moza. Password: 530 Login incorrect. Login failed. ftp> by 221 Goodbye. I have created a user like this: useradd -g 10 -d /lam/moza -m -s... (11 Replies)
Discussion started by: fretagi
11 Replies

3. Red Hat

Unable to connect to internet

Hello, I just installed CentOS 7 (Server with GUI) and guess what I could install Virtual Box Guest additions without installing any extra package/software which is great news ! Now bad news or not so great news. My Host OS is Windows 10, Virtual Box is the virtualization software. CentOS7-1... (0 Replies)
Discussion started by: bluemind2005
0 Replies

4. UNIX for Advanced & Expert Users

Unable to connect to sqlplus from unix

Hi, I have been trying to connect to sqlplus the same way I used to do in my earlier company but I get these error messages , please suggest way out - user name - xyzuser schema name - xyzschema $ sqlplus xyzuser@xyzschema ksh: sqlplus: not found. $ sqlplus -s xyzuser@xyzschema... (5 Replies)
Discussion started by: dhirajdsharma
5 Replies

5. HP-UX

Unable to connect SSH from HP-UX

Hi, I'm trying to connect from an HP-UX with SSH2 client(ssh2 3.1.2 on hppa1.1-hp-hpux11.00) to an SSH2 server on a VxWorks system. The SSH connection is failing with the below connection logs: > /usr/local/bin/ssh2 -v -l testuser 10.10.10.10 debug: Ssh2/ssh2.c:1391: Using file... (4 Replies)
Discussion started by: ysafi
4 Replies

6. Emergency UNIX and Linux Support

How to connect Unix and Sql Server 2005?

Hi All Can any one please help me about How to connect Unix with Sql Server 2005 I want to do it urgently and i didn't find the way. (14 Replies)
Discussion started by: parthmittal2007
14 Replies

7. Emergency UNIX and Linux Support

Unable to connect using SFTP

I shall explain the situation that I am facing to the best extent possible. I require some help, as this situation is an urgent one. I am trying to automate sending data from one AIX machine to another. A script runs that tries to push data received from an upstream application to another AIX... (7 Replies)
Discussion started by: ggayathri
7 Replies

8. Solaris

Unable to connect to Internet

Hi friends recently i have installed SXDE 1/08 into my machine,and i installed wifi driver also its working fine,Recently i was unable to connect to Internet,I have not changed any configurations and any installations,thing is that i got my iwk0 interface is UP and IP address also and i can... (6 Replies)
Discussion started by: srinivas2828
6 Replies

9. Solaris

Connect From VB to SQL Server

Dear All Now I can't connect from VB to Sybase on Unix. How could I do? Please help me. (0 Replies)
Discussion started by: Than Chanroeun
0 Replies

10. HP-UX

Unable to connect to HP-UX 11.11 via eXceed 7.1

Hello HP-UX Gurus, I am having issues trying to start an x-session via eXceed 7.1. When I bring up eXceed via XDMCP Braodcast I see the host name and IP Address but when I try to connect the X window does not come up. I made the modification to the following file “/etc/dt/config/Xaccess”... (2 Replies)
Discussion started by: smokie
2 Replies
Login or Register to Ask a Question