ORA-00980如何解決

來源:互聯網
上載者:User

ORA-00980: synonym translation is no longer valid
 
ORA-00980:同義字轉換不再有效
 
TOM大師對該error的解釋:http://asktom.Oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:7095288486502
 

that means you lost some object/access to some object when you did your move.  That error
 simply means "synonym is still here, but the object it points to is inaccessible".  It
 could be inaccessible due to a missing grant, or due to the object not being there.
 
You need to find out what synonym it is, query the data dictionary to figure out what
 object it points to and figure out why you no longer have access to that object.
 
ops$tkyte@ORA920> create synonym s for t;
 Synonym created.
 
ops$tkyte@ORA920> select * from s where rownum = 1;
 
C
 ----------
 1
 
ops$tkyte@ORA920> drop table t;
 Table dropped.
 
ops$tkyte@ORA920> select * from s where rownum = 1;
 select * from s where rownum = 1
              *
 ERROR at line 1:
 ORA-00980: synonym translation is no longer valid
 

 

ops$tkyte%ORA11GR2> !oerr ora 980
 00980, 00000, "synonym translation is no longer valid"
 // *Cause: A synonym did not translate to a legal target object. This
//        could happen for one of the following reasons:
 //        1. The target schema does not exist.
 //        2. The target object does not exist.
 //        3. The synonym specifies an incorrect database link.
 //        4. The synonym is not versioned but specifies a versioned
 //            target object.
 // *Action: Change the synonym definition so that the synonym points at
 //          a legal target object.
 
query dba_objects and dba_users to see if there is another object/schema out there that overlaps the namespace please.
 

總而言之,TOM的意思是說該同義字已經失效。至於為什麼失效,請看上面的解釋。

我在使用DBlink的時候發生ORA-00980 synonym translation is no longer valid錯誤。我很疑惑,如果瞭解請告訴我,謝謝!
 情況:
 1)在PL/SQL 中寫SQL語句insert into table (.....) select .... from view@dblink沒有問題,能夠正常執行,並且資料也可以插入。
 2)在Procedure裡把上述SQL寫入後,編譯時間報錯,ORA-00980 synonym translation is no longer valid。
 3)我在本機資料庫建立一個view, create or replace view XXX as  select .....from from view@dblink,成功。
 4)在procedure裡的SQL修改為如下insert into table (.....) select .... from XXX,能夠成功編譯。
 
為什嗎?難道在procedure裡不能用dblink來讀取view嗎?

我是通過建立中間視圖,來解決過程編譯報錯00980的問題。如果有更好的方法解決該問題,請告知,謝謝!

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.