Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Using ODBC - use Hostname method not tnsnames.ora
It always amazes me that no one ever seems to consider the Hostname Method
of connecting to Oracle databases. No client config needed, but does limit
you to defaults that most people probably use anyway.
Briefly...
1) Using tnsnames.ora (call the Local Method) is a pain whenever the server
changes or SID changes, you have to change the tnsnames.ora that everyone
uses.
2) Names Server Method is being phased out and replaced by the LDAP Method.
Both require a more of a setup and infrastructure.
3) Hostname Method has only the disadvantage of you have to use the default
port on the server and have a TCP/IP network and a valid DNS name, which
most people would have. There are some other limits of not using MTS
(mutli-threaded sever) and not using fail safe setup. How many people really
use these features anyway?
With the Hostname Method, the clients do not need any config files and only requires 1 line in the listener.ora file on the server. The client side default files installed by Oracle for Net8 are all that is needed on the client (and Net8 is always needed in a client/server 2-tier mode). Of yeah and you have to be using at least Net8 and not using version 7 or older client side or server side Oracle software.
The following is a server listener.ora example of clients using connection string "mydbname.mydomain.com"....
(SID_DESC =
(GLOBAL_DBNAME = mydbname.mydomain.com ) (ORACLE_HOME = /oracle/OraHome1) (SID_NAME = whateveryoucalledit)
If you don't want to mess with DNS setups, what would you use for the Host= in the tnsnames.ora ? Put that in the place of GLOBAL_DBNAME and use it in the connect string on the client.
We have 1 Sun server with 5 prod databases and there are 5 DNS TCP/IP "Aliases" all pointing to the IP address of this one server . Works great to not have to worry about tnsnames.ora .
-- "Beebs" <ABieberitz_at_2tacweb.com> wrote in message news:vfp33le45cr65c_at_corp.supernews.com...Received on Fri Jun 27 2003 - 17:21:53 CDT
> Peter,
>
> Thanks for the help, but it was actually an error on my part. This whole
> time I had been using the Oracle Names Server I had set up, rather than
the
> Service Name of the database itself. Once I checked this in SQL Plus and
> verified I could connect up, I linked to a table in another application
and
> it worked without any errors.
>
> My next question is what do I need to distribute with my application so my
> user's can access this data without it residing on a server, or is that
> impossible. If so, and they need it on a server, what drivers and dlls,
> etc...need to be on each client's computer?
>
> Thanks,
> Aaron
>
> > Start by running the following command on the same box:
> > sqlplus system/manager_at_your_service_name
>
>
![]() |
![]() |