Search

Join this Blog for direct reference of any post into your inbox. To join just click on "Join this Site" under "Follower" then Login with your Email.*** DECLARATION: I Maintain this Blog for Helping Myself While at Work and Welcome any body Needing Help!!!.*** CAUTION: Using any of the script from this Blog may contain at Own Risk. These scripts May or May not have been Tested.***

Wednesday, 12 September 2012

Listener Configuration in Oracle 9i RAC

The TNS listener process listens on a specific network address for connection requests to one of the services from one of the database instances that it services. When requested, a server process (dedicated server environment) and connects the user to that process or forwards the connection request to a dispatcher (shared server environment) for service to the database service requested. Alternatively, if the listener knows of more than one instance providing the requested service, it may direct the client to an alternate listener (usually on a different node) that will service the request.
In any Oracle database configuration, listeners define the instances as local or remote (in single-instance environments, normally everything is local).
The remote_listener parameter specifies a list of listening end points that the local instance should contact to register its services. This list is usually defined in a TNS entry in the tnsnames.ora file and then the TNS alias set as the value of the remote_listener parameter.
Step to Configure Listener Manually in RAC database
        Create individual listener.ora files for each listener. Make sure that the HOST= lines in the listener.ora definition reference the VIP addresses. I prefer to specify IP addresses instead of hostnames or DNS names here to avoid possible lookup issues and/or confusion.
        Create a TNS entry for each node that specifies a single TNS entry by referencing all the listeners in the cluster.
        Set the remote_listener parameter in the instances (Global parameter) to be the name of the TNS entry you created in the previous step. This is done with Alter system set remote_listener = 'MY_REMOTE_LISTENER' scope=BOTH;
        Set the local_listener parameter to be the ADDRESS string for the local instance (Instance specific parameter) with each instance having a similar, but unique value since each instance runs on a different HOST. Alter system set local_listener = '(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.14.18)(PORT=1521))' SID='DB1' scope=BOTH;
        On each instance, you can run “alter system register” to force immediate registration with the listeners. Generally the listener registration will be updated within a minute or two automatically.
        One final tip is to use the lsnrctl program to get information about the current state of the listener. For Example:
LSNRCTL> set curr listener_clust1
Current Listener is listener_clust1
LSNRCTL> set display verbose
Service display mode is VERBOSE
LSNRCTL> servic
Consider the below example, is belongs to 2 node listener configuration of manually created oracle 9i RAC database where DB is the database name and DB1 and DB2 is two different instances on CLUST1 and CLUST2 node respectively. For more details check the previous post:

Go to the $ORACLE_HOME/network/admin and edit tnsnames.ora to add entries for your instances, the database and the listeners. Add in the listener.ora file entry on both nodes.
LISTENERS_DB =  
(ADDRESS_LIST =  
(ADDRESS = (PROTOCOL = TCP)(HOST = clust1-dbserver)(PORT = 1521))  
(ADDRESS = (PROTOCOL = TCP)(HOST = clust2-dbserver)(PORT = 1521))  
)  
Add in the tnsnames.ora file entry on both nodes.
DB =  
(DESCRIPTION =  
(ADDRESS = (PROTOCOL = TCP)(HOST = clust1-dbserver)(PORT = 1521))  
(ADDRESS = (PROTOCOL = TCP)(HOST = clust2-dbserver)(PORT = 1521))  
(LOAD_BALANCE = YES)  
(CONNECT_DATA =  
(SERVER = DEDICATED)  
(SERVICE_NAME = DB)  
)  
)  
DB2 =  
(DESCRIPTION =  
(ADDRESS = (PROTOCOL = TCP)(HOST = clust2-dbserver)(PORT = 1521))  
(CONNECT_DATA =  
(SERVER = DEDICATED)  
(SERVICE_NAME = DB)  
(INSTANCE_NAME = DB2)  
)  
)  
DB1 =  
(DESCRIPTION =  
(ADDRESS = (PROTOCOL = TCP)(HOST = clust1-dbserver)(PORT = 1521))  
(CONNECT_DATA =  
(SERVER = DEDICATED)  
(SERVICE_NAME = DB)  
(INSTANCE_NAME = DB1)  
)  
)  
LISTENERS_DB =  
(ADDRESS_LIST =  
(ADDRESS = (PROTOCOL = TCP)(HOST = clust1-dbserver)(PORT = 1521))  
(ADDRESS = (PROTOCOL = TCP)(HOST = clust2-dbserver)(PORT = 1521))  
)
Fixing RAC Listener Configuration Issue:
Suppose one machine is able to establish a connection, but at the same time another client on the same network faces ORA-12514 error.
Cause: It can be due to inability from the client to resolve names (DNS), bad tnsnames configuration, and listener configuration.
Suppose our RAC setup is on 2 node and we have to configure listener for that part of a RAC system:
Server name
SID
VIP
Clust1
DB1
192.168.14.18
Clust2
DB2
192.168.14.19

Got to Configure $ORACLE_HOME/network/admin/listener.ora on each of the nodes, referencing the VIP address:
On Clust1:
LISTENER_ CLUST1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.14.18)(PORT = 1521))
)))
On Clust2:
LISTENER_ CLUST2 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.14.19)(PORT = 1521))
)))
Then create a entry on $ORACLE_HOME/network/admin/tnsnames.ora on each of the RAC node:
MY_REMOTE_LISTENER=
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.14.18)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.14.19)(PORT=1521))
)
Now connect as sysdba to one of the nodes and set the database parameter REMOTE_LISTENER, for instance:
Alter system set remote_listener = 'MY_REMOTE_LISTENER' scope=BOTH;
Now set the LOCAL_LISTENER parameter for each node:
Alter system set local_listener = '(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.14.18)(PORT=1521))' SID='DB1' scope=BOTH;
Alter system set local_listener = '(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.14.19)(PORT=1521))' sid='DB2' scope=BOTH;
Start listeners on their respective nodes:
lsnrctl start LISTENER_ CLUST1
lsnrctl start LISTENER_ CLUST2
connect as sysdba on each of the instances and force registration of services:
Alter system register;
Verify the services registered on each listener on each node:
lsnrctl services LISTENER_CLUST1;
lsnrctl services LISTENER_CLUST2;

3 comments:

  1. DreamHost is definitely the best web-hosting provider with plans for any hosting requirments.

    ReplyDelete
  2. QUANTUM BINARY SIGNALS

    Professional trading signals sent to your mobile phone daily.

    Start following our trades NOW and profit up to 270% a day.

    ReplyDelete
  3. WP land - $5 per month WORDPRESS hosting.

    ReplyDelete