Operating System - HP-UX
1753321 Members
6356 Online
108792 Solutions
New Discussion юеВ

Connecting oracle database from hpux machine

 
SOLVED
Go to solution
Shivkumar
Super Advisor

Connecting oracle database from hpux machine

Dear Sirs;

I want to connet to oracle database server running on hpux.
I have tnsnames.ora file and my account has already been created on the database servers.

I need to connect from one of the hpux box (i believe this box should be running oracle client sqlplus)

Can someone let me know the steps to configure and setup so that i get run sql commands.

Thanks,
Shiv
7 REPLIES 7
Rick Garland
Honored Contributor

Re: Connecting oracle database from hpux machine

If you have all the environment settings for oracle, ssh/telnet to the system as oracle, invoke the sqlplus command, you will be provided a login/passwd combination for SQL.
If successful then you will get the SQL> prompt.

Very important about environment settings for oracle. ORACLE_HOME, ORACLE_BASE, ORACLE_SID, LD_LIB_PATH, etc. Just to name a few...
TwoProc
Honored Contributor
Solution

Re: Connecting oracle database from hpux machine

Install the client tools on the client machine (I presume you're trying to connect remotely). Set your ORACLE_HOME variable to point to the installed ORACLE_HOME directory. Add $ORACLE_HOME/bin to your path. Put your tnsnames.ora file in $ORACLE_HOME/network/admin directory. Make sure you can ping the host by name ("ping servera" - your server for example). Then try to "tnsping" the running Oracle Database - "tnsping [instance]" use the name from the tnsnames.ora file for [instance].
If you get a positive result - you can just run "sqlplus username/password@[instance_name" to connect to the database.

We are the people our parents warned us about --Jimmy Buffett
TwoProc
Honored Contributor

Re: Connecting oracle database from hpux machine

That should have read:
"sqlplus username/password@[instance_name]"
where [instance_name] would be the name given in the tnsnames.ora file.
Ex:
sqlplus user/password@TESTDB
We are the people our parents warned us about --Jimmy Buffett
Kurt Beyers.
Honored Contributor

Re: Connecting oracle database from hpux machine

Shiv,

Can you do a 'tnsping ' from the HP-UX client box?

Then you can connect with the command 'sqlplus' or 'sqlplus /nolog' and login with the mentioned accounts.

Check first your environment variables, but the tnsping will fail as well if they are missing in the first place.

best regards,
Kurt
Ranjith_5
Honored Contributor

Re: Connecting oracle database from hpux machine

Hi Shiv,

Create a user called oradb in the database sever. add the following parameters in the /home/oradb/.profile.

umask 022
export umask

#######below parameters are for9i ########

ORACLE_BASE=/ORACLEdb/app/oracle
ORACLE_HOME=/ORACLEdb/app/oracle/product/9.2.0
ORACLE_DOC=$ORACLE_HOME/doc
ORACLE_SID=ORACLE
CLASSPATH=$ORACLE_HOME/jlib/product_jar_file
LD_LIBRARY_PATH=$ORACLE_HOME/lib
SHLIB_PATH=$ORACLE_HOME/lib32
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data

PATH=$ORACLE_HOME/bin:/usr/ccs/bin:/usr/bin:/etc:/usr/bin/X11:/usr/local/bin:/opt/perl/bin:/opt/unzip/bin:/usr/sbin
export ORACLE_BASE ORACLE_DOC ORACLE_SID CLASSPATH LD_LIBRARY_PATH SHLIB_PATH ORA_NLS33 PATH ORACLE_HOME

####### above parameters are for9i ########

ALERT=/ORACLEdb/app/oracle/admin/bdump
export ALERT



Here after if you login with oradb user all the oracle parameters will be set.

The you can connect to oracle as follows.

dbserver:oradb-/home/oradb>
dbserver:oradb-/home/oradb>sqlplus /nolog

SQL*Plus: Release 8.1.7.0.0 - Production on Wed Aug 17 07:19:55 2005

(c) Copyright 2000 Oracle Corporation. All rights reserved.

SQL> connect / as sysdba
Connected.
SQL>

here in the sql prompt you can type your queries and get information.

Hope this helps.

Regards,
Syam
Ranjith_5
Honored Contributor

Re: Connecting oracle database from hpux machine

Hi Shiva,

Once you are able to do the above things in the database server, remotely you can take a telnet session of this database server and do your work any time.

Incase you need any more info pls reply.

Regards,
Syam
Cem Tugrul
Esteemed Contributor

Re: Connecting oracle database from hpux machine

Shiv,

if you are root or know root pwd on server;
#su - oracle
(so you are in oracle home dir)
so run the command;
$sqlplus /nolog
you have to see prompt SQL>
then run;
SQL>connect / as sysdba
Finally you have to see like;
Connected.

if you are not root flow the other replies
as above

Good Luck,
Our greatest duty in this life is to help others. And please, if you can't