Operating System - HP-UX
1752520 Members
4711 Online
108788 Solutions
New Discussion юеВ

Re: oracle sqlplus error on hpux 11i

 
SOLVED
Go to solution
Shivkumar
Super Advisor

oracle sqlplus error on hpux 11i

Dear Sirs/Madam,

When i try to execute the command sqlplus and enter my username and password i got below error:-

ERROR:
ORA-12162: TNS:net service name is incorrectly specified

Appreciate any help.

Thanks,
Shiv
7 REPLIES 7
Sameer_Nirmal
Honored Contributor

Re: oracle sqlplus error on hpux 11i

Hi,

The error occurs as the service name is incorrectly specified in 'tnsnames.ora" file.

Check the file for any correct syntax in the connect descriptor like un-matched parentheses or any unwanted characters.



Yogeeraj_1
Honored Contributor

Re: oracle sqlplus error on hpux 11i

hi,

there is problem with your tnsnames.ora most probably or your sql client is not resolving to the listener. Did you try tnsping?

to check this, try to connect by explicitly specifying the connect string thus bypassing the tnsnames.ora

try:
sqlplus 'user/password@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=mydb.mu)(PORT=1521)))(CONNECT_DATA=(SID=mydb)))'



hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Yogeeraj_1
Honored Contributor

Re: oracle sqlplus error on hpux 11i

hi again,

It also seems like you did not specify a TNS:Net service name nor have the environement variable TWO_TASK set.

Also, did you set the user environment variable $ORACLE_SID?

In case, you don't want to specify the alias as define in the tnsnames.ora, you may also wish to add the ORACLE_SID to your .profile. This will give the BEQ adapter a route to connect to the instance.



hope this helps too!

merry christmas
Kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Delrish
Trusted Contributor

Re: oracle sqlplus error on hpux 11i

The connect descriptor corresponding to the service name in NSNAMES.ORA is incorrectly specified.Make sure there are no syntax errors in the connect descriptor. Particularly look for unmatched parentheses or stray characters. Any error in a TNSNAMES.ORA file makes it unusable. See Chapter 4 in the SQL*Net V2 Administrator's Guide.
Delrish
Trusted Contributor

Re: oracle sqlplus error on hpux 11i

by the NSNAME.ORA I mean TNSNAME.ORA, I made a mistake in my previous post.
Arunvijai_4
Honored Contributor
Solution

Re: oracle sqlplus error on hpux 11i

Hi Shiv, A tnsnames.ora file provides the ability to reference oracle databases by a simple alias just like hostname for a server. it contains,

net_service_name=
(DESCRIPTION=
(ADDRESS=(protocol_address_information))
(CONNECT_DATA=
(SERVICE_NAME=service_name)))
You have specified wrong TNS name, so that you got this error.

-Arun
"A ship in the harbor is safe, but that is not what ships are built for"
Arturo Galbiati
Esteemed Contributor

Re: oracle sqlplus error on hpux 11i

Hi,
did you set the ORACLE_SID prior to try to conenct by sqlplus?

if not use:
export ORAENV_ASK=NO
export ORACLE_SID=
.oraenv
to define it.

To check if the is correctly define din the /etc/tnsnames.ora use:

tnsping

HTH,
Art