How to change Oracle XE default hostname and DB ports

How to change Oracle XE default hostname and DB ports

Stop listener in command window:
lsnrctl stop
Modify ORACLE_HOME/app/oracle/product/10.2.0/server/NETWORK/ADMIN/listener.ora
LISTENER =
(DESCRIPTION_LIST =
 (DESCRIPTION =
   (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
   (ADDRESS = (PROTOCOL = TCP)(HOST = <hostname>)(PORT = <port number>))
 )
)
Change the PORT to the number wanted. Also modify PORT in tnsnames.ora and save.
Start listener:
lsnrctl start
Run SQL Plus to add local listener for that port, then change HTTP listening port:
conn system/password;
alter system set local_listener = "(ADDRESS=(PROTOCOL=TCP)(HOST=<hostname>)(PORT=<port number>))";
exec dbms_xdb.sethttpport(<port number>);
alter system register;
disc;
If "set local_listener" is omitted, you probably will get get "ORA-12514: TNS:listener does not currently know of service requested when openning SQL Plus with sqlplus system@xe

alter system register" is also important as it reregisters the DB and all services with the listener. Otherwise you can find the port is not listening with netstat -an. Also you can verify with lsnrctl status, and a line like following should be there:
 (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=<hostname>)(PORT=nnnn))(Presentation=HTTP)(Session=RAW))
Confirm:
select dbms_xdb.gethttpport as "HTTP Port",
dbms_xdb.getftpport as "FTP Port" from dual;

Ref: http://download.oracle.com/docs/cd/B25329_01/doc/admin.102/b25107/network.htm#BHCCDEIH

Comments

Popular posts from this blog

React JS

WaterMark behavior in ADF

WebLogic Application Deployment & Shared Library