您的位置:首页 > 数据库 > Oracle

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

2017-07-27 14:05 806 查看
官当中的解释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了。这里就不举例了。

最好就是用第一种方法。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐