- 论坛徽章:
- 0
|
说明:库在ll机器,监听在lj机器
1)配置lj上的listener LISTENER_lj= (DESCRIPTION= (ADDRESS_LIST= (ADDRESS=(PROTOCOL=tcp)(HOST=lj)(PORT=1521)) (ADDRESS=(PROTOCOL=ipc)(KEY=extproc))))
2)配置ll上的tnsnames.ora listener_lj = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = Lj)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = fox) ) )
3)启动lj上的监听 lsnrctl start listener_lj
4)在ll的库上配置remote_listener,并动态注册 SQL> alter system set remote_listener='LISTENER_LJ';
System altered.
SQL> ALTER SYSTEM REGISTER;
System altered.
5)再次查看lj上的监听 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lj)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\extprocipc))) Services Summary... Service "fox" has 1 instance(s). Instance "fox", status READY, has 1 handler(s) for this service... Service "foxXDB" has 1 instance(s). Instance "fox", status READY, has 1 handler(s) for this service... Service "fox_XPT" has 1 instance(s). Instance "fox", status READY, has 1 handler(s) for this service... The command completed successfully
LSNRCTL> set current_listener listener_lj Current Listener is listener_lj LSNRCTL> services Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=lj)(PORT=1521))) Services Summary... Service "fox" has 1 instance(s). Instance "fox", status READY, has 1 handler(s) for this service... Handler(s): "DEDICATED" established:1 refused:0 state:ready REMOTE SERVER (ADDRESS=(PROTOCOL=TCP)(HOST=LL)(PORT=1521))
在ll上测试连接 SQL> conn sys/oracle@listener_lj as sysdba Connected.
|
|