In 11.2, after manually purged the message queue, some queue rule sets might become Invalid.
before purging the queue.
SQL> select object_type, object_name
from dba_objects
where owner='SYS' and status!='VALID';
no rows selected
Purge the queue table.
SQL> DECLARE
po dbms_aqadm.aq$_purge_options_t;
BEGIN
po.block := FALSE;
DBMS_AQADM.PURGE_QUEUE_TABLE
( queue_table => 'SYS.SYS$SERVICE_METRICS_TAB',
purge_condition => NULL,
purge_options => po);
END;
/
PL/SQL procedure successfully completed.
Check the Invalid objects again.
SQL> select object_type, object_name
from dba_objects
where owner='SYS' and status!='VALID';
OBJECT_TYPE OBJECT_NAME
------------------- --------------------------
RULE SET SYS$SERVICE_METRICS_N
Recompile the invalid objects.
SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql
SQL> select object_type, object_name
from dba_objects
where owner='SYS' and status!='VALID';
no rows selected