Home > Oracle > Using a non default listener

Using a non default listener

When a non-default listener is used, then a listener.ora must be configured with the relevant listener address. For example

NESWPCTS =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = testoracle)(PORT = 50944))
  )

[oracle@testoracle admin]$ lsnrctl

LSNRCTL for Linux: Version 10.2.0.1.0 – Production on 19-NOV-2009 12:22:27

Copyright (c) 1991, 2005, Oracle.  All rights reserved.

Welcome to LSNRCTL, type “help” for information.

LSNRCTL>set cu NESWPCTS

Current Listener is NESWPCTS

LSNRCTL> start

This would start the listener on port 50944

In order for PMON to be able to register the database service(s) with this listener, the init.ora parameter LOCAL_LISTENER must be set.

Eg, LOCAL_LISTENER=listener_NESWPCTS

PMON will attempt to resolve LOCAL_LISTENER using some naming method. For example, this may be resolved in tnsnames.ora, as follows:

 listener_NESWPCTS = (DESCRIPTION = (ADDRESS=(PROTOCOL=TCP)(HOST=testoracle)(PORT=50944)) )

If a tnsnames.ora cannot be found or if LOCAL_LISTENER cannot be resolved, the alert.log will show:

PMON started with pid=2 Syntax error in listener string

If LOCAL_LISTENER can be resolved, but there is a syntax error in the tnsnames.ora specification, the alert log will show:

PMON started with pid=2 Syntax error in listener string (DESCRIPTION =)

SPECIFYING MULTIPLE LOCAL_LISTENERS

Multiple LOCAL_LISTENERs can be specified in one of two ways in the init.ora:

local_listener=listener_NESWPCTS, listener_NESWPCTS_ALIAS
local_listener=istener_NESWPCTS
local_listener=listener_NESWPCTS_ALIAS

In both cases, v$parameter will show: local_listener=listener_NESWPCTS, listener_NESWPCTS_ALIAS

PMON will register ONLY with the listener that appears first in the v$parameter value for local_listener

The correct method is to specify one local_listener in the init.ora,
and to specify multiple listener ADDRESSes in the connect descriptor.

For example,
init.ora:
   local_listener=all_listeners

tnsnames.ora:
   all_listeners.netwstore.ncs.local=
    (DESCRIPTION =
      (ADDRESS=(PROTOCOL=TCP)(HOST=nesdb1)(PORT=50634))
      (ADDRESS=(PROTOCOL=TCP)(HOST=nesdb2)(PORT=50611))
    )

Advertisements
Categories: Oracle
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: