HOWTO: Installing XMLDB functionality

Just as a reminder, this HOWTO, applicable for Oracle 10.2 and higher (registration of the protocol server is different on 10.1 and lower, see posts on this site).

--
-- set ORACLE_SID
--
-- remove XMLDB via
-- @?/rdbms/admin/catnoqm.sql
--

conn / as sysdba

-- alter session set NLS_LENGTH_SEMANTICS ='BYTE';

-- create dedicated tablespace

CREATE TABLESPACE "XDB" DATAFILE
'/oracle/oradata/$ORACLE_SID/xmldb01.dbf' SIZE 250M
AUTOEXTEND ON NEXT 10485760 MAXSIZE 2048M
LOGGING ONLINE PERMANENT BLOCKSIZE 8192
EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT MANUAL;

spool xdb_install.lst

-- create functionality and repository

@?/rdbms/admin/catqm.sql oracle XDB TEMP

-- recompile all invalid objects

@?/rdbms/admin/utlrp

spool off

--
-- reset statement
-- ALTER SYSTEM RESET dispatchers scope=spfile sid='*';
-- 

alter system set dispatchers='(PROTOCOL=TCP)(SERVICE=$ORACLE_SIDXDB)'
comment='Dispatcher enabled for XMLDB Protocol Server' scope = both;

-- in case we go heavy

alter system set shared_servers=5 scope=both;

-- instantiate all changes against the listener

alter system register;

host lsnrctl status

-- set HTTP, FTP, WebDav ports

select dbms_xdb.getftpport() from dual;
select dbms_xdb.gethttpport() from dual;

exec dbms_xdb.setHttpPort(8080);
exec dbms_xdb.setFtpPort(2100);

select dbms_xdb.getftpport() from dual;
select dbms_xdb.gethttpport() from dual;

-- Double check 

host lsnrctl status

set head off

-- Valid?

select * from dba_registry where comp_id='XDB';

set head on

-- final test via browser: 

http://localhost:8080/
 ftp://localhost:2100/
.
Marco Gralike Written by: