Link to home
Start Free TrialLog in
Avatar of hussainkhan22
hussainkhan22Flag for United States of America

asked on

oracle tnsname file

hey I need to add my tnsnames.ora file on my local laptop so that I can access my company databases. I open my local tnsnames.ora file and paste the contents of my company tnsnames.ora at the end. But its saying it couldn't resolve name. What mistake might be I am doing please let me know
Avatar of carsRST
carsRST
Flag of United States of America image

make sure you have the correct file.  
Search through your machine to make sure you have the correct file.

http://www.dba-oracle.com/t_windows_tnsnames.ora_file_location.htm

Also might check firewall settings on machine and or see if you can ping the database from where you're testing.
1. check if you can ping your company db servers.
if good.
2. check your SQLNET.ORA contents (try to make it similar to your company SQLNET.ORA)
Avatar of hussainkhan22

ASKER

What is the command to check the tnsnames file is correct or not. What is the command for ping
c:> ping <dbservername>
c:\%ORACLE_HOME%\bin>tnsping <database_name>

You can find tnsnames.ora file under ORACLE_HOME\network\admin.

eg:ORACLE_HOME=C:\oracle\product\10.2.0\db

If you cannot figure it out paste the tnsnames.ora and sqlnet.ora under ORACLE_HOME\network\admin.
try tnsping
c:\tnsping <tns alias>
Avatar of Chakravarthi Ayyala
Could you please copy/paste your tns entry here?
Wondering whether you are referring to the host by its FQDN(fully qualified domain name) and it is not able to resolve it.
If that is the case, i would recommend adding the hostname with ip address to the file "\\WINDOWS\system32\drivers\etc\hosts" and try.
Avatar of Ora_Techie
Ora_Techie

If you are getting "ORA-12154 TNS:could not resolve service name" then make sure you also copy the sqlnet.ora file contents. Are the oracle client versions on both machines are same?
# tnsnames.ora Network Configuration File: C:\oracle\product\10.2.0\db_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

ORACLE10 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 6BB5F1)(PORT = 1523))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = oracle10)
    )
  )

EXTPROC_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    )
    (CONNECT_DATA =
      (SID = PLSExtProc)
      (PRESENTATION = RO)
    )
  )

ORACLE9 =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 6BB5F1)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = oracle9)
    )
  )

I am sorry for replying late
>>hey I need to add my tnsnames.ora file on my local laptop so that I can access my company databases
you mean!? you copied your company's databases to your laptop?  does your company allow you to copy data's?

OK;
Know your ip address,
know your computer name,

type in your web browser;
http://YOUR_IP_ADDRESS:1523
http://YOUR_COMPUTER_NAME:1523
http://LOCALHOST:1523
http://127.0.0.1:1523

try also :1521 or remove version 9 in your tns since you have 10

Let's see if you can log on the web,
But check first in your Services Window, Check if ORA is started, if not start it.
Thanks alot its working fine now local OEM for my local database.

Generally I see this error
ORA-12154 TNS:could not resolve service name.
What is the solution for this sort of errors.

If you are getting "ORA-12154 TNS:could not resolve service name"
then make sure you also copy the sqlnet.ora file contents.
>>riazpk
Hi Can you tell me step by step what all I need to do when I get
"ORA-12154 TNS:could not resolve service name" .

Thanks for your help in advance
ASKER CERTIFIED SOLUTION
Avatar of systan
systan
Flag of Philippines 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
I do following when get that sort of error:
1) ping <db_host>
2) tnsping <tns alias>
3) If above two are fine then go to db server and check listner
lsntctl status

here I should be able to see that my service is in ready state.

based on the above steps, we can go and check different configuration. you can tell use what are you getting from these steps.
hi
Is it fix by my procedures?  How is it?  I want to know why did you accept my comment, did my steps really work?