Dynamic Registration listener
SQL> select * from v$version where rownum=1;BANNER--------------------------------------------------------------------------------Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - ProductionSQL> !cat /etc/issueEnterprise Linux Enterprise Linux Server release 5.5 (Carthage)Kernel \r on an \m
The listening with the default port number of 1521 is very simple. After service_names is set up, PMON automatically helps us Register and is very convenient. Registration is not the default port number:
Add the following in $ ORACLE_HOME/network/admin/listener. ora:
LISTENER1 =(DESCRIPTION_LIST =(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = 172.18.115.78)(PORT = 1590))))
(It is best to use IP addresses here)
Set local_listener:
SQL> alter system set local_listener = '(ADDRESS = (PROTOCOL = TCP) (HOST = 172.18.115.78) (PORT = 1590)' scope = both
2;
The system has been changed.
Set service_names:
SQL> alter system set service_names = 'a, B, c, d, diy, OS ';
The system has been changed.
Confirm that the listening process has stopped:
[Oracle @ localhost ~] $ Ps-ef | grep tnslsnr | grep-v grep
Oracle 7312 1 0? 00:00:00/u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr LISTENER-inherit
Oracle 7465 1 0? 00:00:00/u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr listener1-inherit
Stop the listener directly or use the OS command
Here we will directly kill the process:
SQL>! Kill-9 7312
SQL>! Kill-9 7465
SQL>! Ps-ef | grep tnslsnr | grep-v grep
The listening process has stopped.
[Oracle @ localhost ~] $ Lsnrctl start listener1
LSNRCTL for Linux: Version 11.2.0.1.0-Production on-2015 11:42:08
Copyright (c) 1991,200 9, Oracle. All rights reserved.
Start/u01/app/oracle/product/11.2.0/dbhome_1/bin/tnslsnr: Please wait...
TNSLSNR for Linux: Version 11.2.0.1.0-Production
The system parameter file is/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener. ora.
Write/u01/app/oracle/diag/tnslsnr/localhost/listener1/alert/log. xml log information
Listener: (DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 172.18.115.78) (PORT = 1590 )))
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 172.18.115.78) (PORT = 1590 )))
LISTENER STATUS
------------------------
Alias listener1
Version TNSLSNR for Linux: Version 11.2.0.1.0-Production
Start Date: 2015 11:42:08
Normal operation time 0 days 0 hours 0 minutes 0 seconds
Tracking level off
Security ON: Local OS Authentication
SNMP OFF
Listener parameter file/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener. ora
Listener log file/u01/app/oracle/diag/tnslsnr/localhost/listener1/alert/log. xml
Listener endpoint overview...
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 172.18.115.78) (PORT = 1590 )))
The Listener does not support services.
Command executed successfully
After a while, PMON registers the listener:
[Oracle @ localhost ~] $ Lsnrctl status listener1
LSNRCTL for Linux: Version 11.2.0.1.0-Production on-2015 11:43:06
Copyright (c) 1991,200 9, Oracle. All rights reserved.
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 172.18.115.78) (PORT = 1590 )))
LISTENER STATUS
------------------------
Alias listener1
Version TNSLSNR for Linux: Version 11.2.0.1.0-Production
Start Date: 2015 11:42:08
Normal operation time 0 days 0 hours 0 minutes 57 seconds
Tracking level off
Security ON: Local OS Authentication
SNMP OFF
Listener parameter file/u01/app/oracle/product/11.2.0/dbhome_1/network/admin/listener. ora
Listener log file/u01/app/oracle/diag/tnslsnr/localhost/listener1/alert/log. xml
Listener endpoint overview...
(DESCRIPTION = (ADDRESS = (PROTOCOL = tcp) (HOST = 172.18.115.78) (PORT = 1590 )))
Service summary ..
The Service "a. localdomain" contains one instance.
Instance "ORCL3939", status READY, contains 1 handler of this service...
The Service "B. localdomain" contains one instance.
Instance "ORCL3939", status READY, contains 1 handler of this service...
The Service "c. localdomain" contains one instance.
Instance "ORCL3939", status READY, contains 1 handler of this service...
The Service "d. localdomain" contains one instance.
Instance "ORCL3939", status READY, contains 1 handler of this service...
The Service "diy. localdomain" contains one instance.
Instance "ORCL3939", status READY, contains 1 handler of this service...
The Service "orcl3939.localdomain" contains one instance.
Instance "ORCL3939", status READY, contains 1 handler of this service...
The Service "orcl3939XDB. localdomain" contains one instance.
Instance "ORCL3939", status READY, contains 1 handler of this service...
The Service "OS. localdomain" contains one instance.
Instance "ORCL3939", status READY, contains 1 handler of this service...
Command executed successfully