Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3538
  • Last Modified:

hwo to configure TNSNAMES.ORA file

Hi experts,

                  Can someone please guide me with the easiest way to configure TNSNAMES.ORA file for oracle client.
0
aman0711
Asked:
aman0711
  • 4
  • 4
3 Solutions
 
mrjoltcolaCommented:
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
 
mrjoltcolaCommented:
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
 
aman0711Author Commented:
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mrjoltcolaCommented:
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
 
aman0711Author Commented:
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
 
mrjoltcolaCommented:
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
 
aman0711Author Commented:
Wow.. so cool :-) Worked perfectly :-)
 Let me close this question here, Can we move to configuring ODBC connection now?
0
 
aman0711Author Commented:
Thank You so much :-)
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now