1. If the default port 1521 is used and the instance is automatically registered to the listener, you do not need to set local_listener. The listener. ora file can be configured as normal.
2. If a non-default port 1521 is used to enable the instance to automatically register the listener, set the local_listerner parameter local_listener = 'lsnr2' (which can be dynamically modified)
3. Edit the listener. ora file. There are two listeners. One is the default port used for Dynamic Registration and the other is the non-default port used for static registration:
LISTENER1 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oms) (PORT = 1526 ))
)
SID_LIST_LISTENER1 =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = guuc)
(Oracle_HOME =/oracle/product/10201)
(SID_NAME = cuug)
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME =/oracle/product/10201)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = oms) (PORT = 1521 ))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC0 ))
)
3. The database listens to two cases after the database is started. At this time, the database is not started. The default database does not exist yet. The non-default database has a static one:
[Oracle @ oms admin] $ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0-Production on 14-APR-2010 00:12:37
Copyright (c) 1991,200 5, Oracle. All rights reserved.
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = oms) (PORT = 1521 )))
STATUS of the LISTENER
------------------------
Alias listener
Version TNSLSNR for Linux: Version 10.2.0.1.0-Production
Start Date 14-APR-2010 00:07:35
Uptime 0 days 0 hr. 5 min. 1 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File/oracle/product/10201/network/admin/listener. ora
Listener Log File/oracle/product/10201/network/log/listener. log
Listening Endpoints Summary...
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = oms) (PORT = 1521 )))
(DESCRIPTION = (ADDRESS = (PROTOCOL = ipc) (KEY = EXTPROC0 )))
Services Summary...
Service "PLSExtProc" has 1 instance (s ).
Instance "PLSExtProc", status UNKNOWN, has 1 handler (s) for this service...
The command completed successfully
======================================
[Oracle @ oms admin] $ lsnrctl status listener1
LSNRCTL for Linux: Version 10.2.0.1.0-Production on 14-APR-2010 00:12:40
Copyright (c) 1991,200 5, Oracle. All rights reserved.
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = oms) (PORT = 1526 )))
STATUS of the LISTENER
------------------------
Alias listener1
Version TNSLSNR for Linux: Version 10.2.0.1.0-Production
Start Date 14-APR-2010 00:06:56
Uptime 0 days 0 hr. 5 min. 43 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File/oracle/product/10201/network/admin/listener. ora
Listener Log File/oracle/product/10201/network/log/listener1.log
Listening Endpoints Summary...
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = oms) (PORT = 1526 )))
Services Summary...
Service "guuc" has 1 instance (s ).
Instance "cuug", status UNKNOWN, has 1 handler (s) for this service...
The command completed successfully
4. Start the database and observe the listener changes. An instance is registered by default, which is not changed by default:
[Oracle @ oms admin] $ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0-Production on 14-APR-2010 00:18:40
Copyright (c) 1991,200 5, Oracle. All rights reserved.
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = oms) (PORT = 1521 )))
STATUS of the LISTENER
------------------------
Alias listener
Version TNSLSNR for Linux: Version 10.2.0.1.0-Production
Start Date 14-APR-2010 00:07:35
Uptime 0 days 0 hr. 11 min. 4 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File/oracle/product/10201/network/admin/listener. ora
Listener Log File/oracle/product/10201/network/log/listener. log
Listening Endpoints Summary...
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = oms) (PORT = 1521 )))
(DESCRIPTION = (ADDRESS = (PROTOCOL = ipc) (KEY = EXTPROC0 )))
Services Summary...
Service "PLSExtProc" has 1 instance (s ).
Instance "PLSExtProc", status UNKNOWN, has 1 handler (s) for this service...
Service "cuug" has 1 instance (s ).
Instance "cuug", status READY, has 1 handler (s) for this service...
Service "cuug_XPT" has 1 instance (s ).
Instance "cuug", status READY, has 1 handler (s) for this service...
The command completed successfully
======================================
[Oracle @ oms admin] $ lsnrctl status listener1
LSNRCTL for Linux: Version 10.2.0.1.0-Production on 14-APR-2010 00:18:42
Copyright (c) 1991,200 5, Oracle. All rights reserved.
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = oms) (PORT = 1526 )))
STATUS of the LISTENER
------------------------
Alias listener1
Version TNSLSNR for Linux: Version 10.2.0.1.0-Production
Start Date 14-APR-2010 00:06:56
Uptime 0 days 0 hr. 11 min. 45 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File/oracle/product/10201/network/admin/listener. ora
Listener Log File/oracle/product/10201/network/log/listener1.log
Listening Endpoints Summary...
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = oms) (PORT = 1526 )))
Services Summary...
Service "guuc" has 1 instance (s ).
Instance "cuug", status UNKNOWN, has 1 handler (s) for this servi
5. Configure the local tnsnames. ora File
LSNR2 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = oms) (PORT = 1526 ))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = cuug) # This name can be customized. It is generally defined as the Instance name.
)
)
6. dynamically change the value of local_listener:
SQL> alter system set local_listener = lsnr2;
7. Pay attention to the changes in the two listeners. The default listener does not have instance registration, and an instance is not registered by default:
[Oracle @ oms admin] $ lsnrctl status listener
LSNRCTL for Linux: Version 10.2.0.1.0-Production on 14-APR-2010 00:25:50
Copyright (c) 1991,200 5, Oracle. All rights reserved.
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = oms) (PORT = 1521 )))
STATUS of the LISTENER
------------------------
Alias listener
Version TNSLSNR for Linux: Version 10.2.0.1.0-Production
Start Date 14-APR-2010 00:07:35
Uptime 0 days 0 hr. 18 min. 14 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File/oracle/product/10201/network/admin/listener. ora
Listener Log File/oracle/product/10201/network/log/listener. log
Listening Endpoints Summary...
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = oms) (PORT = 1521 )))
(DESCRIPTION = (ADDRESS = (PROTOCOL = ipc) (KEY = EXTPROC0 )))
Services Summary...
Service "PLSExtProc" has 1 instance (s ).
Instance "PLSExtProc", status UNKNOWN, has 1 handler (s) for this service...
The command completed successfully
======================================
[Oracle @ oms admin] $ lsnrctl status listener1
LSNRCTL for Linux: Version 10.2.0.1.0-Production on 14-APR-2010 00:26:03
Copyright (c) 1991,200 5, Oracle. All rights reserved.
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = oms) (PORT = 1526 )))
STATUS of the LISTENER
------------------------
Alias listener1
Version TNSLSNR for Linux: Version 10.2.0.1.0-Production
Start Date 14-APR-2010 00:24:35
Uptime 0 days 0 hr. 1 min. 28 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File/oracle/product/10201/network/admin/listener. ora
Listener Log File/oracle/product/10201/network/log/listener1.log
Listening Endpoints Summary...
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = oms) (PORT = 1526 )))
Services Summary...
Service "cuug" has 1 instance (s ).
Instance "cuug", status READY, has 1 handler (s) for this service...
Service "cuug_XPT" has 1 instance (s ).
Instance "cuug", status READY, has 1 handler (s) for this service...
Service "guuc" has 1 instance (s ).
Instance "cuug", status UNKNOWN, has 1 handler (s) for this service...
The command completed successfully
Note: The instance has been registered to the listener of this port. Now, we finally understand the role of the local_listener parameter. If the default value is global_name of the database, we will register the default listener; if a new value, such as lsnr2, is set according to tnsnames. ora settings, registered to the listener of the specified port, the port is consistent with the specified port of a listener.
For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12