---
title: "解决Oracle XDB的8080端口冲突问题"
author: "wunda"
date: "2011-03-08T11:28:33Z"
tags: ["JBoss", "Oracle", "Tomcat", "Web", "脚本"]
categories: ["编程语言"]
slug: "oracle-xdb-8080"
draft: false
lastmod: "2011-03-08T11:28:33Z"
id: 946117
url: "https://wunda.iteye.com/blog/946117"
---

从Oracle 9i开始，Oracle的安装缺省包含了XDB。在启动数据库后，Oracle XDB的http服务将会自动占用了8080端口，这给使用或JBoss、Tomcat进行java web开发的人造成了许多不必要的麻烦。 

　　本文将主要介绍修改XDB的http和ftp服务端口的3种方法。 

　　1.使用dbms_xdb包修改端口设置 

　　使用sys登录sqlplus 

　　sqlplus sys/syspassword as sysdba 

　　执行如下的脚本: 

　　============================ 

-- Change the HTTP/WEBDAV port from 8080 to 8081 
call dbms_xdb.cfg_update(updateXML(dbms_xdb.cfg_get(), '/xdbconfig/sysconfig/protocolconfig/httpconfig/http-port/text()', 8081)) 
/ 
-- Change the FTP port from 2100 to 2111 
call dbms_xdb.cfg_update(updateXML(dbms_xdb.cfg_get(), '/xdbconfig/sysconfig/protocolconfig/ftpconfig/ftp-port/text()', 2111)) 
/ 
COMMIT; 
EXEC dbms_xdb.cfg_refresh; 


   2.使用OEM console 

　　选择数据库，XML Database，Configuration。更改XDB的有关设置。 

　　3.修改SPFILE[SID名].ORA文件,去掉数据库的初始化参数： 

　　这个文件是Oracle的启动配置文件dispatchers='(PROTOCOL=TCP) (SERVICE=XDB)'，将会禁止XDB的http和ftp服务。 

　　下面我们来重启计算机，或者在服务中重启OracleService[SID名]这个服务。重启后可能无法使用Enterprise Manager Console和其他客户端连接，这时请大家使用Oracle的Configuration and Migration Tools/Net Configuration Assistant工具删除监听器，然后新建一个监听器，最后重启监听器