Go to main content

Oracle® SuperCluster M8 and SuperCluster M7 Administration Guide

Exit Print View

Updated: June 2020
 
 

Create a DB Listener on the IB Network

This procedure describes how to create a database listener on the SuperCluster IB network. Creating such a listener enables database clients to connect over IB (as opposed to over the Ethernet Client Access Network). This is typical for an application running on SuperCluster in an Application Domain or zone. Listeners over IB can be setup to use the TCP protocol, the SDP (Sockets Direct Protocol) protocol, or both.

On SuperCluster, connections to the database over IB are established on the Storage IB Network that is setup using the IB partition 8503. This IB partition is created as part of the initial installation and configuration of the SuperCluster. There is no need to create it as part of the IB listener setup. The example in this procedure adds an IB listener to an existing 2-node RAC. The Storage IB subnet is 192.0.2.0/22. The VIPs for the Client Access Network and the Storage IB Network are listed in the /etc/hosts file.

  1. Edit the /etc/hosts file on each Database Domain in the cluster to add the virtual IP addresses to be used for the IB network.

    For this example, these addresses are added to the /etc/hosts file on both nodes. Addresses starting with x.y are VIPs on the 10 GbE client access network. Those starting with a.b. are on the storage IB.

    Ensure that the IP addresses that you specify are not already in use.

    x.y.132.103   node1-vip
    a.b.30.65 node1-vipIB
    x.y.132.104   node2-vip
    a.b.30.66 node2-vipIB
  2. As superuser on node 1, register the IB subnet in the Grid by running these commands from the bin directory of the Grid home (the usual Grid home is /u01/app/11.2.x.y/grid/bin). Also register the two VIPs:
    root@node1# srvctl add network -k 2 -S 192.0.2.0/255.255.252.0/stor_ipmp0 -w static -v
    root@node1# srvctl add vip -n node1 -A node1-vipIB/255.255.252.0/stor_ipmp0 -k 2
    root@node1# srvctl add vip -n node2 -A node2-vipIB/255.255.252.0/stor_ipmp0 -k 2
    root@node1# srvctl start vip -i node1-vipIB
    root@node1# srvctl start vip -i node2-vipIB
  3. As the grid user on node 1, create a LISTENER_IP by running these commands from the Grid home bin directory (if there is no grid account use the oracle account):

    Note -  If you want to enable SDP in addition to TCP, replace: grid@node1$ srvctl add listener -l LISTENER_IB -k 2 -p 1522 with: grid@node1$ srvctl add listener -l LISTENER_IB -k 2 -p TCP:1522,/SDP:1522
    grid@node1$ srvctl add listener -l LISTENER_IB -k 2 -p 1522
    grid@node1$ srvctl start listener -l LISTENER_IB
    grid@node1$ srvctl status listener -l LISTENER_IB
      Listener LISTENER_IB is enabled
      Listener LISTENER_IB is running on node(s): node1,node2
  4. As oracle one node 1, check that the listener is properly registered by running these commands from the Grid home bin directory:
    oracle@node1$ lsnrctl status LISTENER_IB
    
       LSNRCTL for Solaris: Version 11.2.0.3.0 - Production on 30-SEP-2018 15:49:2
      Copyright (c) 1991, 2018, Oracle.  All rights reserved.
      Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_IB)))
      STATUS of the LISTENER
      ------------------------
      Alias                     LISTENER_IB
      Version                   TNSLSNR for Solaris: Version 11.2.0.3.0 - Production
      Start Date                30-SEP-2018 15:48:38
      Uptime                    0 days 0 hr. 0 min. 50 sec
      Trace Level               off
      Security                  ON: Local OS Authentication
      SNMP                      OFF
      Listener Parameter File   /u01/app/11.2.x.y/grid/network/admin/listener.ora
      Listener Log File         /u01/app/11.2.x.y/grid/log/diag/tnslsnr/node1/listener_ib/alert/log.xml
      Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_IB)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=sdp)(HOST=a.b.30.65)(PORT=1522)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=a.b.30.65)(PORT=1522)))
      The listener supports no services
      The command completed successfully
  5. As oracle on node 1, edit tnsnames.ora file located in the Grid home network/admin directory.

    Note -  If the IB listener is to be used only with a specific standalone database, then modify the tnsnames.ora from the Oracle home instead.
    1. Get the database name DBNAME from the Grid home bin directory.

      This value is assigned to SERVICE_NAME in the tnsnames.ora file.

      oracle@node1$ srvctl config database
        DBNAME
    2. Use vi with the :set list option to view and remove invisible characters.

      Invisible characters such as tabs (^l) and end of line ($) can create problems during the next step and should be removed.

      ## BEGIN
      DBNAME_IB =
      (DESCRIPTION =
              (LOAD_BALANCE=on)
              (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vipIB)(PORT = 1522))
              (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vipIB)(PORT = 1522))
              (CONNECT_DATA =
                      (SERVER = DEDICATED)
                      (SERVICE_NAME = DBNAME)
              )
      )
      
      LISTENER_IBREMOTE =
      (DESCRIPTION =
              (ADDRESS_LIST =
                      (ADDRESS = (PROTOCOL = TCP)(HOST =  node2-vipIB)(PORT = 1522))
              )
      )
      
      LISTENER_IBLOCAL =
      (DESCRIPTION =
              (ADDRESS_LIST =
                      (ADDRESS = (PROTOCOL = TCP)(HOST =  node1-vipIB)(PORT = 1522))
                      (ADDRESS = (PROTOCOL = SDP)(HOST =  node1-vipIB)(PORT = 1522))
              )
      )
      
      LISTENER_IPLOCAL =
      (DESCRIPTION =
              (ADDRESS_LIST =
                      (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))
              )
      )
      
      LISTENER_IPREMOTE =
      (DESCRIPTION =
              (ADDRESS_LIST =
                      (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))
              )
      )
      ## END
  6. As oracle on node 2, add these lines to the tnsnames.ora file in the Grid home network/admin directory:
    DBNAME_IB =
    (DESCRIPTION =
            (LOAD_BALANCE=on)
            (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vipIB)(PORT = 1522))
            (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vipIB)(PORT = 1522))
            (CONNECT_DATA =
                    (SERVER = DEDICATED)
                    (SERVICE_NAME = DBNAME)
            )
    )
    
    LISTENER_IBREMOTE =
    (DESCRIPTION =
            (ADDRESS_LIST =
                    (ADDRESS = (PROTOCOL = TCP)(HOST =  node1-vipIB)(PORT = 1522))
            )
    )
    
    LISTENER_IBLOCAL =
    (DESCRIPTION =
            (ADDRESS_LIST =
                    (ADDRESS = (PROTOCOL = TCP)(HOST =  node2-vipIB)(PORT = 1522))
                    (ADDRESS = (PROTOCOL = SDP)(HOST =  node2-vipIB)(PORT = 1522))
            )
    )
    
    LISTENER_IPLOCAL =
    (DESCRIPTION =
            (ADDRESS_LIST =
                    (ADDRESS = (PROTOCOL = TCP)(HOST = node2-vip)(PORT = 1521))
            )
    )
    
    LISTENER_IPREMOTE =
    (DESCRIPTION =
            (ADDRESS_LIST =
                    (ADDRESS = (PROTOCOL = TCP)(HOST = node1-vip)(PORT = 1521))
            )
    )
    ## END
  7. As oracle, register the new listener at the database level.

    Make sure to set ORACLE_SID to the proper value before running sqlplus.


    Note -  If the LOCAL_LISTENER and REMOTE_LISTENER parameters are defined in the database, they should not appear in the LISTENER_NETWORKS parameter or cross registration occurs and connections will be redirected across networks. In this example, if LOCAL_LISTENER and REMOTE_LISTENER are defined respectively to LISTENER_IPLOCAL and LISTERNER_IPREMOTE, then the SQL statements should be as follows.

    On Node 1:

    SQL> alter system set listener_networks='((NAME=network2)(LOCAL_LISTENER=LISTENER_IBLOCAL)(REMOTE_LISTENER=LISTENER_IBREMOTE))';

    On Node 2:

    SQL> alter system set listener_networks='((NAME=network2)(LOCAL_LISTENER=LISTENER_IBLOCAL)(REMOTE_LISTENER=LISTENER_IBREMOTE))';

    Register the listener on both nodes, as shown:

    oracle@node1$ export ORACLE_SID=DBNAME1
    oracle@node1$ sqlplus / as sysdba
    SQL> alter system set listener_networks='((NAME=network2)(LOCAL_LISTENER=LISTENER_IBLOCAL)(REMOTE_LISTENER=LISTENER_IBREMOTE))',
         '((NAME=network1)(LOCAL_LISTENER=LISTENER_IPLOCAL)(REMOTE_LISTENER=LISTENER_IPREMOTE))' scope=both;
    
    
    oracle@node2$ export ORACLE_SID=DBNAME2
    oracle@node2$ sqlplus / as sysdba
    SQL> alter system set listener_networks='((NAME=network2)(LOCAL_LISTENER=LISTENER_IBLOCAL)(REMOTE_LISTENER=LISTENER_IBREMOTE))',
         '((NAME=network1)(LOCAL_LISTENER=LISTENER_IPLOCAL)(REMOTE_LISTENER=LISTENER_IPREMOTE))' scope=both;
  8. As oracle on node 1, restart the LISTENER_IB and check its status:
    oracle@node1$ srvctl stop listener -l LISTENER_IB
    oracle@node1$ srvctl start listener -l LISTENER_IB
    oracle@node1$ export TNS_ADMIN=/u01/app/11.2.x.y/grid/network/admin
    oracle@node1$ lsnrctl status LISTENER_IB
    
    LSNRCTL for Solaris: Version 11.2.0.3.0 - Production on 04-SEP-2018 11:53:20
    Copyright (c) 1991, 2018, Oracle.  All rights reserved.
    Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER_IB)))
    STATUS of the LISTENER
    ------------------------
    Alias                     LISTENER_IB
    Version                   TNSLSNR for Solaris: Version 11.2.0.3.0 - Production
    Start Date                04-SEP-2018 11:52:32
    Uptime                    0 days 0 hr. 0 min. 47 sec
    Trace Level               off
    Security                  ON: Local OS Authentication
    SNMP                      OFF
    Listener Parameter File   /u01/app/11.2.0.3/grid/network/admin/listener.ora
    Listener Log File         /u01/app/11.2.0.3/grid/log/diag/tnslsnr/rmb-zpr-db-int1/listener_ib/alert/log.xml
    Listening Endpoints Summary...
      (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER_IB)))
      (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=a.b.30.86)(PORT=1522)))
    Services Summary...
    Service "DBNAME" has 2 instance(s).
      Instance "DBNAME1", status READY, has 1 handler(s) for this service...
      Instance "DBNAME2", status READY, has 1 handler(s) for this service...
    The command completed successfully

Related Information