Saturday, November 21, 2020

Some features of implementation when using TNSNAMES connection descriptors

 1. You can double parameters in row, Oracle will you only last value. For example, when you use

             (ADDRESS=
                (PROTOCOL=tcp)
                (HOST=localhost)
                (port=1520)
                (PORT=1521)
              )

, the port 1521 which is the last in the group of values of the same group (address), and that one will be used in the connection (1520 will not be tried at all). This behavior is expected though, remember several addresses in the address_list group, but in case of address_list the client tries to establish the connection with every address until succeed, and in our case the client simply goes via the last parameter in the list.

2. You can use some abstract (not existed and not considered by oracle) parameters and values for debugging or for other purposes, for example,

            (CONNECT_DATA=
                (service_name = pdb1.db-01.site)
                (instance_name = cdb121)
                (instance_name = cdb_manual)
                (aaa = bbb)
            )

Here abstract parameter aaa is used. The listener entry in this case could be like this :

22-NOV-2020 09:22:31 * (CONNECT_DATA=(service_name=pdb1.db-01.site)(instance_name=cdb121)(instance_name=cdb_manual)(global_name=cdb121aaa)(aaa=bbb)(CID=(PROGRAM=sqlplus@db-01)(HOST=db-01)(USER=oracle))) * (ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=21799)) * establish * pdb1.db-01.site * 0

As we can see sqlplus established connection with instance_name=cdb_manual (the last of the group of instance_name parameters inside of tns descriptor, you can confirm it with help of select sys_context from dual statement)

3. Will be continued...

Good Luck !

No comments:

Post a Comment