REMOVE_STREAMS_CONFIGURATION過程清除流環境報錯ORA-24042

yangtingkun發表於2010-11-21

利用DBMS_STREAMS_ADM包的REMOVE_STREAMS_CONFIGURATION過程清理流環境時,碰到了ORA-24042錯誤。

 

 

Oracle10203版本,執行下面清除過程報錯:

SQL> CONN STRMADMIN/STRMADMIN@192.25.1.101/YANGTK.COMPUTE
已連線。
SQL> SELECT COUNT(*) FROM ALL_CAPTURE;

  COUNT(*)
----------
         1

SQL> SELECT COUNT(*) FROM ALL_PROPAGATION;

  COUNT(*)
----------
         1

SQL> SELECT COUNT(*) FROM ALL_APPLY;

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

SQL> EXEC DBMS_STREAMS_ADM.REMOVE_STREAMS_CONFIGURATION
BEGIN DBMS_STREAMS_ADM.REMOVE_STREAMS_CONFIGURATION; END;

*
1 行出現錯誤:
ORA-24042:
不存在 QUEUE "STRMADMIN"."STREAMS_QUEUE" DESTINATION
STREAM1.COMPUTE
的傳播日程
ORA-06512:
"SYS.DBMS_STREAMS_ADM", line 1846
ORA-06512:
line 1

顯然錯誤和傳播程式有關,檢查執行過程中的流環境:

SQL> SELECT COUNT(*) FROM ALL_CAPTURE;

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

SQL> SELECT COUNT(*) FROM ALL_PROPAGATION;

  COUNT(*)
----------
         1

捕獲程式被清除了,但是傳播過程並沒有被清除。

查詢metalink,發現是Oraclebug,在10204以前的版本,如果部署了QUEUE TO QUEUE的傳播方式,則利用REMOVE_STREAMS_CONFIGURATION過程清理流環境就會報錯。在metalink上對應的錯誤號為Bug 4627457,文件ID 4627457.8詳細描述了這個問題。

11g10204FIX了這個bug,如果碰到這個錯誤,只能透過手工清除的方法來解決。

SQL> SELECT PROPAGATION_NAME FROM ALL_PROPAGATION;

PROPAGATION_NAME
------------------------------
TABLE_SINGLE_STREAM

SQL> EXEC DBMS_PROPAGATION_ADM.DROP_PROPAGATION('TABLE_SINGLE_STREAM', TRUE)

PL/SQL 過程已成功完成。

SQL> SELECT PROPAGATION_NAME FROM ALL_PROPAGATION;

未選定行

下面還需要清除對應的RULERULESET

SQL> SELECT RULE_OWNER, RULE_NAME, RULE_CONDITION
  2  FROM DBA_RULES
  3  WHERE RULE_OWNER = 'STRMADMIN';

RULE_OWNER RULE_NAME   RULE_CONDITION
---------- ----------- -----------------------------------------------------------------------------
STRMADMIN  T_STREAM18  (((:dml.get_object_owner() = 'YANGTK' and :dml.get_object_name() = 'T_STREAM'
STRMADMIN  T_STREAM19  (((:ddl.get_object_owner() = 'YANGTK' and :ddl.get_object_name() = 'T_STREAM'

SQL> SELECT RULE_SET_OWNER, RULE_SET_NAME, RULE_OWNER, RULE_NAME
  2  FROM DBA_RULE_SET_RULES
  3  WHERE RULE_NAME IN ('T_STREAM18', 'T_STREAM19');

RULE_SET_OWNER                 RULE_SET_NAME                  RULE_OWNER RULE_NAME
------------------------------ ------------------------------ ---------- -----------
STRMADMIN                      RULESET$_20                    STRMADMIN  T_STREAM19
STRMADMIN                      RULESET$_20                    STRMADMIN  T_STREAM18

SQL> SELECT RULE_SET_OWNER, RULE_SET_NAME
  2  FROM DBA_RULE_SETS
  3  WHERE RULE_SET_NAME = 'RULESET$_20';

RULE_SET_OWNER                 RULE_SET_NAME
------------------------------ ------------------------------
STRMADMIN                      RULESET$_20

SQL> EXEC DBMS_RULE_ADM.DROP_RULE_SET('RULESET$_20', TRUE)

PL/SQL 過程已成功完成。

 

 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/4227/viewspace-678615/,如需轉載,請註明出處,否則將追究法律責任。

相關文章