This discussion is archived
5 Replies Latest reply: Sep 24, 2013 1:36 AM by Anar Godjaev RSS

How to add listneer

849425 Newbie
Currently Being Moderated

We have following specs of RAC environment:

 

OS: Redhat linux 5

DB: 11.2.0.3

RAC: Two nodes Primary, Two nodes dataguard

 

Right now due to constraints of the cost, we have to build a very small vendor app db onto the existing rac cluster.

 

The requirements are to build a new db, create a listener on different port as 1521.

 

NOw my question is: our SCAN listener listens on 1521.  If I add another entry in listener.ora with a new listener to listen on 1522 for example, how do I deal with SCAN listener?

 

Do I give out scan as host name or the new listener info?

 

Thanks in advance.

  • 1. Re: How to add another listner with different port as SCAN listener in RAC Cluster
    srsatya Journeyer
    Currently Being Moderated

    Hi,

     

      Good question but simple answer , you have two options now,

    1. Eithor modify scan port to a different port number.

    2. Change the vender database listener port number to a different port.

  • 2. Re: How to add another listner with different port as SCAN listener in RAC Cluster
    849425 Newbie
    Currently Being Moderated

    Cannot change existing scan information. THere is an existing db there.

  • 3. Re: How to add another listner with different port as SCAN listener in RAC Cluster
    JohnWatson Guru
    Currently Being Moderated

    You can create as many listeners as you want, listening on any ports you want. You'll have to decide whether you want to run them off the GI home or the RDBMS home, which network(s) they should listen on, and register them with the clusterware. If you are  GUI person, netca will do all that for you. Then adjust your local and remote listener instance parameters accordingly.

     

    But why do any of this? Why can't your new database register with the existing scan and node listeners?

  • 4. Re: How to add another listner with different port as SCAN listener in RAC Cluster
    849425 Newbie
    Currently Being Moderated

    This is our management decision for security purpose, although I think our management knows nothing about oracle.

     

    My confusion here is local_listener and user tnsnames.

     

    In the existing db, the local listener and remote listener is like this:

     

    local_listener                       string      (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle07-vip)(PORT=1521))))

    remote_listener                    string      oracle7scan:1521

     

    See here local listener is actually pointing to the vip address of the server. remote point to scan name. Both port is 1521.

     

    Our tnsnames is such because we have dataguard configured:

    prod7_oci=

       (DESCRIPTION_LIST=

       (LOAD_BALANCE=off)

       (FAILOVER=on)

            (DESCRIPTION=

            (CONNECT_TIMEOUT=5)(TRANSPORT_CONNECT_TIMEOUT=3)(RETRY_COUNT=3)

             (ADDRESS_LIST= (LOAD_BALANCE=on) (ADDRESS=(PROTOCOL=TCP)(HOST= oracle7scan)(PORT=1521)))

              (CONNECT_DATA=(SERVICE_NAME= prod7_rw_oci_service)))

           (DESCRIPTION=

           (CONNECT_TIMEOUT=5)(TRANSPORT_CONNECT_TIMEOUT=3)(RETRY_COUNT=3)

             (ADDRESS_LIST= (LOAD_BALANCE=on) (ADDRESS=(PROTOCOL=TCP)(HOST= dg_oracle7scan)(PORT=1521)))

              (CONNECT_DATA=(SERVICE_NAME= prod7_rw_oci_service))))

     

     

    In regards to the new db going to be created, I understand I can use srvctl add listener to add a listener to a different port. But my questions are:

    1). do I simply set locallistener in the init parameter files to the new listener name?

    2). How do I configure the service to point to that listener?

    3). In the tnsnames, simply put host to the scan name but port to 1522 (new port for new listener), will that work?

     

    Thanks,

  • 5. Re: How to add another listner with different port as SCAN listener in RAC Cluster
    Anar Godjaev Expert
    Currently Being Moderated

    Hi ,

     

    For example:

     

    [grid@rac01 grid]$ srvctl config scan

    SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2

    SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.192

    [grid@rac01 grid]$ srvctl config scan_listener

    SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521

    [grid@rac01 grid]$

    [grid@rac01 grid]$ ping rac-scan.example.com
    PING rac-scan.example.com (133.22.67.193) 56(84) bytes of data.
    From rac01.seo.int (133.22.38.50) icmp_seq=2 Destination Host Unreachable
    From rac01.seo.int (133.22.38.50) icmp_seq=3 Destination Host Unreachable
    From rac01.seo.int (133.22.38.50) icmp_seq=4 Destination Host Unreachable

    — rac-scan.example.com ping statistics —
    6 packets transmitted, 0 received, +3 errors, 100% packet loss, time 5000ms
    , pipe 3
    [grid@rac01 grid]$ ping rac-scan
    PING rac-scan.example.com (133.22.67.194) 56(84) bytes of data.
    From rac01.seo.int (133.22.38.50) icmp_seq=2 Destination Host Unreachable
    From rac01.seo.int (133.22.38.50) icmp_seq=3 Destination Host Unreachable
    From rac01.seo.int (133.22.38.50) icmp_seq=4 Destination Host Unreachable
    From rac01.seo.int (133.22.38.50) icmp_seq=6 Destination Host Unreachable
    From rac01.seo.int (133.22.38.50) icmp_seq=7 Destination Host Unreachable
    From rac01.seo.int (133.22.38.50) icmp_seq=8 Destination Host Unreachable

    — rac-scan.example.com ping statistics —
    11 packets transmitted, 0 received, +6 errors, 100% packet loss, time 10000ms
    , pipe 3
    [grid@rac01 grid]$ ping rac-scan
    PING rac-scan.example.com (133.22.67.192) 56(84) bytes of data.
    64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=1 ttl=64 time=0.039 ms
    64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=2 ttl=64 time=0.054 ms
    64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=3 ttl=64 time=0.049 ms
    64 bytes from rac-scan.example.com (133.22.67.192): icmp_seq=4 ttl=64 time=0.063 ms

    — rac-scan.example.com ping statistics —
    4 packets transmitted, 4 received, 0% packet loss, time 3001ms
    rtt min/avg/max/mdev = 0.039/0.051/0.063/0.010 ms
    [grid@rac01 grid]$

    [grid@rac01 grid]$ host rac-scan
    rac-scan.example.com has address 133.22.67.194
    rac-scan.example.com has address 133.22.67.193
    rac-scan.example.com has address 133.22.67.192
    [grid@rac01 grid]$ nslookup rac-scan
    Server:         133.22.5.53
    Address:        133.22.5.53#53

    Name:   rac-scan.example.com
    Address: 133.22.67.194
    Name:   rac-scan.example.com
    Address: 133.22.67.192
    Name:   rac-scan.example.com
    Address: 133.22.67.193

    [grid@rac01 grid]$

    [root@rac01 network-scripts]# host rac-scan
    rac-scan.example.com has address 133.22.67.194
    rac-scan.example.com has address 133.22.67.193
    rac-scan.example.com has address 133.22.67.192
    [root@rac01 network-scripts]#

    rac-scan.example.com IN A 133.22.67.194
    IN A 133.22.67.193
    IN A 133.22.67.192

    [grid@rac02 grid]$ Check_CRS.txt
    HA Resource                                        Target     State
    ———–                                        ——     —–
    ora.CRS.dg                                         ONLINE     ONLINE on rac01
    ora.FRA.dg                                         ONLINE     ONLINE on rac01
    ora.LISTENER.lsnr                                  ONLINE     ONLINE on rac01
    ora.LISTENER_SCAN1.lsnr                            ONLINE     ONLINE on rac01
    ora.RACDB_DATA.dg                                  ONLINE     ONLINE on rac01
    ora.asm                                            ONLINE     ONLINE on rac01
    ora.eons                                           ONLINE     ONLINE on rac01
    ora.gsd                                            OFFLINE    OFFLINE
    ora.net1.network                                   ONLINE     ONLINE on rac01
    ora.oc4j                                           OFFLINE    OFFLINE
    ora.ons                                            ONLINE     ONLINE on rac01


    ora.rac02.vip                                      ONLINE     ONLINE on rac02
    ora.rac10g.db                                      ONLINE     ONLINE on rac02
    ora.rac10g.rac10g1.inst                            ONLINE     ONLINE on rac01
    ora.rac10g.rac10g2.inst                            ONLINE     OFFLINE
    ora.racpoc.askm1.svc                               ONLINE     ONLINE on rac01
    ora.racpoc.db                                      ONLINE     ONLINE on rac01
    ora.registry.acfs                                  ONLINE     ONLINE on rac01
    ora.scan1.vip                                      ONLINE     ONLINE on rac01
    ora.testdb.db                                      ONLINE     ONLINE on rac01

    tnsnames.ora file :

    TESTDB =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = rac-scan.example.com)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = testdb.example.com)
    )
    )

    The above session data clearly shows there is only one scan listener configured. When we use scan name in tnsnames.ora, the client connections will be established to database only when the scan name resolves to valid IP address.
    But with the above configurations, the client connections some times may fail when the SCAN is resolving to 133.22.67.193 or 133.22.67.194. It establishes connection only when the SCAN resolves to 133.22.67.192.

    SQL> conn test/test@testdb ==> Connection failed. rac-scan resolves either to 133.22.67.193 or 133.22.67.194

    ERROR:

    ORA-12543: TNS:destination host unreachable

    SQL>conn test/test@testdb ==> Connection established.rac-scan resolves to 133.22.67.192.
    connected
    SQL>

    Now to avoid this , we need to create two more scan listeners.

    [grid@rac01 grid]$ srvctl stop scan_listener
    [grid@rac01 grid]$ srvctl stop scan
    [grid@rac01 grid]$ srvctl config scan
    SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2
    SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.192
    [grid@rac01 grid]$ srvctl config scan_listener
    SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
    [grid@rac01 grid]$ which srvctl
    /u01/home/11.2.0/grid/bin/srvctl
    [grid@rac01 grid]$

    [root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl modify scan -h

    Modifies the SCAN name.

    Usage: srvctl modify scan -n <scan_name>
    -n <scan_name>           Domain name qualified SCAN name
    -h                       Print usage
    [root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl modify scan -n rac-scan
    [root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl config scan
    SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2
    SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.193
    SCAN VIP name: scan2, IP: /rac-scan.example.com/133.22.67.194
    SCAN VIP name: scan3, IP: /rac-scan.example.com/133.22.67.192
    [root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl modify scan_listener -u

    [root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl config scan_listener
    SCAN Listener LISTENER_SCAN1 exists. Port: TCP:1521
    SCAN Listener LISTENER_SCAN2 exists. Port: TCP:1521
    SCAN Listener LISTENER_SCAN3 exists. Port: TCP:1521
    [root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl start scan_listener
    [root@rac01 network-scripts]# /u01/home/11.2.0/grid/bin/srvctl config scan
    SCAN name: rac-scan, Network: 1/133.22.38.0/255.255.255.0/eth2
    SCAN VIP name: scan1, IP: /rac-scan.example.com/133.22.67.193
    SCAN VIP name: scan2, IP: /rac-scan.example.com/133.22.67.194
    SCAN VIP name: scan3, IP: /rac-scan.example.com/133.22.67.192
    [root@rac01 network-scripts]#

    [grid@rac02 grid]$ Check_CRS.txt
    HA Resource                                        Target     State
    ———–                                        ——     —–
    ora.CRS.dg                                         ONLINE     ONLINE on rac01
    ora.FRA.dg                                         ONLINE     ONLINE on rac01
    ora.LISTENER.lsnr                                  ONLINE     ONLINE on rac01
    ora.LISTENER_SCAN1.lsnr                            ONLINE     ONLINE on rac01
    ora.LISTENER_SCAN2.lsnr                            ONLINE     ONLINE on rac02
    ora.LISTENER_SCAN3.lsnr                            ONLINE     ONLINE on rac02

    ora.RACDB_DATA.dg                                  ONLINE     ONLINE on rac01
    ora.asm                                            ONLINE     ONLINE on rac01
    ora.eons                                           ONLINE     ONLINE on rac01
    ora.gsd                                            OFFLINE    OFFLINE
    ora.net1.network                                   ONLINE     ONLINE on rac01
    ora.oc4j                                           OFFLINE    OFFLINE
    ora.ons                                            ONLINE     ONLINE on rac01


    ora.rac02.vip                                      ONLINE     ONLINE on rac02
    ora.rac10g.db                                      ONLINE     ONLINE on rac02
    ora.rac10g.rac10g1.inst                            ONLINE     ONLINE on rac01
    ora.rac10g.rac10g2.inst                            ONLINE     OFFLINE
    ora.racpoc.askm1.svc                               ONLINE     ONLINE on rac01
    ora.racpoc.db                                      ONLINE     ONLINE on rac01
    ora.registry.acfs                                  ONLINE     ONLINE on rac01
    ora.scan1.vip                                      ONLINE     ONLINE on rac01
    ora.scan2.vip                                      ONLINE     ONLINE on rac02
    ora.scan3.vip                                      ONLINE     ONLINE on rac02

    ora.testdb.db                                      ONLINE     ONLINE on rac01
    [grid@rac02 grid]$

    Status :

    [grid@rac01 ~]$ srvctl status scan
    SCAN VIP scan1 is enabled
    SCAN VIP scan1 is running on node rac01
    SCAN VIP scan2 is enabled
    SCAN VIP scan2 is running on node rac02
    SCAN VIP scan3 is enabled
    SCAN VIP scan3 is running on node rac02
    [grid@rac01 ~]$ srvctl status scan_listener
    SCAN Listener LISTENER_SCAN1 is enabled
    SCAN listener LISTENER_SCAN1 is running on node rac01
    SCAN Listener LISTENER_SCAN2 is enabled
    SCAN listener LISTENER_SCAN2 is running on node rac02
    SCAN Listener LISTENER_SCAN3 is enabled
    SCAN listener LISTENER_SCAN3 is running on node rac02
    [grid@rac01 ~]$

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points