监听器的配置:
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = dba.up.com)(PORT = 1521))
)
)监
听器可以配置多个依次为:
LISTENER1 =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = dba.up.com)(PORT = 1521))
)
)在监听器上配置数据库:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = orcl)
(sid_name = orcl)
(SID_DESC =
(GLOBAL_DBNAME = orcl1)
(sid_name = orcl1))
)
客户端的tnsnam.ora配置:
DBA =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dba.up.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)以
上为静态注册,动态注册不需要
在监听器上配置数据库:
只需要设置初始化参数server_names即可:alter system set server_names=monkey,sage;
客户端的tnsnam.ora配置:
DBA =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dba.up.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = monkey))
动态注册使用非1521端口时需要在服务器端的tnsname.ora中进行配置:
LSN1421 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = dba.up.com)(PORT = 1421)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = monkey))
alter system set local_listener=lsn1421;