SCAN listener redirects connection to another port I have setup RAC. I have two listeners LISTENER and LISTENER_DG.
LISTENER is listening port 1521
LISTENER_DG is listening 1530

When client connects to the database using SHARED connection mode even indicating port 1521 during connection, scan listener sometimes forwards connection to the vip ip on port 1530 and because netadmins just opened 1521 port for client and not 1530, connection fails. 

This happens only on shared connection mode. DEDICATED works good.

LISTENER_DG (port 1530) is used for data guard broker  and for it I am using port other than 1521.

Why does scan forward connections to 1530 event client uses 1521 port in tnsnames.ora?
I found PDF about Oracle Single Client Access Name (SCAN)

Using SCAN with Multiple Ports on the Same Subnet


For the purpose of allowing applications to maintain a distinguishable connect string on host / port 
level using one SCAN as the host or to enable port-based firewall configurations, SCAN can be set up 
to support more than one port for the same subnet. 

  
  **     It needs to be noticed that different ports are only used for an initial connect. Once a connection using 
      SCAN on any SCAN port has been established, port assignment is not maintained and routing of 
      connections within the Oracle RAC cluster is performed using database services registered with one or 
      more local listeners. 
      This means that all SCAN ports are treated the same, so that a connection that comes in on any SCAN 
      port can be directed to any registered local listener on any port within the same subnet.
  **

Note also that the multi-port assignment differs per version. Oracle Grid Infrastructure 11.2.0.3 would 
not let you set up multiple ports on one SCAN anymore, while Oracle Grid Infrastructure 11.2.0.2 
would have let you use this configuration. Support for this configuration is resumed with Oracle Grid 
Infrastructure 11.2.0.3.6 and higher as well as Oracle Grid Infrastructure 12c.



I have local_listener set to value: 
(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=node1-vip-hq)(PORT=1530))(ADDRESS=(PROTOCOL=TCP)(HOST=node1-vip-hq)(PORT=1521)))

So my local listeners are 1530 and 1521. and incoming connection from scan can be redirected to any of them.

I have added another listener(port 1522) statically registered database with this listener and did not indicated this listener in local_listener parameter. 

Just connection to this port must be done trough vip address, not by scan. like that:

&gt; MYDB_JOB =   (DESCRIPTION =
&gt;     (ADDRESS_LIST=  
&gt;      (FAILOVER=on) 
&gt;      (LOAD_BALANCE=on)                                 
&gt;      (ADDRESS=(PROTOCOL=tcp)(HOST= node1-vip-hq)(PORT=1522)) 
&gt;      (ADDRESS=(PROTOCOL=tcp)(HOST= node1-vip-hq)(PORT=1522))
&gt;      )
&gt;     (CONNECT_DATA =
&gt;       (SERVER = DEDICATED)
&gt;       (SERVICE_NAME = MYDB)
&gt;     )   )