Solved

oracle tnsname file

Posted on 2010-08-27
15
1,015 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
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.

 
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:Chakravarthi Ayyala
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
 

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.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

829 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