Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

hwo to configure TNSNAMES.ORA file

Posted on 2009-05-11
8
3,449 Views
Last Modified: 2012-05-06
Hi experts,

                  Can someone please guide me with the easiest way to configure TNSNAMES.ORA file for oracle client.
0
Comment
Question by:aman0711
  • 4
  • 4
8 Comments
 
LVL 40

Accepted Solution

by:
mrjoltcola earned 500 total points
ID: 24355267
1) Using netca command from client box
2) Copy the one below and change CAT to your SID and the IP address to your host
CAT =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = my_ip_address)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = CAT)
    )
  )

Open in new window

0
 
LVL 40

Expert Comment

by:mrjoltcola
ID: 24355275
Clarification, you can do 1 or the other above, no need to do both, however it is a good idea to learn how to run netca, as it will help you configure other naming services and the listener as well, when needed.
0
 
LVL 10

Author Comment

by:aman0711
ID: 24355306
Hi mrjoltcola,
                         I am very new to this, as you already know :-)

                        As you suggested me in my other questiong (Oracle ODBC connection), I downloaded the oracle client on my machine.

                          Using netca command? where exactly I need to give that command?

                      In the second method, you meant, copy the contents and edit the TNSNAMES.ora present in Oracle_home/network/admin?
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 40

Assisted Solution

by:mrjoltcola
mrjoltcola earned 500 total points
ID: 24355493
netca is an Oracle program. Install the Oracle client, it will add Oracle programs to your PATH, then you can just type netca at the command prompt on Windows

Easiest route is not to run netca, just copy the TNSNAMES.ORA file I gave.

Your TNSNAMES.ORA file should be copied to the {ORACLE_HOME}/network/admin directory, this is created when you install Oracle client and you should note it down.

Did you run the oracle client install?
0
 
LVL 10

Author Comment

by:aman0711
ID: 24355552
Hi mrjoltcola,

                        I ran the netca and I guess I am able to edit the tnsnames.ora.

                        I even tested the connection with netca GUI.

                        Now how do I test it from SQL*PLUS?
 
                        I mean as soon as I openj SQL*PLUS. its asking for username, password and hoststring? and as far as I remember, I didnt submit any username and pass while installing. what is this host string?

                        Please have a look at the file, is it correct? I configured two database instances

bon007.ABC.COM =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = pl100.mno.abc.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = bon007)
    )
  )
 
offd01.ABC.COM =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = ml48.xyz.abc.com)(PORT = 1522))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = offd01)
    )
  )

Open in new window

0
 
LVL 40

Assisted Solution

by:mrjoltcola
mrjoltcola earned 500 total points
ID: 24355593
Now that you configured TNSNAMES, sqlplus only needs the TNS aliases (bon007 and offd01)
Put one of those aliases in for host string.

Or use a command prompt mode:

sqlplus user/password@bon007
0
 
LVL 10

Author Comment

by:aman0711
ID: 24355618
Wow.. so cool :-) Worked perfectly :-)
 Let me close this question here, Can we move to configuring ODBC connection now?
0
 
LVL 10

Author Closing Comment

by:aman0711
ID: 31580168
Thank You so much :-)
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

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

Suggested Solutions

I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
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
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

828 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