参考oracle联机丛书中 Net Services Reference的第7章Listener Parameters (listener.ora)
oracle的Database services有2种注册方式,静态和动态。
Dynamic service registration, a feature of Oracle9i and Oracle8, eliminates the need for static configuration of supported services. However, static service configuration is required if you plan to use Oracle Enterprise Manager.
For later database releases, the listener uses the dynamic service information about the database and instance it has received through service registration before using statically configured information in the listener.ora file. Therefore, the SID_LIST is not required, unless Oracle Enterprise Manager is used to monitor an Oracle9i or Oracle8 database.
如果使用动态注册方式。他是通过PMON进程进行的,一般在启动数据库后PMON进程会一分钟执行一次,检测到没有注册的服务会进行注册。如果等不了一分钟,也可以使用alter system register;命令进行手动注册。

Process Monitor Process (PMON)

The process monitor (PMON) performs process recovery when a user process fails. PMON is responsible for cleaning up the database buffer cache and freeing resources that the user process was using. For example, it resets the status of the active transaction table, releases locks, and removes the process ID from the list of active processes.
PMON periodically checks the status of dispatcher and server processes, and restarts any that have stopped running (but not any that Oracle has terminated intentionally). PMON also registers information about the instance and dispatcher processes with the network listener.
Like SMON, PMON checks regularly to see whether it is needed and can be called if another process detects the need for it.
SQL> show parameter service
NAME                                 TYPE
------------------------------------ ----------------------
service_names                        string
[oracle@test64 admin]$ sqlplus scott/oracle@
[oracle@test64 admin]$ cat listener.ora
# listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER                                           #静态注册
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (PROGRAM = extproc)
    (SID_DESC =
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (SID_NAME = orcl)
    (SID_DESC =
      (GLOBAL_DBNAME = ocp)
      (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
      (SID_NAME = ocp)
LISTENER                                                      #动态注册
      (ADDRESS = (PROTOCOL = TCP)(HOST = = 1521))
[oracle@test64 admin]$ lsnrctl status
LSNRCTL for Linux: Version - Production on 01-MAR-2012 01:14:03
Copyright (c) 1991, 2005, Oracle.  All rights reserved.
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version - Production
Start Date                01-MAR-2012 01:13:04
Uptime                    0 days 0 hr. 0 min. 58 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "ocp" has 1 instance(s).
  Instance "ocp", status UNKNOWN, has 1 handler(s) for this service...
Service "" has 2 instance(s).
  Instance "orcl", status UNKNOWN, has 1 handler(s) for this service...
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
Service "" has 1 instance(s).
  Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
将监听的信息添加到tnsnames.ora 文件中。 注意,是tnsnames.ora 文件, 因为pmon在动态注册监听时要从tnsnames.ora中读取相关信息。
(ADDRESS = (PROTOCOL = TCP)(HOST = DaveDai)(PORT = 1522))
SQL> alter system set local_listener=listener;
SQL> alter system register;
SQL> alter system set LOCAL_LISTENER='(ADDRESS = (PROTOCOL = TCP)(HOST = DaveDai)(PORT = 1522))';
SQL> alter system register;