理论先不说了,简单记一下在listener.ora和tnsnames.ora里的表现形式:
1、listener.ora,其中红色字体部分为静态注册信息
listener=
(description=
(address=(protocol=ipc)(key=extproc))
(address=(protocol=tcp)(host=testdb1)(port=1521)))
listener_1526=
(description=
(address=(protocol=tcp)(host=testdb1)(port=1526)))
sid_list_listener=
(sid_list=
(sid_desc=
(sid_name=plsextproc)
(oracle_home=/u01/app/oracle/product/10.2.0/db_1)
(program=extproc))
(sid_desc=
(GLOBAL_DBNAME=ORCL1)
(oracle_home=/u01/app/oracle/product/10.2.0/db_1)
(SID_NAME=ORCL1))
(sid_desc=
(GLOBAL_DBNAME=ORCL2)
(oracle_home=/u01/app/oracle/product/10.2.0/db_1)
(SID_NAME=ORCL2)))
2、非默认端口若使用动态注册监听,需要在tnsnames.ora中添加一节记录,并将oracle参数local_listener指向该串名:
$ cat tnsnames.ora
lsnr2=(address=(protocol=tcp)(host=testdb1)(port=1526))
SYS@ ORCL1>sho parameter local
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string lsnr2
1、listener.ora,其中红色字体部分为静态注册信息
listener=
(description=
(address=(protocol=ipc)(key=extproc))
(address=(protocol=tcp)(host=testdb1)(port=1521)))
listener_1526=
(description=
(address=(protocol=tcp)(host=testdb1)(port=1526)))
sid_list_listener=
(sid_list=
(sid_desc=
(sid_name=plsextproc)
(oracle_home=/u01/app/oracle/product/10.2.0/db_1)
(program=extproc))
(sid_desc=
(GLOBAL_DBNAME=ORCL1)
(oracle_home=/u01/app/oracle/product/10.2.0/db_1)
(SID_NAME=ORCL1))
(sid_desc=
(GLOBAL_DBNAME=ORCL2)
(oracle_home=/u01/app/oracle/product/10.2.0/db_1)
(SID_NAME=ORCL2)))
2、非默认端口若使用动态注册监听,需要在tnsnames.ora中添加一节记录,并将oracle参数local_listener指向该串名:
$ cat tnsnames.ora
lsnr2=(address=(protocol=tcp)(host=testdb1)(port=1526))
SYS@ ORCL1>sho parameter local
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
local_listener string lsnr2
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12355989/viewspace-704448/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/12355989/viewspace-704448/