Link to home
Start Free TrialLog in
Avatar of catchmeifuwant
catchmeifuwant

asked on

TNSPING working SQLPLUS not working

Hi there,

I'm baffled with a problem in connecting a client to a server(remote connection).

The entries in tnsnames.ora on the server side are working fine(when connected from the server).I use the same configuration on my client side,but it doesn't work.

TNSPING for the connect strings are OK.

I get a couple of errors from SQLPLUS,like:

1)ORA-12545 : Connect failed because of target host or object does not exist
2)Oracle not available
3)Shared realm does not exist.

Thanks for your inputs...!!!
ASKER CERTIFIED SOLUTION
Avatar of anand_2000v
anand_2000v
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
can you see any difference between the sqlnet.ora file in the client and server?
Avatar of catchmeifuwant
catchmeifuwant

ASKER

1)Ping is also working.

2)There was no sqlnet.ora on the client side.So i added a copy of it on the client side.Still no use...

NAMES.DIRECTORY_PATH= (TNSNAMES)
SQLNET.EXPIRE_TIME=15
ok
1)is the database up?
2) are the tnsnames.ora values specified with the domain?
are you trying with computer name or ipaddress?
1)DB is up and running.I can connect to the remote server(I login to the server and from terminal there ...possible).

2)No TNSNames are not specified with the domain

3)IP address
are the server and the remote  sun machines? if yes I can give you an exact solution otherwise you will have to find similiar options with your OS

>>I can connect to the remote server(RSERVER)(I login to the server(YOUR_SERVER) and from terminal there ...possible).


in YOUR_SERVER give the command

redir --lport=9021 --rport=1521 --ipaddress=<RSERVER ADDRESS>&

in the client machine change the TNSNAMES configuration with
host=YOUR_SERVER
port=9021

regards

or on windows I believe there is a command called as "route"
Client is Win 2000 and Server is HP-UX 11

If I check v$dispatcher,then the port that appears is 49674...does this have anything to do with it?
sorry it was
redir --lport=9021 --cport=1521 --caddr=<RSERVER ADDRESS>&
no.... that's the dispatcher....
remote machine is in which OS?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
let me see if I am understanding your problem correctly

You have a server, let's say SERV1, from which when you try to connect to a remote DB present in server SERV2 the connection works perfectly.

However when you try the same from a client machine CLNT1, which is connected to SERV1 it does not work.

therefore you have to us the command
redir --lport=9021 --cport=1521 --caddr=SERV2&

and change the tnsnames in CLNT1 to
host=SERV1
port=9021

instead of what is present now.
Oh...sorry if my responses were misleading..the scenario is:

I have a DB installed on Serv1(HP-UX).I connect to the DB from Serv1 (using tnsnames configured in Serv1),the connection is successful.

I now have a client Clin1(Win 2000).This client is in a remote location.I have the replica of tnsnames as on Serv1 and sqlnet.ora as well.

When I try connecting from Clin1 to DB on Serv1,thats where I face the problem.

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
schwertner,

1)The host name and service name is right,as I'm using the same configuration from the server.
2)Instance is started.

a)V$instance -> status is open
b)Host_Name is the name of the host (not it's IP)
The TNS-12545 error normally occurs when the TCP/IP protocol cannot resolve a given hostname either when initiating a connection, or when resolving a hostname from a redirect packet

Diagnosing the Error
1. Create a level 16 trace file and reproduce the problem
a. edit the sqlnet.ora file
b. add the parameter TRACE_LEVEL_CLIENT=16
c. reconnect in order to receive the TNS-12545 error again
d. exit the connecting application (i.e. SQL*Plus)

2. Open the client trace (probably cli.trc) in a text editor
a. search for the line:
   "nttbnd2addr:  *** hostname lookup failure! ***"
b. The line above this line reveals the hostname trying to be resolved
   by TCP/IP (NOTE: SQL*Net does not resolve hostnames).

solution:

Add the hostname, returned by the trace, to the local hosts file and assign it the correct IP address (NOTE: this hostname may be a secondary network card on the server or in some cases you need to add the 'Hostname.DomainName'
of the server in the etc/Hosts file at the client side).
when I add an entry in hosts file(on client side),sqlplus hangs and aborts with a timeout error.

BTW,do you want sqlnet.ora to be modified on the server side(not possible due to restrictions), or the client side?

It should be on the client side.

Can you try with this command from command from:

c:\nslookup <your_host_name>

to see if your ip and host is correct
The trace file is in: $ORACLE_HOME\bin
baonguyen1,

OK,here are the results.

1)First time the trace showed,"hostname lookup failure"

2)Added an entry in etc/hosts.This time the error was 12535 TNS Operation timed out.It could resolve the host properly.

REgarding,nslookup...errors again:

*** Can't find server name for address <IP>: Non-existent domain
*** Default servers are not available
Server:  UnKnown
Address:  <IP>
OK, so your client can not lookup the server as it is an HP-UX.

Try this:

c:\ping <your_server_name>
Pinging <your_server_name>.<your_domain> (IP) with 32 bytes of data
Reply from ....

Use the host name and domain here. Try to tnsping fisrt when you have changed the hostname in the tnsnames.ora
well unfortunately,when ping is used,

ping n4004_4

I get the message

Pinging n4004_n [IP] with 32 bytes of data

...no domain name
I think there is problem with DNS resolution. My solution is:

1. Try with to add the hostname without domain name to the etc\hosts file to see if it works
2. Use nslookup with your client to see what is your domain or if you already know, use it:

c:\nslookup <your_client_name>

3. Ping your cleint itself to find the domain
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
yes, you can use IP but sometime it does not work.

I forgot, you can use

c:\ipconfig /all

to check your IP configuration. The domain of your organization should be here
Hi all,

Thanks for all your support.It was some network configuration problem,that's been fixed.

I'm splitting up the points !!!