一个oracle实例对于多个监听,一个监听对于多个端口。现在我们可以创建一个oracle实例一个监听的两个端口。这一共有两种方法:
oracle一个实例配置多个listener或多个端口
listener.ora文件的内容如下:
sid_list_listener =
(sid_list =
(sid_desc =
(sid_name = plsextproc)
(oracle_home = /u01/app/oracle/product/10.2.0/db)
(program = extproc)
)
(sid_desc =
(global_dbname = jingyong)
(oracle_home =/u01/app/oracle/product/10.2.0/db)
(sid_name = jingyong)
)
)
listener =
(description_list =
(description =
(address = (protocol = tcp)(host = jingyong)(port = 1521))
)
)
上面的配置只配置了一个listener
下面再增加一个listener_2
sid_list_listener_2 =
(sid_list =
(sid_desc =
(sid_name = plsextproc)
(oracle_home = /u01/app/oracle/product/10.2.0/db)
(program = extproc)
)
(sid_desc =
(global_dbname = jingyong)
(oracle_home =/u01/app/oracle/product/10.2.0/db)
(sid_name = jingyong)
)
)
listener_2 =
(description_list =
(description =
(address = (protocol = tcp)(host = jingyong)(port = 1522))
)
)
sid_list_ 这里的要和listener名称一致。
sid_desc则注册要提供服务的数据库实例名。这样listener2 才能够提供服务。
再来启动两个listener
[oracle@jingyong udump]$ lsnrctl stop listener
lsnrctl for linux: version 10.2.0.1.0 - production on 13-jan-2013 18:06:21
copyright (c) 1991, 2005, oracle. all rights reserved.
connecting to (description=(address=(protocol=tcp)(host=jingyong)(port=1521)))
the command completed successfully
[oracle@jingyong udump]$ lsnrctl start listener_2
lsnrctl for linux: version 10.2.0.1.0 - production on 13-jan-2013 18:06:37
copyright (c) 1991, 2005, oracle. all rights reserved.
starting /u01/app/oracle/product/10.2.0/db/bin/tnslsnr: please wait...
tnslsnr for linux: version 10.2.0.1.0 - production
system parameter file is /u01/app/oracle/product/10.2.0/db/network/admin/listener.ora
log messages written to /u01/app/oracle/product/10.2.0/db/network/log/listener_2.log
listening on: (description=(address=(protocol=tcp)(host=jingyong)(port=1522)))
connecting to (description=(address=(protocol=tcp)(host=jingyong)(port=1522)))
status of the listener
------------------------
alias listener_2
version tnslsnr for linux: version 10.2.0.1.0 - production
start date 13-jan-2013 18:06:37
uptime 0 days 0 hr. 0 min. 0 sec
trace level off
security on: local os authentication
snmp off
listener parameter file /u01/app/oracle/product/10.2.0/db/network/admin/listener.ora
listener log file /u01/app/oracle/product/10.2.0/db/network/log/listener_2.log
listening endpoints summary...
(description=(address=(protocol=tcp)(host=jingyong)(port=1522)))
services summary...
service plsextproc has 1 instance(s).
instance plsextproc, status unknown, has 1 handler(s) for this service...
service jingyong has 1 instance(s).
instance jingyong, status unknown, has 1 handler(s) for this service...
the command completed successfully
[oracle@jingyong udump]$ lsnrctl start listener
lsnrctl for linux: version 10.2.0.1.0 - production on 13-jan-2013 18:06:41
copyright (c) 1991, 2005, oracle. all rights reserved.
starting /u01/app/oracle/product/10.2.0/db/bin/tnslsnr: please wait...
tnslsnr for linux: version 10.2.0.1.0 - production
system parameter file is /u01/app/oracle/product/10.2.0/db/network/admin/listener.ora
log messages written to /u01/app/oracle/product/10.2.0/db/network/log/listener.log
listening on: (description=(address=(protocol=tcp)(host=jingyong)(port=1521)))
connecting to (description=(address=(protocol=tcp)(host=jingyong)(port=1521)))
status of the listener
------------------------
alias listener
version tnslsnr for linux: version 10.2.0.1.0 - production
start date 13-jan-2013 18:06:41
uptime 0 days 0 hr. 0 min. 0 sec
trace level off
security on: local os authentication
snmp off
listener parameter file /u01/app/oracle/product/10.2.0/db/network/admin/listener.ora
listener log file /u01/app/oracle/product/10.2.0/db/network/log/listener.log
listening endpoints summary...
(description=(address=(protocol=tcp)(host=jingyong)(port=1521)))
services summary...
service plsextproc has 1 instance(s).
instance plsextproc, status unknown, has 1 handler(s) for this service...
service jingyong has 1 instance(s).
instance jingyong, status unknown, has 1 handler(s) for this service...
the command completed successfully
,