HOME

Oracle XDBとの競合回避

2005.04.30

  1. Oracle XDBとの競合回避
  2. Oracle をインストールしている場合、Oracle XDBと競合し、 Tomcatが起動しない問題を以下の手順にて回避する。

  3. スクリプトの実行
  4. CREATE OR REPLACE PACKAGE XDB_UTILITY
    as
     procedure  SET_HTTP_PORT (PORT_NUMBER number);
     procedure  SET_FTP_PORT  (PORT_NUMBER number);
    end XDB_UTILITY;
    /
    show errors
    --
    create or replace package body XDB_UTILITY as
    --
    FTP_XPATH   varchar2(256) := '/xdbconfig/sysconfig/protocolconfig/ftpconfig/ftp-port';
    HTTP_XPATH  varchar2(256) := '/xdbconfig/sysconfig/protocolconfig/httpconfig/http-port';
    --
    procedure SET_XDB_PORT(PORT_XPATH varchar2, PORT_NUMBER number)
    as
       config XMLType;
    begin
       config := dbms_xdb.cfg_get();
       select updateXML(config, PORT_XPATH, PORT_NUMBER) 
       into config
       from dual;
       dbms_xdb.cfg_update(config);
       commit;
       dbms_xdb.cfg_refresh();
    end;
    ----
    -- Create the SET_HTTP_PORT and SET_FTP_PORT functions
    --
    procedure SET_HTTP_PORT(PORT_NUMBER number)
    as
    begin
      SET_XDB_PORT(HTTP_XPATH || '/text()', PORT_NUMBER);
    end;
    --
    procedure SET_FTP_PORT(PORT_NUMBER number)
    as
    begin
      SET_XDB_PORT(FTP_XPATH || '/text()', PORT_NUMBER);
    end;
    --
    end XDB_UTILITY;
    /
    show errors
    --
    create or replace public synonym XDB_UTILITY for XDB_UTILITY
    /
    grant execute on XDB_UTILITY to XDBADMIN
    /
    			

  5. Oracle XDBのポートを変更
    1. HTTPポートの変更(2100 から 8081 に変更)
    2. 例 :

      SQL> call xdb_utility.set_http_port(8081)
      						

    3. FTPポートの変更(8080 から 8021に変更)
    4. 例 :

      SQL> call xdb_utility.set_ftp_port(8021)
      						

    5. ポートが変更されていることを確認する
    6. [oracle@oolong work]$ lsnrctl status
      
      LSNRCTL for Linux: Version 10.1.0.2.0 - Production on 04-DEC-2004 12:51:43
      
      Copyright (c) 1991, 2004, Oracle.  All rights reserved.
      
      Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC)))
      STATUS of the LISTENER
      ------------------------
      Alias                     LISTENER
      Version                   TNSLSNR for Linux: Version 10.1.0.2.0 - Production
      Start Date                04-DEC-2004 11:40:22
      Uptime                    0 days 1 hr. 11 min. 21 sec
      Trace Level               off
      Security                  ON: Local OS Authentication
      SNMP                      OFF
      Listener Parameter File   /u01/app/oracle/product/10.1.0/db_2/network/admin/listener.ora
      Listener Log File         /u01/app/oracle/product/10.1.0/db_2/network/log/listener.log
      Listening Endpoints Summary...
        (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC)))
        (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oolong.cafeaulait.bne.jp)(PORT=1521)))
        (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oolong.cafeaulait.bne.jp)(PORT=8021))(Presentation=FTP)(Session=RAW))
        (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oolong.cafeaulait.bne.jp)(PORT=8081))(Presentation=HTTP)(Session=RAW))
      Services Summary...
      Service "PLSExtProc" has 1 instance(s).
        Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
      Service "libra.cafeaulait.bne.jp" has 1 instance(s).
        Instance "libra", status READY, has 1 handler(s) for this service...
      Service "libraXDB.cafeaulait.bne.jp" has 1 instance(s).
        Instance "libra", status READY, has 1 handler(s) for this service...
      The command completed successfully