ITPub博客

首页 > 数据库 > Oracle > [20211013]测试远程监听补充.txt

[20211013]测试远程监听补充.txt

原创 Oracle 作者:lfree 时间:2021-10-13 10:21:47 0 删除 编辑

[20211013]测试远程监听补充.txt

--//昨天做了远程监听的测试,今天本想看看SECURE_REGISTER_LISTENER= (TCP),是否限制这个功能.
--//在测试前我遇到无法登录的情况.

1.测试环境。

--//数据库在192.168.100.78 sid=book,监听端口1521 版本11.2.0.4
--//监听服务器在192.168.100.33     ,监听端口1521 版本10.2.0.4。
--//两台机器监听同时启动。

2.测试:
d:\>sqlplus -s -l scott/book@192.168.100.33:1521/book
ERROR:
ORA-12545: Connect failed because target host or object does not exist
SP2-0751: Unable to connect to Oracle.  Exiting SQL*Plus

--//我自己检查没有问题,突然想起我昨天做的测试
--//http://blog.itpub.net/267265/viewspace-2795454/=>[20211012]sqlnet.ora USE_DEDICATED_SERVER=on.txt
--//我已经注解了USE_DEDICATED_SERVER=on.

--//我马上取消注解,发现ok.
d:\notes\2021>echo @ ver1 | sqlplus -s -l scott/book@192.168.100.33:1521/book
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

--//这才想起来我昨天修改了参数dispatchers:
SYS@book> show parameter dispatchers
NAME        TYPE   VALUE
----------- ------ -------------------------------------
dispatchers string (PROTOCOL=TCP) (SERVICE=book,bookXDB)

--//这样导致book支持两种模式 shared ,DEDICATED.使用ezconnect 缺省不指明优先使用共享模式.
--//很明显远程监听的方式不支持共享模式:

--//注解客户端的sqlnet.ora文件中的USE_DEDICATED_SERVER=on.

d:\notes\2021>sqlplus -s -l scott/book@192.168.100.33:1521/book
ERROR:
ORA-12545: Connect failed because target host or object does not exist
SP2-0751: Unable to connect to Oracle.  Exiting SQL*Plus

--//我必须明确指明采用DEDICATED模式连接:
d:\notes\2021>echo @ver1 | sqlplus -s -l scott/book@192.168.100.33:1521/book:DEDICATED
PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

--//在192.168.100.33上执行:
$ lsnrctl service

LSNRCTL for Linux: Version 10.2.0.4.0 - Production on 13-OCT-2021 10:10:36

Copyright (c) 1991, 2007, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.100.33)(PORT=1521)))
Services Summary...
Service "BOOKSHARE" has 1 instance(s).
  Instance "book", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:11 refused:0 state:ready
         REMOTE SERVER
         (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.78)(PORT=1521)))
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0
         LOCAL SERVER
Service "book" has 1 instance(s).
  Instance "book", status READY, has 2 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:11 refused:0 state:ready
         REMOTE SERVER
         (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.78)(PORT=1521)))
      "D000" established:8 refused:0 current:4 max:1022 state:ready
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         DISPATCHER <machine: gxqyydg4, pid: 47703>
         (ADDRESS=(PROTOCOL=tcp)(HOST=gxqyydg4.com)(PORT=3012))
Service "bookXDB" has 1 instance(s).
  Instance "book", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:8 refused:0 current:4 max:1022 state:ready
         DISPATCHER <machine: gxqyydg4, pid: 47703>
         (ADDRESS=(PROTOCOL=tcp)(HOST=gxqyydg4.com)(PORT=3012))
Service "icare" has 1 instance(s).
  Instance "icaredg", status UNKNOWN, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0
         LOCAL SERVER
Service "test" has 1 instance(s).
  Instance "test", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
Service "testXDB" has 1 instance(s).
  Instance "test", status READY, has 1 handler(s) for this service...
    Handler(s):
      "D000" established:0 refused:0 current:0 max:1022 state:ready
         DISPATCHER <machine: icaredg, pid: 23483>
         (ADDRESS=(PROTOCOL=tcp)(HOST=icaredg)(PORT=19254))
Service "test_XPT" has 1 instance(s).
  Instance "test", status READY, has 1 handler(s) for this service...
    Handler(s):
      "DEDICATED" established:0 refused:0 state:ready
         LOCAL SERVER
The command completed successfully

--//共享模式是注册的.很明显无法通过远程监听实现这个功能.
--//执行如下直接访问端口.
d:\>sqlplus  scott/book@192.168.100.78:3012/book

SCOTT@192.168.100.78:3012/book> @ spid
       SID    SERIAL# PROCESS                  SERVER    SPID                     PID  P_SERIAL# C50
---------- ---------- ------------------------ --------- -------------------- ------- ---------- --------------------------------------------------
       281         15 8512:8764                SHARED    47705                     20          1 alter system kill session '281,15' immediate;


3.关于SECURE_REGISTER_LISTENER=(TCP)限制我一直无法实现.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/267265/viewspace-2795654/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
熟悉oracle相关技术,擅长sql优化,rman备份与恢复,熟悉linux shell编程。

注册时间:2008-01-03

  • 博文量
    3085
  • 访问量
    6808137