xdb组件中关于ftp/http监听

联系:手机/微信(+86 17813235971) QQ(107644445)QQ咨询惜分飞

标题:xdb组件中关于ftp/http监听

作者:惜分飞©版权所有[未经本人同意,不得以任何形式转载,否则有进一步追究法律责任的权利.]

发现监听进程监听8080和2100端口

--监听端口
[oracle@xifenfei ~]$ netstat -nap|grep tnslsnr
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 0.0.0.0:8080                0.0.0.0:*                   LISTEN      29866/tnslsnr
tcp        0      0 0.0.0.0:1521                0.0.0.0:*                   LISTEN      29866/tnslsnr
tcp        0      0 0.0.0.0:2100                0.0.0.0:*                   LISTEN      29866/tnslsnr

--进程名称
[oracle@xifenfei ~]$ ps -ef|grep 29866
oracle   29866     1  0 00:20 pts/0    00:00:00 /u01/oracle/9.2.0/db_1/bin/tnslsnr LISTENER -inherit

查看监听状态

[oracle@xifenfei ~]$ lsnrctl status

LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 08-MAY-2012 00:26:50

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xifenfei)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 9.2.0.4.0 - Production
Start Date                08-MAY-2012 00:20:47
Uptime                    0 days 0 hr. 6 min. 3 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /u01/oracle/9.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/oracle/9.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=8080))(Presentation=HTTP)(Session=RAW))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=2100))(Presentation=FTP)(Session=RAW))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "xffXDB" has 1 instance(s).
  Instance "xff", status READY, has 1 handler(s) for this service...
Service "xifenfei" has 2 instance(s).
  Instance "xff", status UNKNOWN, has 1 handler(s) for this service...
  Instance "xff", status READY, has 1 handler(s) for this service...
The command completed successfully
--从这里可以看出oracle的listener确实监听了8080和2100端口

查看listener.ora文件

[oracle@xifenfei ~]$ more /u01/oracle/9.2.0/db_1/network/admin/listener.ora
# LISTENER.ORA Network Configuration File: /u01/oracle/9.2.0/db_1/network/admin/listener.ora
# Generated by Oracle configuration tools.

LISTENER =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = TCP)(HOST = xifenfei)(PORT = 1521))
      )
      (ADDRESS_LIST =
        (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
      )
    )
  )

SID_LIST_LISTENER =
  (SID_LIST =
    (SID_DESC =
      (SID_NAME = PLSExtProc)
      (ORACLE_HOME = /u01/oracle/9.2.0/db_1)
      (PROGRAM = extproc)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = xifenfei)
      (ORACLE_HOME = /u01/oracle/9.2.0/db_1)
      (SID_NAME = xff)
    )
  )
--从中确认未监听8080和2100端口,看来这两个端口是在动态注册监听的时候加入进去的.
--我们知道oracle的xdb组件可能会启用http和ftp功能,这两个功能可能会开启响应端口,我们分析xdb组件.

查看xdb组件是否工作正常

SQL> select 
  2  comp_name, status, version from 
  3  DBA_REGISTRY where 
  4  comp_name='Oracle XML Database'; 

COMP_NAME                      STATUS                 VERSION
------------------------------ ---------------------- ----------
Oracle XML Database            VALID                  9.2.0.4.0

SQL> select  count(*) from  dba_objects where owner='XDB' and status='INVALID';

  COUNT(*)
----------
         0

SQL>   show parameter dispatchers;

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
dispatchers                          string                 (PROTOCOL=TCP) (SERVICE=xffXDB)
max_dispatchers                      integer                5
mts_dispatchers                      string                 (PROTOCOL=TCP) (SERVICE=xffXDB)
mts_max_dispatchers                  integer                5
--查询证明xdb组件应该工作正常

查看xdb中ftp和http启动相关端口

SQL> select dbms_xdb.GETFTPPORT() from dual; 
select dbms_xdb.GETFTPPORT() from dual
       *
ERROR at line 1:
ORA-00904: "DBMS_XDB"."GETFTPPORT": invalid identifier


SQL> select dbms_xdb.GETHTTPPORT() from dual; 
select dbms_xdb.GETHTTPPORT() from dual
       *
ERROR at line 1:
ORA-00904: "DBMS_XDB"."GETHTTPPORT": invalid identifier
--9i中为提供上述查询端口的相关程序.

SQL> set long 10000
SQL> set pagesize 0
SQL> SELECT dbms_xdb.cfg_get FROM dual;
--从中找到类此这样记录,确实ftp启用2100端口,http启用8080端口
     <ftpconfig>
        <ftp-port>2100</ftp-port>
        <ftp-listener>local_listener</ftp-listener>
        <ftp-protocol>tcp</ftp-protocol>
        <session-timeout>6000</session-timeout>
     </ftpconfig>
     <httpconfig>
        <http-port>8080</http-port>
        <http-listener>local_listener</http-listener>
        <http-protocol>tcp</http-protocol>
        <session-timeout>6000</session-timeout>
        <server-name>XDB HTTP Server</server-name>
     </httpconfig>
--到这里我们可以确定是由于xdb组件中的ftp和http功能自动注册导致监听了2100和8080端口

修改xdb中监听ftp和http端口

SQL> call dbms_xdb.cfg_update(updateXML(dbms_xdb.cfg_get(),'
   2 /xdbconfig/sysconfig/protocolconfig/httpconfig/http-port/text()',8888));

Call completed.

SQL> call dbms_xdb.cfg_update(updateXML(dbms_xdb.cfg_get(),
   2 '/xdbconfig/sysconfig/protocolconfig/ftpconfig/ftp-port/text()',2222));

Call completed.

SQL> commit;

Commit complete.

SQL>  exec dbms_xdb.cfg_refresh;

PL/SQL procedure successfully completed.

SQL> exit
Disconnected from Oracle9i Enterprise Edition Release 9.2.0.4.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.4.0 - Production
[oracle@xifenfei ~]$ lsnrctl status

LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 08-MAY-2012 00:57:13

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xifenfei)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 9.2.0.4.0 - Production
Start Date                08-MAY-2012 00:20:47
Uptime                    0 days 0 hr. 36 min. 26 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /u01/oracle/9.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/oracle/9.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=8888))(Presentation=HTTP)(Session=RAW))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=2222))(Presentation=FTP)(Session=RAW))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "xffXDB" has 1 instance(s).
  Instance "xff", status READY, has 1 handler(s) for this service...
Service "xifenfei" has 2 instance(s).
  Instance "xff", status UNKNOWN, has 1 handler(s) for this service...
  Instance "xff", status READY, has 1 handler(s) for this service...
The command completed successfully

xdb中ftp和http监听

SQL> alter system reset dispatchers  scope=spfile sid='*';

System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  353441008 bytes
Fixed Size                   451824 bytes
Variable Size             184549376 bytes
Database Buffers          167772160 bytes
Redo Buffers                 667648 bytes
Database mounted.
Database opened.

SQL> show parameter dispatchers;

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ---------
dispatchers                          string
max_dispatchers                      integer                5
mts_dispatchers                      string
mts_max_dispatchers                  integer                5

--SELECT dbms_xdb.cfg_get FROM dual;中信息
      <ftpconfig>
        <ftp-port>2222</ftp-port>
        <ftp-listener>local_listener</ftp-listener>
        <ftp-protocol>tcp</ftp-protocol>
        <session-timeout>6000</session-timeout>
      </ftpconfig>
      <httpconfig>
        <http-port>8888</http-port>
        <http-listener>local_listener</http-listener>
        <http-protocol>tcp</http-protocol>
        <session-timeout>6000</session-timeout>
        <server-name>XDB HTTP Server</server-name>
      </httpconfig>

[oracle@xifenfei dbs]$ lsnrctl status

LSNRCTL for Linux: Version 9.2.0.4.0 - Production on 08-MAY-2012 01:10:07

Copyright (c) 1991, 2002, Oracle Corporation.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xifenfei)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for Linux: Version 9.2.0.4.0 - Production
Start Date                08-MAY-2012 00:20:47
Uptime                    0 days 0 hr. 49 min. 20 sec
Trace Level               off
Security                  OFF
SNMP                      OFF
Listener Parameter File   /u01/oracle/9.2.0/db_1/network/admin/listener.ora
Listener Log File         /u01/oracle/9.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=xifenfei)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "xifenfei" has 2 instance(s).
  Instance "xff", status UNKNOWN, has 1 handler(s) for this service...
  Instance "xff", status READY, has 1 handler(s) for this service...
The command completed successfully
--证明已经关闭了xdb 组件的ftp/http监听

xdb组件中的ftp/http监听在9i数据库中,只要你安装了xdb组件,会自动启用这功能.
在10g及其11g中默认不启用.所以为了你的数据库安全,如果不使用这些功能,建议手工关闭

此条目发表在 Oracle 监听 分类目录。将固定链接加入收藏夹。

评论功能已关闭。