Sunday, September 25, 2011

Create a Local Listener on non default port ( ports other than 1521)


On some circumstances you may need to have separate listeners running on seperate ports for your databases.When you create a database, the default listener will be created and listens on port 1521. There may be cases when you want to run multiple listeners for your databases.

If you want PMON to register with a local listener that does not use TCP/IP, port 1521, configure the LOCAL_LISTENER parameter in the initialization parameter file to locate the local listener.

For a shared server environment, you can alternatively use the LISTENER attribute of the DISPATCHERS parameter in the initialization parameter file to register the dispatchers with a nondefault local listener. Because both the LOCAL_LISTENER parameter and the LISTENER attribute enable PMON to register dispatcher information with the listener, it is not necessary to specify both the parameter and the attribute if the listener values are the same.

The steps are as follows.

1. Create new non default listener
    Create a new listener using $ORACLE_HOME/netca for this.


2.Set the LOCAL_LISTENER parameter for your database. You can set this in two ways.
a ) Initialization parameter file (PFILE)
     a ) Ensure you have ORACLE_HOME and ORACLE_SID environment variable set
     b) sqlplus / as sysdba
     c) create pfile='$ORACLE_HOME/dbs/init.ora from spfile;
     d) Open $ORACLE_HOME/dbs/init.ora and add the following entry
            *.local_listener=listener1
                   where listener1 is the name you want to give for your new listener.
     e) shut immediate;
     f) startup pfile='$ORACLE_HOME/dbs/init.ora'


b) Server parameter file ( SPFILE )
     a ) Ensure you have ORACLE_HOME and ORACLE_SID environment variable set
     b) sqlplus / as sysdba
     c) alter system set local_listener=listener1 scope=spfile sid='*';
     d) shut immediate;
     e) startup;

2.Resolve listener name with tnsnames.ora
listener name ( in this case listener1) is then resolved to the listener protocol addresses through a naming method, such as a tnsnames.ora file on the database server.

Add the following entry in your database server tnsnames.ora

listener1=
 (DESCRIPTION=
  (ADDRESS=(PROTOCOL=tcp)(HOST= )(PORT=<port you wish to configure>)))

3.Restart the database
a ) Ensure you have ORACLE_HOME and ORACLE_SID environment variable set
     a) sqlplus / as sysdba
     b) shut immediate;
     c) startup;

You will see that database is registered with new listener.

Refer : http://download.oracle.com/docs/cd/B13789_01/network.101/b10775/listenercfg.htm

0 comments:

Post a Comment

 

ORA-BLOG. Copyright 2008 All Rights Reserved Revolution Two Church theme by Brian Gardner Converted into Blogger Template by Bloganol dot com