【ORA-01922】oracle私有dblink无法通过限定owner删除的原因

来源:互联网 发布:张艾嘉爱的代价 知乎 编辑:程序博客网 时间:2024/05/01 01:29

官当中的解释Restriction on Dropping Database Links 

You cannot drop a database link in another user's schema, and you cannot qualify dblink with the name of a schema, because periods are permitted in names of database links. Therefore, Oracle Database interprets the entire name, such as ralph.linktosales, as the name of a database link in your schema rather than as a database link named linktosales in the schema ralph.

你无法删除另外一个用户下的dblink,并且无法使用schema限定dblink,因为dblink的名字是允许使用分段的。因此,Oracle数据库将整个名称(如ralph.linktosales)解释为dblink的名称,而不是模式ralph中名为linktosales的dblink。

所以私有的dblink其他用户也是不可以访问的。

所以想要删除私有的dblink。有两种方法

1.使用dblink的属组用户,可以通过代理方式。

alter user ralph account unlock;
alter user ralph grant connect through user01;
conn user01[ralph]  -----user01 password
DROP DATABASE LINK linktosales;
alter user ralph revoke connect through user01;

2.在dblink的属组下定义个删除dblink的存储过程,调用这个过程就可以删除私有dblink了。这里就不举例了。

最好就是用第一种方法。

阅读全文
0 0
原创粉丝点击