HOWTO: Enable the Protocol Server (Listener)

On itself, this one is very simple, but to my surprise it still not very clear when I read the questions about this on the OTN XMLDB forum. Maybe this occurs because this isn’t mentioned on the OTN XMLDB FAQ thread, which isn’t read as much as it should be. A lot of really good examples of Mark (Drake) are described in more detail here, and the are definitely worth your time.

So how to enable the WebDAV, HTTP(s) and FTP(s) functionality via the protocol server?

Before Oracle database version 10.2 this is done default (HTTP on port 8080, FTP on port 2100). After (and in my opinion this is the correct behavior) port numbers are set to 0 (zero) and therefore this functionality is disabled.

The XMLDB Protocol Server functionality is configured and controlled via the xdbconfig.xml file. Updating this file via SQL statements is described in the following section.

Oracle database version 10.2 and upwards

You can enable HTTP, WebDAV and FTP protocols the following way…

Let’s enable the ports on the Oracle default listening values (8080 HTTP and 2100 FTP).

sqlplusw.exe /nolog

-- ----------------------------------------------------------
-- check if the protocol is enabled
-- connect to the database with a privileged user account
-- ----------------------------------------------------------

SQL*Plus: Release 10.2.0.2.0 - Production on Wed Jun 6 11:58:38 2007

Copyright (c) 1982, 2005, Oracle.  All Rights Reserved.

Error accessing package DBMS_APPLICATION_INFO
You may need to install the Oracle Procedural option
SET APPINFO requires Oracle Server Release 7.2 or later

SQL> connect xdb
ERROR:
ORA-28000: the account is locked

-- ----------------------------------------------------------
-- This is as it should be (leave it locked)
--
-- The XDB account will be reserved for Oracle, just like
-- the SYS account, don't use it for new applications.
-- ----------------------------------------------------------

SQL> connect system
Connected.

SQL> select xdb.dbms_xdb.getFTPPort() from dual;

XDB.DBMS_XDB.GETFTPPORT()
-------------------------
                       0

1 row selected.

SQL> select xdb.dbms_xdb.getHTTPPort() from dual;

XDB.DBMS_XDB.GETHTTPPORT()
--------------------------
                        0

1 row selected.

-- ----------------------------------------------------------
-- Set FTP and HTTP ports
-- ----------------------------------------------------------

SQL> call dbms_xdb.setHttpPort(8080);

Call completed.

SQL> call dbms_xdb.setFtpPort(2100); 

Call completed.

-- ----------------------------------------------------------
-- For better performance one could set more shared servers
-- Don't forget to update the pfile, etc afterwards...
-- ----------------------------------------------------------

SQL> alter system set
  2     shared_servers=5
  3     comment='06-JUN-2007, MG, OldValue=1'
  4     scope=both;

System altered.

-- ----------------------------------------------------------
-- Force the changes to be picked up by the listener
-- ----------------------------------------------------------

SQL> alter system register; 

System altered.

SQL> disco

Oracle database versions 9.2.0.3 until 10.1

The “old” way is described in the following section (for completeness).

-- ----------------------------------------------------------
-- Use the following in a SQL session
-- ----------------------------------------------------------

declare

   newconfig XMLType;

begin
    --Get status and set FTP port
    select updatexml(
    dbms_xdb.cfg_get(),'/xdbconfig/sysconfig/protocolconfig/ftpconfig/ftp-port/text()',2100) into newconfig from dual;
    dbms_xdb.cfg_update(newconfig);

    --Get status and set HTTP port
    select updatexml(
    dbms_xdb.cfg_get(),'/xdbconfig/sysconfig/protocolconfig/httpconfig/http-port/text()',8080) into newconfig from dual;
    dbms_xdb.cfg_update(newconfig);

end;
/

Disable the Protocol Server

Disabling the Protocol Server can be done via applying the described actions in reverse order. When port numbers are set to value 0 (zero); the Protocol Server functionality is disabled.

XMLDB Repository (via WebDAV)

This can also be achieved via updating the xdbconfig.xml file directly via WebDAV or (an application that is WebDAV aware like: XMLSpy, JDeveloper or Microsoft Word) or FTP .

Some troubleshooting tips

When you are in trouble and the protocol functionality doesn’t work as expected try checking the following…

  • Check if your host name resolving works…
  • If ports like 8080 are not already claimed by applications like Tomcat or APEX
  • Check your listener.log for more information
    (located in $ORACLE_HOME/network/log)
  • Enable SQL*Net tracing
  • Is your value for LOCAL_LISTENER set properly?
  • Is your value for DISPATCHERS set properly?
  • Under Oracle XE, there is also a procedure called dbms_xdb.setListenerLocalAccess to take into account
    (more information see OTN XMLDB forum, or the Oracle documentation)

For more information see also post: “Registering non-default XMLDB HTTP/WebDAV and FTP ports on a non-default Oracle Listener port” or use the “SQLNet” category link on this site. Hope I have been of help.

🙂
Marco Gralike Written by:

2 Comments

  1. Kristof
    March 21

    Perhaps a late comment but this article was very helpfull 🙂 thx for that !

    Regards

    Kristof

Comments are closed.