在服务器端配置listener.ora和tnsnames.ora
修改lisnter.ora和tnsnames.ora文件,以增加listener.
这一部分,RAC环境和非RAC环境没有区别,可以参考Oracle的文档.
可以一个listener给三个instance服务,也可以启动三个listener给三个instance服务.
我启动了三个listener.
Listener.ora
LSNR1 =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=your_ip_or_name)(PORT=1521)))
LSNR2 =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=your_ip_or_name)(PORT=1522)))
LSNR3 =
(ADDRESS_LIST=
(ADDRESS=(PROTOCOL=tcp)(HOST=your_ip_or_name)(PORT=1523)))
tnsnames.ora
lsnr1=(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=your_ip_or_name)(PORT=1521)))
lsnr2=(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=your_ip_or_name)(PORT=1522)))
lsnr3=(DESCRIPTION=
(ADDRESS=(PROTOCOL=tcp)(HOST=your_ip_or_name)(PORT=1523)))
将your_ip_or_name替换为你的IP地址或者hostname.
Rac.test.com替换为你init.ora文件中设置的db_name.db_domain
启动三个listener.
$ lsnrctl start lsnr1
$ lsnrctl start lsnr2
$ lsnrctl start lsnr3