Home » Infrastructure » Unix » Running sql script on UNIX
Running sql script on UNIX [message #98006] Wed, 15 October 2003 14:15 Go to next message
rachana
Messages: 27
Registered: August 2003
Junior Member
Hi All,
I have a sql script (a report) that I want to run on a UNIX server. I will be running the script on the UNIX server, I will be logging into SQLPLUS, and connecting to an reporting (oracle) database that is on a windows NT server.
Now, I am fairly new to this. I have got access to the UNIX server and have reflections installed. Here are my questions-
1. Do I need to have sqlplus installed on the UNIX server or on the WIndows NT (Reporting database) server?
2. How do I check to see if the UNIX server already has the sqlplus installed?
3. what needs to be done if the UNIX server does not have the sqlplus installed?
thanks.
Re: Running sql script on UNIX [message #98007 is a reply to message #98006] Wed, 15 October 2003 15:57 Go to previous messageGo to next message
Manish
Messages: 79
Registered: December 2000
Member
>1. Do I need to have sqlplus installed on the UNIX >server or on the WIndows NT (Reporting database) >server?

Yes u need to have the client installed on the unix machine, this should also includ net8 ( the networkign layer of Oracle.)

>2. How do I check to see if the UNIX server already >has the sqlplus installed?
>find / -name sqlplus -print 2>/dev/null

if this doesnt return anything then sqlplus is not installed in your environment

>3. what needs to be done if the UNIX server does not >have the sqlplus installed?
Get the media (CDROM) and install the same.

you will have to setup the TNSNAMES to connect to your database on the windows machine.

Manish
Need help: Running sql script on UNIX [message #98008 is a reply to message #98007] Thu, 16 October 2003 10:03 Go to previous messageGo to next message
rachana
Messages: 27
Registered: August 2003
Junior Member
Thanks Manish. I found where sqlplus is on the Unix box, but get an error when I execute it. Also, I get a different message, when I execute it from my home directory. Can someone help me with this? Thanks!

On the UNIX box, I have the following directory structure-

$ pwd
/opt/oracle/product/8.1.7/bin

-rwxr-xr-x 1 oracle dba 4372 Mar 21 2001 netasst
-rwxr-x--x 1 oracle dba 8663040 Mar 21 2001 sqlplus
-rwxr-xr-x 1 oracle dba 8658944 Sep 15 2000 sqlplusO

$ pwd
/opt/oracle/product/8.1.7/bin
$ sqlplus
Message file sp1<lang>.msb not found
Error 6 initializing SQL*Plus
(I do not know what the above error message means?)

I get the following message, when I execute sqlplus in my home direcotry-
$ pwd
/home/rachana
$ sqlplus
ksh: sqlplus: not found

The following is my .profile file -

# Default user .profile file (/usr/bin/sh initialization).

# Set up the terminal:
if [[ "$TERM" = "" ]]
then
eval ` tset -s -Q -m ':?hp' `
else
eval ` tset -s -Q `
fi
stty erase "^H" kill "^U" intr "^C" eof "^D"
stty hupcl ixon ixoff
tabs

# Set up the search paths:
PATH=$PATH:.:/opt/oracle/product/8.1.7/bin/sqlplus
export PATH


# Set up the shell environment:
set -u
trap "echo 'logout'" 0

# Set up the shell variables:
EDITOR=vi
export EDITOR
Re: Need help: Running sql script on UNIX [message #389945 is a reply to message #98008] Wed, 04 March 2009 04:45 Go to previous messageGo to next message
shashikanth.kg
Messages: 1
Registered: March 2009
Junior Member
Use PATH=$PATH:.:/opt/oracle/product/8.1.7/bin
instead
PATH=$PATH:.:/opt/oracle/product/8.1.7/bin/sqlplus



or


on your prompt
$ export PATH:$PATH:/opt/oracle/product/8.1.7/bin

Regards
Re: Need help: Running sql script on UNIX [message #390028 is a reply to message #389945] Wed, 04 March 2009 11:52 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
Oracle 8.1.7 is very old. You need to specify what version of Oracle is installed on Windows. I don't think 8.1.7 client will connect to anything newer than 9.2 database. You'll need a few more Oracle client variables too. SHLIB_PATH vs LD_LIBRARY_PATH varies by *nix OS. Setting both is a good starting point.

export ORACLE_HOME=/opt/oracle/product/8.1.7
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export SHLIB_PATH=$LD_LIBRARY_PATH
export PATH=$ORACLE_HOME/bin
#export TNS_ADMIN=/my-path-to-tnsnames.ora-location

Re: Need help: Running sql script on UNIX [message #390030 is a reply to message #390028] Wed, 04 March 2009 11:57 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
Oracle 8.1.7 is very old.

As well as the last answer in this topic: 6 years old.

Regards
Michel
Re: Need help: Running sql script on UNIX [message #390044 is a reply to message #390030] Wed, 04 March 2009 13:01 Go to previous message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
yes - thx, I should have spotted that.
Previous Topic: Permission Denied
Next Topic: CPU in Solaris 10 achieved 100% with Oracle Database
Goto Forum:
  


Current Time: Thu Nov 21 10:48:15 CST 2024