listener动态注册:PMON进程自动将数据库的信息注册到listener中,或者使用alter system register显示注册,要求listener必须使用1521端口,使用动态注册将不需要在listener.ora中指定SID_LIST。如果指定了instance_name,service_names参数,动态注册将使用这两个参数,如果没有指定service_name,那么将使用db_domain+db_name作为service_name进行动态注册。
listener status看到如下内容:
Service "test" has 2 instance(s).
Instance "test", status UNKNOWN, has 1 handler(s) for this service...(静态注册)
Instance "test", status READY, has 1 handler(s) for this service...(动态注册)
如果指定了多个service_names,将会看到多个service指向同一个instance,如下:
Service "jackytest1" has 1 instance(s).
Instance "aaa", status READY, has 1 handler(s) for this service...
Service "jackytest2" has 1 instance(s).
Instance "aaa", status READY, has 1 handler(s) for this service...
listener静态注册:在listener中显示指定SID_LIST,静态注册中global_dbname的作用就如同动态注册中的service_names,用于为同一个instance设置多个别名
比如
(SID_DESC =
(GLOBAL_DBNAME = test1)
(ORACLE_HOME = /opt/oracle/products/9.2.0)
(SID_NAME = test1)
)
(SID_DESC =
(GLOBAL_DBNAME = xxxyyy)
(ORACLE_HOME = /opt/oracle/products/9.2.0)
(SID_NAME = test1)
)
这样就为test1这个instance设置了两个service_name,分别是test1和xxxyyy
Service "test1" has 1 instance(s).
Instance "test1", status UNKNOWN, has 1 handler(s) for this service...
Service "xxxyyy" has 1 instance(s).
Instance "test1", status UNKNOWN, has 1 handler(s) for this service...