在删除XDB的时候,导致一些sys一些对象失效:

版本为:11.2.0.1 to 11.2.0.2

SQL> select COMP_ID, COMP_NAME, VERSION, STATUS from dba_registry;

COMP_ID COMP_NAME                            VERSION      STATUS
------- ------------------------------------ ------------ --------
CONTEXT Oracle Text                          11.2.0.2.0   VALID
EXF     Oracle Expression Filter             11.2.0.2.0   VALID
OWM     Oracle Workspace Manager             11.2.0.2.0   VALID
CATALOG Oracle Database Catalog Views        11.2.0.2.0   INVALID
CATPROC Oracle Database Packages and Types   11.2.0.2.0   INVALID
RAC     Oracle Real Application Clusters     11.2.0.2.0   VALID
JAVAVM  JServer JAVA Virtual Machine         11.2.0.2.0   VALID
XML     Oracle XDK                           11.2.0.2.0   VALID
CATJAVA Oracle Database Java Packages        11.2.0.2.0   VALID

9 rows selected.

SQL> select OWNER, OBJECT_NAME, OBJECT_TYPE from dba_objects where status = 'INVALID';

OWNER    OBJECT_NAME                     OBJECT_TYPE 
-------- ------------------------------- ------------------
SYS      ALL_XML_SCHEMAS                 VIEW
SYS      ALL_XML_SCHEMAS2                VIEW
SYS      KU$_XMLSCHEMA_VIEW              VIEW
SYS      KU$_EXP_XMLSCHEMA_VIEW          VIEW
SYS      KU$_XMLSCHEMA_ELMT_VIEW         VIEW
SYS      KU$_OPQTYPE_VIEW                VIEW
SYS      KU$_TABLE_XMLSCHEMA_VIEW        VIEW
SYS      KU$_COLUMN_VIEW                 VIEW
SYS      KU$_PCOLUMN_VIEW                VIEW
SYS      KU$_NT_PARENT_VIEW              VIEW
SYS      KU$_FHTABLE_VIEW                VIEW
SYS      KU$_10_2_FHTABLE_VIEW           VIEW
SYS      KU$_10_1_FHTABLE_VIEW           VIEW
SYS      KU$_PFHTABLE_VIEW               VIEW
SYS      KU$_10_1_PFHTABLE_VIEW          VIEW
SYS      KU$_ACPTABLE_VIEW               VIEW
SYS      KU$_IOTABLE_VIEW                VIEW
SYS      KU$_10_1_IOTABLE_VIEW           VIEW
SYS      KU$_PIOTABLE_VIEW               VIEW
SYS      KU$_10_1_PIOTABLE_VIEW          VIEW
SYS      KU$_XMLSCHEMA_TYPES_VIEW        VIEW
SYS      KU$_TTS_TYPES_VIEW              VIEW
SYS      KU$_VIEW_VIEW                   VIEW
SYS      KU$_M_VIEW_FH_VIEW              VIEW
SYS      KU$_M_VIEW_PFH_VIEW             VIEW
SYS      KU$_M_VIEW_IOT_VIEW             VIEW
SYS      KU$_M_VIEW_PIOT_VIEW            VIEW
SYS      KU$_M_VIEW_LOG_FH_VIEW          VIEW
SYS      KU$_M_VIEW_LOG_PFH_VIEW         VIEW
SYS      KU$_CLUSTER_VIEW                VIEW
SYS      DBMS_METADATA                   PACKAGE BODY
SYS      DBMS_METADATA_INT               PACKAGE BODY
SYS      DBMS_METADATA_UTIL              PACKAGE BODY

33 rows selected.

 

需要手动重新运行一些脚本,重建对象

SQL> connect / as sysdba

-- Make XDB Dummy views
start ?/rdbms/admin/catxdbdv.sql

-- update Data Pump related objects and KU$_ views

start ?/rdbms/admin/dbmsmeta.sql
start ?/rdbms/admin/dbmsmeti.sql
start ?/rdbms/admin/dbmsmetu.sql
start ?/rdbms/admin/dbmsmetb.sql
start ?/rdbms/admin/dbmsmetd.sql
start ?/rdbms/admin/dbmsmet2.sql
start ?/rdbms/admin/catmeta.sql
start ?/rdbms/admin/prvtmeta.plb
start ?/rdbms/admin/prvtmeti.plb
start ?/rdbms/admin/prvtmetu.plb
start ?/rdbms/admin/prvtmetb.plb
start ?/rdbms/admin/prvtmetd.plb
start ?/rdbms/admin/prvtmet2.plb
start ?/rdbms/admin/catmet2.sql

REM Check to verify that all components are valid
select COMP_ID, COMP_NAME, VERSION, STATUS from dba_registry;

COMP_ID COMP_NAME                            VERSION      STATUS
------- ------------------------------------ ------------ --------
CONTEXT Oracle Text                          11.2.0.2.0   VALID
EXF     Oracle Expression Filter             11.2.0.2.0   VALID
OWM     Oracle Workspace Manager             11.2.0.2.0   VALID
CATALOG Oracle Database Catalog Views        11.2.0.2.0   VALID
CATPROC Oracle Database Packages and Types   11.2.0.2.0   VALID
RAC     Oracle Real Application Clusters     11.2.0.2.0   VALID
JAVAVM  JServer JAVA Virtual Machine         11.2.0.2.0   VALID
XML     Oracle XDK                           11.2.0.2.0   VALID
CATJAVA Oracle Database Java Packages        11.2.0.2.0   VALID

9 rows selected.

select count(*) from dba_objects where status = 'INVALID'; -- no rows

  COUNT(*)
---------
        0