If your Oracle database will have remote client connections, you will want to protect the Oracle Listener in addition to the Oracle database server. Please refer to the Oracle documentation for information on using Oracle network configuration utilities to create Oracle network configuration files such as listener.ora and tnsnames.ora.

Note: Refer to the Creating a Shared Oracle Listener for Multiple Resources section in the appendix in this document for instructions on how to create a shared Oracle Listener for multiple resources.

Listener Configuration

  1. You need to choose a vip address for clients to make connections to. You may want to put this address in DNS. (Refer to the LifeKeeper IP Recovery Kit Documentation for details on creating an IP resource hierarchy. Refer to the topic Creating a Resource Dependency under GUI Administration Tasks for details on creating a resource dependency).
  1. In the listener.ora file, specify this vip address as the HOST for the database service name. (See the Oracle documentation for details about the listener.ora file.) Although the DNS name can be used in place of the vip address for the HOST database service name, LifeKeeper best practices does not recommend this. Using the vip address will prevent DNS lookup issues from impacting LifeKeeper’s ability to determine the status of a running listener during quickCheck, restore or remove processing. Additionally, a SID_LIST_LISTENER must be defined, even though you may have only one listener defined.

Sample format of a listener.ora:

.
.
.
SID_LIST_LISTENER =
     (SID_LIST =
     (SID_DESC =
             (SID_NAME = <SID Name>)
       )
)
.
.
.
<listener name>=
     (DESCRIPTION_LIST =
         (DESCRIPTION =
              (ADDRESS = (PROTOCOL = TCP)(HOST = <vip>)(PORT = <port number>))
       )
)
.
.
.

Specify the vip address as the HOST in the tnsnames.ora file or Oracle Names. (See the Oracle documentation for details about the tnsnames.ora file.) Although the DNS name can be used in place of the vip address for the HOST database service name, LifeKeeper best practices does not recommend this. Using the vip address will prevent DNS lookup issues from impacting LifeKeeper’s ability to determine the status of a running listener during quickCheck, restore or remove processing:
    .
    .
    .
    <SID Name>=
       (DESCRIPTION =
          (ADDRESS_LIST =
             (ADDRESS = (PROTOCOL = TCP)(HOST = <vip>)(PORT = <port number>))
             )
             (CONNECT_DATA =
             (SID = <SID Name>)
          )
       )

These sample files should work with both Oracle 10g and 11g:

listener.ora

SID_LIST_LISTENER =
   (SID_LIST =
   (SID_DESC =
      (SID_NAME = ORA11A)
   )
)
LISTENER =
   (DESCRIPTION_LIST =
      (DESCRIPTION =
         (ADDRESS = (PROTOCOL = TCP)(HOST = 192.0.2.0)(PORT = 1521))
      )
   )

tnsnames.ora

ORA01 =
   (DESCRIPTION =
      (ADDRESS_LIST =
         (ADDRESS = (PROTOCOL = TCP)(HOST = 192.0.2.0)(PORT = 1521))
      )
         (CONNECT_DATA =
         (SID = ORA01)
      )
   )

The normal location of listener.ora is in $ORACLE_HOME/network/admin. The most common port number is 1521. The global name of the database was defined at creation time. Also keep in mind, if the $ORACLE_HOME directory is installed on non-shared storage, a copy of listener.ora will need to be on both systems.

Note: Oracle Net provides the option of automatically failing over client connections to another listener if the listener for a service should fail. To take advantage of this feature, set the FAILOVER parameter to “ON” in the tnsnames.ora file. If the listener for the LifeKeeper-protected Oracle SID should fail, this allows client connections to continue through another listener until LifeKeeper recovers the protected listener.

Possible Error

If you encounter the following error please see the solution below.

Oracle listener fails with TNS-00511: No Listener Linux Error:111: Connection refused

If you have configured the listener.ora file the same as in the example below, SIOS LifeKeeper will not be able to start the listener.

 (ADDRESS_LIST=
        (ADDRESS=(PROTOCOL=tcp)(HOST=<hostname>)(PORT=1521))
        (ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))
        (ADDRESS=(PROTOCOL=tcp)(HOST=<vip>)(PORT=1521))
  )

Where <hostname> is the hostname of the host and <vip> is the virtual IP address,

the actual error which may scroll by quickly is:

TNS-12542: TNS:address already in use TNS-12560: TNS:protocol adapter error

Solution

SIOS recommends that you change the listener.ora as such:

  (ADDRESS_LIST=
        (ADDRESS=(PROTOCOL=tcp)(HOST=<ip>)(PORT=1521))
        (ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))
        (ADDRESS=(PROTOCOL=tcp)(HOST=<vip>)(PORT=1521))
  )

Where <ip> is the ip address of the host and <vip> is the virtual IP address.

Note: if security audits are an issue, this should work as well where vipname is the DNS name of the virtual IP.

  (ADDRESS_LIST=
        (ADDRESS=(PROTOCOL=tcp)(HOST=<vipname>)(PORT=1521))
  )

This should also pertain to tnsnames.ora file changes.

Feedback

Was this helpful?

Yes No
You indicated this topic was not helpful to you ...
Could you please leave a comment telling us why? Thank you!
Thanks for your feedback.

Post your comment on this topic.

Post Comment