ORA-00980如何解决

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的问题。如果有更好的方法解决该问题,请告知,谢谢!


  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
回答: Oracle ORA-00980错误是由于在SQL语句中使用了错误的语法或语句结构导致的。根据引用\[1\]的例子,错误的SQL语句使用了错误的语法,set后面的字段不能使用'and'连接。正确的语法应该是使用逗号分隔字段,例如:update table1 set 字段1 = "值1", 字段2 = "值2" where id = 1 and numNo = "001"。另外,根据引用\[2\]的代码,可以通过查询dba_synonyms表来查找所有失效的同义词,并生成删除脚本。最后,根据引用\[3\]的建议,可以查询dba_objects和dba_users表来查看是否存在与命名空间重叠的其他对象或模式。 #### 引用[.reference_title] - *1* [报错:oracle ORA-00913和oracle ORA-00933](https://blog.csdn.net/SUMMERENT/article/details/124153424)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [ORacle异常:ORA-00980:同义词转换不再有效](https://blog.csdn.net/MaYuLeMMM/article/details/126489433)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [ORA-00980如何解决](https://blog.csdn.net/weixin_29924243/article/details/116411451)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值