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: