How to drop and recreate SYS.SYS$SERVICE_METRICS_TAB

简介: How to drop and recreate SYS.SYS$SERVICE_METRICS_TAB
  1. Check the existence of the SYS$SERVICE_METRICS_TAB
    SQL> col object_name for a30
    SQL> select object_name, object_type from dba_objects
    where objectname like '%SYS$SERVICE%';
    OBJECT_NAME OBJECT_TYPE

AQ$_SYS$SERVICE_METRICS_TAB_S TABLE
AQ$_SYS$SERVICE_METRICS_TAB_V EVALUATION CONTEXT
AQ$_SYS$SERVICE_METRICS_TAB_T TABLE
AQ$SYS$SERVICE_METRICS_TAB_S VIEW
AQ$_SYS$SERVICE_METRICS_TAB_N SEQUENCE
AQ$_SYS$SERVICE_METRICS_TAB_H TABLE
AQ$_SYS$SERVICE_METRICS_TAB_G TABLE
AQ$_SYS$SERVICE_METRICS_TAB_I TABLE
AQ$_SYS$SERVICE_METRICS_TAB_E QUEUE
AQ$_SYS$SERVICE_METRICS_TAB_F VIEW
AQ$SYS$SERVICE_METRICS_TAB VIEW
AQ$SYS$SERVICE_METRICS_TAB_R VIEW
SYS$SERVICE_METRICS_R RULE SET
SYS$SERVICE_METRICS_TAB TABLE
SYS$SERVICE_METRICS_N RULE SET
SYS$SERVICE_METRICS QUEUE

  1. Modify parameter job_queue_processes to 0 so that none of the AQ jobs start.
    alter system set job_queue_processes=0 scope=both sid='*';
  1. Drop Table SYS.SYS$SERVICE_METRICS_TAB:
    exec dbms_aqadm.drop_queue_table(queue_table=>'SYS.SYS$SERVICE_METRICS_TAB',force => TRUE);

NOTE: If this is a PDB, then connect to it and execute:

alter session set "_ORACLE_SCRIPT" = true;
exec dbms_aqadm.drop_queue_table(queue_table=>'SYS.SYS$SERVICE_METRICS_TAB',force => TRUE);

  1. 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 objectname like '%SYS$SERVICE%';
    no rows selected
  1. Recreate Queue tables:
    @$ORACLE_HOME/rdbms/admin/execsvr.sql
  1. 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 objectname like '%SYS$SERVICE%';
    OBJECT_NAME OBJECT_TYPE

AQ$_SYS$SERVICE_METRICS_TAB_S TABLE
AQ$_SYS$SERVICE_METRICS_TAB_V EVALUATION CONTEXT
AQ$_SYS$SERVICE_METRICS_TAB_T TABLE
AQ$SYS$SERVICE_METRICS_TAB_S VIEW
AQ$_SYS$SERVICE_METRICS_TAB_N SEQUENCE
AQ$_SYS$SERVICE_METRICS_TAB_H TABLE
AQ$_SYS$SERVICE_METRICS_TAB_G TABLE
AQ$_SYS$SERVICE_METRICS_TAB_I TABLE
AQ$_SYS$SERVICE_METRICS_TAB_E QUEUE
AQ$_SYS$SERVICE_METRICS_TAB_F VIEW
AQ$SYS$SERVICE_METRICS_TAB VIEW
AQ$SYS$SERVICE_METRICS_TAB_R VIEW
SYS$SERVICE_METRICS_R RULE SET
SYS$SERVICE_METRICS_TAB TABLE
SYS$SERVICE_METRICS_N RULE SET
SYS$SERVICE_METRICS QUEUE

  1. Modify parameter job_queue_processes
    alter system set job_queue_processes= scope=both sid='*';

Example:

alter system set job_queue_processes=10 scope=both sid='*';
If you explicitly set aq_tm_processes = 10 then there will be no processes available to maintain buffered messages.

Instance bounce might be required.

  1. 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;
    COUNT(
    ) MSG_STATE QUEUE

   105 PROCESSED        SYS$SERVICE_METRICS            
     5 READY            SYS$SERVICE_METRICS       
相关文章
|
8月前
|
SQL Oracle 关系型数据库
SYS_AUTO_SPM_EVOLVE_TASK
AUTO_STATS_ADVISOR_TASK SYS_AUTO_SPM_EVOLVE_TASK
64 0
|
8月前
Example: Auditing the SYS User
Example: Auditing the SYS User
36 0
sys_service_provider_id返佣参数详解-参数解读系列
说明: 返佣分为支付宝返佣和口碑返佣 支付宝返佣:需要isv服务商签署《当面付ISV基础协作费方案》、《花呗分期协作费方案(前台)》等协议。举列:第三方应用授权模式下,商户授权给isv,isv代商户发起支付请求时,请求参数中传 sys_service_provider_id(系统商编号 该参数作为系统商返佣数据提取的依据,请填写系统商签约协议的PID)参数。
2514 12
|
SQL 数据库 数据库管理
Replication-Replication Distribution Subsystem: agent xxxxxx failed. Column names in each table must be unique
原文:Replication-Replication Distribution Subsystem: agent xxxxxx failed. Column names in each table must be unique   最近遇到一个关于发布订阅(Replication)的奇葩问题,特此记录一下这个案例。
1040 0