A technical troubleshooting blog about Oracle with other Databases & Cloud Technologies.

Oracle XML Database (XDB) Installation on 12c – XDB invalid status

3 min read
On 12c, Oracle XML DB is now a mandatory component of Oracle Database.

You cannot uninstall it, and if Oracle XML DB is not already installed in your database prior to an upgrade to Oracle Database 12c or later, then it is automatically installed in tablespace SYSAUX during the upgrade.

If Oracle XML DB has been automatically installed, and if you want to use Oracle XML DB, then after the upgrade operation, you must set the database compatibility to at least 12.1.0.1. If the compatibility is less than 12.1.0.1 then an error is raised when you try to use Oracle XML DB.
Component                                 Version            Status
----------------------------------------- ------------------ --------------
Oracle Application Express                4.2.5.00.08        VALID
Oracle Workspace Manager                  12.1.0.2.0         VALID
Oracle XML Database                       12.1.0.2.0         INVALID ****
Oracle Database Catalog Views             12.1.0.2.0         VALID
Oracle Database Packages and Types        12.1.0.2.0         VALID
JServer JAVA Virtual Machine              12.1.0.2.0         VALID
Oracle XDK                                12.1.0.2.0         VALID
Oracle Database Java Packages             12.1.0.2.0         VALID
Oracle Real Application Clusters          12.1.0.2.0         VALID
SQL> SELECT COMP_NAME FROM DBA_REGISTRY WHERE STATUS=’INVALID’;

COMP_NAME
——————————————————————————–
Oracle XML Database
Execute the below packages and triggers
alter package xdb.dbms_clobutil compile body ;
alter package xdb.dbms_csx_admin compile body ;
alter package xdb.dbms_csx_int2 compile body ;
alter package xdb.dbms_json compile body ;
alter package xdb.dbms_json_int compile body ;
alter package xdb.dbms_soda_admin compile body ;
alter package xdb.dbms_soda_dml compile body ;
alter package xdb.dbms_soda_dom compile body ;
alter package xdb.dbms_soda_user_admin compile body ;
alter package xdb.dbms_soda_user_dml compile body ;
alter package xdb.dbms_xdb compile body ;
alter package xdb.dbms_xdbnfs compile body ;
alter package xdb.dbms_xdbrepos compile body ;
alter package xdb.dbms_xdbresource compile body ;
alter package xdb.dbms_xdbutil_int compile body ;
alter package xdb.dbms_xdbz0 compile body ;
alter package xdb.dbms_xdb_admin compile body ;
alter package xdb.dbms_xdb_config compile body ;
alter package xdb.dbms_xdb_constants compile body ;
alter package xdb.dbms_xdb_content compile body ;
alter package xdb.dbms_xdb_print compile body ;
alter package xdb.dbms_xdb_repos compile body ;
alter package xdb.dbms_xevent compile body ;
alter package xdb.dbms_xlsb compile body ;
alter package xdb.dbms_xmldom compile body ;
alter package xdb.xdb_rvtrig_pkg compile body ;
alter package xdb.dbms_xmlindex compile body ;
alter package xdb.dbms_xmlindex0 compile body ;
alter package xdb.dbms_xmlparser compile body ;
alter package xdb.dbms_xmlschema_annotate compile body ;
alter package xdb.dbms_xmlschema_lsb compile body ;
alter package xdb.dbms_xmlstorage_manage compile body ;
alter package xdb.dbms_xmltranslations compile body ;
alter package xdb.dbms_xslprocessor compile body ;
alter package xdb.xdb_ancop compile body ;
alter package xdb.xdb_dltrig_pkg compile body ;
alter package xdb.prvt_dbms_manage_xmlstorage compile body ;
alter function xdb.under_path_func compile;
alter trigger xdb .xdb_pv_trig compile;
alter trigger xdb .xdb_rv_trig compile;
alter package xdb .dbms_json_int compile;
alter package xdb .dbms_xmldom_icd compile;
alter package xdb .dbms_soda_user_dml compile;
alter package xdb .dbms_soda_dml compile;
alter operator xdb .depth compile;
alter function xdb .get_xdb_tablespace compile;
alter operator xdb .path compile;
Compile the invalid packages
exec dbms_utility.compile_schema('XDB');

@?/rdbms/admin/utlrp.sql -- Run this a few times
-- Validate the XDB

connect / as sysdba
set serveroutput on
execute sys.dbms_regxdb.validatexdb;
Check the Invalid Component
SQL> select schema,status from dba_registry WHERE COMP_ID=’XDB’;

SCHEMA     STATUS
—————– ————
XDB            VALID