Sunteți pe pagina 1din 10

Author: Joshua Ehiguese

Date: Oct. 10th-2014

Title: Steps to drop and recreate SYS.SYS$SERVICE_METRICS_TAB.

Ref: How to drop and recreate SYS.SYS$SERVICE_METRICS_TAB (Doc ID 1574889.1)

Document Change Control.

Revision Date Author Description of change

1.0 2014-10-10 Joshua Ehiguese Document Creation.

STEP 1

Check the existence of the SYS$SERVICE_METRICS_TAB

{rac1:tutu} $ sqlplus sys/<passwd>@rac-scan:1522/tutu.statcan.ca as sysdba

SQL> select name from gv$database;


NAME
---------
TUTU
TUTU

SQL> select status from gv$instance;

STATUS
------------
OPEN
OPEN

SQL>
select object_name, object_type from dba_objects where object_name like '%SYS$SERVICE_%';
STEP 2

Modify parameter job_queue_processes to 0 so that none of the AQ jobs start.

SQL> show parameter job;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
job_queue_processes integer 1000
SQL>
SQL> alter system set job_queue_processes=0 scope=both sid='*';

System altered.

SQL> show parameter job;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
job_queue_processes integer 0
SQL>

STEP 3

Drop Table SYS.SYS$SERVICE_METRICS_TAB

SQL> exec
dbms_aqadm.drop_queue_table(queue_table=>'SYS.SYS$SERVICE_METRICS_TAB',force =>
TRUE);

PL/SQL procedure successfully completed.

SQL>
STEP 4

Check whether the table,SYS$SERVICE_METRICS_TAB, dropped or not

SQL> col object_name for a30


SQL> select object_name, object_type from dba_objects where object_name like
'%SYS$SERVICE_%';

no rows selected

STEP 5

Recreate Queue tables

@$ORACLE_HOME/rdbms/admin/execsvr.sql

SQL> @$ORACLE_HOME/rdbms/admin/execsvr.sql

Session altered.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Type created.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.


PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed.

Session altered.

SQL>
STEP 6

Check whether the table SYS$SERVICE_METRICS_TAB, recreated or not

SQL> col object_name for a30


SQL> select object_name, object_type from dba_objects where object_name like
'%SYS$SERVICE_%';

OBJECT_NAME OBJECT_TYPE
------------------------------ -----------------------
AQ$_SYS$SERVICE_METRICS_TAB_V EVALUATION CONTEXT
AQ$SYS$SERVICE_METRICS_TAB_S VIEW
AQ$_SYS$SERVICE_METRICS_TAB_F VIEW
AQ$SYS$SERVICE_METRICS_TAB VIEW
AQ$SYS$SERVICE_METRICS_TAB_R VIEW
SYS$SERVICE_METRICS_TAB TABLE
AQ$_SYS$SERVICE_METRICS_TAB_S TABLE
AQ$_SYS$SERVICE_METRICS_TAB_T TABLE
AQ$_SYS$SERVICE_METRICS_TAB_N SEQUENCE
AQ$_SYS$SERVICE_METRICS_TAB_H TABLE
AQ$_SYS$SERVICE_METRICS_TAB_L TABLE

OBJECT_NAME OBJECT_TYPE
------------------------------ -----------------------
AQ$_SYS$SERVICE_METRICS_TAB_G TABLE
AQ$_SYS$SERVICE_METRICS_TAB_I TABLE
AQ$_SYS$SERVICE_METRICS_TAB_E QUEUE
SYS$SERVICE_METRICS_R RULE SET
SYS$SERVICE_METRICS_N RULE SET
SYS$SERVICE_METRICS QUEUE

17 rows selected.
STEP 7

Modify parameter job_queue_processes

SQL> alter system set job_queue_processes=1000 scope=both sid='*';

System altered.
STEP 8

Check AQ table is getting populated or not.

SQL> select count(*), msg_state, queue from


AQ$SYS$SERVICE_METRICS_TAB group by msg_state,queue; 2

COUNT(*) MSG_STATE QUEUE


---------- ---------------- ------------------------------
1 READY SYS$SERVICE_METRICS
27 PROCESSED SYS$SERVICE_METRICS

SQL>

STEP 9

Make sure no invalid objects

SQL> select owner,object_name,status,object_type from all_objects WHERE


STATUS='INVALID';

no rows selected

SQL>

End of document
Below is just to show what the job queue process was before the fix, you can see undeliverable
issues

SQL> show parameter job;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
job_queue_processes integer 1000
SQL> alter system set job_queue_processes=0 scope=both sid='*';

System altered.

SQL> show parameter job;

NAME TYPE VALUE


------------------------------------ ----------- ------------------------------
job_queue_processes integer 0
SQL>
Below is what it looks like after the fix.

S-ar putea să vă placă și