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.

:-)
m4s0n501
Written by:

2 Comments

  1. Kristof
    3/21/2008

    Perhaps a late comment but this article was very helpfull :-) thx for that !

    Regards

    Kristof

Comments are closed.