ORA-30926: unable to get a stable set of rows in the source tables

oracle_kai發表於2008-06-24

今天在做etl載入歷史資料,處理到8月份的時候,報錯 ORA-30926: unable to get a stable set of rows in the source tables,該etl過程中有用merge語句,google該錯誤的解釋:

Oracle Error :: ORA-30926

unable to get a stable set of rows in the source tables

Cause

A stable set of rows could not be got because of large dml activity or a non-deterministic where clause.

Action

Remove any non-deterministic where clauses and reissue the dml.

non-deterministic  非確定性的到底指的是什麼呢?再搜

ORA-30926: unable to get a stable set of rows in the source tables" error if there is either a many-to-one or many-to-many relationship between the source and target tables. This is not as serious as it sounds because you would normally have to MERGE a one-to-one or one-to-zero relationship as your join condition would be protected by the target's primary key.

When performing a merge statement, the table to be merged had multiplerecords with the same key used for matching. While this is ok forrecords to be inserted into the target table, Oracle doesn't like thison the update portion of the statement. The solution is to remove the
duplicate or pick a matching key that is truely unique.

此處說明了,merge在做update子句的時候,違反target的主鍵約束可能會導致ora-30926 錯誤。

找出procedure,檢視source,和target,結果看到source的確有重複記錄,而且在清洗的時候沒能發現這個bug。

好了,可以手工把重複記錄刪除,至少不影響歷史資料的載入了。

 

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

相關文章