Solved

oracle tnsname file

Posted on 2010-08-27
15
1,012 Views
Last Modified: 2012-06-21
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
0
Comment
Question by:hussainkhan22
  • 4
  • 4
  • 2
  • +4
15 Comments
 
LVL 16

Expert Comment

by:carsRST
ID: 33546598
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.
0
 
LVL 6

Expert Comment

by:sridharv9
ID: 33547042
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)
0
 

Author Comment

by:hussainkhan22
ID: 33547469
What is the command to check the tnsnames file is correct or not. What is the command for ping
0
 
LVL 6

Expert Comment

by:sridharv9
ID: 33547549
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.
0
 
LVL 7

Expert Comment

by:sumit2906
ID: 33548274
try tnsping
c:\tnsping <tns alias>
0
 
LVL 8

Expert Comment

by:ReliableDBA
ID: 33548558
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.
0
 
LVL 13

Expert Comment

by:riazpk
ID: 33552072
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?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:hussainkhan22
ID: 33566392
# 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
0
 
LVL 14

Expert Comment

by:systan
ID: 33566572
>>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.
0
 

Author Comment

by:hussainkhan22
ID: 33567083
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.

0
 
LVL 14

Expert Comment

by:systan
ID: 33567240
If you are getting "ORA-12154 TNS:could not resolve service name"
then make sure you also copy the sqlnet.ora file contents.
>>riazpk
0
 

Author Comment

by:hussainkhan22
ID: 33567304
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
0
 
LVL 14

Accepted Solution

by:
systan earned 500 total points
ID: 33569976
These is the help link;
http://www.dba-oracle.com/t_ora_12154_tns_resolve_service_name.htm

But this is my help steps;
Goto your Services Window, find ORA_yourORAname service,  find ORA_yourORAname that doesn't start,  if you find it,  then right click to view ORA properties, then goto [Log On] then select Local system account,   [check]  the  "Allow service to interact with desktop"

Apply, Ok.
Start ORA_yourORAname service,   there will be an interaction with the desktop console, so Read whats the message, the mesage is an IP_address,  look for it.

If you now know the IP_address...

This can be a shortcut;
Goto your C:\oracle folders....\..\..\.., find a filename with "127.0.0.1", or with a filename "Localhost" then copy the contents of that filename to a new name file <the IP_address> youve seen in the desktop console,  in other words copy filename   then paste it with the new name <the IP_address> youve seen in the desktop console  when you start the ORA_yourORAname service.


Directly this can be a shortbut too;
Goto your C:\oracle folders....\..\..\.., find a filename with "127.0.0.1", or with a filename "Localhost"
copy that filename,  paste it with the new nameS;
your_computer_name.x.x.x.x???
your_ipaddress.x.x.x.x???
0
 
LVL 7

Expert Comment

by:sumit2906
ID: 33570085
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.
0
 
LVL 14

Expert Comment

by:systan
ID: 33623828
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?
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Suggested Solutions

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines
Via a live example, show how to take different types of Oracle backups using RMAN.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now