Re: TNS alias synonym entry

From: Harel Safra <harel.safra_at_gmail.com>
Date: Wed, 27 May 2020 23:54:04 +0300
Message-ID: <CA+UC=5F1YMVmAP45O76mFdzzKyRFQL3YxiJw7h6yh-J1wqw1sQ_at_mail.gmail.com>



If you're willing to add an identical service name in both databases you can use local /etc/hosts entries to point the same server name to different IP addresses.
The entry will look like:
MONIT =
   (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = monit_server_dummy)(PORT = 1521))

     (CONNECT_DATA =
     (SERVER = DEDICATED)
      (SERVICE_NAME = monit_service)

   )
 )

and monit_server_dummy will point to someserver01 in some servers' /etc/hosts file and to someserver02 on others.

Harel

On Tue, May 26, 2020 at 5:08 PM Luis Claudio Dias dos Santos < lsantos_at_pobox.com> wrote:

> Is is possible to define a TNS alias *synonym*? Despite the confuse it
> seems, I will explain.
>
> We have a LDAP server serving most of our TNS names resolutions.
>
> But in a specific case I want a special TNS entry, called MONIT, be
> resolved different in different servers. So I can't use LDAP.
>
> The most usual way to do is to create a FULL TNS entry, in each defined
> servers, with different MONITs entries. For example:
>
> *server 1:*
>
>
>> *MONIT =*
>> * (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = someserver01)(PORT
>> = 1521))*
>> * (CONNECT_DATA =*
>> * (SERVER = DEDICATED)*
>> * (SERVICE_NAME = DB01)*
>> * )** )*
>
>
> *server 2:*
>
>
>> *MONIT =*
>> * (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = someserver02)(PORT
>> = 1521))*
>> * (CONNECT_DATA =*
>> * (SERVER = DEDICATED)*
>> * (SERVICE_NAME = DB02)*
>> * )** )*
>
>
> But this entries, for DB01 and DB02 service names, are well defined on
> LDAP server with some other alias:
>
> *$ tnsping DB01*
>
>
>
>> *Used LDAP adapter to resolve the alias*
>> *Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =
>> someserver01)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)
>> (SERVICE_NAME = DB01)))**OK (10 msec) *
>
>
>
>> *$ tnsping DB02*
>> *Used LDAP adapter to resolve the alias*
>> *Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =
>> someserver02)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)
>> (SERVICE_NAME = DB02)))**OK (10 msec)*
>
>
> SO, I want locally, on TNSNAMES.ORA, with of course SQLNET.ORA containing *NAMES.DIRECTORY_PATH=
> (TNSNAMES,LDAP)*, the following in local TNSNAMES.ORA:
>
> *server 1:*
>
> *MONIT = DB01*
>
>
>
> *server 2:*
>
> *MONIT = DB02*
>
>
> But this does not work...
>
>
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed May 27 2020 - 22:54:04 CEST

Original text of this message