The installed components and their status,
Oracle Database Catalog Views 184.108.40.206.0 Valid Oracle Database Packages and Types 220.127.116.11.0 Valid Oracle XML Database 18.104.22.168.0 Loaded
The XML Database component states as loaded, as there are invalid objects.
--> Tried to recompile invalid objects by running utlrp.sql but no use, still the invalid objects exist.
--> Unable to expdp/impdp due to sys objs being invalid with the below error,
ORA-04063: package body "SYS.DBMS_METADATA" has errors 04063. 00000 - "%s has errors" *Cause: Attempt to execute a stored procedure or use a view that has errors. For stored procedures, the problem could be syntax errors or references to other, non-existent procedures. For views, the problem could be a reference in the view's defining query to a non-existent table. Can also be a table which has references to non-existent or inaccessible types. *Action: Fix the errors and/or create referenced objects as necessary
Tried the below as suggested by Oracle docs but still, the issue persist
1) Master Note for Oracle XML Database (XDB) Install / Deinstall (Doc ID 1292089.1)
Oracle 10.1 and above - XDB Reload spool xdbreload.log connect / as sysdba set echo on; shutdown immediate; startup upgrade; @?/rdbms/admin/xdbrelod.sql shutdown immediate; startup; @?/rdbms/admin/utlrp.sql spool off
2) XDB is INVALID in DBA_REGISTRY after Fresh Installation (Doc ID 1297620.1)
3) Oracle XML Database (XDB) Installation on 12c - XDB invalid status after fresh installation/upgrade (Doc ID 2222780.1)